@blocknote/core 0.26.0 → 0.27.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 (146) hide show
  1. package/dist/blocknote.cjs +11 -10
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +3685 -9960
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/comments.cjs.map +1 -1
  6. package/dist/comments.js.map +1 -1
  7. package/dist/en-B7ycW7c8.js +360 -0
  8. package/dist/en-B7ycW7c8.js.map +1 -0
  9. package/dist/en-D4taoCs4.cjs +2 -0
  10. package/dist/en-D4taoCs4.cjs.map +1 -0
  11. package/dist/locales.cjs +2 -0
  12. package/dist/locales.cjs.map +1 -0
  13. package/dist/locales.js +6129 -0
  14. package/dist/locales.js.map +1 -0
  15. package/dist/style.css +1 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/dist/webpack-stats.json +1 -1
  18. package/package.json +36 -27
  19. package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +1 -1
  20. package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +1 -1
  21. package/src/api/clipboard/clipboardExternal.test.ts +1 -1
  22. package/src/api/clipboard/clipboardInternal.test.ts +1 -1
  23. package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -0
  24. package/src/api/clipboard/fromClipboard/pasteExtension.ts +96 -42
  25. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +1 -1
  26. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +1 -1
  27. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +1 -1
  28. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +1 -1
  29. package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +1 -1
  30. package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +1 -1
  31. package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +1 -1
  32. package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +1 -1
  33. package/src/api/exporters/html/htmlConversion.test.ts +2 -2
  34. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +4 -4
  35. package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +1 -1
  36. package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +1 -1
  37. package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +1 -1
  38. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -6
  39. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +6 -6
  40. package/src/api/exporters/markdown/markdownExporter.test.ts +2 -2
  41. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +2 -2
  42. package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +1 -1
  43. package/src/api/parsers/html/parseHTML.test.ts +1 -1
  44. package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +42 -0
  45. package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +19 -0
  46. package/src/api/parsers/markdown/detectMarkdown.ts +60 -0
  47. package/src/api/parsers/markdown/parseMarkdown.test.ts +7 -2
  48. package/src/api/parsers/markdown/parseMarkdown.ts +19 -18
  49. package/src/api/testUtil/cases/defaultSchema.ts +13 -0
  50. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +100 -69
  51. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +98 -0
  52. package/src/blocks/TableBlockContent/TableExtension.ts +1 -1
  53. package/src/blocks/defaultBlocks.ts +2 -2
  54. package/src/editor/Block.css +13 -0
  55. package/src/editor/BlockNoteEditor.ts +102 -10
  56. package/src/editor/BlockNoteExtensions.ts +18 -4
  57. package/src/extensions/Comments/CommentsPlugin.ts +1 -1
  58. package/src/extensions/HardBreak/HardBreak.ts +35 -0
  59. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +100 -3
  60. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -1
  61. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +12 -0
  62. package/src/i18n/index.ts +2 -0
  63. package/src/i18n/locales/ar.ts +6 -0
  64. package/src/i18n/locales/de.ts +6 -0
  65. package/src/i18n/locales/en.ts +6 -0
  66. package/src/i18n/locales/es.ts +6 -0
  67. package/src/i18n/locales/fr.ts +6 -0
  68. package/src/i18n/locales/hr.ts +6 -0
  69. package/src/i18n/locales/is.ts +6 -0
  70. package/src/i18n/locales/it.ts +6 -0
  71. package/src/i18n/locales/ja.ts +6 -0
  72. package/src/i18n/locales/ko.ts +6 -0
  73. package/src/i18n/locales/nl.ts +6 -0
  74. package/src/i18n/locales/no.ts +6 -0
  75. package/src/i18n/locales/pl.ts +6 -0
  76. package/src/i18n/locales/pt.ts +6 -0
  77. package/src/i18n/locales/ru.ts +6 -0
  78. package/src/i18n/locales/uk.ts +6 -0
  79. package/src/i18n/locales/vi.ts +6 -0
  80. package/src/i18n/locales/zh.ts +6 -0
  81. package/src/index.ts +2 -3
  82. package/src/locales.ts +1 -0
  83. package/src/schema/blocks/types.ts +1 -0
  84. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +1 -1
  85. package/types/src/api/blockManipulation/setupTestEnv.d.ts +34 -2
  86. package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
  87. package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +2 -2
  88. package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +3 -3
  89. package/types/src/api/clipboard/testUtil.d.ts +66 -34
  90. package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +1 -1
  91. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -2
  92. package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -2
  93. package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +1 -1
  94. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
  95. package/types/src/api/parsers/markdown/detectMarkdown.d.ts +6 -0
  96. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -0
  97. package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -40
  98. package/types/src/api/testUtil/cases/customInlineContent.d.ts +34 -2
  99. package/types/src/api/testUtil/cases/customStyles.d.ts +34 -2
  100. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +3 -3
  101. package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +46 -34
  102. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +3 -3
  103. package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +1 -1
  104. package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
  105. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -2
  106. package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
  107. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
  108. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
  109. package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +2 -2
  110. package/types/src/blocks/PageBreakBlockContent/schema.d.ts +13 -13
  111. package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
  112. package/types/src/blocks/QuoteBlockContent/QuoteBlockContent.d.ts +52 -0
  113. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
  114. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -2
  115. package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
  116. package/types/src/blocks/defaultBlocks.d.ts +107 -44
  117. package/types/src/comments/threadstore/yjs/YjsThreadStore.d.ts +3 -3
  118. package/types/src/editor/BlockNoteEditor.d.ts +58 -0
  119. package/types/src/editor/BlockNoteExtensions.d.ts +3 -2
  120. package/types/src/exporter/mapping.d.ts +2 -2
  121. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
  122. package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +1 -1
  123. package/types/src/extensions/HardBreak/HardBreak.d.ts +2 -0
  124. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
  125. package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
  126. package/types/src/i18n/index.d.ts +2 -0
  127. package/types/src/i18n/locales/en.d.ts +7 -1
  128. package/types/src/index.d.ts +1 -2
  129. package/types/src/locales.d.ts +1 -0
  130. package/types/src/pm-nodes/BlockContainer.d.ts +2 -7
  131. package/types/src/pm-nodes/BlockGroup.d.ts +2 -7
  132. package/types/src/schema/blocks/types.d.ts +1 -0
  133. package/types/src/schema/inlineContent/internal.d.ts +1 -1
  134. package/README.md +0 -125
  135. package/src/blocks/CodeBlockContent/defaultSupportedLanguages.ts +0 -116
  136. package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +0 -47
  137. package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +0 -121
  138. package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +0 -12
  139. package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +0 -97
  140. package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +0 -83
  141. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +0 -79
  142. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +0 -1
  143. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +0 -15
  144. package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +0 -13
  145. package/types/src/extensions/Comments/types.d.ts +0 -109
  146. package/types/src/models/User.d.ts +0 -5
