@blocknote/core 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/blocknote.cjs +9 -9
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +1298 -1326
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/{en-CvDoFvhc.js → en-Bq3Es3Np.js} +6 -12
  6. package/dist/en-Bq3Es3Np.js.map +1 -0
  7. package/dist/en-D3B48eJ7.cjs +2 -0
  8. package/dist/en-D3B48eJ7.cjs.map +1 -0
  9. package/dist/locales.cjs +1 -1
  10. package/dist/locales.cjs.map +1 -1
  11. package/dist/locales.js +109 -229
  12. package/dist/locales.js.map +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -0
  14. package/dist/webpack-stats.json +1 -1
  15. package/package.json +7 -7
  16. package/src/api/clipboard/toClipboard/copyExtension.ts +0 -2
  17. package/src/api/exporters/html/externalHTMLExporter.ts +0 -1
  18. package/src/api/exporters/markdown/markdownExporter.ts +13 -22
  19. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +2 -12
  20. package/src/api/parsers/html/parseHTML.ts +3 -2
  21. package/src/api/parsers/html/util/nestedLists.test.ts +8 -8
  22. package/src/api/parsers/markdown/parseMarkdown.ts +17 -14
  23. package/src/api/positionMapping.test.ts +155 -34
  24. package/src/api/positionMapping.ts +2 -2
  25. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +0 -1
  26. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +3 -2
  27. package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +1 -7
  28. package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +42 -17
  29. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +0 -1
  30. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +0 -1
  31. package/src/editor/BlockNoteEditor.ts +17 -23
  32. package/src/editor/BlockNoteExtensions.ts +3 -0
  33. package/src/extensions/Comments/CommentsPlugin.ts +2 -0
  34. package/src/extensions/SideMenu/SideMenuPlugin.ts +0 -2
  35. package/src/i18n/locales/ar.ts +6 -12
  36. package/src/i18n/locales/de.ts +6 -12
  37. package/src/i18n/locales/en.ts +6 -12
  38. package/src/i18n/locales/es.ts +6 -12
  39. package/src/i18n/locales/fr.ts +6 -12
  40. package/src/i18n/locales/he.ts +6 -12
  41. package/src/i18n/locales/hr.ts +6 -12
  42. package/src/i18n/locales/is.ts +6 -12
  43. package/src/i18n/locales/it.ts +6 -12
  44. package/src/i18n/locales/ja.ts +6 -12
  45. package/src/i18n/locales/ko.ts +6 -12
  46. package/src/i18n/locales/nl.ts +6 -12
  47. package/src/i18n/locales/no.ts +6 -12
  48. package/src/i18n/locales/pl.ts +6 -12
  49. package/src/i18n/locales/pt.ts +6 -12
  50. package/src/i18n/locales/ru.ts +6 -12
  51. package/src/i18n/locales/sk.ts +6 -12
  52. package/src/i18n/locales/uk.ts +6 -12
  53. package/src/i18n/locales/vi.ts +6 -12
  54. package/src/i18n/locales/zh-tw.ts +6 -12
  55. package/src/i18n/locales/zh.ts +6 -12
  56. package/src/index.ts +0 -1
  57. package/types/src/api/exporters/markdown/markdownExporter.d.ts +1 -1
  58. package/types/src/api/parsers/html/parseHTML.d.ts +1 -1
  59. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -2
  60. package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +1 -1
  61. package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +1 -1
  62. package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +1 -1
  63. package/types/src/editor/BlockNoteEditor.d.ts +6 -9
  64. package/types/src/editor/BlockNoteExtensions.d.ts +2 -0
  65. package/types/src/extensions/Comments/CommentsPlugin.d.ts +3 -1
  66. package/types/src/i18n/locales/en.d.ts +1 -12
  67. package/types/src/i18n/locales/sk.d.ts +1 -12
  68. package/types/src/index.d.ts +0 -1
  69. package/dist/en-CvDoFvhc.js.map +0 -1
  70. package/dist/en-ub2yVBX0.cjs +0 -2
  71. package/dist/en-ub2yVBX0.cjs.map +0 -1
  72. package/src/util/esmDependencies.ts +0 -51
  73. package/types/src/util/esmDependencies.d.ts +0 -24
