@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.
- package/dist/blocknote.cjs +11 -10
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +3685 -9960
- package/dist/blocknote.js.map +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js.map +1 -1
- package/dist/en-B7ycW7c8.js +360 -0
- package/dist/en-B7ycW7c8.js.map +1 -0
- package/dist/en-D4taoCs4.cjs +2 -0
- package/dist/en-D4taoCs4.cjs.map +1 -0
- package/dist/locales.cjs +2 -0
- package/dist/locales.cjs.map +1 -0
- package/dist/locales.js +6129 -0
- package/dist/locales.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +36 -27
- package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +1 -1
- package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +1 -1
- package/src/api/clipboard/clipboardExternal.test.ts +1 -1
- package/src/api/clipboard/clipboardInternal.test.ts +1 -1
- package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -0
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +96 -42
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +1 -1
- package/src/api/exporters/html/htmlConversion.test.ts +2 -2
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +4 -4
- package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -6
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +6 -6
- package/src/api/exporters/markdown/markdownExporter.test.ts +2 -2
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +2 -2
- package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +1 -1
- package/src/api/parsers/html/parseHTML.test.ts +1 -1
- package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +42 -0
- package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +19 -0
- package/src/api/parsers/markdown/detectMarkdown.ts +60 -0
- package/src/api/parsers/markdown/parseMarkdown.test.ts +7 -2
- package/src/api/parsers/markdown/parseMarkdown.ts +19 -18
- package/src/api/testUtil/cases/defaultSchema.ts +13 -0
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +100 -69
- package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +98 -0
- package/src/blocks/TableBlockContent/TableExtension.ts +1 -1
- package/src/blocks/defaultBlocks.ts +2 -2
- package/src/editor/Block.css +13 -0
- package/src/editor/BlockNoteEditor.ts +102 -10
- package/src/editor/BlockNoteExtensions.ts +18 -4
- package/src/extensions/Comments/CommentsPlugin.ts +1 -1
- package/src/extensions/HardBreak/HardBreak.ts +35 -0
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +100 -3
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -1
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +12 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +6 -0
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +6 -0
- package/src/i18n/locales/fr.ts +6 -0
- package/src/i18n/locales/hr.ts +6 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/it.ts +6 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/no.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +6 -0
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/uk.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/index.ts +2 -3
- package/src/locales.ts +1 -0
- package/src/schema/blocks/types.ts +1 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +1 -1
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +34 -2
- package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
- package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +2 -2
- package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +3 -3
- package/types/src/api/clipboard/testUtil.d.ts +66 -34
- package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +1 -1
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -2
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -2
- package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +1 -1
- package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
- package/types/src/api/parsers/markdown/detectMarkdown.d.ts +6 -0
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -40
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +34 -2
- package/types/src/api/testUtil/cases/customStyles.d.ts +34 -2
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +3 -3
- package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +46 -34
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +3 -3
- package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +1 -1
- package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +2 -2
- package/types/src/blocks/PageBreakBlockContent/schema.d.ts +13 -13
- package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
- package/types/src/blocks/QuoteBlockContent/QuoteBlockContent.d.ts +52 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -2
- package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
- package/types/src/blocks/defaultBlocks.d.ts +107 -44
- package/types/src/comments/threadstore/yjs/YjsThreadStore.d.ts +3 -3
- package/types/src/editor/BlockNoteEditor.d.ts +58 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +3 -2
- package/types/src/exporter/mapping.d.ts +2 -2
- package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
- package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +1 -1
- package/types/src/extensions/HardBreak/HardBreak.d.ts +2 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
- package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
- package/types/src/i18n/index.d.ts +2 -0
- package/types/src/i18n/locales/en.d.ts +7 -1
- package/types/src/index.d.ts +1 -2
- package/types/src/locales.d.ts +1 -0
- package/types/src/pm-nodes/BlockContainer.d.ts +2 -7
- package/types/src/pm-nodes/BlockGroup.d.ts +2 -7
- package/types/src/schema/blocks/types.d.ts +1 -0
- package/types/src/schema/inlineContent/internal.d.ts +1 -1
- package/README.md +0 -125
- package/src/blocks/CodeBlockContent/defaultSupportedLanguages.ts +0 -116
- package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +0 -47
- package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +0 -121
- package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +0 -12
- package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +0 -97
- package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +0 -83
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +0 -79
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +0 -1
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +0 -15
- package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +0 -13
- package/types/src/extensions/Comments/types.d.ts +0 -109
- package/types/src/models/User.d.ts +0 -5
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BlockNoDefaults, BlockSchema, InlineContentSchema, PartialBlockNoDefaults, StyleSchema } from "../schema/index.js";
|
|
2
|
-
export { customizeCodeBlock } from "./CodeBlockContent/CodeBlockContent.js";
|
|
3
2
|
export declare const defaultBlockSpecs: {
|
|
4
3
|
paragraph: {
|
|
5
4
|
config: {
|
|
@@ -18,7 +17,7 @@ export declare const defaultBlockSpecs: {
|
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
implementation: import("../
|
|
20
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
22
21
|
type: "paragraph";
|
|
23
22
|
content: "inline";
|
|
24
23
|
propSchema: {
|
|
@@ -56,7 +55,7 @@ export declare const defaultBlockSpecs: {
|
|
|
56
55
|
};
|
|
57
56
|
};
|
|
58
57
|
};
|
|
59
|
-
implementation: import("../
|
|
58
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
60
59
|
type: "heading";
|
|
61
60
|
content: "inline";
|
|
62
61
|
propSchema: {
|
|
@@ -77,6 +76,40 @@ export declare const defaultBlockSpecs: {
|
|
|
77
76
|
};
|
|
78
77
|
}, any, InlineContentSchema, StyleSchema>;
|
|
79
78
|
};
|
|
79
|
+
quote: {
|
|
80
|
+
config: {
|
|
81
|
+
type: "quote";
|
|
82
|
+
content: "inline";
|
|
83
|
+
propSchema: {
|
|
84
|
+
backgroundColor: {
|
|
85
|
+
default: "default";
|
|
86
|
+
};
|
|
87
|
+
textColor: {
|
|
88
|
+
default: "default";
|
|
89
|
+
};
|
|
90
|
+
textAlignment: {
|
|
91
|
+
default: "left";
|
|
92
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
97
|
+
type: "quote";
|
|
98
|
+
content: "inline";
|
|
99
|
+
propSchema: {
|
|
100
|
+
backgroundColor: {
|
|
101
|
+
default: "default";
|
|
102
|
+
};
|
|
103
|
+
textColor: {
|
|
104
|
+
default: "default";
|
|
105
|
+
};
|
|
106
|
+
textAlignment: {
|
|
107
|
+
default: "left";
|
|
108
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}, any, InlineContentSchema, StyleSchema>;
|
|
112
|
+
};
|
|
80
113
|
codeBlock: {
|
|
81
114
|
config: {
|
|
82
115
|
type: "codeBlock";
|
|
@@ -84,17 +117,15 @@ export declare const defaultBlockSpecs: {
|
|
|
84
117
|
propSchema: {
|
|
85
118
|
language: {
|
|
86
119
|
default: string;
|
|
87
|
-
values: string[];
|
|
88
120
|
};
|
|
89
121
|
};
|
|
90
122
|
};
|
|
91
|
-
implementation: import("../
|
|
123
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
92
124
|
type: "codeBlock";
|
|
93
125
|
content: "inline";
|
|
94
126
|
propSchema: {
|
|
95
127
|
language: {
|
|
96
128
|
default: string;
|
|
97
|
-
values: string[];
|
|
98
129
|
};
|
|
99
130
|
};
|
|
100
131
|
}, any, InlineContentSchema, StyleSchema>;
|
|
@@ -116,7 +147,7 @@ export declare const defaultBlockSpecs: {
|
|
|
116
147
|
};
|
|
117
148
|
};
|
|
118
149
|
};
|
|
119
|
-
implementation: import("../
|
|
150
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
120
151
|
type: "bulletListItem";
|
|
121
152
|
content: "inline";
|
|
122
153
|
propSchema: {
|
|
@@ -154,7 +185,7 @@ export declare const defaultBlockSpecs: {
|
|
|
154
185
|
};
|
|
155
186
|
};
|
|
156
187
|
};
|
|
157
|
-
implementation: import("../
|
|
188
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
158
189
|
type: "numberedListItem";
|
|
159
190
|
content: "inline";
|
|
160
191
|
propSchema: {
|
|
@@ -195,7 +226,7 @@ export declare const defaultBlockSpecs: {
|
|
|
195
226
|
};
|
|
196
227
|
};
|
|
197
228
|
};
|
|
198
|
-
implementation: import("../
|
|
229
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
199
230
|
type: "checkListItem";
|
|
200
231
|
content: "inline";
|
|
201
232
|
propSchema: {
|
|
@@ -225,7 +256,7 @@ export declare const defaultBlockSpecs: {
|
|
|
225
256
|
};
|
|
226
257
|
};
|
|
227
258
|
};
|
|
228
|
-
implementation: import("../
|
|
259
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
229
260
|
type: "table";
|
|
230
261
|
content: "table";
|
|
231
262
|
propSchema: {
|
|
@@ -255,7 +286,7 @@ export declare const defaultBlockSpecs: {
|
|
|
255
286
|
content: "none";
|
|
256
287
|
isFileBlock: true;
|
|
257
288
|
};
|
|
258
|
-
implementation: import("../
|
|
289
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
259
290
|
type: "file";
|
|
260
291
|
propSchema: {
|
|
261
292
|
backgroundColor: {
|
|
@@ -306,7 +337,7 @@ export declare const defaultBlockSpecs: {
|
|
|
306
337
|
isFileBlock: true;
|
|
307
338
|
fileBlockAccept: string[];
|
|
308
339
|
};
|
|
309
|
-
implementation: import("../
|
|
340
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
310
341
|
type: "image";
|
|
311
342
|
propSchema: {
|
|
312
343
|
textAlignment: {
|
|
@@ -368,7 +399,7 @@ export declare const defaultBlockSpecs: {
|
|
|
368
399
|
isFileBlock: true;
|
|
369
400
|
fileBlockAccept: string[];
|
|
370
401
|
};
|
|
371
|
-
implementation: import("../
|
|
402
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
372
403
|
type: "video";
|
|
373
404
|
propSchema: {
|
|
374
405
|
textAlignment: {
|
|
@@ -423,7 +454,7 @@ export declare const defaultBlockSpecs: {
|
|
|
423
454
|
isFileBlock: true;
|
|
424
455
|
fileBlockAccept: string[];
|
|
425
456
|
};
|
|
426
|
-
implementation: import("../
|
|
457
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
427
458
|
type: "audio";
|
|
428
459
|
propSchema: {
|
|
429
460
|
backgroundColor: {
|
|
@@ -448,7 +479,7 @@ export declare const defaultBlockSpecs: {
|
|
|
448
479
|
}, any, InlineContentSchema, StyleSchema>;
|
|
449
480
|
};
|
|
450
481
|
};
|
|
451
|
-
export declare const defaultBlockSchema: import("../
|
|
482
|
+
export declare const defaultBlockSchema: import("../index.js").BlockSchemaFromSpecs<{
|
|
452
483
|
paragraph: {
|
|
453
484
|
config: {
|
|
454
485
|
type: "paragraph";
|
|
@@ -466,7 +497,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
466
497
|
};
|
|
467
498
|
};
|
|
468
499
|
};
|
|
469
|
-
implementation: import("../
|
|
500
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
470
501
|
type: "paragraph";
|
|
471
502
|
content: "inline";
|
|
472
503
|
propSchema: {
|
|
@@ -504,7 +535,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
504
535
|
};
|
|
505
536
|
};
|
|
506
537
|
};
|
|
507
|
-
implementation: import("../
|
|
538
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
508
539
|
type: "heading";
|
|
509
540
|
content: "inline";
|
|
510
541
|
propSchema: {
|
|
@@ -525,6 +556,40 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
525
556
|
};
|
|
526
557
|
}, any, InlineContentSchema, StyleSchema>;
|
|
527
558
|
};
|
|
559
|
+
quote: {
|
|
560
|
+
config: {
|
|
561
|
+
type: "quote";
|
|
562
|
+
content: "inline";
|
|
563
|
+
propSchema: {
|
|
564
|
+
backgroundColor: {
|
|
565
|
+
default: "default";
|
|
566
|
+
};
|
|
567
|
+
textColor: {
|
|
568
|
+
default: "default";
|
|
569
|
+
};
|
|
570
|
+
textAlignment: {
|
|
571
|
+
default: "left";
|
|
572
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
577
|
+
type: "quote";
|
|
578
|
+
content: "inline";
|
|
579
|
+
propSchema: {
|
|
580
|
+
backgroundColor: {
|
|
581
|
+
default: "default";
|
|
582
|
+
};
|
|
583
|
+
textColor: {
|
|
584
|
+
default: "default";
|
|
585
|
+
};
|
|
586
|
+
textAlignment: {
|
|
587
|
+
default: "left";
|
|
588
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
}, any, InlineContentSchema, StyleSchema>;
|
|
592
|
+
};
|
|
528
593
|
codeBlock: {
|
|
529
594
|
config: {
|
|
530
595
|
type: "codeBlock";
|
|
@@ -532,17 +597,15 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
532
597
|
propSchema: {
|
|
533
598
|
language: {
|
|
534
599
|
default: string;
|
|
535
|
-
values: string[];
|
|
536
600
|
};
|
|
537
601
|
};
|
|
538
602
|
};
|
|
539
|
-
implementation: import("../
|
|
603
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
540
604
|
type: "codeBlock";
|
|
541
605
|
content: "inline";
|
|
542
606
|
propSchema: {
|
|
543
607
|
language: {
|
|
544
608
|
default: string;
|
|
545
|
-
values: string[];
|
|
546
609
|
};
|
|
547
610
|
};
|
|
548
611
|
}, any, InlineContentSchema, StyleSchema>;
|
|
@@ -564,7 +627,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
564
627
|
};
|
|
565
628
|
};
|
|
566
629
|
};
|
|
567
|
-
implementation: import("../
|
|
630
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
568
631
|
type: "bulletListItem";
|
|
569
632
|
content: "inline";
|
|
570
633
|
propSchema: {
|
|
@@ -602,7 +665,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
602
665
|
};
|
|
603
666
|
};
|
|
604
667
|
};
|
|
605
|
-
implementation: import("../
|
|
668
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
606
669
|
type: "numberedListItem";
|
|
607
670
|
content: "inline";
|
|
608
671
|
propSchema: {
|
|
@@ -643,7 +706,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
643
706
|
};
|
|
644
707
|
};
|
|
645
708
|
};
|
|
646
|
-
implementation: import("../
|
|
709
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
647
710
|
type: "checkListItem";
|
|
648
711
|
content: "inline";
|
|
649
712
|
propSchema: {
|
|
@@ -673,7 +736,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
673
736
|
};
|
|
674
737
|
};
|
|
675
738
|
};
|
|
676
|
-
implementation: import("../
|
|
739
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
677
740
|
type: "table";
|
|
678
741
|
content: "table";
|
|
679
742
|
propSchema: {
|
|
@@ -703,7 +766,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
703
766
|
content: "none";
|
|
704
767
|
isFileBlock: true;
|
|
705
768
|
};
|
|
706
|
-
implementation: import("../
|
|
769
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
707
770
|
type: "file";
|
|
708
771
|
propSchema: {
|
|
709
772
|
backgroundColor: {
|
|
@@ -754,7 +817,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
754
817
|
isFileBlock: true;
|
|
755
818
|
fileBlockAccept: string[];
|
|
756
819
|
};
|
|
757
|
-
implementation: import("../
|
|
820
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
758
821
|
type: "image";
|
|
759
822
|
propSchema: {
|
|
760
823
|
textAlignment: {
|
|
@@ -816,7 +879,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
816
879
|
isFileBlock: true;
|
|
817
880
|
fileBlockAccept: string[];
|
|
818
881
|
};
|
|
819
|
-
implementation: import("../
|
|
882
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
820
883
|
type: "video";
|
|
821
884
|
propSchema: {
|
|
822
885
|
textAlignment: {
|
|
@@ -871,7 +934,7 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
871
934
|
isFileBlock: true;
|
|
872
935
|
fileBlockAccept: string[];
|
|
873
936
|
};
|
|
874
|
-
implementation: import("../
|
|
937
|
+
implementation: import("../index.js").TiptapBlockImplementation<{
|
|
875
938
|
type: "audio";
|
|
876
939
|
propSchema: {
|
|
877
940
|
backgroundColor: {
|
|
@@ -904,100 +967,100 @@ export declare const defaultStyleSpecs: {
|
|
|
904
967
|
type: string;
|
|
905
968
|
propSchema: "boolean";
|
|
906
969
|
};
|
|
907
|
-
implementation: import("../
|
|
970
|
+
implementation: import("../index.js").StyleImplementation;
|
|
908
971
|
};
|
|
909
972
|
italic: {
|
|
910
973
|
config: {
|
|
911
974
|
type: string;
|
|
912
975
|
propSchema: "boolean";
|
|
913
976
|
};
|
|
914
|
-
implementation: import("../
|
|
977
|
+
implementation: import("../index.js").StyleImplementation;
|
|
915
978
|
};
|
|
916
979
|
underline: {
|
|
917
980
|
config: {
|
|
918
981
|
type: string;
|
|
919
982
|
propSchema: "boolean";
|
|
920
983
|
};
|
|
921
|
-
implementation: import("../
|
|
984
|
+
implementation: import("../index.js").StyleImplementation;
|
|
922
985
|
};
|
|
923
986
|
strike: {
|
|
924
987
|
config: {
|
|
925
988
|
type: string;
|
|
926
989
|
propSchema: "boolean";
|
|
927
990
|
};
|
|
928
|
-
implementation: import("../
|
|
991
|
+
implementation: import("../index.js").StyleImplementation;
|
|
929
992
|
};
|
|
930
993
|
code: {
|
|
931
994
|
config: {
|
|
932
995
|
type: string;
|
|
933
996
|
propSchema: "boolean";
|
|
934
997
|
};
|
|
935
|
-
implementation: import("../
|
|
998
|
+
implementation: import("../index.js").StyleImplementation;
|
|
936
999
|
};
|
|
937
1000
|
textColor: {
|
|
938
1001
|
config: {
|
|
939
1002
|
type: string;
|
|
940
1003
|
propSchema: "string";
|
|
941
1004
|
};
|
|
942
|
-
implementation: import("../
|
|
1005
|
+
implementation: import("../index.js").StyleImplementation;
|
|
943
1006
|
};
|
|
944
1007
|
backgroundColor: {
|
|
945
1008
|
config: {
|
|
946
1009
|
type: string;
|
|
947
1010
|
propSchema: "string";
|
|
948
1011
|
};
|
|
949
|
-
implementation: import("../
|
|
1012
|
+
implementation: import("../index.js").StyleImplementation;
|
|
950
1013
|
};
|
|
951
1014
|
};
|
|
952
|
-
export declare const defaultStyleSchema: import("../
|
|
1015
|
+
export declare const defaultStyleSchema: import("../index.js").StyleSchemaFromSpecs<{
|
|
953
1016
|
bold: {
|
|
954
1017
|
config: {
|
|
955
1018
|
type: string;
|
|
956
1019
|
propSchema: "boolean";
|
|
957
1020
|
};
|
|
958
|
-
implementation: import("../
|
|
1021
|
+
implementation: import("../index.js").StyleImplementation;
|
|
959
1022
|
};
|
|
960
1023
|
italic: {
|
|
961
1024
|
config: {
|
|
962
1025
|
type: string;
|
|
963
1026
|
propSchema: "boolean";
|
|
964
1027
|
};
|
|
965
|
-
implementation: import("../
|
|
1028
|
+
implementation: import("../index.js").StyleImplementation;
|
|
966
1029
|
};
|
|
967
1030
|
underline: {
|
|
968
1031
|
config: {
|
|
969
1032
|
type: string;
|
|
970
1033
|
propSchema: "boolean";
|
|
971
1034
|
};
|
|
972
|
-
implementation: import("../
|
|
1035
|
+
implementation: import("../index.js").StyleImplementation;
|
|
973
1036
|
};
|
|
974
1037
|
strike: {
|
|
975
1038
|
config: {
|
|
976
1039
|
type: string;
|
|
977
1040
|
propSchema: "boolean";
|
|
978
1041
|
};
|
|
979
|
-
implementation: import("../
|
|
1042
|
+
implementation: import("../index.js").StyleImplementation;
|
|
980
1043
|
};
|
|
981
1044
|
code: {
|
|
982
1045
|
config: {
|
|
983
1046
|
type: string;
|
|
984
1047
|
propSchema: "boolean";
|
|
985
1048
|
};
|
|
986
|
-
implementation: import("../
|
|
1049
|
+
implementation: import("../index.js").StyleImplementation;
|
|
987
1050
|
};
|
|
988
1051
|
textColor: {
|
|
989
1052
|
config: {
|
|
990
1053
|
type: string;
|
|
991
1054
|
propSchema: "string";
|
|
992
1055
|
};
|
|
993
|
-
implementation: import("../
|
|
1056
|
+
implementation: import("../index.js").StyleImplementation;
|
|
994
1057
|
};
|
|
995
1058
|
backgroundColor: {
|
|
996
1059
|
config: {
|
|
997
1060
|
type: string;
|
|
998
1061
|
propSchema: "string";
|
|
999
1062
|
};
|
|
1000
|
-
implementation: import("../
|
|
1063
|
+
implementation: import("../index.js").StyleImplementation;
|
|
1001
1064
|
};
|
|
1002
1065
|
}>;
|
|
1003
1066
|
export type _DefaultStyleSchema = typeof defaultStyleSchema;
|
|
@@ -1012,7 +1075,7 @@ export declare const defaultInlineContentSpecs: {
|
|
|
1012
1075
|
implementation: any;
|
|
1013
1076
|
};
|
|
1014
1077
|
};
|
|
1015
|
-
export declare const defaultInlineContentSchema: import("../
|
|
1078
|
+
export declare const defaultInlineContentSchema: import("../index.js").InlineContentSchemaFromSpecs<{
|
|
1016
1079
|
text: {
|
|
1017
1080
|
config: "text";
|
|
1018
1081
|
implementation: any;
|
|
@@ -41,8 +41,8 @@ export declare class YjsThreadStore extends YjsThreadStoreBase {
|
|
|
41
41
|
reactions: import("../../types.js").CommentReactionData[];
|
|
42
42
|
metadata: any;
|
|
43
43
|
} & {
|
|
44
|
-
deletedAt?:
|
|
45
|
-
body:
|
|
44
|
+
deletedAt?: never;
|
|
45
|
+
body: CommentBody;
|
|
46
46
|
}>;
|
|
47
47
|
updateComment: (options: {
|
|
48
48
|
comment: {
|
|
@@ -55,7 +55,7 @@ export declare class YjsThreadStore extends YjsThreadStoreBase {
|
|
|
55
55
|
deleteComment: (options: {
|
|
56
56
|
threadId: string;
|
|
57
57
|
commentId: string;
|
|
58
|
-
softDelete?: boolean
|
|
58
|
+
softDelete?: boolean;
|
|
59
59
|
}) => Promise<void>;
|
|
60
60
|
deleteThread: (options: {
|
|
61
61
|
threadId: string;
|
|
@@ -21,6 +21,7 @@ import { EditorView } from "prosemirror-view";
|
|
|
21
21
|
import type { ThreadStore, User } from "../comments/index.js";
|
|
22
22
|
import "../style.css";
|
|
23
23
|
import { EventEmitter } from "../util/EventEmitter.js";
|
|
24
|
+
import { CodeBlockOptions } from "../blocks/CodeBlockContent/CodeBlockContent.js";
|
|
24
25
|
export type BlockNoteExtensionFactory = (editor: BlockNoteEditor<any, any, any>) => BlockNoteExtension;
|
|
25
26
|
export type BlockNoteExtension = AnyExtension | {
|
|
26
27
|
plugin: Plugin;
|
|
@@ -63,6 +64,10 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
|
|
|
63
64
|
*/
|
|
64
65
|
showCursorLabels?: "always" | "activity";
|
|
65
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Options for code blocks.
|
|
69
|
+
*/
|
|
70
|
+
codeBlock?: CodeBlockOptions;
|
|
66
71
|
comments: {
|
|
67
72
|
threadStore: ThreadStore;
|
|
68
73
|
};
|
|
@@ -100,6 +105,38 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
|
|
|
100
105
|
* @deprecated, provide placeholders via dictionary instead
|
|
101
106
|
*/
|
|
102
107
|
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Custom paste handler that can be used to override the default paste behavior.
|
|
110
|
+
* @returns The function should return `true` if the paste event was handled, otherwise it should return `false` if it should be canceled or `undefined` if it should be handled by another handler.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* pasteHandler: ({ defaultPasteHandler }) => {
|
|
115
|
+
* return defaultPasteHandler({ pasteBehavior: "prefer-html" });
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
pasteHandler?: (context: {
|
|
120
|
+
event: ClipboardEvent;
|
|
121
|
+
editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* The default paste handler
|
|
124
|
+
* @param context The context object
|
|
125
|
+
* @returns Whether the paste event was handled or not
|
|
126
|
+
*/
|
|
127
|
+
defaultPasteHandler: (context?: {
|
|
128
|
+
/**
|
|
129
|
+
* Whether to prioritize Markdown content in `text/plain` over `text/html` when pasting from the clipboard.
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
prioritizeMarkdownOverHTML?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Whether to parse `text/plain` content from the clipboard as Markdown content.
|
|
135
|
+
* @default true
|
|
136
|
+
*/
|
|
137
|
+
plainTextAsMarkdown?: boolean;
|
|
138
|
+
}) => boolean | undefined;
|
|
139
|
+
}) => boolean | undefined;
|
|
103
140
|
/**
|
|
104
141
|
* Resolve a URL of a file block to one that can be displayed or downloaded. This can be used for creating authenticated URL or
|
|
105
142
|
* implementing custom protocols / schemes
|
|
@@ -274,6 +311,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
274
311
|
cellTextColor: boolean;
|
|
275
312
|
headers: boolean;
|
|
276
313
|
};
|
|
314
|
+
codeBlock: CodeBlockOptions;
|
|
277
315
|
};
|
|
278
316
|
static create<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema>(options?: Partial<BlockNoteEditorOptions<BSchema, ISchema, SSchema>>): BlockNoteEditor<BSchema, ISchema, SSchema>;
|
|
279
317
|
protected constructor(options: Partial<BlockNoteEditorOptions<any, any, any>>);
|
|
@@ -564,4 +602,24 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
564
602
|
}): void;
|
|
565
603
|
getForceSelectionVisible(): boolean;
|
|
566
604
|
setForceSelectionVisible(forceSelectionVisible: boolean): void;
|
|
605
|
+
/**
|
|
606
|
+
* This will convert HTML into a format that is compatible with BlockNote.
|
|
607
|
+
*/
|
|
608
|
+
private convertHtmlToBlockNoteHtml;
|
|
609
|
+
/**
|
|
610
|
+
* Paste HTML into the editor. Defaults to converting HTML to BlockNote HTML.
|
|
611
|
+
* @param html The HTML to paste.
|
|
612
|
+
* @param raw Whether to paste the HTML as is, or to convert it to BlockNote HTML.
|
|
613
|
+
*/
|
|
614
|
+
pasteHTML(html: string, raw?: boolean): void;
|
|
615
|
+
/**
|
|
616
|
+
* Paste text into the editor. Defaults to interpreting text as markdown.
|
|
617
|
+
* @param text The text to paste.
|
|
618
|
+
*/
|
|
619
|
+
pasteText(text: string): boolean | undefined;
|
|
620
|
+
/**
|
|
621
|
+
* Paste markdown into the editor.
|
|
622
|
+
* @param markdown The markdown to paste.
|
|
623
|
+
*/
|
|
624
|
+
pasteMarkdown(markdown: string): Promise<void>;
|
|
567
625
|
}
|
|
@@ -2,7 +2,7 @@ import { Plugin } from "prosemirror-state";
|
|
|
2
2
|
import * as Y from "yjs";
|
|
3
3
|
import type { ThreadStore } from "../comments/index.js";
|
|
4
4
|
import { BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema/index.js";
|
|
5
|
-
import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
|
|
5
|
+
import type { BlockNoteEditor, BlockNoteEditorOptions, BlockNoteExtension } from "./BlockNoteEditor.js";
|
|
6
6
|
type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
7
7
|
editor: BlockNoteEditor<BSchema, I, S>;
|
|
8
8
|
domAttributes: Partial<BlockNoteDOMAttributes>;
|
|
@@ -32,9 +32,10 @@ type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema
|
|
|
32
32
|
comments?: {
|
|
33
33
|
threadStore: ThreadStore;
|
|
34
34
|
};
|
|
35
|
+
pasteHandler: BlockNoteEditorOptions<any, any, any>["pasteHandler"];
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
37
38
|
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
38
39
|
*/
|
|
39
|
-
export declare const getBlockNoteExtensions: <BSchema extends
|
|
40
|
+
export declare const getBlockNoteExtensions: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(opts: ExtensionOptions<BSchema, I, S>) => Record<string, BlockNoteExtension>;
|
|
40
41
|
export {};
|
|
@@ -25,6 +25,6 @@ export type StyleMapping<S extends StyleSchema, RS> = {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function mappingFactory<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(_schema: BlockNoteSchema<B, I, S>): {
|
|
27
27
|
createBlockMapping: <R, RI>(mapping: BlockMapping<B, I, S, R, RI>) => BlockMapping<B, I, S, R, RI>;
|
|
28
|
-
createInlineContentMapping: <
|
|
29
|
-
createStyleMapping: <
|
|
28
|
+
createInlineContentMapping: <R, RS>(mapping: InlineContentMapping<I, S, R, RS>) => InlineContentMapping<I, S, R, RS>;
|
|
29
|
+
createStyleMapping: <R>(mapping: StyleMapping<S, R>) => StyleMapping<S, R>;
|
|
30
30
|
};
|
|
@@ -11,7 +11,7 @@ export declare const createCollaborationExtensions: (collaboration: {
|
|
|
11
11
|
showCursorLabels?: "always" | "activity";
|
|
12
12
|
}) => (import("@tiptap/core").Extension<import("@tiptap/extension-collaboration").CollaborationOptions, import("@tiptap/extension-collaboration").CollaborationStorage> | import("@tiptap/core").Extension<import("@tiptap/extension-collaboration-cursor").CollaborationCursorOptions, {
|
|
13
13
|
users: {
|
|
14
|
-
[key: string]: any;
|
|
15
14
|
clientId: number;
|
|
15
|
+
[key: string]: any;
|
|
16
16
|
}[];
|
|
17
17
|
}>)[];
|
|
@@ -80,13 +80,13 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
80
80
|
*/
|
|
81
81
|
unfreezeHandles: () => void;
|
|
82
82
|
getCellsAtRowHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeRowIndex: RelativeCellIndices["row"]) => (RelativeCellIndices & {
|
|
83
|
-
cell: import("../../
|
|
83
|
+
cell: import("../../index.js").TableCell<any, any>;
|
|
84
84
|
})[];
|
|
85
85
|
/**
|
|
86
86
|
* Get all the cells in a column of the table block.
|
|
87
87
|
*/
|
|
88
88
|
getCellsAtColumnHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeColumnIndex: RelativeCellIndices["col"]) => (RelativeCellIndices & {
|
|
89
|
-
cell: import("../../
|
|
89
|
+
cell: import("../../index.js").TableCell<any, any>;
|
|
90
90
|
})[];
|
|
91
91
|
/**
|
|
92
92
|
* Sets the selection to the given cell or a range of cells.
|
|
@@ -138,9 +138,9 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
138
138
|
*/
|
|
139
139
|
getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "vertical" | "horizontal" | undefined;
|
|
140
140
|
cropEmptyRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, removeEmpty: "columns" | "rows") => {
|
|
141
|
-
cells: (import("../../
|
|
141
|
+
cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
142
142
|
}[];
|
|
143
143
|
addRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, addType: "columns" | "rows", numToAdd: number) => {
|
|
144
|
-
cells: (import("../../
|
|
144
|
+
cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
145
145
|
}[];
|
|
146
146
|
}
|
|
@@ -18,6 +18,12 @@ export declare const en: {
|
|
|
18
18
|
aliases: string[];
|
|
19
19
|
group: string;
|
|
20
20
|
};
|
|
21
|
+
quote: {
|
|
22
|
+
title: string;
|
|
23
|
+
subtext: string;
|
|
24
|
+
aliases: string[];
|
|
25
|
+
group: string;
|
|
26
|
+
};
|
|
21
27
|
numbered_list: {
|
|
22
28
|
title: string;
|
|
23
29
|
subtext: string;
|
|
@@ -91,7 +97,7 @@ export declare const en: {
|
|
|
91
97
|
group: string;
|
|
92
98
|
};
|
|
93
99
|
};
|
|
94
|
-
placeholders: Record<string, string | undefined>;
|
|
100
|
+
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
95
101
|
file_blocks: {
|
|
96
102
|
image: {
|
|
97
103
|
add_button_text: string;
|