@@ -1,7 +1,7 @@
1
1
  import { EditorTestCases } from "../index.js";
2
2
  import { DefaultInlineContentSchema, DefaultStyleSchema } from "../../../blocks/defaultBlocks.js";
3
3
  import { BlockNoteSchema } from "../../../editor/BlockNoteSchema.js";
4
- declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSchemaFromSpecs<{
4
+ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFromSpecs<{
5
5
  simpleImage: {
6
6
  config: {
7
7
  type: string;
@@ -31,7 +31,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
31
31
  };
32
32
  content: "none";
33
33
  };
34
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
34
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
35
35
  type: string;
36
36
  propSchema: {
37
37
  textAlignment: {
@@ -58,7 +58,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
58
58
  };
59
59
  };
60
60
  content: "none";
61
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
61
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
62
62
  };
63
63
  customParagraph: {
64
64
  config: {
@@ -77,7 +77,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
77
77
  };
78
78
  content: "inline";
79
79
  };
80
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
80
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
81
81
  type: string;
82
82
  propSchema: {
83
83
  backgroundColor: {
@@ -92,7 +92,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
92
92
  };
93
93
  };
94
94
  content: "inline";
95
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
95
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
96
96
  };
97
97
  simpleCustomParagraph: {
98
98
  config: {
@@ -111,7 +111,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
111
111
  };
112
112
  content: "inline";
113
113
  };
114
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
114
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
115
115
  type: string;
116
116
  propSchema: {
117
117
  backgroundColor: {
@@ -126,7 +126,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
126
126
  };
127
127
  };
128
128
  content: "inline";
129
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
129
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
130
130
  };
131
131
  paragraph: {
132
132
  config: {
@@ -145,7 +145,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
145
145
  };
146
146
  };
147
147
  };
148
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
148
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
149
149
  type: "paragraph";
150
150
  content: "inline";
151
151
  propSchema: {
@@ -160,7 +160,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
160
160
  values: readonly ["left", "center", "right", "justify"];
161
161
  };