@@ -57,6 +57,7 @@ import type {
57
57
  BlockNoteEditorOptions,
58
58
  SupportedExtension,
59
59
  } from "./BlockNoteEditor.js";
60
+ import { BlockNoteSchema } from "./BlockNoteSchema.js";
60
61
  import { ForkYDocPlugin } from "../extensions/Collaboration/ForkYDocPlugin.js";
61
62
 
62
63
  type ExtensionOptions<
@@ -92,6 +93,7 @@ type ExtensionOptions<
92
93
  >;
93
94
  tabBehavior?: "prefer-navigate-ui" | "prefer-indent";
94
95
  comments?: {
96
+ schema?: BlockNoteSchema<any, any, any>;
95
97
  threadStore: ThreadStore;
96
98
  };
97
99
  pasteHandler: BlockNoteEditorOptions<any, any, any>["pasteHandler"];
@@ -156,6 +158,7 @@ export const getBlockNoteExtensions = <
156
158
  opts.editor,
157
159
  opts.comments.threadStore,
158
160
  CommentMark.name,
161
+ opts.comments.schema,
159
162
  );
160
163
  }
161
164
 
@@ -10,6 +10,7 @@ import type {
10
10
  } from "../../comments/index.js";
11
11
  import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
12
12
  import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
13
+ import { BlockNoteSchema } from "../../editor/BlockNoteSchema.js";
13
14
  import { UserStore } from "./userstore/UserStore.js";
14
15
 
15
16
  const PLUGIN_KEY = new PluginKey(`blocknote-comments`);
@@ -134,6 +135,7 @@ export class CommentsPlugin extends BlockNoteExtension {
134
135
  private readonly editor: BlockNoteEditor<any, any, any>,
135
136
  public readonly threadStore: ThreadStore,
136
137
  private readonly markType: string,
138
+ public readonly commentEditorSchema?: BlockNoteSchema<any, any, any>,
137
139
  ) {
138
140
  super();
139
141
 
@@ -17,7 +17,6 @@ import {
17
17
  InlineContentSchema,
18
18
  StyleSchema,
19
19
  } from "../../schema/index.js";
20
- import { initializeESMDependencies } from "../../util/esmDependencies.js";
21
20
  import { getDraggableBlockFromElement } from "../getDraggableBlockFromElement.js";
22
21
  import { dragStart, unsetDragImage } from "./dragging.js";
23
22
 
@@ -171,7 +170,6 @@ export class SideMenuView<
171
170
  this.onDragEnd as EventListener,
172
171
  true,
173
172
  );
174
- initializeESMDependencies();
175
173
 
176
174
  // Shows or updates menu position whenever the cursor moves, if the menu isn't frozen.
