@blocknote/core 0.25.1 → 0.26.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 (65) hide show
  1. package/dist/blocknote.cjs +7 -7
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +781 -646
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/comments.cjs +1 -1
  6. package/dist/comments.cjs.map +1 -1
  7. package/dist/comments.js +45 -44
  8. package/dist/comments.js.map +1 -1
  9. package/dist/style.css +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/webpack-stats.json +1 -1
  12. package/package.json +2 -2
  13. package/src/api/nodeConversions/nodeToBlock.ts +3 -2
  14. package/src/api/parsers/html/__snapshots__/parse-2-tables.json +129 -0
  15. package/src/api/parsers/html/parseHTML.test.ts +35 -0
  16. package/src/comments/threadstore/ThreadStore.ts +1 -1
  17. package/src/comments/threadstore/yjs/YjsThreadStore.ts +1 -0
  18. package/src/comments/threadstore/yjs/yjsHelpers.ts +3 -1
  19. package/src/comments/types.ts +4 -0
  20. package/src/editor/Block.css +1 -1
  21. package/src/editor/BlockNoteEditor.ts +1 -7
  22. package/src/editor/BlockNoteTipTapEditor.ts +18 -7
  23. package/src/extensions/Comments/CommentMark.ts +0 -1
  24. package/src/extensions/Comments/CommentsPlugin.ts +79 -30
  25. package/src/extensions/SideMenu/dragging.ts +13 -0
  26. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +6 -2
  27. package/src/extensions/TableHandles/TableHandlesPlugin.ts +25 -26
  28. package/src/i18n/locales/ar.ts +4 -0
  29. package/src/i18n/locales/de.ts +15 -1
  30. package/src/i18n/locales/en.ts +4 -0
  31. package/src/i18n/locales/es.ts +15 -1
  32. package/src/i18n/locales/fr.ts +4 -0
  33. package/src/i18n/locales/hr.ts +21 -4
  34. package/src/i18n/locales/is.ts +4 -0
  35. package/src/i18n/locales/it.ts +15 -1
  36. package/src/i18n/locales/ja.ts +4 -0
  37. package/src/i18n/locales/ko.ts +4 -0
  38. package/src/i18n/locales/nl.ts +4 -0
  39. package/src/i18n/locales/no.ts +4 -0
  40. package/src/i18n/locales/pl.ts +4 -0
  41. package/src/i18n/locales/pt.ts +4 -0
  42. package/src/i18n/locales/ru.ts +4 -0
  43. package/src/i18n/locales/uk.ts +4 -0
  44. package/src/i18n/locales/vi.ts +4 -0
  45. package/src/i18n/locales/zh.ts +4 -0
  46. package/types/src/comments/threadstore/ThreadStore.d.ts +1 -1
  47. package/types/src/comments/types.d.ts +4 -0
  48. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -1
  49. package/types/src/extensions/Comments/CommentsPlugin.d.ts +16 -1
  50. package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +47 -0
  51. package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +121 -0
  52. package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +12 -0
  53. package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +97 -0
  54. package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +83 -0
  55. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +79 -0
  56. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +1 -0
  57. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +15 -0
  58. package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +13 -0
  59. package/types/src/extensions/Comments/types.d.ts +109 -0
  60. package/types/src/i18n/locales/de.d.ts +2 -304
  61. package/types/src/i18n/locales/en.d.ts +4 -0
  62. package/types/src/i18n/locales/es.d.ts +2 -269
  63. package/types/src/i18n/locales/hr.d.ts +2 -266
  64. package/types/src/i18n/locales/it.d.ts +2 -269
  65. package/types/src/models/User.d.ts +5 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The body of a comment. This actually is a BlockNote document (array of blocks)