162
162
  };
163
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
163
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
164
164
  };
165
165
  heading: {
166
166
  config: {
@@ -183,7 +183,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
183
183
  };
184
184
  };
185
185
  };
186
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
186
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
187
187
  type: "heading";
188
188
  content: "inline";
189
189
  propSchema: {
@@ -202,7 +202,41 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
202
202
  values: readonly ["left", "center", "right", "justify"];
203
203
  };
204
204
  };
205
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
205
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
206
+ };
207
+ quote: {
208
+ config: {
209
+ type: "quote";
210
+ content: "inline";
211
+ propSchema: {
212
+ backgroundColor: {
213
+ default: "default";
214
+ };
215
+ textColor: {
216
+ default: "default";
217
+ };
218
+ textAlignment: {
219
+ default: "left";
220
+ values: readonly ["left", "center", "right", "justify"];
221
+ };
222
+ };
223
+ };
224
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
225
+ type: "quote";
226
+ content: "inline";
227
+ propSchema: {
228
+ backgroundColor: {
229
+ default: "default";
230
+ };
231
+ textColor: {
232
+ default: "default";
233
+ };
234
+ textAlignment: {
235
+ default: "left";
236
+ values: readonly ["left", "center", "right", "justify"];
237
+ };
238
+ };
239
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
206
240
  };
207
241
  codeBlock: {
208
242
  config: {
@@ -211,20 +245,18 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
211
245
  propSchema: {
212
246
  language: {
213
247
  default: string;
214
- values: string[];
215
248
  };
216
249
  };
217
250
  };
218
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
251
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
219
252
  type: "codeBlock";
220
253
  content: "inline";
221
254
  propSchema: {
222
255
  language: {
223
256
  default: string;
224
- values: string[];
225
257
  };
226
258
  };
227
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
259
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
228
260
  };
229
261
  bulletListItem: {
230
262
  config: {
@@ -243,7 +275,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
243
275
  };
244
276
  };
245
277
  };
246
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
278
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
247
279
  type: "bulletListItem";
248
280
  content: "inline";
249
281
  propSchema: {
@@ -258,7 +290,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
258
290
  values: readonly ["left", "center", "right", "justify"];
259
291
  };
260
292
  };
261
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
293
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
262
294
  };
263
295
  numberedListItem: {
264
296
  config: {
@@ -281,7 +313,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
281
313
  };
282
314
  };
283
315
  };
284
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
316
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
285
317
  type: "numberedListItem";
286
318
  content: "inline";
287
319
  propSchema: {
@@ -300,7 +332,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
300
332
  values: readonly ["left", "center", "right", "justify"];
301
333
  };
302
334
  };
303
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
335
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
304
336
  };
305
337
  checkListItem: {
306
338
  config: {
@@ -322,7 +354,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
322
354
  };
323
355
  };
324
356
  };
325
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
357
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
326
358
  type: "checkListItem";
327
359
  content: "inline";
328
360
  propSchema: {
@@ -340,7 +372,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
340
372
  values: readonly ["left", "center", "right", "justify"];
341
373
  };
342
374
  };
343
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
375
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
344
376
  };
345
377
  table: {
346
378
  config: {
@@ -352,7 +384,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
352
384
  };
353
385
  };
354
386
  };
355
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
387
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
356
388
  type: "table";
357
389
  content: "table";
358
390
  propSchema: {
@@ -360,7 +392,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
360
392
  default: "default";
361
393
  };
362
394
  };
363
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
395
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
364
396
  };