177
175
  this.pmView.root.addEventListener(
@@ -169,18 +169,12 @@ export const ar: Dictionary = {
169
169
  comment_reply: "أضف تعليقًا...",
170
170
  },
171
171
  file_blocks: {
172
- image: {
173
- add_button_text: "إضافة صورة",
174
- },
175
- video: {
176
- add_button_text: "إضافة فيديو",
177
- },
178
- audio: {
179
- add_button_text: "إضافة صوت",
180
- },
181
- file: {
182
- add_button_text: "إضافة ملف",
183
- },
172
+ add_button_text: {
173
+ image: "إضافة صورة",
174
+ video: "إضافة فيديو",
175
+ audio: "إضافة صوت",
176
+ file: "إضافة ملف",
177
+ } as Record<string, string>,
184
178
  },
185
179
  toggle_blocks: {
186
180
  add_block_button: "تبديل فارغ. انقر لإضافة كتلة.",
@@ -204,18 +204,12 @@ export const de: Dictionary = {
204
204
  comment_reply: "Kommentar hinzufügen …",
205
205
  },
206
206
  file_blocks: {
207
- image: {
208
- add_button_text: "Bild hinzufügen",
209
- },
210
- video: {
211
- add_button_text: "Video hinzufügen",
212
- },
213
- audio: {
214
- add_button_text: "Audio hinzufügen",
215
- },
216
- file: {
217
- add_button_text: "Datei hinzufügen",
218
- },
207
+ add_button_text: {
208
+ image: "Bild hinzufügen",
209
+ video: "Video hinzufügen",
210
+ audio: "Audio hinzufügen",
211
+ file: "Datei hinzufügen",
212
+ } as Record<string, string>,
219
213
  },
220
214
  toggle_blocks: {
221
215
  add_block_button:
@@ -184,18 +184,12 @@ export const en = {
184
184
  comment_reply: "Add comment...",
185
185
  } as Record<string | "default" | "emptyDocument", string | undefined>,
186
186
  file_blocks: {
187
- image: {
188
- add_button_text: "Add image",
189
- },
190
- video: {
191
- add_button_text: "Add video",
192
- },
193
- audio: {
194
- add_button_text: "Add audio",
195
- },
196
- file: {
197
- add_button_text: "Add file",
198
- },
187
+ add_button_text: {
188
+ image: "Add image",
189
+ video: "Add video",
190
+ audio: "Add audio",
191
+ file: "Add file",
192
+ } as Record<string, string>,
199
193
  },
200
194
  toggle_blocks: {
201
195
  add_block_button: "Empty toggle. Click to add a block.",
@@ -184,18 +184,12 @@ export const es: Dictionary = {
184
184
  comment_reply: "Agregar comentario...",
185
185
  },
186
186
  file_blocks: {
187
- image: {
188
- add_button_text: "Agregar imagen",
189
- },
190
- video: {
191
- add_button_text: "Agregar vídeo",
192
- },
193
- audio: {
194
- add_button_text: "Agregar audio",
195
- },
196
- file: {
197
- add_button_text: "Agregar archivo",
198
- },
187
+ add_button_text: {
188
+ image: "Agregar imagen",
189
+ video: "Agregar vídeo",
190
+ audio: "Agregar audio",
191
+ file: "Agregar archivo",
192
+ } as Record<string, string>,
199
193
  },
200
194
  toggle_blocks: {
201
195
  add_block_button: "Toggle vacío. Haz clic para añadir un bloque.",
@@ -230,18 +230,12 @@ export const fr: Dictionary = {
230
230
  comment_reply: "Ajouter un commentaire...",
231
231
  },
232
232
  file_blocks: {
233
- image: {
234
- add_button_text: "Ajouter une image",
235
- },
236
- video: {
237
- add_button_text: "Ajouter une vidéo",
238
- },
239
- audio: {
240
- add_button_text: "Ajouter un audio",
241
- },
242
- file: {
243
- add_button_text: "Ajouter un fichier",
244
- },
233
+ add_button_text: {
234
+ image: "Ajouter une image",
235
+ video: "Ajouter une vidéo",
236
+ audio: "Ajouter un audio",
237
+ file: "Ajouter un fichier",
238
+ } as Record<string, string>,
245
239
  },
246
240
  toggle_blocks: {
247
241
  add_block_button: "Toggle vide. Cliquez pour ajouter un bloc.",
@@ -186,18 +186,12 @@ export const he: Dictionary = {
186
186
  comment_reply: "הוסף תגובה...",
187
187
  } as Record<string | "default" | "emptyDocument", string | undefined>,
188
188
  file_blocks: {
189
- image: {
190
- add_button_text: "הוסף תמונה",
191
- },
192
- video: {
193
- add_button_text: "הוסף וידאו",
194
- },
195
- audio: {
196
- add_button_text: "הוסף אודיו",
197
- },
198
- file: {
199
- add_button_text: "הוסף קובץ",
200
- },
189
+ add_button_text: {
190
+ image: "הוסף תמונה",
191
+ video: "הוסף וידאו",
192
+ audio: "הוסף אודיו",
193
+ file: "הוסף קובץ",
194
+ } as Record<string, string>,
201
195
  },
202
196
  toggle_blocks: {
203
197
  add_block_button: "מתג ריק. לחץ כדי להוסיף בלוק.",
@@ -197,18 +197,12 @@ export const hr: Dictionary = {
197
197
  comment_reply: "Dodaj komentar...",
198
198
  },
199
199
  file_blocks: {
200
- image: {
201
- add_button_text: "Dodaj sliku",
202
- },
203
- video: {
204
- add_button_text: "Dodaj video",
205
- },
206
- audio: {
207
- add_button_text: "Dodaj audio",
208
- },
209
- file: {
210
- add_button_text: "Dodaj datoteku",
211
- },
200
+ add_button_text: {
201
+ image: "Dodaj sliku",
202
+ video: "Dodaj video",
203
+ audio: "Dodaj audio",
204
+ file: "Dodaj datoteku",
205
+ } as Record<string, string>,
212
206
  },
213
207
  toggle_blocks: {
214
208
  add_block_button: "Prazan sklopivi blok. Klikni da dodaš sadržaj.",
@@ -198,18 +198,12 @@ export const is: Dictionary = {
198
198
  comment_reply: "Bæta við athugasemd...",
199
199
  },
200
200
  file_blocks: {
201
- image: {
202
- add_button_text: "Bæta við mynd",
203
- },
204
- video: {
205
- add_button_text: "Bæta við myndbandi",
206
- },
207
- audio: {
208
- add_button_text: "Bæta við hljóði",
209
- },
210
- file: {
211
- add_button_text: "Bæta við skrá",
212
- },
201
+ add_button_text: {
202
+ image: "Bæta við mynd",
203
+ video: "Bæta við myndbandi",
204
+ audio: "Bæta við hljóði",
205
+ file: "Bæta við skrá",
206
+ } as Record<string, string>,
213
207
  },
214
208
  toggle_blocks: {
215
209
  add_block_button: "Tóm fellilína. Smelltu til að bæta við blokk.",
@@ -206,18 +206,12 @@ export const it: Dictionary = {
206
206
  comment_reply: "Aggiungi commento...",
207
207
  },
208
208
  file_blocks: {
209
- image: {
210
- add_button_text: "Aggiungi immagine",
211
- },
212
- video: {
213
- add_button_text: "Aggiungi video",
214
- },
215
- audio: {
216
- add_button_text: "Aggiungi audio",
217
- },
218
- file: {
219
- add_button_text: "Aggiungi file",
220
- },
209
+ add_button_text: {
210
+ image: "Aggiungi immagine",
211
+ video: "Aggiungi video",
212
+ audio: "Aggiungi audio",
213
+ file: "Aggiungi file",
214
+ } as Record<string, string>,
221
215
  },
222
216
  toggle_blocks: {
223
217
  add_block_button: "Toggle vuoto. Clicca per aggiungere un blocco.",
@@ -224,18 +224,12 @@ export const ja: Dictionary = {
224
224
  comment_reply: "コメントを追加...",
225
225
  },
226
226
  file_blocks: {
227
- image: {
228
- add_button_text: "画像を追加",
229
- },
230
- video: {
231
- add_button_text: "ビデオを追加",
232
- },
233
- audio: {
234
- add_button_text: "オーディオを追加",
235
- },
236
- file: {
237
- add_button_text: "ファイルを追加",
238
- },
227
+ add_button_text: {
228
+ image: "画像を追加",
229
+ video: "ビデオを追加",
230
+ audio: "オーディオを追加",
231
+ file: "ファイルを追加",
232
+ } as Record<string, string>,
239
233
  },
240
234
  toggle_blocks: {
241
235
  add_block_button: "空のトグルです。クリックしてブロックを追加。",
@@ -197,18 +197,12 @@ export const ko: Dictionary = {
197
197
  comment_reply: "댓글 추가...",
198
198
  },
199
199
  file_blocks: {
200
- image: {
201
- add_button_text: "이미지 추가",
202
- },
203
- video: {
204
- add_button_text: "비디오 추가",
205
- },
206
- audio: {
207
- add_button_text: "오디오 추가",
208
- },
209
- file: {
210
- add_button_text: "파일 추가",
211
- },
200
+ add_button_text: {
201
+ image: "이미지 추가",
202
+ video: "비디오 추가",
203
+ audio: "오디오 추가",
204
+ file: "파일 추가",
205
+ } as Record<string, string>,
212
206
  },
213
207
  toggle_blocks: {
214
208
  add_block_button: "비어 있는 토글입니다. 클릭하여 블록을 추가하세요.",
@@ -185,18 +185,12 @@ export const nl: Dictionary = {
185
185
  comment_reply: "Reactie toevoegen...",
186
186
  },
187
187
  file_blocks: {
188
- image: {
189
- add_button_text: "Afbeelding toevoegen",
190
- },
191
- video: {
192
- add_button_text: "Video toevoegen",
193
- },
194
- audio: {
195
- add_button_text: "Audio toevoegen",
196
- },
197
- file: {
198
- add_button_text: "Bestand toevoegen",
199
- },
188
+ add_button_text: {
189
+ image: "Afbeelding toevoegen",
190
+ video: "Video toevoegen",
191
+ audio: "Audio toevoegen",
192
+ file: "Bestand toevoegen",
193
+ } as Record<string, string>,
200
194
  },
201
195
  toggle_blocks: {
202
196
  add_block_button: "Lege uitklapper. Klik om een blok toe te voegen.",
@@ -203,18 +203,12 @@ export const no: Dictionary = {
203
203
  comment_reply: "Legg til kommentar...",
204
204
  },
205
205
  file_blocks: {
206
- image: {
207
- add_button_text: "Legg til bilde",
208
- },
209
- video: {
210
- add_button_text: "Legg til video",
211
- },
212
- audio: {
213
- add_button_text: "Legg til lyd",
214
- },
215
- file: {
216
- add_button_text: "Legg til fil",
217
- },
206
+ add_button_text: {
207
+ image: "Legg til bilde",
208
+ video: "Legg til video",
209
+ audio: "Legg til lyd",
210
+ file: "Legg til fil",
211
+ } as Record<string, string>,
218
212
  },
219
213
  toggle_blocks: {
220
214
  add_block_button: "Tomt toggle. Klikk for å legge til en blokk.",
@@ -175,18 +175,12 @@ export const pl: Dictionary = {
175
175
  comment_reply: "Dodaj komentarz...",
176
176
  },
177
177
  file_blocks: {
178
- image: {
179
- add_button_text: "Dodaj zdjęcie",
180
- },
181
- video: {
182
- add_button_text: "Dodaj wideo",
183
- },
184
- audio: {
185
- add_button_text: "Dodaj audio",
186
- },
187
- file: {
188
- add_button_text: "Dodaj plik",
189
- },
178
+ add_button_text: {
179
+ image: "Dodaj zdjęcie",
180
+ video: "Dodaj wideo",
181
+ audio: "Dodaj audio",
182
+ file: "Dodaj plik",
183
+ } as Record<string, string>,
190
184
  },
191
185
  toggle_blocks: {
192
186
  add_block_button:
@@ -176,18 +176,12 @@ export const pt: Dictionary = {
176
176
  comment_reply: "Adicionar comentário...",
177
177
  },
178
178
  file_blocks: {
179
- image: {
180
- add_button_text: "Adicionar imagem",
181
- },
182
- video: {
183
- add_button_text: "Adicionar vídeo",
184
- },
185
- audio: {
186
- add_button_text: "Adicionar áudio",
187
- },
188
- file: {
189
- add_button_text: "Adicionar arquivo",
190
- },
179
+ add_button_text: {
180
+ image: "Adicionar imagem",
181
+ video: "Adicionar vídeo",
182
+ audio: "Adicionar áudio",
183
+ file: "Adicionar arquivo",
184
+ } as Record<string, string>,
191
185
  },
192
186
  toggle_blocks: {
193
187
  add_block_button: "Toggle vazio. Clique para adicionar um bloco.",
@@ -227,18 +227,12 @@ export const ru: Dictionary = {
227
227
  comment_reply: "Добавить комментарий...",
228
228
  },
229
229
  file_blocks: {
230
- image: {
231
- add_button_text: "Добавить изображение",
232
- },
233
- video: {
234
- add_button_text: "Добавить видео",
235
- },
236
- audio: {
237
- add_button_text: "Добавить аудио",
238
- },
239
- file: {
240
- add_button_text: "Добавить файл",
241
- },
230
+ add_button_text: {
231
+ image: "Добавить изображение",
232
+ video: "Добавить видео",
233
+ audio: "Добавить аудио",
234
+ file: "Добавить файл",
235
+ } as Record<string, string>,
242
236
  },
243
237
  toggle_blocks: {
244
238
  add_block_button: "Пустой переключатель. Нажмите, чтобы добавить блок.",
@@ -184,18 +184,12 @@ export const sk = {
184
184
  comment_reply: "Pridať komentár...",
185
185
  } as Record<string | "default" | "emptyDocument", string | undefined>,
186
186
  file_blocks: {
187
- image: {
188
- add_button_text: "Pridať obrázok",
189
- },
190
- video: {
191
- add_button_text: "Pridať video",
192
- },
193
- audio: {
194
- add_button_text: "Pridať audio",
195
- },
196
- file: {
197
- add_button_text: "Pridať súbor",
198
- },
187
+ add_button_text: {
188
+ image: "Pridať obrázok",
189
+ video: "Pridať video",
190
+ audio: "Pridať audio",
191
+ file: "Pridať súbor",
192
+ } as Record<string, string>,
199
193
  },
200
194
  toggle_blocks: {
201
195
  add_block_button: "Prázdne prepínanie. Kliknite pre pridanie bloku.",
@@ -209,18 +209,12 @@ export const uk: Dictionary = {
209
209
  comment_reply: "Додати коментар...",
210
210
  },
211
211
  file_blocks: {
212
- image: {
213
- add_button_text: "Додати зображення",
214
- },
215
- video: {
216
- add_button_text: "Додати відео",
217
- },
218
- audio: {
219
- add_button_text: "Додати аудіо",
220
- },
221
- file: {
222
- add_button_text: "Додати файл",
223
- },
212
+ add_button_text: {
213
+ image: "Додати зображення",
214
+ video: "Додати відео",
215
+ audio: "Додати аудіо",
216
+ file: "Додати файл",
217
+ } as Record<string, string>,
224
218
  },
225
219
  toggle_blocks: {
226
220
  add_block_button: "Порожній перемикач. Натисніть, щоб додати блок.",
@@ -183,18 +183,12 @@ export const vi: Dictionary = {
183
183
  comment_reply: "Thêm bình luận...",
184
184
  },
185
185
  file_blocks: {
186
- image: {
187
- add_button_text: "Thêm ảnh",
188
- },
189
- video: {
190
- add_button_text: "Thêm video",
191
- },
192
- audio: {
193
- add_button_text: "Thêm âm thanh",
194
- },
195
- file: {
196
- add_button_text: "Thêm tệp",
197
- },
186
+ add_button_text: {
187
+ image: "Thêm ảnh",
188
+ video: "Thêm video",
189
+ audio: "Thêm âm thanh",
190
+ file: "Thêm tệp",
191
+ } as Record<string, string>,
198
192
  },
199
193
  toggle_blocks: {
200
194
  add_block_button: "Toggle trống. Nhấp để thêm khối.",
@@ -225,18 +225,12 @@ export const zhTW: Dictionary = {
225
225
  comment_reply: "新增評論...",
226
226
  },
227
227
  file_blocks: {
228
- image: {
229
- add_button_text: "新增圖片",
230
- },
231
- video: {
232
- add_button_text: "新增影片",
233
- },
234
- audio: {
235
- add_button_text: "新增音訊",
236
- },
237
- file: {
238
- add_button_text: "新增檔案",
239
- },
228
+ add_button_text: {
229
+ image: "新增圖片",
230
+ video: "新增影片",
231
+ audio: "新增音訊",
232
+ file: "新增檔案",
233
+ } as Record<string, string>,
240
234
  },
241
235
  toggle_blocks: {
242
236
  add_block_button: "空的切換區。點擊新增區塊。",
@@ -225,18 +225,12 @@ export const zh: Dictionary = {
225
225
  comment_reply: "添加评论...",
226
226
  },
227
227
  file_blocks: {
228
- image: {
229
- add_button_text: "添加图片",
230
- },
231
- video: {
232
- add_button_text: "添加视频",
233
- },
234
- audio: {
235
- add_button_text: "添加音频",
236
- },
237
- file: {
238
- add_button_text: "添加文件",
239
- },
228
+ add_button_text: {
229
+ image: "添加图片",
230
+ video: "添加视频",
231
+ audio: "添加音频",
232
+ file: "添加文件",
233
+ } as Record<string, string>,
240
234
  },
241
235
  toggle_blocks: {
242
236
  add_block_button: "空的切换区。点击添加区块。",
package/src/index.ts CHANGED
@@ -56,7 +56,6 @@ export * from "./i18n/dictionary.js";
56
56
  export * from "./schema/index.js";
57
57
  export * from "./util/browser.js";
58
58
  export * from "./util/combineByGroup.js";
59
- export * from "./util/esmDependencies.js";
60
59
  export * from "./util/string.js";
61
60
  export * from "./util/table.js";
62
61
  export * from "./util/typescript.js";
@@ -5,4 +5,4 @@ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/i
5
5
  export declare function cleanHTMLToMarkdown(cleanHTMLString: string): string;
6
6
  export declare function blocksToMarkdown<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blocks: PartialBlock<BSchema, I, S>[], schema: Schema, editor: BlockNoteEditor<BSchema, I, S>, options: {
7
7
  document?: Document;
8
- }): Promise<string>;
8
+ }): string;
@@ -1,4 +1,4 @@
1
1
  import { Schema } from "prosemirror-model";
2
2
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
3
3
  import { Block } from "../../../blocks/defaultBlocks.js";
4
- export declare function HTMLToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(html: string, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
4
+ export declare function HTMLToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(html: string, pmSchema: Schema): Block<BSchema, I, S>[];
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "prosemirror-model";
2
2
  import { Block } from "../../../blocks/defaultBlocks.js";
3
3
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
4
- export declare function markdownToHTML(markdown: string): Promise<string>;
5
- export declare function markdownToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(markdown: string, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
4
+ export declare function markdownToHTML(markdown: string): string;
5
+ export declare function markdownToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(markdown: string, pmSchema: Schema): Block<BSchema, I, S>[];
@@ -1,6 +1,6 @@
1
1
  import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
2
2
  import { BlockFromConfig, FileBlockConfig } from "../../../../schema/index.js";
3
- export declare const createAddFileButton: (block: BlockFromConfig<FileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>, buttonText?: string, buttonIcon?: HTMLElement) => {
3
+ export declare const createAddFileButton: (block: BlockFromConfig<FileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>, buttonIcon?: HTMLElement) => {
4
4
  dom: HTMLDivElement;
5
5
  destroy: () => void;
6
6
  };