3
+ */
4
+ export type CommentBody = any;
5
+ /**
6
+ * A reaction to a comment.
7
+ */
8
+ export type CommentReactionData = {
9
+ /**
10
+ * The emoji that was reacted to the comment.
11
+ */
12
+ emoji: string;
13
+ /**
14
+ * The date the first user reacted to the comment with this emoji.
15
+ */
16
+ createdAt: Date;
17
+ /**
18
+ * The user ids of the users that have reacted to the comment with this emoji
19
+ */
20
+ userIds: string[];
21
+ };
22
+ /**
23
+ * Information about a comment.
24
+ */
25
+ export type CommentData = {
26
+ type: "comment";
27
+ /**
28
+ * The unique identifier for the comment.
29
+ */
30
+ id: string;
31
+ /**
32
+ * The user id of the author of the comment.
33
+ */
34
+ userId: string;
35
+ /**
36
+ * The date when the comment was created.
37
+ */
38
+ createdAt: Date;
39
+ /**
40
+ * The date when the comment was last updated.
41
+ */
42
+ updatedAt: Date;
43
+ /**
44
+ * The reactions (emoji reactions) to the comment.
45
+ */
46
+ reactions: CommentReactionData[];
47
+ /**
48
+ * You can use this store any additional information about the comment.
49
+ */
50
+ metadata: any;
51
+ } & ({
52
+ /**
53
+ * The date when the comment was deleted. This applies only for "soft deletes",
54
+ * otherwise the comment is removed entirely.
55
+ */
56
+ deletedAt: Date;
57
+ /**
58
+ * The body of the comment is undefined if the comment is deleted.
59
+ */
60
+ body: undefined;
61
+ } | {
62
+ /**
63
+ * In case of a non-deleted comment, this is not set
64
+ */
65
+ deletedAt?: never;
66
+ /**
67
+ * The body of the comment.
68
+ */
69
+ body: CommentBody;
70
+ });
71
+ /**
72
+ * Information about a thread. A thread holds a list of comments.
73
+ */
74
+ export type ThreadData = {
75
+ type: "thread";
76
+ /**
77
+ * The unique identifier for the thread.
78
+ */
79
+ id: string;
80
+ /**
81
+ * The date when the thread was created.
82
+ */
83
+ createdAt: Date;
84
+ /**
85
+ * The date when the thread was last updated.
86
+ */
87
+ updatedAt: Date;
88
+ /**
89
+ * The comments in the thread.
90
+ */
91
+ comments: CommentData[];
92
+ /**
93
+ * Whether the thread has been marked as resolved.
94
+ */
95
+ resolved: boolean;
96
+ /**
97
+ * The date when the thread was marked as resolved.
98
+ */
99
+ resolvedUpdatedAt?: Date;
100
+ /**
101
+ * You can use this store any additional information about the thread.
102
+ */
103
+ metadata: any;
104
+ /**
105
+ * The date when the thread was deleted. (or undefined if it is not deleted)
106
+ * This only applies for "soft deletes", otherwise the thread is removed entirely.
107
+ */
108
+ deletedAt?: Date;
109
+ };
@@ -1,304 +1,2 @@
1
- export declare const de: {
2
- slash_menu: {
3
- heading: {
4
- title: string;
5
- subtext: string;
6
- aliases: string[];
7
- group: string;
8
- };
9
- heading_2: {
10
- title: string;
11
- subtext: string;
12
- aliases: string[];
13
- group: string;
14
- };
15
- heading_3: {
16
- title: string;
17
- subtext: string;
18
- aliases: string[];
19
- group: string;
20
- };
21
- numbered_list: {
22
- title: string;
23
- subtext: string;
24
- aliases: string[];
25
- group: string;
26
- };
27
- bullet_list: {
28
- title: string;
29
- subtext: string;
30
- aliases: string[];
31
- group: string;
32
- };
33
- check_list: {
34
- title: string;
35
- subtext: string;
36
- aliases: string[];
37
- group: string;
38
- };
39
- paragraph: {
40
- title: string;
41
- subtext: string;
42
- aliases: string[];
43
- group: string;
44
- };
45
- code_block: {
46
- title: string;
47
- subtext: string;
48
- aliases: string[];
49
- group: string;
50
- };
51
- page_break: {
52
- title: string;
53
- subtext: string;
54
- aliases: string[];
55
- group: string;
56
- };
57
- table: {
58
- title: string;
59
- subtext: string;
60
- aliases: string[];
61
- group: string;
62
- };
63
- image: {
64
- title: string;
65
- subtext: string;
66
- aliases: string[];
67
- group: string;
68
- };
69
- video: {
70
- title: string;
71
- subtext: string;
72
- aliases: string[];
73
- group: string;
74
- };
75
- audio: {
76
- title: string;
77
- subtext: string;
78
- aliases: string[];
79
- group: string;
80
- };
81
- file: {
82
- title: string;
83
- subtext: string;
84
- aliases: string[];
85
- group: string;
86
- };
87
- emoji: {
88
- title: string;
89
- subtext: string;
90
- aliases: string[];
91
- group: string;
92
- };
93
- };
94
- placeholders: {
95
- default: string;
96
- heading: string;
97
- bulletListItem: string;
98
- numberedListItem: string;
99
- checkListItem: string;
100
- new_comment: string;
101
- edit_comment: string;
102
- comment_reply: string;
103
- };
104
- file_blocks: {
105
- image: {
106
- add_button_text: string;
107
- };
108
- video: {
109
- add_button_text: string;
110
- };
111
- audio: {
112
- add_button_text: string;
113
- };
114
- file: {
115
- add_button_text: string;
116
- };
117
- };
118
- side_menu: {
119
- add_block_label: string;
120
- drag_handle_label: string;
121
- };
122
- drag_handle: {
123
- delete_menuitem: string;
124
- colors_menuitem: string;
125
- };
126
- table_handle: {
127
- delete_column_menuitem: string;
128
- delete_row_menuitem: string;
129
- add_left_menuitem: string;
130
- add_right_menuitem: string;
131
- add_above_menuitem: string;
132
- add_below_menuitem: string;
133
- };
134
- suggestion_menu: {
135
- no_items_title: string;
136
- loading: string;
137
- };
138
- color_picker: {
139
- text_title: string;
140
- background_title: string;
141
- colors: {
142
- default: string;
143
- gray: string;
144
- brown: string;
145
- red: string;
146
- orange: string;
147
- yellow: string;
148
- green: string;
149
- blue: string;
150
- purple: string;
151
- pink: string;
152
- };
153
- };
154
- formatting_toolbar: {
155
- bold: {
156
- tooltip: string;
157
- secondary_tooltip: string;
158
- };
159
- italic: {
160
- tooltip: string;
161
- secondary_tooltip: string;
162
- };
163
- underline: {
164
- tooltip: string;
165
- secondary_tooltip: string;
166
- };
167
- strike: {
168
- tooltip: string;
169
- secondary_tooltip: string;
170
- };
171
- code: {
172
- tooltip: string;
173
- secondary_tooltip: string;
174
- };
175
- colors: {
176
- tooltip: string;
177
- };
178
- link: {
179
- tooltip: string;
180
- secondary_tooltip: string;
181
- };
182
- file_caption: {
183
- tooltip: string;
184
- input_placeholder: string;
185
- };
186
- file_replace: {
187
- tooltip: {
188
- image: string;
189
- video: string;
190
- audio: string;
191
- file: string;
192
- };
193
- };
194
- file_rename: {
195
- tooltip: {
196
- image: string;
197
- video: string;
198
- audio: string;
199
- file: string;
200
- };
201
- input_placeholder: {
202
- image: string;
203
- video: string;
204
- audio: string;
205
- file: string;
206
- };
207
- };
208
- file_download: {
209
- tooltip: {
210
- image: string;
211
- video: string;
212
- audio: string;
213
- file: string;
214
- };
215
- };
216
- file_delete: {
217
- tooltip: {
218
- image: string;
219
- video: string;
220
- audio: string;
221
- file: string;
222
- };
223
- };
224
- file_preview_toggle: {
225
- tooltip: string;
226
- };
227
- nest: {
228
- tooltip: string;
229
- secondary_tooltip: string;
230
- };
231
- unnest: {
232
- tooltip: string;
233
- secondary_tooltip: string;
234
- };
235
- align_left: {
236
- tooltip: string;
237
- };
238
- align_center: {
239
- tooltip: string;
240
- };
241
- align_right: {
242
- tooltip: string;
243
- };
244
- align_justify: {
245
- tooltip: string;
246
- };
247
- comment: {
248
- tooltip: string;
249
- };
250
- };
251
- file_panel: {
252
- upload: {
253
- title: string;
254
- file_placeholder: {
255
- image: string;
256
- video: string;
257
- audio: string;
258
- file: string;
259
- };
260
- upload_error: string;
261
- };
262
- embed: {
263
- title: string;
264
- embed_button: {
265
- image: string;
266
- video: string;
267
- audio: string;
268
- file: string;
269
- };
270
- url_placeholder: string;
271
- };
272
- };
273
- link_toolbar: {
274
- delete: {
275
- tooltip: string;
276
- };
277
- edit: {
278
- text: string;
279
- tooltip: string;
280
- };
281
- open: {
282
- tooltip: string;
283
- };
284
- form: {
285
- title_placeholder: string;
286
- url_placeholder: string;
287
- };
288
- };
289
- comments: {
290
- actions: {
291
- add_reaction: string;
292
- resolve: string;
293
- edit_comment: string;
294
- delete_comment: string;
295
- more_actions: string;
296
- };
297
- reactions: {
298
- reacted_by: string;
299
- };
300
- };
301
- generic: {
302
- ctrl_shortcut: string;
303
- };
304
- };
1
+ import { Dictionary } from "../dictionary.js";
2
+ export declare const de: Dictionary;
@@ -261,6 +261,10 @@ export declare const en: {
261
261
  reactions: {
262
262
  reacted_by: string;
263
263
  };
264
+ sidebar: {
265
+ marked_as_resolved: string;
266
+ more_replies: (count: number) => string;
267
+ };
264
268
  };