365
397
  file: {
366
398
  config: {
@@ -382,7 +414,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
382
414
  content: "none";
383
415
  isFileBlock: true;
384
416
  };
385
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
417
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
386
418
  type: "file";
387
419
  propSchema: {
388
420
  backgroundColor: {
@@ -400,7 +432,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
400
432
  };
401
433
  content: "none";
402
434
  isFileBlock: true;
403
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
435
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
404
436
  };
405
437
  image: {
406
438
  config: {
@@ -433,7 +465,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
433
465
  isFileBlock: true;
434
466
  fileBlockAccept: string[];
435
467
  };
436
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
468
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
437
469
  type: "image";
438
470
  propSchema: {
439
471
  textAlignment: {
@@ -462,7 +494,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
462
494
  content: "none";
463
495
  isFileBlock: true;
464
496
  fileBlockAccept: string[];
465
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
497
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
466
498
  };
467
499
  video: {
468
500
  config: {
@@ -495,7 +527,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
495
527
  isFileBlock: true;
496
528
  fileBlockAccept: string[];
497
529
  };
498
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
530
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
499
531
  type: "video";
500
532
  propSchema: {
501
533
  textAlignment: {
@@ -524,7 +556,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
524
556
  content: "none";
525
557
  isFileBlock: true;
526
558
  fileBlockAccept: string[];
527
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
559
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
528
560
  };
529
561
  audio: {
530
562
  config: {
@@ -550,7 +582,7 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
550
582
  isFileBlock: true;
551
583
  fileBlockAccept: string[];
552
584
  };
553
- implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
585
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
554
586
  type: "audio";
555
587
  propSchema: {
556
588
  backgroundColor: {
@@ -572,9 +604,9 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
572
604
  content: "none";
573
605
  isFileBlock: true;
574
606
  fileBlockAccept: string[];
575
- }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
607
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
576
608
  };
577
- }>, import("../../../schema/index.js").InlineContentSchemaFromSpecs<{
609
+ }>, import("../../../index.js").InlineContentSchemaFromSpecs<{
578
610
  text: {
579
611
  config: "text";
580
612
  implementation: any;
@@ -583,55 +615,55 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
583
615
  config: "link";
584
616
  implementation: any;
585
617
  };
586
- }>, import("../../../schema/index.js").StyleSchemaFromSpecs<{
618
+ }>, import("../../../index.js").StyleSchemaFromSpecs<{
587
619
  bold: {
588
620
  config: {
589
621
  type: string;
590
622
  propSchema: "boolean";
591
623
  };
592
- implementation: import("../../../schema/index.js").StyleImplementation;
624
+ implementation: import("../../../index.js").StyleImplementation;
593
625
  };
594
626
  italic: {
595
627
  config: {
596
628
  type: string;
597
629
  propSchema: "boolean";
598
630
  };
599
- implementation: import("../../../schema/index.js").StyleImplementation;
631
+ implementation: import("../../../index.js").StyleImplementation;
600
632
  };
601
633
  underline: {
602
634
  config: {
603
635
  type: string;
604
636
  propSchema: "boolean";
605
637
  };
606
- implementation: import("../../../schema/index.js").StyleImplementation;
638
+ implementation: import("../../../index.js").StyleImplementation;
607
639
  };
608
640
  strike: {
609
641
  config: {
610
642
  type: string;
611
643
  propSchema: "boolean";
612
644
  };
613
- implementation: import("../../../schema/index.js").StyleImplementation;
645
+ implementation: import("../../../index.js").StyleImplementation;
614
646
  };
615
647
  code: {
616
648
  config: {
617
649
  type: string;
618
650
  propSchema: "boolean";
619
651
  };
620
- implementation: import("../../../schema/index.js").StyleImplementation;
652
+ implementation: import("../../../index.js").StyleImplementation;
621
653
  };
622
654
  textColor: {
623
655
  config: {
624
656
  type: string;
625
657
  propSchema: "string";
626
658
  };
627
- implementation: import("../../../schema/index.js").StyleImplementation;
659
+ implementation: import("../../../index.js").StyleImplementation;
628
660
  };
629
661
  backgroundColor: {
630
662
  config: {
631
663
  type: string;
632
664
  propSchema: "string";
633
665
  };
634
- implementation: import("../../../schema/index.js").StyleImplementation;
666
+ implementation: import("../../../index.js").StyleImplementation;
635
667
  };
636
668
  }>>;
637
669
  export declare const customBlocksTestCases: EditorTestCases<typeof schema.blockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
@@ -78,6 +78,40 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
78
78
  };
79
79
  }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
80
80
  };
81
+ quote: {
82
+ config: {
83
+ type: "quote";
84
+ content: "inline";
85
+ propSchema: {
86
+ backgroundColor: {
87
+ default: "default";
88
+ };
89
+ textColor: {
90
+ default: "default";
91
+ };
92
+ textAlignment: {
93
+ default: "left";
94
+ values: readonly ["left", "center", "right", "justify"];
95
+ };
96
+ };
97
+ };
98
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
99
+ type: "quote";
100
+ content: "inline";
101
+ propSchema: {
102
+ backgroundColor: {
103
+ default: "default";
104
+ };
105
+ textColor: {
106
+ default: "default";
107
+ };
108
+ textAlignment: {
109
+ default: "left";
110
+ values: readonly ["left", "center", "right", "justify"];
111
+ };
112
+ };
113
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
114
+ };
81
115
  codeBlock: {
82
116
  config: {
83
117
  type: "codeBlock";
@@ -85,7 +119,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
85
119
  propSchema: {
86
120
  language: {
87
121
  default: string;
88
- values: string[];
89
122
  };
90
123
  };
91
124
  };
@@ -95,7 +128,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
95
128
  propSchema: {
96
129
  language: {
97
130
  default: string;
98
- values: string[];
99
131
  };
100
132
  };
101
133
  }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
@@ -78,6 +78,40 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
78
78
  };
79
79
  }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
