@blocknote/core 0.15.3 → 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/dist/blocknote.js +681 -375
- 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/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/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/dist/blocknote.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var Bt = Object.defineProperty;
|
|
2
2
|
var Lt = (e, t, o) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
3
|
var c = (e, t, o) => Lt(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
-
import { Slice as
|
|
4
|
+
import { Slice as D, Fragment as L, DOMSerializer as xe, DOMParser as It, Node as At } from "prosemirror-model";
|
|
5
5
|
import Je from "rehype-parse";
|
|
6
6
|
import Ye from "rehype-stringify";
|
|
7
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
|
|
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
9
|
import { Plugin as y, PluginKey as S, Selection as me, NodeSelection as re, TextSelection as Y, EditorState as Wt } from "prosemirror-state";
|
|
10
10
|
import { v4 as $t } from "uuid";
|
|
11
11
|
import { fromDom as we } from "hast-util-from-dom";
|
|
@@ -3738,9 +3738,315 @@ const _o = {
|
|
|
3738
3738
|
generic: {
|
|
3739
3739
|
ctrl_shortcut: "Ctrl"
|
|
3740
3740
|
}
|
|
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
|
+
}
|
|
3741
4046
|
}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3742
4047
|
__proto__: null,
|
|
3743
4048
|
ar: _o,
|
|
4049
|
+
de: Lo,
|
|
3744
4050
|
en: et,
|
|
3745
4051
|
fr: yo,
|
|
3746
4052
|
is: wo,
|
|
@@ -3753,18 +4059,18 @@ const _o = {
|
|
|
3753
4059
|
vi: Mo,
|
|
3754
4060
|
zh: To
|
|
3755
4061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3756
|
-
function
|
|
4062
|
+
function Io(e, t = JSON.stringify) {
|
|
3757
4063
|
const o = {};
|
|
3758
4064
|
return e.filter((i) => {
|
|
3759
4065
|
const n = t(i);
|
|
3760
4066
|
return Object.prototype.hasOwnProperty.call(o, n) ? !1 : o[n] = !0;
|
|
3761
4067
|
});
|
|
3762
4068
|
}
|
|
3763
|
-
function
|
|
4069
|
+
function Ao(e) {
|
|
3764
4070
|
const t = e.filter(
|
|
3765
4071
|
(i, n) => e.indexOf(i) !== n
|
|
3766
4072
|
);
|
|
3767
|
-
return
|
|
4073
|
+
return Io(t);
|
|
3768
4074
|
}
|
|
3769
4075
|
const oe = M.create({
|
|
3770
4076
|
name: "uniqueID",
|
|
@@ -3852,7 +4158,7 @@ const oe = M.create({
|
|
|
3852
4158
|
n.doc,
|
|
3853
4159
|
m,
|
|
3854
4160
|
(T) => l.includes(T.type.name)
|
|
3855
|
-
), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A =
|
|
4161
|
+
), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A = Ao(b);
|
|
3856
4162
|
g.forEach(({ node: T, pos: N }) => {
|
|
3857
4163
|
let Z;
|
|
3858
4164
|
const Pe = (Z = s.doc.nodeAt(N)) === null || Z === void 0 ? void 0 : Z.attrs[d];
|
|
@@ -3937,7 +4243,7 @@ const oe = M.create({
|
|
|
3937
4243
|
s.push(d);
|
|
3938
4244
|
}), L.from(s);
|
|
3939
4245
|
};
|
|
3940
|
-
return t = !1, new
|
|
4246
|
+
return t = !1, new D(
|
|
3941
4247
|
r(o.content),
|
|
3942
4248
|
o.openStart,
|
|
3943
4249
|
o.openEnd
|
|
@@ -4004,12 +4310,12 @@ class I extends Error {
|
|
|
4004
4310
|
super(`Unreachable case: ${t}`);
|
|
4005
4311
|
}
|
|
4006
4312
|
}
|
|
4007
|
-
function
|
|
4313
|
+
function Vr(e, t = !0) {
|
|
4008
4314
|
const { "data-test": o, ...i } = e;
|
|
4009
4315
|
if (Object.keys(i).length > 0 && t)
|
|
4010
4316
|
throw new Error("Object must be empty " + JSON.stringify(e));
|
|
4011
4317
|
}
|
|
4012
|
-
function
|
|
4318
|
+
function ze(e, t, o) {
|
|
4013
4319
|
const i = [];
|
|
4014
4320
|
for (const [n, r] of Object.entries(e.styles)) {
|
|
4015
4321
|
const a = o[n];
|
|
@@ -4025,7 +4331,7 @@ function Re(e, t, o) {
|
|
|
4025
4331
|
return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
|
|
4026
4332
|
` ? t.nodes.hardBreak.create() : t.text(n, i));
|
|
4027
4333
|
}
|
|
4028
|
-
function
|
|
4334
|
+
function No(e, t, o) {
|
|
4029
4335
|
const i = t.marks.link.create({
|
|
4030
4336
|
href: e.href
|
|
4031
4337
|
});
|
|
@@ -4043,20 +4349,20 @@ function ve(e, t, o) {
|
|
|
4043
4349
|
const i = [];
|
|
4044
4350
|
if (typeof e == "string")
|
|
4045
4351
|
return i.push(
|
|
4046
|
-
...
|
|
4352
|
+
...ze(
|
|
4047
4353
|
{ type: "text", text: e, styles: {} },
|
|
4048
4354
|
t,
|
|
4049
4355
|
o
|
|
4050
4356
|
)
|
|
4051
4357
|
), i;
|
|
4052
4358
|
for (const n of e)
|
|
4053
|
-
i.push(...
|
|
4359
|
+
i.push(...ze(n, t, o));
|
|
4054
4360
|
return i;
|
|
4055
4361
|
}
|
|
4056
4362
|
function W(e, t, o) {
|
|
4057
4363
|
const i = [];
|
|
4058
4364
|
for (const n of e)
|
|
4059
|
-
typeof n == "string" ? i.push(...ve(n, t, o)) : ot(n) ? i.push(...
|
|
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(
|
|
4060
4366
|
nt(n, t, o)
|
|
4061
4367
|
);
|
|
4062
4368
|
return i;
|
|
@@ -4122,7 +4428,7 @@ function P(e, t, o) {
|
|
|
4122
4428
|
r.length > 0 ? [n, a] : n
|
|
4123
4429
|
);
|
|
4124
4430
|
}
|
|
4125
|
-
function
|
|
4431
|
+
function Po(e, t, o) {
|
|
4126
4432
|
const i = {
|
|
4127
4433
|
type: "tableContent",
|
|
4128
4434
|
rows: []
|
|
@@ -4302,7 +4608,7 @@ function v(e, t, o, i, n) {
|
|
|
4302
4608
|
i
|
|
4303
4609
|
);
|
|
4304
4610
|
else if (d.content === "table")
|
|
4305
|
-
p =
|
|
4611
|
+
p = Po(
|
|
4306
4612
|
a.contentNode,
|
|
4307
4613
|
o,
|
|
4308
4614
|
i
|
|
@@ -4320,14 +4626,14 @@ function v(e, t, o, i, n) {
|
|
|
4320
4626
|
};
|
|
4321
4627
|
return n == null || n.set(e, h), h;
|
|
4322
4628
|
}
|
|
4323
|
-
function
|
|
4629
|
+
function Ho(e) {
|
|
4324
4630
|
return e.document || window.document;
|
|
4325
4631
|
}
|
|
4326
4632
|
const at = (e, t, o, i, n) => {
|
|
4327
4633
|
if (!o.nodes[e.type.name])
|
|
4328
4634
|
throw new Error("Serializer is missing a node type: " + e.type.name);
|
|
4329
4635
|
const { dom: r, contentDOM: a } = xe.renderSpec(
|
|
4330
|
-
|
|
4636
|
+
Ho(t),
|
|
4331
4637
|
o.nodes[e.type.name](e)
|
|
4332
4638
|
);
|
|
4333
4639
|
if (a) {
|
|
@@ -4370,7 +4676,7 @@ const at = (e, t, o, i, n) => {
|
|
|
4370
4676
|
const i = t.serializeFragment(e, o), n = document.createElement("div");
|
|
4371
4677
|
return n.appendChild(i), n.innerHTML;
|
|
4372
4678
|
};
|
|
4373
|
-
function
|
|
4679
|
+
function Uo(e) {
|
|
4374
4680
|
const t = /* @__PURE__ */ new Set([
|
|
4375
4681
|
...e.orderedListItemBlockTypes,
|
|
4376
4682
|
...e.unorderedListItemBlockTypes
|
|
@@ -4432,7 +4738,7 @@ function Ho(e) {
|
|
|
4432
4738
|
}
|
|
4433
4739
|
const se = (e, t) => {
|
|
4434
4740
|
const o = xe.fromSchema(e);
|
|
4435
|
-
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => Ee().use(Je, { fragment: !0 }).use(
|
|
4741
|
+
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => Ee().use(Je, { fragment: !0 }).use(Uo, {
|
|
4436
4742
|
orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
|
|
4437
4743
|
unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
|
|
4438
4744
|
"bulletListItem",
|
|
@@ -4458,24 +4764,24 @@ const se = (e, t) => {
|
|
|
4458
4764
|
n
|
|
4459
4765
|
);
|
|
4460
4766
|
}, o;
|
|
4461
|
-
},
|
|
4767
|
+
}, Do = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
|
|
4462
4768
|
function H(e, t = "Ctrl") {
|
|
4463
|
-
return
|
|
4769
|
+
return Do() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
|
|
4464
4770
|
}
|
|
4465
|
-
function
|
|
4771
|
+
function j(...e) {
|
|
4466
4772
|
return e.filter((t) => t).join(" ");
|
|
4467
4773
|
}
|
|
4468
|
-
const
|
|
4774
|
+
const zr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
4469
4775
|
function V(e, t, o, i) {
|
|
4470
4776
|
const n = document.createElement("div");
|
|
4471
|
-
n.className =
|
|
4777
|
+
n.className = j(
|
|
4472
4778
|
"bn-block-content",
|
|
4473
4779
|
o.class
|
|
4474
4780
|
), n.setAttribute("data-content-type", e);
|
|
4475
4781
|
for (const [a, s] of Object.entries(o))
|
|
4476
4782
|
a !== "class" && n.setAttribute(a, s);
|
|
4477
4783
|
const r = document.createElement(t);
|
|
4478
|
-
r.className =
|
|
4784
|
+
r.className = j(
|
|
4479
4785
|
"bn-inline-content",
|
|
4480
4786
|
i.class
|
|
4481
4787
|
);
|
|
@@ -4488,7 +4794,7 @@ function V(e, t, o, i) {
|
|
|
4488
4794
|
contentDOM: r
|
|
4489
4795
|
};
|
|
4490
4796
|
}
|
|
4491
|
-
const
|
|
4797
|
+
const Re = (e, t) => {
|
|
4492
4798
|
const o = P(e, t.pmSchema, t.schema.styleSchema).firstChild, i = t.pmSchema.nodes[o.type.name].spec.toDOM;
|
|
4493
4799
|
if (i === void 0)
|
|
4494
4800
|
throw new Error(
|
|
@@ -4565,13 +4871,13 @@ function fe(e, t, o, i, n = !1, r) {
|
|
|
4565
4871
|
if (r !== void 0)
|
|
4566
4872
|
for (const [s, l] of Object.entries(r))
|
|
4567
4873
|
s !== "class" && a.setAttribute(s, l);
|
|
4568
|
-
a.className =
|
|
4874
|
+
a.className = j(
|
|
4569
4875
|
"bn-block-content",
|
|
4570
4876
|
(r == null ? void 0 : r.class) || ""
|
|
4571
4877
|
), a.setAttribute("data-content-type", t);
|
|
4572
4878
|
for (const [s, l] of Object.entries(o))
|
|
4573
4879
|
!lt.includes(s) && l !== i[s].default && a.setAttribute(ae(s), l);
|
|
4574
|
-
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className =
|
|
4880
|
+
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = j(
|
|
4575
4881
|
"bn-inline-content",
|
|
4576
4882
|
e.contentDOM.className
|
|
4577
4883
|
), e.contentDOM.setAttribute("data-editable", "")), {
|
|
@@ -4579,7 +4885,7 @@ function fe(e, t, o, i, n = !1, r) {
|
|
|
4579
4885
|
dom: a
|
|
4580
4886
|
};
|
|
4581
4887
|
}
|
|
4582
|
-
function
|
|
4888
|
+
function R(e) {
|
|
4583
4889
|
return $.create(e);
|
|
4584
4890
|
}
|
|
4585
4891
|
function ct(e, t) {
|
|
@@ -4598,8 +4904,8 @@ function q(e, t, o) {
|
|
|
4598
4904
|
{
|
|
4599
4905
|
node: e,
|
|
4600
4906
|
requiredExtensions: o,
|
|
4601
|
-
toInternalHTML:
|
|
4602
|
-
toExternalHTML:
|
|
4907
|
+
toInternalHTML: Re,
|
|
4908
|
+
toExternalHTML: Re
|
|
4603
4909
|
// parse: () => undefined, // parse rules are in node already
|
|
4604
4910
|
}
|
|
4605
4911
|
);
|
|
@@ -4609,7 +4915,7 @@ function ut(e) {
|
|
|
4609
4915
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4610
4916
|
);
|
|
4611
4917
|
}
|
|
4612
|
-
function
|
|
4918
|
+
function Vo(e, t) {
|
|
4613
4919
|
const o = [
|
|
4614
4920
|
{
|
|
4615
4921
|
tag: "[data-content-type=" + e.type + "]",
|
|
@@ -4627,7 +4933,7 @@ function Do(e, t) {
|
|
|
4627
4933
|
}), o;
|
|
4628
4934
|
}
|
|
4629
4935
|
function le(e, t) {
|
|
4630
|
-
const o =
|
|
4936
|
+
const o = R({
|
|
4631
4937
|
name: e.type,
|
|
4632
4938
|
content: e.content === "inline" ? "inline*" : "",
|
|
4633
4939
|
group: "blockContent",
|
|
@@ -4636,7 +4942,7 @@ function le(e, t) {
|
|
|
4636
4942
|
return dt(e.propSchema);
|
|
4637
4943
|
},
|
|
4638
4944
|
parseHTML() {
|
|
4639
|
-
return
|
|
4945
|
+
return Vo(e, t.parse);
|
|
4640
4946
|
},
|
|
4641
4947
|
renderHTML() {
|
|
4642
4948
|
const i = document.createElement("div");
|
|
@@ -4699,7 +5005,7 @@ function le(e, t) {
|
|
|
4699
5005
|
}
|
|
4700
5006
|
});
|
|
4701
5007
|
}
|
|
4702
|
-
function
|
|
5008
|
+
function zo(e, t, o, i) {
|
|
4703
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;
|
|
4704
5010
|
}
|
|
4705
5011
|
function Ro(e) {
|
|
@@ -4716,7 +5022,7 @@ function Oo(e, t) {
|
|
|
4716
5022
|
implementation: t
|
|
4717
5023
|
};
|
|
4718
5024
|
}
|
|
4719
|
-
function
|
|
5025
|
+
function Fo(e, t) {
|
|
4720
5026
|
return Oo(
|
|
4721
5027
|
{
|
|
4722
5028
|
type: e.name,
|
|
@@ -4733,7 +5039,7 @@ function pt(e) {
|
|
|
4733
5039
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4734
5040
|
);
|
|
4735
5041
|
}
|
|
4736
|
-
function
|
|
5042
|
+
function Go(e) {
|
|
4737
5043
|
return [
|
|
4738
5044
|
{
|
|
4739
5045
|
tag: `[data-inline-content-type="${e.type}"]`,
|
|
@@ -4759,7 +5065,7 @@ function Or(e, t) {
|
|
|
4759
5065
|
return Ro(e);
|
|
4760
5066
|
},
|
|
4761
5067
|
parseHTML() {
|
|
4762
|
-
return
|
|
5068
|
+
return Go(e);
|
|
4763
5069
|
},
|
|
4764
5070
|
renderHTML({ node: i }) {
|
|
4765
5071
|
const n = this.options.editor, r = t.render(
|
|
@@ -4770,7 +5076,7 @@ function Or(e, t) {
|
|
|
4770
5076
|
)
|
|
4771
5077
|
// TODO: fix cast
|
|
4772
5078
|
);
|
|
4773
|
-
return
|
|
5079
|
+
return zo(
|
|
4774
5080
|
r,
|
|
4775
5081
|
e.type,
|
|
4776
5082
|
i.attrs,
|
|
@@ -4778,12 +5084,12 @@ function Or(e, t) {
|
|
|
4778
5084
|
);
|
|
4779
5085
|
}
|
|
4780
5086
|
});
|
|
4781
|
-
return
|
|
5087
|
+
return Fo(
|
|
4782
5088
|
o,
|
|
4783
5089
|
e.propSchema
|
|
4784
5090
|
);
|
|
4785
5091
|
}
|
|
4786
|
-
function
|
|
5092
|
+
function Ko(e) {
|
|
4787
5093
|
return e === "boolean" ? {} : {
|
|
4788
5094
|
stringValue: {
|
|
4789
5095
|
default: void 0,
|
|
@@ -4795,7 +5101,7 @@ function Go(e) {
|
|
|
4795
5101
|
}
|
|
4796
5102
|
};
|
|
4797
5103
|
}
|
|
4798
|
-
function
|
|
5104
|
+
function Wo(e, t, o, i) {
|
|
4799
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;
|
|
4800
5106
|
}
|
|
4801
5107
|
function ht(e, t) {
|
|
@@ -4820,7 +5126,7 @@ function mt(e) {
|
|
|
4820
5126
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4821
5127
|
);
|
|
4822
5128
|
}
|
|
4823
|
-
function
|
|
5129
|
+
function $o(e) {
|
|
4824
5130
|
return [
|
|
4825
5131
|
{
|
|
4826
5132
|
tag: `[data-style-type="${e.type}"]`,
|
|
@@ -4831,14 +5137,14 @@ function Wo(e) {
|
|
|
4831
5137
|
}
|
|
4832
5138
|
];
|
|
4833
5139
|
}
|
|
4834
|
-
function
|
|
5140
|
+
function Fr(e, t) {
|
|
4835
5141
|
const o = Ce.create({
|
|
4836
5142
|
name: e.type,
|
|
4837
5143
|
addAttributes() {
|
|
4838
|
-
return
|
|
5144
|
+
return Ko(e.propSchema);
|
|
4839
5145
|
},
|
|
4840
5146
|
parseHTML() {
|
|
4841
|
-
return
|
|
5147
|
+
return $o(e);
|
|
4842
5148
|
},
|
|
4843
5149
|
renderHTML({ mark: i }) {
|
|
4844
5150
|
let n;
|
|
@@ -4848,7 +5154,7 @@ function zr(e, t) {
|
|
|
4848
5154
|
n = t.render(i.attrs.stringValue);
|
|
4849
5155
|
else
|
|
4850
5156
|
throw new I(e.propSchema);
|
|
4851
|
-
return
|
|
5157
|
+
return Wo(
|
|
4852
5158
|
n,
|
|
4853
5159
|
e.type,
|
|
4854
5160
|
i.attrs.stringValue,
|
|
@@ -4869,7 +5175,7 @@ const de = (e) => {
|
|
|
4869
5175
|
return i.className = "bn-file-default-preview-name", i.textContent = e.props.name || "", t.appendChild(o), t.appendChild(i), {
|
|
4870
5176
|
dom: t
|
|
4871
5177
|
};
|
|
4872
|
-
},
|
|
5178
|
+
}, z = (e, t) => {
|
|
4873
5179
|
const o = document.createElement("div");
|
|
4874
5180
|
o.className = "bn-file-and-caption-wrapper";
|
|
4875
5181
|
const i = document.createElement("p");
|
|
@@ -4910,7 +5216,7 @@ const de = (e) => {
|
|
|
4910
5216
|
);
|
|
4911
5217
|
}
|
|
4912
5218
|
};
|
|
4913
|
-
},
|
|
5219
|
+
}, Oe = (e) => ({ url: e.src || void 0 }), ue = (e, t) => {
|
|
4914
5220
|
const o = e.querySelector(
|
|
4915
5221
|
t
|
|
4916
5222
|
);
|
|
@@ -4986,7 +5292,7 @@ const de = (e) => {
|
|
|
4986
5292
|
);
|
|
4987
5293
|
}
|
|
4988
5294
|
};
|
|
4989
|
-
}, Fe = (e) => ({ url: e.src || void 0 }),
|
|
5295
|
+
}, Fe = (e) => ({ url: e.src || void 0 }), qo = {
|
|
4990
5296
|
backgroundColor: _.backgroundColor,
|
|
4991
5297
|
// File name.
|
|
4992
5298
|
name: {
|
|
@@ -5003,13 +5309,13 @@ const de = (e) => {
|
|
|
5003
5309
|
showPreview: {
|
|
5004
5310
|
default: !0
|
|
5005
5311
|
}
|
|
5006
|
-
},
|
|
5312
|
+
}, Xo = {
|
|
5007
5313
|
type: "audio",
|
|
5008
|
-
propSchema:
|
|
5314
|
+
propSchema: qo,
|
|
5009
5315
|
content: "none",
|
|
5010
5316
|
isFileBlock: !0,
|
|
5011
5317
|
fileBlockAcceptMimeTypes: ["audio/*"]
|
|
5012
|
-
},
|
|
5318
|
+
}, Zo = (e, t) => {
|
|
5013
5319
|
const o = document.createElement("div");
|
|
5014
5320
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5015
5321
|
const i = document.createElement("div");
|
|
@@ -5032,17 +5338,17 @@ const de = (e) => {
|
|
|
5032
5338
|
i.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
|
|
5033
5339
|
i.src = r;
|
|
5034
5340
|
}), i.controls = !0, i.contentEditable = "false", i.draggable = !1;
|
|
5035
|
-
const n =
|
|
5341
|
+
const n = z(e, i);
|
|
5036
5342
|
return o.appendChild(n.dom), {
|
|
5037
5343
|
dom: o
|
|
5038
5344
|
};
|
|
5039
5345
|
} else {
|
|
5040
5346
|
const i = de(e).dom;
|
|
5041
5347
|
return {
|
|
5042
|
-
dom:
|
|
5348
|
+
dom: z(e, i).dom
|
|
5043
5349
|
};
|
|
5044
5350
|
}
|
|
5045
|
-
},
|
|
5351
|
+
}, Jo = (e) => {
|
|
5046
5352
|
if (e.tagName === "AUDIO")
|
|
5047
5353
|
return Fe(e);
|
|
5048
5354
|
if (e.tagName === "FIGURE") {
|
|
@@ -5055,7 +5361,7 @@ const de = (e) => {
|
|
|
5055
5361
|
caption: i
|
|
5056
5362
|
};
|
|
5057
5363
|
}
|
|
5058
|
-
},
|
|
5364
|
+
}, Yo = (e) => {
|
|
5059
5365
|
if (!e.props.url) {
|
|
5060
5366
|
const o = document.createElement("p");
|
|
5061
5367
|
return o.textContent = "Add audio", {
|
|
@@ -5066,11 +5372,11 @@ const de = (e) => {
|
|
|
5066
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) : {
|
|
5067
5373
|
dom: t
|
|
5068
5374
|
};
|
|
5069
|
-
},
|
|
5070
|
-
render:
|
|
5071
|
-
parse:
|
|
5072
|
-
toExternalHTML:
|
|
5073
|
-
}),
|
|
5375
|
+
}, Qo = le(Xo, {
|
|
5376
|
+
render: Zo,
|
|
5377
|
+
parse: Jo,
|
|
5378
|
+
toExternalHTML: Yo
|
|
5379
|
+
}), ei = {
|
|
5074
5380
|
backgroundColor: _.backgroundColor,
|
|
5075
5381
|
// File name.
|
|
5076
5382
|
name: {
|
|
@@ -5084,12 +5390,12 @@ const de = (e) => {
|
|
|
5084
5390
|
caption: {
|
|
5085
5391
|
default: ""
|
|
5086
5392
|
}
|
|
5087
|
-
},
|
|
5393
|
+
}, ti = {
|
|
5088
5394
|
type: "file",
|
|
5089
|
-
propSchema:
|
|
5395
|
+
propSchema: ei,
|
|
5090
5396
|
content: "none",
|
|
5091
5397
|
isFileBlock: !0
|
|
5092
|
-
},
|
|
5398
|
+
}, oi = (e, t) => {
|
|
5093
5399
|
const o = document.createElement("div");
|
|
5094
5400
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5095
5401
|
const i = ce(e, t);
|
|
@@ -5098,25 +5404,25 @@ const de = (e) => {
|
|
|
5098
5404
|
destroy: i.destroy
|
|
5099
5405
|
};
|
|
5100
5406
|
} else {
|
|
5101
|
-
const i = de(e).dom, n =
|
|
5407
|
+
const i = de(e).dom, n = z(e, i);
|
|
5102
5408
|
return o.appendChild(n.dom), {
|
|
5103
5409
|
dom: o
|
|
5104
5410
|
};
|
|
5105
5411
|
}
|
|
5106
|
-
},
|
|
5412
|
+
}, ii = (e) => {
|
|
5107
5413
|
if (e.tagName === "EMBED")
|
|
5108
|
-
return
|
|
5414
|
+
return Oe(e);
|
|
5109
5415
|
if (e.tagName === "FIGURE") {
|
|
5110
5416
|
const t = ue(e, "embed");
|
|
5111
5417
|
if (!t)
|
|
5112
5418
|
return;
|
|
5113
5419
|
const { targetElement: o, caption: i } = t;
|
|
5114
5420
|
return {
|
|
5115
|
-
...
|
|
5421
|
+
...Oe(o),
|
|
5116
5422
|
caption: i
|
|
5117
5423
|
};
|
|
5118
5424
|
}
|
|
5119
|
-
},
|
|
5425
|
+
}, ni = (e) => {
|
|
5120
5426
|
if (!e.props.url) {
|
|
5121
5427
|
const o = document.createElement("p");
|
|
5122
5428
|
return o.textContent = "Add file", {
|
|
@@ -5127,14 +5433,14 @@ const de = (e) => {
|
|
|
5127
5433
|
return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? pe(t, e.props.caption) : {
|
|
5128
5434
|
dom: t
|
|
5129
5435
|
};
|
|
5130
|
-
},
|
|
5131
|
-
render:
|
|
5132
|
-
parse:
|
|
5133
|
-
toExternalHTML:
|
|
5436
|
+
}, ri = le(ti, {
|
|
5437
|
+
render: oi,
|
|
5438
|
+
parse: ii,
|
|
5439
|
+
toExternalHTML: ni
|
|
5134
5440
|
}), Ge = (e) => {
|
|
5135
5441
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5136
5442
|
return { url: t, previewWidth: o };
|
|
5137
|
-
},
|
|
5443
|
+
}, ai = {
|
|
5138
5444
|
textAlignment: _.textAlignment,
|
|
5139
5445
|
backgroundColor: _.backgroundColor,
|
|
5140
5446
|
// File name.
|
|
@@ -5156,13 +5462,13 @@ const de = (e) => {
|
|
|
5156
5462
|
previewWidth: {
|
|
5157
5463
|
default: 512
|
|
5158
5464
|
}
|
|
5159
|
-
},
|
|
5465
|
+
}, si = {
|
|
5160
5466
|
type: "image",
|
|
5161
|
-
propSchema:
|
|
5467
|
+
propSchema: ai,
|
|
5162
5468
|
content: "none",
|
|
5163
5469
|
isFileBlock: !0,
|
|
5164
5470
|
fileBlockAcceptMimeTypes: ["image/*"]
|
|
5165
|
-
},
|
|
5471
|
+
}, li = (e, t) => {
|
|
5166
5472
|
const o = document.createElement("div");
|
|
5167
5473
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5168
5474
|
const i = document.createElement("div");
|
|
@@ -5194,7 +5500,7 @@ const de = (e) => {
|
|
|
5194
5500
|
i,
|
|
5195
5501
|
() => i.width,
|
|
5196
5502
|
(a) => i.width = a
|
|
5197
|
-
), r =
|
|
5503
|
+
), r = z(e, n.dom);
|
|
5198
5504
|
return o.appendChild(r.dom), {
|
|
5199
5505
|
dom: o,
|
|
5200
5506
|
destroy: n.destroy
|
|
@@ -5202,10 +5508,10 @@ const de = (e) => {
|
|
|
5202
5508
|
} else {
|
|
5203
5509
|
const i = de(e).dom;
|
|
5204
5510
|
return {
|
|
5205
|
-
dom:
|
|
5511
|
+
dom: z(e, i).dom
|
|
5206
5512
|
};
|
|
5207
5513
|
}
|
|
5208
|
-
},
|
|
5514
|
+
}, di = (e) => {
|
|
5209
5515
|
if (e.tagName === "IMG")
|
|
5210
5516
|
return Ge(e);
|
|
5211
5517
|
if (e.tagName === "FIGURE") {
|
|
@@ -5218,7 +5524,7 @@ const de = (e) => {
|
|
|
5218
5524
|
caption: i
|
|
5219
5525
|
};
|
|
5220
5526
|
}
|
|
5221
|
-
},
|
|
5527
|
+
}, ci = (e) => {
|
|
5222
5528
|
if (!e.props.url) {
|
|
5223
5529
|
const o = document.createElement("p");
|
|
5224
5530
|
return o.textContent = "Add image", {
|
|
@@ -5229,14 +5535,14 @@ const de = (e) => {
|
|
|
5229
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) : {
|
|
5230
5536
|
dom: t
|
|
5231
5537
|
};
|
|
5232
|
-
},
|
|
5233
|
-
render:
|
|
5234
|
-
parse:
|
|
5235
|
-
toExternalHTML:
|
|
5538
|
+
}, ui = le(si, {
|
|
5539
|
+
render: li,
|
|
5540
|
+
parse: di,
|
|
5541
|
+
toExternalHTML: ci
|
|
5236
5542
|
}), Ke = (e) => {
|
|
5237
5543
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5238
5544
|
return { url: t, previewWidth: o };
|
|
5239
|
-
},
|
|
5545
|
+
}, pi = {
|
|
5240
5546
|
textAlignment: _.textAlignment,
|
|
5241
5547
|
backgroundColor: _.backgroundColor,
|
|
5242
5548
|
// File name.
|
|
@@ -5258,13 +5564,13 @@ const de = (e) => {
|
|
|
5258
5564
|
previewWidth: {
|
|
5259
5565
|
default: 512
|
|
5260
5566
|
}
|
|
5261
|
-
},
|
|
5567
|
+
}, hi = {
|
|
5262
5568
|
type: "video",
|
|
5263
|
-
propSchema:
|
|
5569
|
+
propSchema: pi,
|
|
5264
5570
|
content: "none",
|
|
5265
5571
|
isFileBlock: !0,
|
|
5266
5572
|
fileBlockAcceptMimeTypes: ["video/*"]
|
|
5267
|
-
},
|
|
5573
|
+
}, mi = (e, t) => {
|
|
5268
5574
|
const o = document.createElement("div");
|
|
5269
5575
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5270
5576
|
const i = document.createElement("div");
|
|
@@ -5294,7 +5600,7 @@ const de = (e) => {
|
|
|
5294
5600
|
i,
|
|
5295
5601
|
() => i.width,
|
|
5296
5602
|
(a) => i.width = a
|
|
5297
|
-
), r =
|
|
5603
|
+
), r = z(e, n.dom);
|
|
5298
5604
|
return o.appendChild(r.dom), {
|
|
5299
5605
|
dom: o,
|
|
5300
5606
|
destroy: n.destroy
|
|
@@ -5302,10 +5608,10 @@ const de = (e) => {
|
|
|
5302
5608
|
} else {
|
|
5303
5609
|
const i = de(e).dom;
|
|
5304
5610
|
return {
|
|
5305
|
-
dom:
|
|
5611
|
+
dom: z(e, i).dom
|
|
5306
5612
|
};
|
|
5307
5613
|
}
|
|
5308
|
-
},
|
|
5614
|
+
}, fi = (e) => {
|
|
5309
5615
|
if (e.tagName === "VIDEO")
|
|
5310
5616
|
return Ke(e);
|
|
5311
5617
|
if (e.tagName === "FIGURE") {
|
|
@@ -5318,7 +5624,7 @@ const de = (e) => {
|
|
|
5318
5624
|
caption: i
|
|
5319
5625
|
};
|
|
5320
5626
|
}
|
|
5321
|
-
},
|
|
5627
|
+
}, gi = (e) => {
|
|
5322
5628
|
if (!e.props.url) {
|
|
5323
5629
|
const o = document.createElement("p");
|
|
5324
5630
|
return o.textContent = "Add video", {
|
|
@@ -5329,11 +5635,11 @@ const de = (e) => {
|
|
|
5329
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) : {
|
|
5330
5636
|
dom: t
|
|
5331
5637
|
};
|
|
5332
|
-
},
|
|
5333
|
-
render:
|
|
5334
|
-
parse:
|
|
5335
|
-
toExternalHTML:
|
|
5336
|
-
}),
|
|
5638
|
+
}, bi = le(hi, {
|
|
5639
|
+
render: mi,
|
|
5640
|
+
parse: fi,
|
|
5641
|
+
toExternalHTML: gi
|
|
5642
|
+
}), Gr = async (e) => {
|
|
5337
5643
|
const t = new FormData();
|
|
5338
5644
|
return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
5339
5645
|
method: "POST",
|
|
@@ -5342,7 +5648,7 @@ const de = (e) => {
|
|
|
5342
5648
|
"tmpfiles.org/",
|
|
5343
5649
|
"tmpfiles.org/dl/"
|
|
5344
5650
|
);
|
|
5345
|
-
},
|
|
5651
|
+
}, ki = Ce.create({
|
|
5346
5652
|
name: "backgroundColor",
|
|
5347
5653
|
addAttributes() {
|
|
5348
5654
|
return {
|
|
@@ -5368,10 +5674,10 @@ const de = (e) => {
|
|
|
5368
5674
|
renderHTML({ HTMLAttributes: e }) {
|
|
5369
5675
|
return ["span", e, 0];
|
|
5370
5676
|
}
|
|
5371
|
-
}),
|
|
5372
|
-
|
|
5677
|
+
}), _i = U(
|
|
5678
|
+
ki,
|
|
5373
5679
|
"string"
|
|
5374
|
-
),
|
|
5680
|
+
), yi = Ce.create({
|
|
5375
5681
|
name: "textColor",
|
|
5376
5682
|
addAttributes() {
|
|
5377
5683
|
return {
|
|
@@ -5395,16 +5701,16 @@ const de = (e) => {
|
|
|
5395
5701
|
renderHTML({ HTMLAttributes: e }) {
|
|
5396
5702
|
return ["span", e, 0];
|
|
5397
5703
|
}
|
|
5398
|
-
}),
|
|
5704
|
+
}), wi = U(yi, "string"), C = (e) => {
|
|
5399
5705
|
const { contentType: t } = k(
|
|
5400
5706
|
e.state.doc,
|
|
5401
5707
|
e.state.selection.from
|
|
5402
5708
|
);
|
|
5403
5709
|
return t.spec.content;
|
|
5404
|
-
},
|
|
5710
|
+
}, vi = {
|
|
5405
5711
|
..._,
|
|
5406
5712
|
level: { default: 1, values: [1, 2, 3] }
|
|
5407
|
-
},
|
|
5713
|
+
}, xi = R({
|
|
5408
5714
|
name: "heading",
|
|
5409
5715
|
content: "inline*",
|
|
5410
5716
|
group: "blockContent",
|
|
@@ -5507,9 +5813,9 @@ const de = (e) => {
|
|
|
5507
5813
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
5508
5814
|
);
|
|
5509
5815
|
}
|
|
5510
|
-
}),
|
|
5511
|
-
|
|
5512
|
-
|
|
5816
|
+
}), Ei = q(
|
|
5817
|
+
xi,
|
|
5818
|
+
vi
|
|
5513
5819
|
), Be = (e) => {
|
|
5514
5820
|
const { contentNode: t, contentType: o } = k(
|
|
5515
5821
|
e.state.doc,
|
|
@@ -5529,9 +5835,9 @@ const de = (e) => {
|
|
|
5529
5835
|
a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
|
|
5530
5836
|
)
|
|
5531
5837
|
]);
|
|
5532
|
-
},
|
|
5838
|
+
}, Ci = {
|
|
5533
5839
|
..._
|
|
5534
|
-
},
|
|
5840
|
+
}, Si = R({
|
|
5535
5841
|
name: "bulletListItem",
|
|
5536
5842
|
content: "inline*",
|
|
5537
5843
|
group: "blockContent",
|
|
@@ -5610,11 +5916,11 @@ const de = (e) => {
|
|
|
5610
5916
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
5611
5917
|
);
|
|
5612
5918
|
}
|
|
5613
|
-
}),
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
),
|
|
5617
|
-
key:
|
|
5919
|
+
}), Mi = q(
|
|
5920
|
+
Si,
|
|
5921
|
+
Ci
|
|
5922
|
+
), Ti = new S("numbered-list-indexing"), Bi = () => new y({
|
|
5923
|
+
key: Ti,
|
|
5618
5924
|
appendTransaction: (e, t, o) => {
|
|
5619
5925
|
const i = o.tr;
|
|
5620
5926
|
i.setMeta("numberedListIndexing", !0);
|
|
@@ -5643,9 +5949,9 @@ const de = (e) => {
|
|
|
5643
5949
|
}
|
|
5644
5950
|
}), n ? i : null;
|
|
5645
5951
|
}
|
|
5646
|
-
}),
|
|
5952
|
+
}), Li = {
|
|
5647
5953
|
..._
|
|
5648
|
-
},
|
|
5954
|
+
}, Ii = R({
|
|
5649
5955
|
name: "numberedListItem",
|
|
5650
5956
|
content: "inline*",
|
|
5651
5957
|
group: "blockContent",
|
|
@@ -5688,7 +5994,7 @@ const de = (e) => {
|
|
|
5688
5994
|
};
|
|
5689
5995
|
},
|
|
5690
5996
|
addProseMirrorPlugins() {
|
|
5691
|
-
return [
|
|
5997
|
+
return [Bi()];
|
|
5692
5998
|
},
|
|
5693
5999
|
parseHTML() {
|
|
5694
6000
|
return [
|
|
@@ -5738,15 +6044,15 @@ const de = (e) => {
|
|
|
5738
6044
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
5739
6045
|
);
|
|
5740
6046
|
}
|
|
5741
|
-
}),
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
),
|
|
6047
|
+
}), Ai = q(
|
|
6048
|
+
Ii,
|
|
6049
|
+
Li
|
|
6050
|
+
), Ni = {
|
|
5745
6051
|
..._,
|
|
5746
6052
|
checked: {
|
|
5747
6053
|
default: !1
|
|
5748
6054
|
}
|
|
5749
|
-
},
|
|
6055
|
+
}, Pi = R({
|
|
5750
6056
|
name: "checkListItem",
|
|
5751
6057
|
content: "inline*",
|
|
5752
6058
|
group: "blockContent",
|
|
@@ -5898,12 +6204,12 @@ const de = (e) => {
|
|
|
5898
6204
|
};
|
|
5899
6205
|
};
|
|
5900
6206
|
}
|
|
5901
|
-
}),
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
),
|
|
6207
|
+
}), Hi = q(
|
|
6208
|
+
Pi,
|
|
6209
|
+
Ni
|
|
6210
|
+
), Ui = {
|
|
5905
6211
|
..._
|
|
5906
|
-
},
|
|
6212
|
+
}, Di = R({
|
|
5907
6213
|
name: "paragraph",
|
|
5908
6214
|
content: "inline*",
|
|
5909
6215
|
group: "blockContent",
|
|
@@ -5945,9 +6251,9 @@ const de = (e) => {
|
|
|
5945
6251
|
);
|
|
5946
6252
|
}
|
|
5947
6253
|
}), ji = q(
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
),
|
|
6254
|
+
Di,
|
|
6255
|
+
Ui
|
|
6256
|
+
), Vi = M.create({
|
|
5951
6257
|
name: "BlockNoteTableExtension",
|
|
5952
6258
|
addProseMirrorPlugins: () => [
|
|
5953
6259
|
oo({
|
|
@@ -5975,13 +6281,13 @@ const de = (e) => {
|
|
|
5975
6281
|
};
|
|
5976
6282
|
return {
|
|
5977
6283
|
tableRole: Ut(
|
|
5978
|
-
|
|
6284
|
+
Dt(e, "tableRole", t)
|
|
5979
6285
|
)
|
|
5980
6286
|
};
|
|
5981
6287
|
}
|
|
5982
|
-
}),
|
|
6288
|
+
}), zi = {
|
|
5983
6289
|
..._
|
|
5984
|
-
}, Ri =
|
|
6290
|
+
}, Ri = R({
|
|
5985
6291
|
name: "table",
|
|
5986
6292
|
content: "tableRow+",
|
|
5987
6293
|
group: "blockContent",
|
|
@@ -6023,15 +6329,15 @@ const de = (e) => {
|
|
|
6023
6329
|
renderHTML({ HTMLAttributes: e }) {
|
|
6024
6330
|
return [
|
|
6025
6331
|
"p",
|
|
6026
|
-
|
|
6332
|
+
jt(this.options.HTMLAttributes, e),
|
|
6027
6333
|
0
|
|
6028
6334
|
];
|
|
6029
6335
|
}
|
|
6030
|
-
}),
|
|
6336
|
+
}), Fi = q(
|
|
6031
6337
|
Ri,
|
|
6032
|
-
|
|
6338
|
+
zi,
|
|
6033
6339
|
[
|
|
6034
|
-
|
|
6340
|
+
Vi,
|
|
6035
6341
|
Oi,
|
|
6036
6342
|
eo.extend({
|
|
6037
6343
|
content: "tableContent"
|
|
@@ -6043,52 +6349,52 @@ const de = (e) => {
|
|
|
6043
6349
|
]
|
|
6044
6350
|
), gt = {
|
|
6045
6351
|
paragraph: ji,
|
|
6046
|
-
heading:
|
|
6047
|
-
bulletListItem:
|
|
6048
|
-
numberedListItem:
|
|
6049
|
-
checkListItem:
|
|
6050
|
-
table:
|
|
6051
|
-
file:
|
|
6052
|
-
image:
|
|
6053
|
-
video:
|
|
6054
|
-
audio:
|
|
6055
|
-
},
|
|
6352
|
+
heading: Ei,
|
|
6353
|
+
bulletListItem: Mi,
|
|
6354
|
+
numberedListItem: Ai,
|
|
6355
|
+
checkListItem: Hi,
|
|
6356
|
+
table: Fi,
|
|
6357
|
+
file: ri,
|
|
6358
|
+
image: ui,
|
|
6359
|
+
video: bi,
|
|
6360
|
+
audio: Qo
|
|
6361
|
+
}, Gi = ut(gt), bt = {
|
|
6056
6362
|
bold: U(qt, "boolean"),
|
|
6057
6363
|
italic: U(Zt, "boolean"),
|
|
6058
6364
|
underline: U(Yt, "boolean"),
|
|
6059
6365
|
strike: U(Jt, "boolean"),
|
|
6060
6366
|
code: U(Xt, "boolean"),
|
|
6061
|
-
textColor:
|
|
6062
|
-
backgroundColor:
|
|
6063
|
-
},
|
|
6367
|
+
textColor: wi,
|
|
6368
|
+
backgroundColor: _i
|
|
6369
|
+
}, Kr = mt(bt), kt = {
|
|
6064
6370
|
text: { config: "text", implementation: {} },
|
|
6065
6371
|
link: { config: "link", implementation: {} }
|
|
6066
|
-
},
|
|
6372
|
+
}, Ki = pt(
|
|
6067
6373
|
kt
|
|
6068
6374
|
);
|
|
6069
6375
|
function E(e, t) {
|
|
6070
|
-
return e in t.schema.blockSchema && t.schema.blockSchema[e] ===
|
|
6376
|
+
return e in t.schema.blockSchema && t.schema.blockSchema[e] === Gi[e];
|
|
6071
6377
|
}
|
|
6072
|
-
function
|
|
6073
|
-
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] ===
|
|
6378
|
+
function Wi(e, t) {
|
|
6379
|
+
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Ki[e];
|
|
6074
6380
|
}
|
|
6075
|
-
function
|
|
6381
|
+
function $i(e, t, o) {
|
|
6076
6382
|
return t.type === e && t.type in o.schema.blockSchema && E(t.type, o);
|
|
6077
6383
|
}
|
|
6078
|
-
function
|
|
6384
|
+
function Wr(e, t) {
|
|
6079
6385
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
|
|
6080
6386
|
}
|
|
6081
|
-
function
|
|
6387
|
+
function $r(e, t) {
|
|
6082
6388
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
|
|
6083
6389
|
}
|
|
6084
|
-
function
|
|
6390
|
+
function qr(e, t) {
|
|
6085
6391
|
return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
6086
6392
|
}
|
|
6087
|
-
function
|
|
6393
|
+
function qi(e, t, o) {
|
|
6088
6394
|
return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === _[e];
|
|
6089
6395
|
}
|
|
6090
|
-
function
|
|
6091
|
-
return
|
|
6396
|
+
function Xr(e, t, o) {
|
|
6397
|
+
return qi(e, t.type, o);
|
|
6092
6398
|
}
|
|
6093
6399
|
function Le(e, t) {
|
|
6094
6400
|
let o, i;
|
|
@@ -6099,7 +6405,7 @@ function Le(e, t) {
|
|
|
6099
6405
|
posBeforeNode: i
|
|
6100
6406
|
};
|
|
6101
6407
|
}
|
|
6102
|
-
function
|
|
6408
|
+
function Xi(e, t, o = "before", i) {
|
|
6103
6409
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
6104
6410
|
for (const d of e)
|
|
6105
6411
|
r.push(
|
|
@@ -6138,7 +6444,7 @@ function qi(e, t, o = "before", i) {
|
|
|
6138
6444
|
);
|
|
6139
6445
|
return l;
|
|
6140
6446
|
}
|
|
6141
|
-
function
|
|
6447
|
+
function Zi(e, t, o) {
|
|
6142
6448
|
const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Le(n, i.state.doc);
|
|
6143
6449
|
i.commands.BNUpdateBlock(r + 1, t);
|
|
6144
6450
|
const a = i.state.doc.resolve(r + 1).node();
|
|
@@ -6184,10 +6490,10 @@ function _t(e, t, o) {
|
|
|
6184
6490
|
}
|
|
6185
6491
|
return t.dispatch(n), a;
|
|
6186
6492
|
}
|
|
6187
|
-
function
|
|
6493
|
+
function Ji(e, t) {
|
|
6188
6494
|
return _t(e, t);
|
|
6189
6495
|
}
|
|
6190
|
-
function
|
|
6496
|
+
function Yi(e, t, o) {
|
|
6191
6497
|
const i = [];
|
|
6192
6498
|
for (const s of t)
|
|
6193
6499
|
i.push(
|
|
@@ -6218,7 +6524,7 @@ function Ji(e, t, o) {
|
|
|
6218
6524
|
);
|
|
6219
6525
|
return { insertedBlocks: a, removedBlocks: r };
|
|
6220
6526
|
}
|
|
6221
|
-
function
|
|
6527
|
+
function Qi(e, t, o, i = { updateSelection: !0 }) {
|
|
6222
6528
|
const n = o._tiptapEditor.state.tr;
|
|
6223
6529
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
6224
6530
|
if (t.forEach((u) => {
|
|
@@ -6229,7 +6535,7 @@ function Yi(e, t, o, i = { updateSelection: !0 }) {
|
|
|
6229
6535
|
}
|
|
6230
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;
|
|
6231
6537
|
}
|
|
6232
|
-
function
|
|
6538
|
+
function en() {
|
|
6233
6539
|
const e = (t) => {
|
|
6234
6540
|
let o = t.children.length;
|
|
6235
6541
|
for (let i = 0; i < o; i++) {
|
|
@@ -6245,7 +6551,7 @@ function Qi() {
|
|
|
6245
6551
|
};
|
|
6246
6552
|
return e;
|
|
6247
6553
|
}
|
|
6248
|
-
function
|
|
6554
|
+
function tn() {
|
|
6249
6555
|
const e = (t) => {
|
|
6250
6556
|
var o;
|
|
6251
6557
|
if (t.children && "length" in t.children && t.children.length)
|
|
@@ -6261,34 +6567,34 @@ function en() {
|
|
|
6261
6567
|
return e;
|
|
6262
6568
|
}
|
|
6263
6569
|
function Ie(e) {
|
|
6264
|
-
return Ee().use(Je, { fragment: !0 }).use(
|
|
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;
|
|
6265
6571
|
}
|
|
6266
|
-
function
|
|
6572
|
+
function on(e, t, o, i) {
|
|
6267
6573
|
const r = se(t, o).exportBlocks(e, i);
|
|
6268
6574
|
return Ie(r);
|
|
6269
6575
|
}
|
|
6270
|
-
function
|
|
6576
|
+
function nn(e) {
|
|
6271
6577
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
6272
6578
|
}
|
|
6273
|
-
function
|
|
6579
|
+
function rn(e) {
|
|
6274
6580
|
return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
|
|
6275
6581
|
}
|
|
6276
|
-
function
|
|
6582
|
+
function an(e) {
|
|
6277
6583
|
e.querySelectorAll("li > ul, li > ol").forEach((t) => {
|
|
6278
|
-
const o =
|
|
6584
|
+
const o = nn(t), i = t.parentElement, n = Array.from(i.childNodes).slice(
|
|
6279
6585
|
o + 1
|
|
6280
6586
|
);
|
|
6281
6587
|
t.remove(), n.forEach((r) => {
|
|
6282
6588
|
r.remove();
|
|
6283
6589
|
}), i.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
|
|
6284
|
-
if (
|
|
6590
|
+
if (rn(r))
|
|
6285
6591
|
return;
|
|
6286
6592
|
const a = document.createElement("li");
|
|
6287
6593
|
a.append(r), t.insertAdjacentElement("afterend", a);
|
|
6288
6594
|
}), i.childNodes.length === 0 && i.remove();
|
|
6289
6595
|
});
|
|
6290
6596
|
}
|
|
6291
|
-
function
|
|
6597
|
+
function sn(e) {
|
|
6292
6598
|
e.querySelectorAll("li + ul, li + ol").forEach((t) => {
|
|
6293
6599
|
var r, a;
|
|
6294
6600
|
const o = t.previousElementSibling, i = document.createElement("div");
|
|
@@ -6299,15 +6605,15 @@ function an(e) {
|
|
|
6299
6605
|
});
|
|
6300
6606
|
}
|
|
6301
6607
|
let We = null;
|
|
6302
|
-
function
|
|
6608
|
+
function ln() {
|
|
6303
6609
|
return We || (We = document.implementation.createHTMLDocument("title"));
|
|
6304
6610
|
}
|
|
6305
6611
|
function yt(e) {
|
|
6306
6612
|
if (typeof e == "string") {
|
|
6307
|
-
const t =
|
|
6613
|
+
const t = ln().createElement("div");
|
|
6308
6614
|
t.innerHTML = e, e = t;
|
|
6309
6615
|
}
|
|
6310
|
-
return
|
|
6616
|
+
return an(e), sn(e), e;
|
|
6311
6617
|
}
|
|
6312
6618
|
async function wt(e, t, o, i, n) {
|
|
6313
6619
|
const r = yt(e), s = It.fromSchema(n).parse(r, {
|
|
@@ -6319,7 +6625,7 @@ async function wt(e, t, o, i, n) {
|
|
|
6319
6625
|
);
|
|
6320
6626
|
return l;
|
|
6321
6627
|
}
|
|
6322
|
-
function
|
|
6628
|
+
function dn(e, t) {
|
|
6323
6629
|
const o = t.value ? t.value + `
|
|
6324
6630
|
` : "", i = {};
|
|
6325
6631
|
t.lang && (i["data-language"] = t.lang);
|
|
@@ -6336,11 +6642,11 @@ function ln(e, t) {
|
|
|
6336
6642
|
children: [n]
|
|
6337
6643
|
}, e.patch(t, n), n;
|
|
6338
6644
|
}
|
|
6339
|
-
function
|
|
6645
|
+
function cn(e, t, o, i, n) {
|
|
6340
6646
|
const r = Ee().use(ao).use(Qe).use(so, {
|
|
6341
6647
|
handlers: {
|
|
6342
6648
|
...lo,
|
|
6343
|
-
code:
|
|
6649
|
+
code: dn
|
|
6344
6650
|
}
|
|
6345
6651
|
}).use(Ye).processSync(e);
|
|
6346
6652
|
return wt(
|
|
@@ -6371,7 +6677,7 @@ class X {
|
|
|
6371
6677
|
this.callbacks = {};
|
|
6372
6678
|
}
|
|
6373
6679
|
}
|
|
6374
|
-
class
|
|
6680
|
+
class un {
|
|
6375
6681
|
constructor(t, o, i, n) {
|
|
6376
6682
|
c(this, "state");
|
|
6377
6683
|
c(this, "emitUpdate");
|
|
@@ -6424,7 +6730,7 @@ class cn {
|
|
|
6424
6730
|
}
|
|
6425
6731
|
}
|
|
6426
6732
|
const ge = new S("FilePanelPlugin");
|
|
6427
|
-
class
|
|
6733
|
+
class pn extends X {
|
|
6428
6734
|
constructor(o) {
|
|
6429
6735
|
super();
|
|
6430
6736
|
c(this, "view");
|
|
@@ -6432,7 +6738,7 @@ class un extends X {
|
|
|
6432
6738
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6433
6739
|
this.plugin = new y({
|
|
6434
6740
|
key: ge,
|
|
6435
|
-
view: (i) => (this.view = new
|
|
6741
|
+
view: (i) => (this.view = new un(
|
|
6436
6742
|
o,
|
|
6437
6743
|
ge,
|
|
6438
6744
|
i,
|
|
@@ -6464,14 +6770,14 @@ class un extends X {
|
|
|
6464
6770
|
return this.on("update", o);
|
|
6465
6771
|
}
|
|
6466
6772
|
}
|
|
6467
|
-
class
|
|
6773
|
+
class hn {
|
|
6468
6774
|
constructor(t, o, i) {
|
|
6469
6775
|
c(this, "state");
|
|
6470
6776
|
c(this, "emitUpdate");
|
|
6471
6777
|
c(this, "preventHide", !1);
|
|
6472
6778
|
c(this, "preventShow", !1);
|
|
6473
6779
|
c(this, "shouldShow", ({ state: t, from: o, to: i, view: n }) => {
|
|
6474
|
-
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);
|
|
6475
6781
|
return !(!n.hasFocus() || s || l);
|
|
6476
6782
|
});
|
|
6477
6783
|
c(this, "blurHandler", (t) => {
|
|
@@ -6542,7 +6848,7 @@ class pn {
|
|
|
6542
6848
|
}
|
|
6543
6849
|
getSelectionBoundingBox() {
|
|
6544
6850
|
const { state: t } = this.pmView, { selection: o } = t, { ranges: i } = o, n = Math.min(...i.map((a) => a.$from.pos)), r = Math.max(...i.map((a) => a.$to.pos));
|
|
6545
|
-
if (
|
|
6851
|
+
if (Rt(o)) {
|
|
6546
6852
|
const a = this.pmView.nodeDOM(n);
|
|
6547
6853
|
if (a)
|
|
6548
6854
|
return a.getBoundingClientRect();
|
|
@@ -6550,18 +6856,18 @@ class pn {
|
|
|
6550
6856
|
return ye(this.pmView, n, r);
|
|
6551
6857
|
}
|
|
6552
6858
|
}
|
|
6553
|
-
const
|
|
6859
|
+
const mn = new S(
|
|
6554
6860
|
"FormattingToolbarPlugin"
|
|
6555
6861
|
);
|
|
6556
|
-
class
|
|
6862
|
+
class fn extends X {
|
|
6557
6863
|
constructor(o) {
|
|
6558
6864
|
super();
|
|
6559
6865
|
c(this, "view");
|
|
6560
6866
|
c(this, "plugin");
|
|
6561
6867
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6562
6868
|
this.plugin = new y({
|
|
6563
|
-
key:
|
|
6564
|
-
view: (i) => (this.view = new
|
|
6869
|
+
key: mn,
|
|
6870
|
+
view: (i) => (this.view = new hn(o, i, (n) => {
|
|
6565
6871
|
this.emit("update", n);
|
|
6566
6872
|
}), this.view),
|
|
6567
6873
|
props: {
|
|
@@ -6577,7 +6883,7 @@ class mn extends X {
|
|
|
6577
6883
|
return this.on("update", o);
|
|
6578
6884
|
}
|
|
6579
6885
|
}
|
|
6580
|
-
class
|
|
6886
|
+
class gn {
|
|
6581
6887
|
constructor(t, o, i) {
|
|
6582
6888
|
c(this, "state");
|
|
6583
6889
|
c(this, "emitUpdate");
|
|
@@ -6595,7 +6901,7 @@ class fn {
|
|
|
6595
6901
|
const o = t.target, i = this.pmView.posAtDOM(o, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
|
|
6596
6902
|
for (const a of r)
|
|
6597
6903
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6598
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
6904
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = De(n, a.type, a.attrs) || void 0;
|
|
6599
6905
|
break;
|
|
6600
6906
|
}
|
|
6601
6907
|
}
|
|
@@ -6667,7 +6973,7 @@ class fn {
|
|
|
6667
6973
|
const i = this.pmView.state.selection.$from.marks();
|
|
6668
6974
|
for (const n of i)
|
|
6669
6975
|
if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6670
|
-
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange =
|
|
6976
|
+
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = De(
|
|
6671
6977
|
this.pmView.state.selection.$from,
|
|
6672
6978
|
n.type,
|
|
6673
6979
|
n.attrs
|
|
@@ -6704,8 +7010,8 @@ class fn {
|
|
|
6704
7010
|
);
|
|
6705
7011
|
}
|
|
6706
7012
|
}
|
|
6707
|
-
const
|
|
6708
|
-
class
|
|
7013
|
+
const bn = new S("LinkToolbarPlugin");
|
|
7014
|
+
class kn extends X {
|
|
6709
7015
|
constructor(o) {
|
|
6710
7016
|
super();
|
|
6711
7017
|
c(this, "view");
|
|
@@ -6744,8 +7050,8 @@ class bn extends X {
|
|
|
6744
7050
|
});
|
|
6745
7051
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6746
7052
|
this.plugin = new y({
|
|
6747
|
-
key:
|
|
6748
|
-
view: (i) => (this.view = new
|
|
7053
|
+
key: bn,
|
|
7054
|
+
view: (i) => (this.view = new gn(o, i, (n) => {
|
|
6749
7055
|
this.emit("update", n);
|
|
6750
7056
|
}), this.view),
|
|
6751
7057
|
props: {
|
|
@@ -6761,7 +7067,7 @@ class bn extends X {
|
|
|
6761
7067
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
6762
7068
|
}
|
|
6763
7069
|
}
|
|
6764
|
-
class
|
|
7070
|
+
class O extends me {
|
|
6765
7071
|
constructor(o, i) {
|
|
6766
7072
|
super(o, i);
|
|
6767
7073
|
c(this, "nodes");
|
|
@@ -6772,13 +7078,13 @@ class z extends me {
|
|
|
6772
7078
|
});
|
|
6773
7079
|
}
|
|
6774
7080
|
static create(o, i, n = i) {
|
|
6775
|
-
return new
|
|
7081
|
+
return new O(o.resolve(i), o.resolve(n));
|
|
6776
7082
|
}
|
|
6777
7083
|
content() {
|
|
6778
|
-
return new
|
|
7084
|
+
return new D(L.from(this.nodes), 0, 0);
|
|
6779
7085
|
}
|
|
6780
7086
|
eq(o) {
|
|
6781
|
-
if (!(o instanceof
|
|
7087
|
+
if (!(o instanceof O) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
|
|
6782
7088
|
return !1;
|
|
6783
7089
|
for (let i = 0; i < this.nodes.length; i++)
|
|
6784
7090
|
if (!this.nodes[i].eq(o.nodes[i]))
|
|
@@ -6787,7 +7093,7 @@ class z extends me {
|
|
|
6787
7093
|
}
|
|
6788
7094
|
map(o, i) {
|
|
6789
7095
|
const n = i.mapResult(this.from), r = i.mapResult(this.to);
|
|
6790
|
-
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(
|
|
6791
7097
|
o.resolve(n.pos),
|
|
6792
7098
|
o.resolve(r.pos)
|
|
6793
7099
|
);
|
|
@@ -6798,13 +7104,13 @@ class z extends me {
|
|
|
6798
7104
|
}
|
|
6799
7105
|
let B;
|
|
6800
7106
|
function he(e, t) {
|
|
6801
|
-
var o;
|
|
6802
|
-
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"; )
|
|
6803
7109
|
e = e.parentElement;
|
|
6804
|
-
if (e.
|
|
7110
|
+
if (((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) === "blockContainer")
|
|
6805
7111
|
return { node: e, id: e.getAttribute("data-id") };
|
|
6806
7112
|
}
|
|
6807
|
-
function
|
|
7113
|
+
function _n(e, t) {
|
|
6808
7114
|
const o = he(e, t);
|
|
6809
7115
|
if (o && o.node.nodeType === 1) {
|
|
6810
7116
|
const i = t.docView, n = i.nearestDesc(o.node, !0);
|
|
@@ -6812,7 +7118,7 @@ function kn(e, t) {
|
|
|
6812
7118
|
}
|
|
6813
7119
|
return null;
|
|
6814
7120
|
}
|
|
6815
|
-
function
|
|
7121
|
+
function yn(e, t) {
|
|
6816
7122
|
let o, i;
|
|
6817
7123
|
const n = t.resolve(e.from).node().type.spec.group === "blockContent", r = t.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
|
|
6818
7124
|
if (n && r) {
|
|
@@ -6844,7 +7150,7 @@ function $e(e, t, o = t) {
|
|
|
6844
7150
|
function vt(e) {
|
|
6845
7151
|
B !== void 0 && (e instanceof ShadowRoot ? e.removeChild(B) : e.body.removeChild(B), B = void 0);
|
|
6846
7152
|
}
|
|
6847
|
-
function
|
|
7153
|
+
function wn(e, t) {
|
|
6848
7154
|
if (!e.dataTransfer)
|
|
6849
7155
|
return;
|
|
6850
7156
|
const o = t.prosemirrorView, i = o.dom.getBoundingClientRect(), n = {
|
|
@@ -6860,11 +7166,11 @@ function yn(e, t) {
|
|
|
6860
7166
|
}
|
|
6861
7167
|
if (!a)
|
|
6862
7168
|
return;
|
|
6863
|
-
const s =
|
|
7169
|
+
const s = _n(a.node, o);
|
|
6864
7170
|
if (s != null) {
|
|
6865
|
-
const l = o.state.selection, d = o.state.doc, { from: u, to: p } =
|
|
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;
|
|
6866
7172
|
h && f ? (o.dispatch(
|
|
6867
|
-
o.state.tr.setSelection(
|
|
7173
|
+
o.state.tr.setSelection(O.create(d, u, p))
|
|
6868
7174
|
), $e(o, u, p)) : (o.dispatch(
|
|
6869
7175
|
o.state.tr.setSelection(re.create(o.state.doc, s))
|
|
6870
7176
|
), $e(o, s));
|
|
@@ -6878,7 +7184,7 @@ function yn(e, t) {
|
|
|
6878
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 };
|
|
6879
7185
|
}
|
|
6880
7186
|
}
|
|
6881
|
-
class
|
|
7187
|
+
class vn {
|
|
6882
7188
|
constructor(t, o, i) {
|
|
6883
7189
|
c(this, "state");
|
|
6884
7190
|
c(this, "emitUpdate");
|
|
@@ -7092,8 +7398,8 @@ class wn {
|
|
|
7092
7398
|
this.editor.openSelectionMenu("/");
|
|
7093
7399
|
}
|
|
7094
7400
|
}
|
|
7095
|
-
const
|
|
7096
|
-
class
|
|
7401
|
+
const xn = new S("SideMenuPlugin");
|
|
7402
|
+
class En extends X {
|
|
7097
7403
|
constructor(o) {
|
|
7098
7404
|
super();
|
|
7099
7405
|
c(this, "view");
|
|
@@ -7107,7 +7413,7 @@ class xn extends X {
|
|
|
7107
7413
|
* Handles drag & drop events for blocks.
|
|
7108
7414
|
*/
|
|
7109
7415
|
c(this, "blockDragStart", (o) => {
|
|
7110
|
-
this.view.isDragging = !0,
|
|
7416
|
+
this.view.isDragging = !0, wn(o, this.editor);
|
|
7111
7417
|
});
|
|
7112
7418
|
/**
|
|
7113
7419
|
* Handles drag & drop events for blocks.
|
|
@@ -7128,8 +7434,8 @@ class xn extends X {
|
|
|
7128
7434
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
7129
7435
|
});
|
|
7130
7436
|
this.editor = o, this.plugin = new y({
|
|
7131
|
-
key:
|
|
7132
|
-
view: (i) => (this.view = new
|
|
7437
|
+
key: xn,
|
|
7438
|
+
view: (i) => (this.view = new vn(o, i, (n) => {
|
|
7133
7439
|
this.emit("update", n);
|
|
7134
7440
|
}), this.view)
|
|
7135
7441
|
});
|
|
@@ -7138,8 +7444,8 @@ class xn extends X {
|
|
|
7138
7444
|
return this.on("update", o);
|
|
7139
7445
|
}
|
|
7140
7446
|
}
|
|
7141
|
-
const
|
|
7142
|
-
class
|
|
7447
|
+
const Cn = Ot((e) => e.type.name === "blockContainer");
|
|
7448
|
+
class Sn {
|
|
7143
7449
|
constructor(t, o) {
|
|
7144
7450
|
c(this, "state");
|
|
7145
7451
|
c(this, "emitUpdate");
|
|
@@ -7200,7 +7506,7 @@ class Cn {
|
|
|
7200
7506
|
}
|
|
7201
7507
|
}
|
|
7202
7508
|
const F = new S("SuggestionMenuPlugin");
|
|
7203
|
-
class
|
|
7509
|
+
class Mn extends X {
|
|
7204
7510
|
constructor(o) {
|
|
7205
7511
|
super();
|
|
7206
7512
|
c(this, "view");
|
|
@@ -7220,7 +7526,7 @@ class Sn extends X {
|
|
|
7220
7526
|
const i = this.triggerCharacters;
|
|
7221
7527
|
this.plugin = new y({
|
|
7222
7528
|
key: F,
|
|
7223
|
-
view: () => (this.view = new
|
|
7529
|
+
view: () => (this.view = new Sn(
|
|
7224
7530
|
o,
|
|
7225
7531
|
(n, r) => {
|
|
7226
7532
|
this.emit(`update ${n}`, r);
|
|
@@ -7276,7 +7582,7 @@ class Sn extends X {
|
|
|
7276
7582
|
if (r === void 0)
|
|
7277
7583
|
return null;
|
|
7278
7584
|
if (!r.fromUserInput) {
|
|
7279
|
-
const a =
|
|
7585
|
+
const a = Cn(n.selection);
|
|
7280
7586
|
if (a)
|
|
7281
7587
|
return G.create(n.doc, [
|
|
7282
7588
|
K.node(
|
|
@@ -7313,32 +7619,32 @@ class Sn extends X {
|
|
|
7313
7619
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
7314
7620
|
}
|
|
7315
7621
|
}
|
|
7316
|
-
function
|
|
7622
|
+
function Zr(e, t) {
|
|
7317
7623
|
e.suggestionMenus.addTriggerCharacter(t);
|
|
7318
7624
|
}
|
|
7319
7625
|
let w;
|
|
7320
7626
|
function qe(e) {
|
|
7321
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));
|
|
7322
7628
|
}
|
|
7323
|
-
function
|
|
7629
|
+
function Tn(e) {
|
|
7324
7630
|
w && (e instanceof Document ? e.body.removeChild(w) : e.removeChild(w), w = void 0);
|
|
7325
7631
|
}
|
|
7326
7632
|
function ie(e) {
|
|
7327
7633
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
7328
7634
|
}
|
|
7329
|
-
function
|
|
7635
|
+
function Bn(e) {
|
|
7330
7636
|
for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
|
|
7331
7637
|
e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
|
|
7332
7638
|
return e;
|
|
7333
7639
|
}
|
|
7334
|
-
function
|
|
7640
|
+
function Ln(e, t) {
|
|
7335
7641
|
e.forEach((o) => {
|
|
7336
7642
|
const i = t.querySelectorAll(o);
|
|
7337
7643
|
for (let n = 0; n < i.length; n++)
|
|
7338
7644
|
i[n].style.visibility = "hidden";
|
|
7339
7645
|
});
|
|
7340
7646
|
}
|
|
7341
|
-
class
|
|
7647
|
+
class In {
|
|
7342
7648
|
constructor(t, o, i) {
|
|
7343
7649
|
c(this, "state");
|
|
7344
7650
|
c(this, "emitUpdate");
|
|
@@ -7350,7 +7656,7 @@ class Ln {
|
|
|
7350
7656
|
var d;
|
|
7351
7657
|
if (this.menuFrozen)
|
|
7352
7658
|
return;
|
|
7353
|
-
const o =
|
|
7659
|
+
const o = Bn(t.target);
|
|
7354
7660
|
if (!o || !this.editor.isEditable) {
|
|
7355
7661
|
(d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate());
|
|
7356
7662
|
return;
|
|
@@ -7371,7 +7677,7 @@ class Ln {
|
|
|
7371
7677
|
this.editor.schema.styleSchema,
|
|
7372
7678
|
this.editor.blockCache
|
|
7373
7679
|
);
|
|
7374
|
-
return
|
|
7680
|
+
return $i("table", h, this.editor) && (this.tablePos = p + 1, l = h), !1;
|
|
7375
7681
|
}), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === i)))
|
|
7376
7682
|
return this.state = {
|
|
7377
7683
|
show: !0,
|
|
@@ -7387,7 +7693,7 @@ class Ln {
|
|
|
7387
7693
|
var h;
|
|
7388
7694
|
if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
|
|
7389
7695
|
return;
|
|
7390
|
-
t.preventDefault(), t.dataTransfer.dropEffect = "move",
|
|
7696
|
+
t.preventDefault(), t.dataTransfer.dropEffect = "move", Ln(
|
|
7391
7697
|
[
|
|
7392
7698
|
"column-resize-handle",
|
|
7393
7699
|
"prosemirror-dropcursor-block",
|
|
@@ -7475,7 +7781,7 @@ class Ln {
|
|
|
7475
7781
|
}
|
|
7476
7782
|
}
|
|
7477
7783
|
const Q = new S("TableHandlesPlugin");
|
|
7478
|
-
class
|
|
7784
|
+
class An extends X {
|
|
7479
7785
|
constructor(o) {
|
|
7480
7786
|
super();
|
|
7481
7787
|
c(this, "view");
|
|
@@ -7535,7 +7841,7 @@ class In extends X {
|
|
|
7535
7841
|
);
|
|
7536
7842
|
this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
|
|
7537
7843
|
this.editor._tiptapEditor.state.tr.setMeta(Q, null)
|
|
7538
|
-
),
|
|
7844
|
+
), Tn(this.editor._tiptapEditor.view.root);
|
|
7539
7845
|
});
|
|
7540
7846
|
/**
|
|
7541
7847
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -7553,7 +7859,7 @@ class In extends X {
|
|
|
7553
7859
|
});
|
|
7554
7860
|
this.editor = o, this.plugin = new y({
|
|
7555
7861
|
key: Q,
|
|
7556
|
-
view: (i) => (this.view = new
|
|
7862
|
+
view: (i) => (this.view = new In(o, i, (n) => {
|
|
7557
7863
|
this.emit("update", n);
|
|
7558
7864
|
}), this.view),
|
|
7559
7865
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -7622,7 +7928,7 @@ function Xe(e, t) {
|
|
|
7622
7928
|
), s = Ie(a);
|
|
7623
7929
|
return { internalHTML: n, externalHTML: a, plainText: s };
|
|
7624
7930
|
}
|
|
7625
|
-
const
|
|
7931
|
+
const Nn = (e) => M.create({
|
|
7626
7932
|
name: "copyToClipboard",
|
|
7627
7933
|
addProseMirrorPlugins() {
|
|
7628
7934
|
return [
|
|
@@ -7662,7 +7968,7 @@ const An = (e) => M.create({
|
|
|
7662
7968
|
];
|
|
7663
7969
|
}
|
|
7664
7970
|
});
|
|
7665
|
-
function
|
|
7971
|
+
function Pn(e) {
|
|
7666
7972
|
let t = e.getTextCursorPosition().block, o = e.schema.blockSchema[t.type].content;
|
|
7667
7973
|
for (; o === "none"; )
|
|
7668
7974
|
t = e.getTextCursorPosition().nextBlock, o = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
|
|
@@ -7676,9 +7982,9 @@ function x(e, t) {
|
|
|
7676
7982
|
"end"
|
|
7677
7983
|
));
|
|
7678
7984
|
const i = e.getTextCursorPosition().block;
|
|
7679
|
-
return
|
|
7985
|
+
return Pn(e), i;
|
|
7680
7986
|
}
|
|
7681
|
-
function
|
|
7987
|
+
function Jr(e) {
|
|
7682
7988
|
const t = [];
|
|
7683
7989
|
return E("heading", e) && t.push(
|
|
7684
7990
|
{
|
|
@@ -7828,7 +8134,7 @@ function Zr(e) {
|
|
|
7828
8134
|
...e.dictionary.slash_menu.emoji
|
|
7829
8135
|
}), t;
|
|
7830
8136
|
}
|
|
7831
|
-
function
|
|
8137
|
+
function Yr(e, t) {
|
|
7832
8138
|
return e.filter(
|
|
7833
8139
|
({ title: o, aliases: i }) => o.toLowerCase().includes(t.toLowerCase()) || i && i.filter(
|
|
7834
8140
|
(n) => n.toLowerCase().includes(t.toLowerCase())
|
|
@@ -7841,7 +8147,7 @@ const Ae = [
|
|
|
7841
8147
|
"text/html",
|
|
7842
8148
|
"text/plain"
|
|
7843
8149
|
];
|
|
7844
|
-
function
|
|
8150
|
+
function Hn(e, t) {
|
|
7845
8151
|
const o = e.split("/"), i = t.split("/");
|
|
7846
8152
|
if (o.length !== 2)
|
|
7847
8153
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
@@ -7874,7 +8180,7 @@ async function xt(e, t) {
|
|
|
7874
8180
|
let s = "file";
|
|
7875
8181
|
for (const d of r)
|
|
7876
8182
|
for (const u of d.fileBlockAcceptMimeTypes || [])
|
|
7877
|
-
if (
|
|
8183
|
+
if (Hn(n[a].type, u)) {
|
|
7878
8184
|
s = d.type;
|
|
7879
8185
|
break;
|
|
7880
8186
|
}
|
|
@@ -7894,7 +8200,7 @@ async function xt(e, t) {
|
|
|
7894
8200
|
}
|
|
7895
8201
|
}
|
|
7896
8202
|
}
|
|
7897
|
-
const
|
|
8203
|
+
const Un = (e) => M.create({
|
|
7898
8204
|
name: "pasteFromClipboard",
|
|
7899
8205
|
addProseMirrorPlugins() {
|
|
7900
8206
|
return [
|
|
@@ -7922,7 +8228,7 @@ const Hn = (e) => M.create({
|
|
|
7922
8228
|
})
|
|
7923
8229
|
];
|
|
7924
8230
|
}
|
|
7925
|
-
}),
|
|
8231
|
+
}), Dn = (e) => M.create({
|
|
7926
8232
|
name: "dropFile",
|
|
7927
8233
|
addProseMirrorPlugins() {
|
|
7928
8234
|
return [
|
|
@@ -7963,7 +8269,7 @@ const Hn = (e) => M.create({
|
|
|
7963
8269
|
}
|
|
7964
8270
|
];
|
|
7965
8271
|
}
|
|
7966
|
-
}),
|
|
8272
|
+
}), Vn = M.create({
|
|
7967
8273
|
name: "textAlignment",
|
|
7968
8274
|
addGlobalAttributes() {
|
|
7969
8275
|
return [
|
|
@@ -7989,7 +8295,7 @@ const Hn = (e) => M.create({
|
|
|
7989
8295
|
}
|
|
7990
8296
|
];
|
|
7991
8297
|
}
|
|
7992
|
-
}),
|
|
8298
|
+
}), zn = M.create({
|
|
7993
8299
|
name: "blockTextColor",
|
|
7994
8300
|
addGlobalAttributes() {
|
|
7995
8301
|
return [
|
|
@@ -8042,7 +8348,7 @@ const Hn = (e) => M.create({
|
|
|
8042
8348
|
})
|
|
8043
8349
|
];
|
|
8044
8350
|
}
|
|
8045
|
-
}), On = new S("non-editable-block"),
|
|
8351
|
+
}), On = new S("non-editable-block"), Fn = () => new y({
|
|
8046
8352
|
key: On,
|
|
8047
8353
|
props: {
|
|
8048
8354
|
handleKeyDown: (e, t) => {
|
|
@@ -8068,7 +8374,7 @@ const Hn = (e) => M.create({
|
|
|
8068
8374
|
return !1;
|
|
8069
8375
|
}
|
|
8070
8376
|
}
|
|
8071
|
-
}), Ze = new S("previous-blocks"),
|
|
8377
|
+
}), Ze = new S("previous-blocks"), Gn = {
|
|
8072
8378
|
// Numbered List Items
|
|
8073
8379
|
index: "index",
|
|
8074
8380
|
// Headings
|
|
@@ -8077,7 +8383,7 @@ const Hn = (e) => M.create({
|
|
|
8077
8383
|
type: "type",
|
|
8078
8384
|
depth: "depth",
|
|
8079
8385
|
"depth-change": "depth-change"
|
|
8080
|
-
},
|
|
8386
|
+
}, Kn = () => {
|
|
8081
8387
|
let e;
|
|
8082
8388
|
return new y({
|
|
8083
8389
|
key: Ze,
|
|
@@ -8110,9 +8416,9 @@ const Hn = (e) => M.create({
|
|
|
8110
8416
|
apply(t, o, i, n) {
|
|
8111
8417
|
if (o.currentTransactionOldBlockAttrs = {}, o.updatedBlocks.clear(), !t.docChanged || i.doc.eq(n.doc))
|
|
8112
8418
|
return o;
|
|
8113
|
-
const r = {}, a =
|
|
8419
|
+
const r = {}, a = je(i.doc, (d) => d.attrs.id), s = new Map(
|
|
8114
8420
|
a.map((d) => [d.node.attrs.id, d])
|
|
8115
|
-
), l =
|
|
8421
|
+
), l = je(n.doc, (d) => d.attrs.id);
|
|
8116
8422
|
for (const d of l) {
|
|
8117
8423
|
const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
|
|
8118
8424
|
if (u && p && h) {
|
|
@@ -8145,7 +8451,7 @@ const Hn = (e) => M.create({
|
|
|
8145
8451
|
return;
|
|
8146
8452
|
const a = o.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
|
|
8147
8453
|
for (const [d, u] of Object.entries(a))
|
|
8148
|
-
s["data-prev-" +
|
|
8454
|
+
s["data-prev-" + Gn[d]] = u || "none";
|
|
8149
8455
|
const l = K.node(r, r + n.nodeSize, {
|
|
8150
8456
|
...s
|
|
8151
8457
|
});
|
|
@@ -8154,13 +8460,13 @@ const Hn = (e) => M.create({
|
|
|
8154
8460
|
}
|
|
8155
8461
|
}
|
|
8156
8462
|
});
|
|
8157
|
-
},
|
|
8463
|
+
}, Wn = {
|
|
8158
8464
|
blockColor: "data-block-color",
|
|
8159
8465
|
blockStyle: "data-block-style",
|
|
8160
8466
|
id: "data-id",
|
|
8161
8467
|
depth: "data-depth",
|
|
8162
8468
|
depthChange: "data-depth-change"
|
|
8163
|
-
},
|
|
8469
|
+
}, $n = $.create({
|
|
8164
8470
|
name: "blockContainer",
|
|
8165
8471
|
group: "blockContainer",
|
|
8166
8472
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -8176,7 +8482,7 @@ const Hn = (e) => M.create({
|
|
|
8176
8482
|
if (typeof e == "string")
|
|
8177
8483
|
return !1;
|
|
8178
8484
|
const t = {};
|
|
8179
|
-
for (const [o, i] of Object.entries(
|
|
8485
|
+
for (const [o, i] of Object.entries(Wn))
|
|
8180
8486
|
e.getAttribute(i) && (t[o] = e.getAttribute(i));
|
|
8181
8487
|
return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
|
|
8182
8488
|
}
|
|
@@ -8193,7 +8499,7 @@ const Hn = (e) => M.create({
|
|
|
8193
8499
|
...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
|
|
8194
8500
|
...e
|
|
8195
8501
|
}, i = document.createElement("div");
|
|
8196
|
-
i.className =
|
|
8502
|
+
i.className = j("bn-block", o.class), i.setAttribute("data-node-type", this.name);
|
|
8197
8503
|
for (const [r, a] of Object.entries(o))
|
|
8198
8504
|
r !== "class" && i.setAttribute(r, a);
|
|
8199
8505
|
return t.appendChild(i), {
|
|
@@ -8236,7 +8542,7 @@ const Hn = (e) => M.create({
|
|
|
8236
8542
|
s.childCount === 2 ? o.tr.replace(
|
|
8237
8543
|
r + l.nodeSize + 1,
|
|
8238
8544
|
a - 1,
|
|
8239
|
-
new
|
|
8545
|
+
new D(L.from(h), 0, 0)
|
|
8240
8546
|
) : o.tr.insert(
|
|
8241
8547
|
r + l.nodeSize,
|
|
8242
8548
|
o.schema.nodes.blockGroup.create({}, h)
|
|
@@ -8339,7 +8645,7 @@ const Hn = (e) => M.create({
|
|
|
8339
8645
|
t.tr.deleteRange(l, l + s.nodeSize).replace(
|
|
8340
8646
|
p - 1,
|
|
8341
8647
|
l,
|
|
8342
|
-
new
|
|
8648
|
+
new D(s.content, 0, 0)
|
|
8343
8649
|
).scrollIntoView()
|
|
8344
8650
|
), t.tr.setSelection(
|
|
8345
8651
|
new Y(t.doc.resolve(p - 1))
|
|
@@ -8359,7 +8665,7 @@ const Hn = (e) => M.create({
|
|
|
8359
8665
|
return n && (i.tr.insert(m, f), i.tr.replace(
|
|
8360
8666
|
g,
|
|
8361
8667
|
g + 1,
|
|
8362
|
-
h.content.size > 0 ? new
|
|
8668
|
+
h.content.size > 0 ? new D(
|
|
8363
8669
|
L.from(h),
|
|
8364
8670
|
u + 2,
|
|
8365
8671
|
u + 2
|
|
@@ -8374,7 +8680,7 @@ const Hn = (e) => M.create({
|
|
|
8374
8680
|
), i.tr.replace(
|
|
8375
8681
|
l + 1,
|
|
8376
8682
|
d - 1,
|
|
8377
|
-
p.content.size > 0 ? new
|
|
8683
|
+
p.content.size > 0 ? new D(
|
|
8378
8684
|
L.from(p),
|
|
8379
8685
|
u + 2,
|
|
8380
8686
|
u + 2
|
|
@@ -8384,7 +8690,7 @@ const Hn = (e) => M.create({
|
|
|
8384
8690
|
};
|
|
8385
8691
|
},
|
|
8386
8692
|
addProseMirrorPlugins() {
|
|
8387
|
-
return [
|
|
8693
|
+
return [Kn(), Fn()];
|
|
8388
8694
|
},
|
|
8389
8695
|
addKeyboardShortcuts() {
|
|
8390
8696
|
return {
|
|
@@ -8491,7 +8797,7 @@ const Hn = (e) => M.create({
|
|
|
8491
8797
|
}
|
|
8492
8798
|
};
|
|
8493
8799
|
}
|
|
8494
|
-
}),
|
|
8800
|
+
}), qn = $.create({
|
|
8495
8801
|
name: "blockGroup",
|
|
8496
8802
|
group: "blockGroup",
|
|
8497
8803
|
content: "blockContainer+",
|
|
@@ -8509,7 +8815,7 @@ const Hn = (e) => M.create({
|
|
|
8509
8815
|
...((i = this.options.domAttributes) == null ? void 0 : i.blockGroup) || {},
|
|
8510
8816
|
...e
|
|
8511
8817
|
}, o = document.createElement("div");
|
|
8512
|
-
o.className =
|
|
8818
|
+
o.className = j(
|
|
8513
8819
|
"bn-block-group",
|
|
8514
8820
|
t.class
|
|
8515
8821
|
), o.setAttribute("data-node-type", "blockGroup");
|
|
@@ -8520,11 +8826,11 @@ const Hn = (e) => M.create({
|
|
|
8520
8826
|
contentDOM: o
|
|
8521
8827
|
};
|
|
8522
8828
|
}
|
|
8523
|
-
}),
|
|
8829
|
+
}), Xn = $.create({
|
|
8524
8830
|
name: "doc",
|
|
8525
8831
|
topNode: !0,
|
|
8526
8832
|
content: "blockGroup"
|
|
8527
|
-
}),
|
|
8833
|
+
}), Zn = (e) => {
|
|
8528
8834
|
var i;
|
|
8529
8835
|
const t = [
|
|
8530
8836
|
J.ClipboardTextSerializer,
|
|
@@ -8551,9 +8857,9 @@ const Hn = (e) => M.create({
|
|
|
8551
8857
|
}
|
|
8552
8858
|
}),
|
|
8553
8859
|
...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
|
|
8554
|
-
|
|
8860
|
+
zn,
|
|
8555
8861
|
jn,
|
|
8556
|
-
|
|
8862
|
+
Vn,
|
|
8557
8863
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
8558
8864
|
M.create({
|
|
8559
8865
|
name: "OverrideEscape",
|
|
@@ -8564,12 +8870,12 @@ const Hn = (e) => M.create({
|
|
|
8564
8870
|
}
|
|
8565
8871
|
}),
|
|
8566
8872
|
// nodes
|
|
8567
|
-
|
|
8568
|
-
|
|
8873
|
+
Xn,
|
|
8874
|
+
$n.configure({
|
|
8569
8875
|
editor: e.editor,
|
|
8570
8876
|
domAttributes: e.domAttributes
|
|
8571
8877
|
}),
|
|
8572
|
-
|
|
8878
|
+
qn.configure({
|
|
8573
8879
|
domAttributes: e.domAttributes
|
|
8574
8880
|
}),
|
|
8575
8881
|
...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
|
|
@@ -8589,9 +8895,9 @@ const Hn = (e) => M.create({
|
|
|
8589
8895
|
domAttributes: e.domAttributes
|
|
8590
8896
|
})
|
|
8591
8897
|
]),
|
|
8592
|
-
|
|
8593
|
-
Hn(e.editor),
|
|
8898
|
+
Nn(e.editor),
|
|
8594
8899
|
Un(e.editor),
|
|
8900
|
+
Dn(e.editor),
|
|
8595
8901
|
ho.configure({ width: 5, color: "#ddeeff" }),
|
|
8596
8902
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
8597
8903
|
// should be handled before Enter handlers in other components like splitListItem
|
|
@@ -8624,20 +8930,20 @@ const Hn = (e) => M.create({
|
|
|
8624
8930
|
const o = e.disableExtensions || [];
|
|
8625
8931
|
return t.filter((n) => !o.includes(n.name));
|
|
8626
8932
|
};
|
|
8627
|
-
function
|
|
8933
|
+
function Jn(e, t) {
|
|
8628
8934
|
const o = [];
|
|
8629
8935
|
return e.forEach((i, n, r) => {
|
|
8630
8936
|
r !== t && o.push(i);
|
|
8631
8937
|
}), L.from(o);
|
|
8632
8938
|
}
|
|
8633
|
-
function
|
|
8939
|
+
function Yn(e, t) {
|
|
8634
8940
|
let o = L.from(e.content);
|
|
8635
8941
|
for (let i = 0; i < o.childCount; i++)
|
|
8636
8942
|
if (o.child(i).type.spec.group === "blockContent") {
|
|
8637
8943
|
const n = [o.child(i)];
|
|
8638
8944
|
if (i + 1 < o.childCount && o.child(i + 1).type.spec.group === "blockGroup") {
|
|
8639
8945
|
const a = o.child(i + 1).child(0).child(0);
|
|
8640
|
-
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o =
|
|
8946
|
+
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o = Jn(o, i + 1));
|
|
8641
8947
|
}
|
|
8642
8948
|
const r = t.state.schema.nodes.blockContainer.create(
|
|
8643
8949
|
void 0,
|
|
@@ -8645,7 +8951,7 @@ function Jn(e, t) {
|
|
|
8645
8951
|
);
|
|
8646
8952
|
o = o.replaceChild(i, r);
|
|
8647
8953
|
}
|
|
8648
|
-
return new
|
|
8954
|
+
return new D(o, e.openStart, e.openEnd);
|
|
8649
8955
|
}
|
|
8650
8956
|
function be(e) {
|
|
8651
8957
|
return e && Object.fromEntries(
|
|
@@ -8755,8 +9061,8 @@ class Et extends Ft {
|
|
|
8755
9061
|
}
|
|
8756
9062
|
Et.prototype.createView = () => {
|
|
8757
9063
|
};
|
|
8758
|
-
const
|
|
8759
|
-
key:
|
|
9064
|
+
const Qn = new S("blocknote-placeholder"), er = (e, t) => new y({
|
|
9065
|
+
key: Qn,
|
|
8760
9066
|
view: () => {
|
|
8761
9067
|
const o = document.createElement("style"), i = e._tiptapEditor.options.injectNonce;
|
|
8762
9068
|
i && o.setAttribute("nonce", i), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(o) : e._tiptapEditor.view.root.head.appendChild(o);
|
|
@@ -8800,7 +9106,7 @@ const Yn = new S("blocknote-placeholder"), Qn = (e, t) => new y({
|
|
|
8800
9106
|
return G.create(i, [l]);
|
|
8801
9107
|
}
|
|
8802
9108
|
}
|
|
8803
|
-
}),
|
|
9109
|
+
}), tr = {
|
|
8804
9110
|
enableInputRules: !0,
|
|
8805
9111
|
enablePasteRules: !0,
|
|
8806
9112
|
enableCoreExtensions: !1
|
|
@@ -8895,8 +9201,8 @@ class Ct {
|
|
|
8895
9201
|
...t.placeholders
|
|
8896
9202
|
}
|
|
8897
9203
|
};
|
|
8898
|
-
this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new
|
|
8899
|
-
const n =
|
|
9204
|
+
this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new fn(this), this.linkToolbar = new kn(this), this.sideMenu = new En(this), this.suggestionMenus = new Mn(this), this.filePanel = new pn(this), E("table", this) && (this.tableHandles = new An(this));
|
|
9205
|
+
const n = Zn({
|
|
8900
9206
|
editor: this,
|
|
8901
9207
|
domAttributes: i.domAttributes || {},
|
|
8902
9208
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -8914,7 +9220,7 @@ class Ct {
|
|
|
8914
9220
|
this.suggestionMenus.plugin,
|
|
8915
9221
|
...this.filePanel ? [this.filePanel.plugin] : [],
|
|
8916
9222
|
...this.tableHandles ? [this.tableHandles.plugin] : [],
|
|
8917
|
-
|
|
9223
|
+
er(this, i.placeholders)
|
|
8918
9224
|
]
|
|
8919
9225
|
});
|
|
8920
9226
|
n.push(r), this.uploadFile = i.uploadFile, this.resolveFileUrl = i.resolveFileUrl || (async (g) => g), this.headless = i._headless, i.collaboration && i.initialContent && console.warn(
|
|
@@ -8936,7 +9242,7 @@ class Ct {
|
|
|
8936
9242
|
"initialContent must be a non-empty array of blocks, received: " + a
|
|
8937
9243
|
);
|
|
8938
9244
|
const s = {
|
|
8939
|
-
...
|
|
9245
|
+
...tr,
|
|
8940
9246
|
...i._tiptapOptions,
|
|
8941
9247
|
content: a,
|
|
8942
9248
|
extensions: [
|
|
@@ -8948,13 +9254,13 @@ class Ct {
|
|
|
8948
9254
|
attributes: {
|
|
8949
9255
|
...(p = (u = i._tiptapOptions) == null ? void 0 : u.editorProps) == null ? void 0 : p.attributes,
|
|
8950
9256
|
...(h = i.domAttributes) == null ? void 0 : h.editor,
|
|
8951
|
-
class:
|
|
9257
|
+
class: j(
|
|
8952
9258
|
"bn-editor",
|
|
8953
9259
|
i.defaultStyles ? "bn-default-styles" : "",
|
|
8954
9260
|
((m = (f = i.domAttributes) == null ? void 0 : f.editor) == null ? void 0 : m.class) || ""
|
|
8955
9261
|
)
|
|
8956
9262
|
},
|
|
8957
|
-
transformPasted:
|
|
9263
|
+
transformPasted: Yn
|
|
8958
9264
|
}
|
|
8959
9265
|
};
|
|
8960
9266
|
this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = new Et(
|
|
@@ -9144,7 +9450,7 @@ class Ct {
|
|
|
9144
9450
|
throw new Error("no editor, but also not headless?");
|
|
9145
9451
|
return !1;
|
|
9146
9452
|
}
|
|
9147
|
-
return this._tiptapEditor.isEditable;
|
|
9453
|
+
return this._tiptapEditor.isEditable === void 0 ? !0 : this._tiptapEditor.isEditable;
|
|
9148
9454
|
}
|
|
9149
9455
|
/**
|
|
9150
9456
|
* Makes the editor editable or locks it, depending on the argument passed.
|
|
@@ -9167,7 +9473,7 @@ class Ct {
|
|
|
9167
9473
|
* `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
|
|
9168
9474
|
*/
|
|
9169
9475
|
insertBlocks(t, o, i = "before") {
|
|
9170
|
-
return
|
|
9476
|
+
return Xi(t, o, i, this);
|
|
9171
9477
|
}
|
|
9172
9478
|
/**
|
|
9173
9479
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -9177,14 +9483,14 @@ class Ct {
|
|
|
9177
9483
|
* @param update A partial block which defines how the existing block should be changed.
|
|
9178
9484
|
*/
|
|
9179
9485
|
updateBlock(t, o) {
|
|
9180
|
-
return
|
|
9486
|
+
return Zi(t, o, this);
|
|
9181
9487
|
}
|
|
9182
9488
|
/**
|
|
9183
9489
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
9184
9490
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
9185
9491
|
*/
|
|
9186
9492
|
removeBlocks(t) {
|
|
9187
|
-
return
|
|
9493
|
+
return Ji(t, this);
|
|
9188
9494
|
}
|
|
9189
9495
|
/**
|
|
9190
9496
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -9194,7 +9500,7 @@ class Ct {
|
|
|
9194
9500
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
9195
9501
|
*/
|
|
9196
9502
|
replaceBlocks(t, o) {
|
|
9197
|
-
return
|
|
9503
|
+
return Yi(t, o, this);
|
|
9198
9504
|
}
|
|
9199
9505
|
/**
|
|
9200
9506
|
* Insert a piece of content at the current cursor position.
|
|
@@ -9207,7 +9513,7 @@ class Ct {
|
|
|
9207
9513
|
this.pmSchema,
|
|
9208
9514
|
this.schema.styleSchema
|
|
9209
9515
|
);
|
|
9210
|
-
|
|
9516
|
+
Qi(
|
|
9211
9517
|
{
|
|
9212
9518
|
from: this._tiptapEditor.state.selection.from,
|
|
9213
9519
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -9380,7 +9686,7 @@ class Ct {
|
|
|
9380
9686
|
* @returns The blocks, serialized as a Markdown string.
|
|
9381
9687
|
*/
|
|
9382
9688
|
async blocksToMarkdownLossy(t = this.document) {
|
|
9383
|
-
return
|
|
9689
|
+
return on(t, this.pmSchema, this, {});
|
|
9384
9690
|
}
|
|
9385
9691
|
/**
|
|
9386
9692
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -9390,7 +9696,7 @@ class Ct {
|
|
|
9390
9696
|
* @returns The blocks parsed from the Markdown string.
|
|
9391
9697
|
*/
|
|
9392
9698
|
async tryParseMarkdownToBlocks(t) {
|
|
9393
|
-
return
|
|
9699
|
+
return cn(
|
|
9394
9700
|
t,
|
|
9395
9701
|
this.schema.blockSchema,
|
|
9396
9702
|
this.schema.inlineContentSchema,
|
|
@@ -9450,8 +9756,8 @@ class Ct {
|
|
|
9450
9756
|
}
|
|
9451
9757
|
}
|
|
9452
9758
|
let ne, ke;
|
|
9453
|
-
async function
|
|
9454
|
-
if (!
|
|
9759
|
+
async function Qr(e, t) {
|
|
9760
|
+
if (!Wi("text", e))
|
|
9455
9761
|
return [];
|
|
9456
9762
|
if (!ne) {
|
|
9457
9763
|
ne = import("@emoji-mart/data"), ke = await import("emoji-mart");
|
|
@@ -9483,7 +9789,7 @@ function St(e) {
|
|
|
9483
9789
|
content: St(t.content)
|
|
9484
9790
|
}) : e;
|
|
9485
9791
|
}
|
|
9486
|
-
function
|
|
9792
|
+
function ea(e, t) {
|
|
9487
9793
|
return t.map(
|
|
9488
9794
|
(o) => Mt(e, o)
|
|
9489
9795
|
);
|
|
@@ -9507,55 +9813,55 @@ function Mt(e, t) {
|
|
|
9507
9813
|
children: o.children.map((i) => Mt(e, i))
|
|
9508
9814
|
};
|
|
9509
9815
|
}
|
|
9510
|
-
function tr(e) {
|
|
9511
|
-
e.id || (e.id = oe.options.generateID()), e.children && or(e.children);
|
|
9512
|
-
}
|
|
9513
9816
|
function or(e) {
|
|
9817
|
+
e.id || (e.id = oe.options.generateID()), e.children && ir(e.children);
|
|
9818
|
+
}
|
|
9819
|
+
function ir(e) {
|
|
9514
9820
|
for (const t of e)
|
|
9515
|
-
|
|
9821
|
+
or(t);
|
|
9516
9822
|
}
|
|
9517
9823
|
export {
|
|
9518
|
-
|
|
9824
|
+
Qo as AudioBlock,
|
|
9519
9825
|
Ct as BlockNoteEditor,
|
|
9520
9826
|
Ne as BlockNoteSchema,
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9827
|
+
ri as FileBlock,
|
|
9828
|
+
pn as FilePanelProsemirrorPlugin,
|
|
9829
|
+
un as FilePanelView,
|
|
9830
|
+
fn as FormattingToolbarProsemirrorPlugin,
|
|
9831
|
+
hn as FormattingToolbarView,
|
|
9526
9832
|
wt as HTMLToBlocks,
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9833
|
+
ui as ImageBlock,
|
|
9834
|
+
kn as LinkToolbarProsemirrorPlugin,
|
|
9835
|
+
En as SideMenuProsemirrorPlugin,
|
|
9836
|
+
vn as SideMenuView,
|
|
9837
|
+
Mn as SuggestionMenuProseMirrorPlugin,
|
|
9838
|
+
An as TableHandlesProsemirrorPlugin,
|
|
9839
|
+
In as TableHandlesView,
|
|
9534
9840
|
oe as UniqueID,
|
|
9535
9841
|
I as UnreachableCaseError,
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9842
|
+
bi as VideoBlock,
|
|
9843
|
+
or as addIdsToBlock,
|
|
9844
|
+
ir as addIdsToBlocks,
|
|
9845
|
+
zo as addInlineContentAttributes,
|
|
9540
9846
|
Ro as addInlineContentKeyboardShortcuts,
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9847
|
+
Wo as addStyleAttributes,
|
|
9848
|
+
Vr as assertEmpty,
|
|
9849
|
+
Xo as audioBlockConfig,
|
|
9850
|
+
Jo as audioParse,
|
|
9851
|
+
qo as audioPropSchema,
|
|
9852
|
+
Zo as audioRender,
|
|
9853
|
+
Yo as audioToExternalHTML,
|
|
9548
9854
|
P as blockToNode,
|
|
9549
|
-
|
|
9855
|
+
on as blocksToMarkdown,
|
|
9550
9856
|
ae as camelToDataKebab,
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9857
|
+
Xr as checkBlockHasDefaultProp,
|
|
9858
|
+
$i as checkBlockIsDefaultType,
|
|
9859
|
+
Wr as checkBlockIsFileBlock,
|
|
9860
|
+
qr as checkBlockIsFileBlockWithPlaceholder,
|
|
9861
|
+
$r as checkBlockIsFileBlockWithPreview,
|
|
9862
|
+
qi as checkBlockTypeHasDefaultProp,
|
|
9557
9863
|
E as checkDefaultBlockTypeInSchema,
|
|
9558
|
-
|
|
9864
|
+
Wi as checkDefaultInlineContentTypeInSchema,
|
|
9559
9865
|
Ie as cleanHTMLToMarkdown,
|
|
9560
9866
|
Se as contentNodeToInlineContent,
|
|
9561
9867
|
ce as createAddFileButton,
|
|
@@ -9564,81 +9870,81 @@ export {
|
|
|
9564
9870
|
de as createDefaultFilePreview,
|
|
9565
9871
|
se as createExternalHTMLExporter,
|
|
9566
9872
|
Te as createFigureWithCaption,
|
|
9567
|
-
|
|
9873
|
+
z as createFileAndCaptionWrapper,
|
|
9568
9874
|
Or as createInlineContentSpec,
|
|
9569
|
-
|
|
9875
|
+
Fo as createInlineContentSpecFromTipTapNode,
|
|
9570
9876
|
ct as createInternalBlockSpec,
|
|
9571
9877
|
Me as createInternalHTMLSerializer,
|
|
9572
9878
|
Oo as createInternalInlineContentSpec,
|
|
9573
9879
|
ht as createInternalStyleSpec,
|
|
9574
9880
|
pe as createLinkWithCaption,
|
|
9575
9881
|
ft as createResizeHandlesWrapper,
|
|
9576
|
-
|
|
9577
|
-
|
|
9882
|
+
R as createStronglyTypedTiptapNode,
|
|
9883
|
+
Fr as createStyleSpec,
|
|
9578
9884
|
U as createStyleSpecFromTipTapMark,
|
|
9579
|
-
|
|
9580
|
-
|
|
9885
|
+
Zr as createSuggestionMenu,
|
|
9886
|
+
Gi as defaultBlockSchema,
|
|
9581
9887
|
gt as defaultBlockSpecs,
|
|
9582
|
-
|
|
9888
|
+
Ki as defaultInlineContentSchema,
|
|
9583
9889
|
kt as defaultInlineContentSpecs,
|
|
9584
9890
|
_ as defaultProps,
|
|
9585
|
-
|
|
9891
|
+
Kr as defaultStyleSchema,
|
|
9586
9892
|
bt as defaultStyleSpecs,
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9893
|
+
ti as fileBlockConfig,
|
|
9894
|
+
ii as fileParse,
|
|
9895
|
+
ei as filePropSchema,
|
|
9896
|
+
oi as fileRender,
|
|
9897
|
+
ni as fileToExternalHTML,
|
|
9592
9898
|
Rr as filenameFromURL,
|
|
9593
|
-
|
|
9899
|
+
Yr as filterSuggestionItems,
|
|
9594
9900
|
H as formatKeyboardShortcut,
|
|
9595
|
-
|
|
9901
|
+
mn as formattingToolbarPluginKey,
|
|
9596
9902
|
jo as getBlockFromPos,
|
|
9597
|
-
|
|
9903
|
+
Zn as getBlockNoteExtensions,
|
|
9598
9904
|
ut as getBlockSchemaFromSpecs,
|
|
9599
|
-
|
|
9600
|
-
|
|
9905
|
+
Qr as getDefaultEmojiPickerItems,
|
|
9906
|
+
Jr as getDefaultSlashMenuItems,
|
|
9601
9907
|
he as getDraggableBlockFromElement,
|
|
9602
|
-
|
|
9908
|
+
Go as getInlineContentParseRules,
|
|
9603
9909
|
pt as getInlineContentSchemaFromSpecs,
|
|
9604
|
-
|
|
9605
|
-
|
|
9910
|
+
Vo as getParseRules,
|
|
9911
|
+
$o as getStyleParseRules,
|
|
9606
9912
|
mt as getStyleSchemaFromSpecs,
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9913
|
+
si as imageBlockConfig,
|
|
9914
|
+
di as imageParse,
|
|
9915
|
+
ai as imagePropSchema,
|
|
9916
|
+
li as imageRender,
|
|
9917
|
+
ci as imageToExternalHTML,
|
|
9612
9918
|
lt as inheritedProps,
|
|
9613
9919
|
W as inlineContentToNodes,
|
|
9614
9920
|
x as insertOrUpdateBlock,
|
|
9615
|
-
|
|
9921
|
+
Do as isAppleOS,
|
|
9616
9922
|
Ve as isLinkInlineContent,
|
|
9617
9923
|
ot as isPartialLinkInlineContent,
|
|
9618
|
-
|
|
9924
|
+
zr as isSafari,
|
|
9619
9925
|
te as isStyledTextInlineContent,
|
|
9620
|
-
|
|
9926
|
+
bn as linkToolbarPluginKey,
|
|
9621
9927
|
jr as locales,
|
|
9622
|
-
|
|
9623
|
-
|
|
9928
|
+
cn as markdownToBlocks,
|
|
9929
|
+
j as mergeCSSClasses,
|
|
9624
9930
|
v as nodeToBlock,
|
|
9625
9931
|
rt as nodeToCustomInlineContent,
|
|
9626
|
-
|
|
9932
|
+
Oe as parseEmbedElement,
|
|
9627
9933
|
ue as parseFigureElement,
|
|
9628
9934
|
Ge as parseImageElement,
|
|
9629
9935
|
Mt as partialBlockToBlockForTesting,
|
|
9630
|
-
|
|
9936
|
+
ea as partialBlocksToBlocksForTesting,
|
|
9631
9937
|
dt as propsToAttributes,
|
|
9632
|
-
|
|
9633
|
-
|
|
9938
|
+
xn as sideMenuPluginKey,
|
|
9939
|
+
Ko as stylePropsToAttributes,
|
|
9634
9940
|
it as tableContentToNodes,
|
|
9635
9941
|
Q as tableHandlesPluginKey,
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9942
|
+
Gr as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
9943
|
+
hi as videoBlockConfig,
|
|
9944
|
+
fi as videoParse,
|
|
9945
|
+
pi as videoPropSchema,
|
|
9946
|
+
mi as videoRender,
|
|
9947
|
+
gi as videoToExternalHTML,
|
|
9642
9948
|
fe as wrapInBlockStructure
|
|
9643
9949
|
};
|
|
9644
9950
|
//# sourceMappingURL=blocknote.js.map
|