265
269
  generic: {
266
270
  ctrl_shortcut: string;
@@ -1,269 +1,2 @@
1
- export declare const es: {
2
- slash_menu: {
3
- heading: {
4
- title: string;
5
- subtext: string;
6
- aliases: string[];
7
- group: string;
8
- };
9
- heading_2: {
10
- title: string;
11
- subtext: string;
12
- aliases: string[];
13
- group: string;
14
- };
15
- heading_3: {
16
- title: string;
17
- subtext: string;
18
- aliases: string[];
19
- group: string;
20
- };
21
- numbered_list: {
22
- title: string;
23
- subtext: string;
24
- aliases: string[];
25
- group: string;
26
- };
27
- bullet_list: {
28
- title: string;
29
- subtext: string;
30
- aliases: string[];
31
- group: string;
32
- };
33
- check_list: {
34
- title: string;
35
- subtext: string;
36
- aliases: string[];
37
- group: string;
38
- };
39
- paragraph: {
40
- title: string;
41
- subtext: string;
42
- aliases: string[];
43
- group: string;
44
- };
45
- code_block: {
46
- title: string;
47
- subtext: string;
48
- aliases: string[];
49
- group: string;
50
- };
51
- page_break: {
52
- title: string;
53
- subtext: string;
54
- aliases: string[];
55
- group: string;
56
- };
57
- table: {
58
- title: string;
59
- subtext: string;
60
- aliases: string[];
61
- group: string;
62
- };
63
- image: {
64
- title: string;
65
- subtext: string;
66
- aliases: string[];
67
- group: string;
68
- };
69
- video: {
70
- title: string;
71
- subtext: string;
72
- aliases: string[];
73
- group: string;
74
- };
75
- audio: {
76
- title: string;
77
- subtext: string;
78
- aliases: string[];
79
- group: string;
80
- };
81
- file: {
82
- title: string;
83
- subtext: string;
84
- aliases: string[];
85
- group: string;
86
- };
87
- emoji: {
88
- title: string;
89
- subtext: string;
90
- aliases: string[];
91
- group: string;
92
- };
93
- };
94
- placeholders: {
95
- default: string;
96
- heading: string;
97
- bulletListItem: string;
98
- numberedListItem: string;
99
- checkListItem: string;
100
- new_comment: string;
101
- edit_comment: string;
102
- comment_reply: string;
103
- };
104
- file_blocks: {
105
- image: {
106
- add_button_text: string;
107
- };
108
- video: {
109
- add_button_text: string;
110
- };
111
- audio: {
112
- add_button_text: string;
113
- };
114
- file: {
115
- add_button_text: string;
116
- };
117
- };
118
- side_menu: {
119
- add_block_label: string;
120
- drag_handle_label: string;
121
- };
122
- drag_handle: {
123
- delete_menuitem: string;
124
- colors_menuitem: string;
125
- };
126
- table_handle: {
127
- delete_column_menuitem: string;
128
- delete_row_menuitem: string;
129
- add_left_menuitem: string;
130
- add_right_menuitem: string;
131
- add_above_menuitem: string;
132
- add_below_menuitem: string;
133
- };
134
- suggestion_menu: {
135
- no_items_title: string;
136
- loading: string;
137
- };
138
- color_picker: {
139
- text_title: string;
140
- background_title: string;
141
- colors: {
142
- default: string;
143
- gray: string;
144
- brown: string;
145
- red: string;
146
- orange: string;
147
- yellow: string;
148
- green: string;
149
- blue: string;
150
- purple: string;
151
- pink: string;
152
- };
153
- };
154
- formatting_toolbar: {
155
- bold: {
156
- tooltip: string;
157
- secondary_tooltip: string;
158
- };
159
- italic: {
160
- tooltip: string;
161
- secondary_tooltip: string;
162
- };
163
- underline: {
164
- tooltip: string;
165
- secondary_tooltip: string;
166
- };
167
- strike: {
168
- tooltip: string;
169
- secondary_tooltip: string;
170
- };
171
- code: {
172
- tooltip: string;
173
- secondary_tooltip: string;
174
- };
175
- colors: {
176
- tooltip: string;
177
- };
178
- link: {
179
- tooltip: string;
180
- secondary_tooltip: string;
181
- };
182
- file_caption: {
183
- tooltip: string;
184
- input_placeholder: string;
185
- };
186
- file_replace: {
187
- tooltip: Record<string, string>;
188
- };
189
- file_rename: {
190
- tooltip: Record<string, string>;
191
- input_placeholder: Record<string, string>;
192
- };
193
- file_download: {
194
- tooltip: Record<string, string>;
195
- };
196
- file_delete: {
197
- tooltip: Record<string, string>;
198
- };
199
- file_preview_toggle: {
200
- tooltip: string;
201
- };
202
- nest: {
203
- tooltip: string;
204
- secondary_tooltip: string;
205
- };
206
- unnest: {
207
- tooltip: string;
208
- secondary_tooltip: string;
209
- };
210
- align_left: {
211
- tooltip: string;
212
- };
213
- align_center: {
214
- tooltip: string;
215
- };
216
- align_right: {
217
- tooltip: string;
218
- };
219
- align_justify: {
220
- tooltip: string;
221
- };
222
- comment: {
223
- tooltip: string;
224
- };
225
- };
226
- file_panel: {
227
- upload: {
228
- title: string;
229
- file_placeholder: Record<string, string>;
230
- upload_error: string;
231
- };
232
- embed: {
233
- title: string;
234
- embed_button: Record<string, string>;
235
- url_placeholder: string;
236
- };
237
- };
238
- link_toolbar: {
239
- delete: {
240
- tooltip: string;
241
- };
242
- edit: {
243
- text: string;
244
- tooltip: string;
245
- };
246
- open: {
247
- tooltip: string;
248
- };
249
- form: {
250
- title_placeholder: string;
251
- url_placeholder: string;
252
- };
253
- };
254
- comments: {
255
- actions: {
256
- add_reaction: string;
257
- resolve: string;
258
- edit_comment: string;
259
- delete_comment: string;
260
- more_actions: string;
261
- };
262
- reactions: {
263
- reacted_by: string;
264
- };
265
- };
266
- generic: {
267
- ctrl_shortcut: string;
268
- };
269
- };
1
+ import { Dictionary } from "../dictionary.js";
2
+ export declare const es: Dictionary;