80
80
  };
81
+ quote: {
82
+ config: {
83
+ type: "quote";
84
+ content: "inline";
85
+ propSchema: {
86
+ backgroundColor: {
87
+ default: "default";
88
+ };
89
+ textColor: {
90
+ default: "default";
91
+ };
92
+ textAlignment: {
93
+ default: "left";
94
+ values: readonly ["left", "center", "right", "justify"];
95
+ };
96
+ };
97
+ };
98
+ implementation: import("../../../index.js").TiptapBlockImplementation<{
99
+ type: "quote";
100
+ content: "inline";
101
+ propSchema: {
102
+ backgroundColor: {
103
+ default: "default";
104
+ };
105
+ textColor: {
106
+ default: "default";
107
+ };
108
+ textAlignment: {
109
+ default: "left";
110
+ values: readonly ["left", "center", "right", "justify"];
111
+ };
112
+ };
113
+ }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
114
+ };
81
115
  codeBlock: {
82
116
  config: {
83
117
  type: "codeBlock";
@@ -85,7 +119,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
85
119
  propSchema: {
86
120
  language: {
87
121
  default: string;
88
- values: string[];
89
122
  };
90
123
  };
91
124
  };
@@ -95,7 +128,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
95
128
  propSchema: {
96
129
  language: {
97
130
  default: string;
98
- values: string[];
99
131
  };
100
132
  };
101
133
  }, any, import("../../../index.js").InlineContentSchema, import("../../../index.js").StyleSchema>;
@@ -43,7 +43,7 @@ export declare const audioBlockConfig: {
43
43
  };
44
44
  export declare const audioRender: (block: BlockFromConfig<typeof audioBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
45
45
  dom: HTMLElement;
46
- destroy?: (() => void) | undefined;
46
+ destroy?: () => void;
47
47
  };
48
48
  export declare const audioParse: (element: HTMLElement) => Partial<Props<typeof audioBlockConfig.propSchema>> | undefined;
49
49
  export declare const audioToExternalHTML: (block: BlockFromConfig<typeof audioBlockConfig, any, any>) => {
@@ -73,7 +73,7 @@ export declare const AudioBlock: {
73
73
  isFileBlock: true;
74
74
  fileBlockAccept: string[];
75
75
  };
76
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
76
+ implementation: import("../../index.js").TiptapBlockImplementation<{
77
77
  type: "audio";
78
78
  propSchema: {
79
79
  backgroundColor: {
@@ -95,5 +95,5 @@ export declare const AudioBlock: {
95
95
  content: "none";
96
96
  isFileBlock: true;
97
97
  fileBlockAccept: string[];
98
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
98
+ }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
99
99
  };
@@ -1,15 +1,52 @@
1
- import { SupportedLanguageConfig } from "./defaultSupportedLanguages.js";
2
- interface CodeBlockOptions {
3
- defaultLanguage: string;
4
- indentLineWithTab: boolean;
5
- supportedLanguages: SupportedLanguageConfig[];
6
- }
1
+ import type { HighlighterGeneric } from "@shikijs/types";
2
+ export type CodeBlockOptions = {
3
+ /**
4
+ * Whether to indent lines with a tab when the user presses `Tab` in a code block.
5
+ *
6
+ * @default true
7
+ */
8
+ indentLineWithTab?: boolean;
9
+ /**
10
+ * The default language to use for code blocks.
11
+ *
12
+ * @default "text"
13
+ */
14
+ defaultLanguage?: string;
15
+ /**
16
+ * The languages that are supported in the editor.
17
+ *
18
+ * @example
19
+ * {
20
+ * javascript: {
21
+ * name: "JavaScript",
22
+ * aliases: ["js"],
23
+ * },
24
+ * typescript: {
25
+ * name: "TypeScript",
26
+ * aliases: ["ts"],
27
+ * },
28
+ * }
29
+ */
30
+ supportedLanguages: Record<string, {
31
+ /**
32
+ * The display name of the language.
33
+ */
34
+ name: string;
35
+ /**
36
+ * Aliases for this language.
37
+ */
38
+ aliases?: string[];
39
+ }>;
40
+ /**
41
+ * The highlighter to use for code blocks.
42
+ */
43
+ createHighlighter?: () => Promise<HighlighterGeneric<any, any>>;
44
+ };
7
45
  export declare const shikiParserSymbol: unique symbol;
8
46
  export declare const shikiHighlighterPromiseSymbol: unique symbol;
9
47
  export declare const defaultCodeBlockPropSchema: {
10
48
  language: {
11
49
  default: string;
12
- values: string[];
13
50
  };
14
51
  };
15
52
  export declare const CodeBlock: {
@@ -19,41 +56,16 @@ export declare const CodeBlock: {
19
56
  propSchema: {
20
57
  language: {
21
58
  default: string;
22
- values: string[];
23
59
  };
24
60
  };
25
61
  };
26
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
62
+ implementation: import("../../index.js").TiptapBlockImplementation<{
27
63
  type: "codeBlock";
28
64
  content: "inline";
29
65
  propSchema: {
30
66
  language: {
31
67
  default: string;
32
- values: string[];
33
- };
34
- };
35
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
36
- };
37
- export declare function customizeCodeBlock(options: Partial<CodeBlockOptions>): {
38
- config: {
39
- type: string;
40
- content: "none";
41
- propSchema: {
42
- language: {
43
- default: string;
44
- values: string[];
45
- };
46
- };
47
- };
48
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
49
- type: string;
50
- content: "none";
51
- propSchema: {
52
- language: {
53
- default: string;
54
- values: string[];
55
68
  };
56
69
  };
57
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
70
+ }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
58
71
  };
59
- export {};
@@ -35,7 +35,7 @@ export declare const fileBlockConfig: {
35
35
  };
36
36
  export declare const fileRender: (block: BlockFromConfig<typeof fileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
37
37
  dom: HTMLElement;
38
- destroy?: (() => void) | undefined;
38
+ destroy?: () => void;
39
39
  };
40
40
  export declare const fileParse: (element: HTMLElement) => {
41
41
  url: string | undefined;
@@ -68,7 +68,7 @@ export declare const FileBlock: {
68
68
  content: "none";
69
69
  isFileBlock: true;
70
70
  };
71
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
71
+ implementation: import("../../index.js").TiptapBlockImplementation<{
72
72
  type: "file";
73
73
  propSchema: {
74
74
  backgroundColor: {
@@ -86,5 +86,5 @@ export declare const FileBlock: {
86
86
  };
87
87
  content: "none";
88
88
  isFileBlock: true;
89
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
89
+ }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
90
90
  };
@@ -5,5 +5,5 @@ export declare const createFileBlockWrapper: (block: BlockFromConfig<FileBlockCo
5
5
  destroy?: () => void;
6
6
  }, buttonText?: string, buttonIcon?: HTMLElement) => {
7
7
  dom: HTMLElement;
8
- destroy?: (() => void) | undefined;
8
+ destroy?: () => void;
9
9
  };
@@ -35,7 +35,7 @@ export declare const Heading: {
35
35
  };
36
36
  };
37
37
  };
38
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
38
+ implementation: import("../../index.js").TiptapBlockImplementation<{
39
39
  type: "heading";
40
40
  content: "inline";
41
41
  propSchema: {
@@ -54,5 +54,5 @@ export declare const Heading: {
54
54
  values: readonly ["left", "center", "right", "justify"];
55
55
  };
56
56
  };
57
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
57
+ }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
58
58
  };
@@ -94,7 +94,7 @@ export declare const ImageBlock: {
94
94
  isFileBlock: true;
95
95
  fileBlockAccept: string[];
96
96
  };
97
- implementation: import("../../schema/index.js").TiptapBlockImplementation<{
97
+ implementation: import("../../index.js").TiptapBlockImplementation<{
98
98
  type: "image";
99
99
  propSchema: {
100
100
  textAlignment: {
@@ -123,5 +123,5 @@ export declare const ImageBlock: {
123
123
  content: "none";
124
124
  isFileBlock: true;
125
125
  fileBlockAccept: string[];
126
- }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
126
+ }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
127
127
  };