@blocknote/core 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +14 -15
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +1 -1
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +5 -3
- package/src/editor/BlockNoteEditor.ts +0 -1
- package/src/editor/editor.css +1 -0
- package/types/src/editor/BlockNoteEditor.d.ts +0 -1
- package/types/src/BlockNoteEditor.d.ts +0 -300
- package/types/src/BlockNoteEditor.test.d.ts +0 -1
- package/types/src/BlockNoteExtensions.d.ts +0 -26
- package/types/src/api/nodeConversions/testUtil.d.ts +0 -7
- package/types/src/api/testCases/cases/customBlocks.d.ts +0 -345
- package/types/src/api/testCases/cases/customInlineContent.d.ts +0 -29
- package/types/src/api/testCases/cases/customStyles.d.ts +0 -64
- package/types/src/api/testCases/cases/defaultSchema.d.ts +0 -3
- package/types/src/api/testCases/index.d.ts +0 -12
- package/types/src/api/util/nodeUtil.d.ts +0 -8
- package/types/src/extensions/Blocks/NonEditableBlockPlugin.d.ts +0 -2
- package/types/src/extensions/Blocks/PreviousBlockTypePlugin.d.ts +0 -14
- package/types/src/extensions/Blocks/api/blocks/createSpec.d.ts +0 -35
- package/types/src/extensions/Blocks/api/blocks/internal.d.ts +0 -45
- package/types/src/extensions/Blocks/api/blocks/types.d.ts +0 -114
- package/types/src/extensions/Blocks/api/cursorPositionTypes.d.ts +0 -8
- package/types/src/extensions/Blocks/api/defaultBlocks.d.ts +0 -577
- package/types/src/extensions/Blocks/api/defaultProps.d.ts +0 -15
- package/types/src/extensions/Blocks/api/inlineContent/createSpec.d.ts +0 -21
- package/types/src/extensions/Blocks/api/inlineContent/internal.d.ts +0 -25
- package/types/src/extensions/Blocks/api/inlineContent/types.d.ts +0 -62
- package/types/src/extensions/Blocks/api/selectionTypes.d.ts +0 -6
- package/types/src/extensions/Blocks/api/styles/createSpec.d.ts +0 -13
- package/types/src/extensions/Blocks/api/styles/internal.d.ts +0 -22
- package/types/src/extensions/Blocks/api/styles/types.d.ts +0 -21
- package/types/src/extensions/Blocks/helpers/findBlock.d.ts +0 -6
- package/types/src/extensions/Blocks/helpers/getBlockInfoFromPos.d.ts +0 -27
- package/types/src/extensions/Blocks/index.d.ts +0 -4
- package/types/src/extensions/Blocks/nodes/BlockAttributes.d.ts +0 -2
- package/types/src/extensions/Blocks/nodes/BlockContainer.d.ts +0 -30
- package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts +0 -58
- package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts +0 -95
- package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -1
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +0 -46
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +0 -2
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +0 -2
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +0 -46
- package/types/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.d.ts +0 -52
- package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableBlockContent.d.ts +0 -53
- package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableExtension.d.ts +0 -2
- package/types/src/extensions/Blocks/nodes/BlockContent/defaultBlockHelpers.d.ts +0 -12
- package/types/src/extensions/Blocks/nodes/BlockGroup.d.ts +0 -10
- package/types/src/shared/BaseUiElementTypes.d.ts +0 -7
- package/types/src/shared/EditorElement.d.ts +0 -0
- package/types/src/shared/EventEmitter.d.ts +0 -11
- package/types/src/shared/plugins/suggestion/SuggestionItem.d.ts +0 -3
- package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +0 -37
- package/types/src/shared/utils.d.ts +0 -6
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import { EditorTestCases } from "..";
|
|
2
|
-
import { BlockSchemaFromSpecs } from "../../../extensions/Blocks/api/blocks/types";
|
|
3
|
-
import { DefaultInlineContentSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
4
|
-
declare const customSpecs: {
|
|
5
|
-
simpleImage: {
|
|
6
|
-
config: {
|
|
7
|
-
type: "simpleImage";
|
|
8
|
-
propSchema: {
|
|
9
|
-
textAlignment: {
|
|
10
|
-
default: "left";
|
|
11
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
12
|
-
};
|
|
13
|
-
backgroundColor: {
|
|
14
|
-
default: "default";
|
|
15
|
-
};
|
|
16
|
-
url: {
|
|
17
|
-
default: "";
|
|
18
|
-
};
|
|
19
|
-
caption: {
|
|
20
|
-
default: "";
|
|
21
|
-
};
|
|
22
|
-
width: {
|
|
23
|
-
default: 512;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
content: "none";
|
|
27
|
-
};
|
|
28
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
29
|
-
type: "simpleImage";
|
|
30
|
-
propSchema: {
|
|
31
|
-
textAlignment: {
|
|
32
|
-
default: "left";
|
|
33
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
34
|
-
};
|
|
35
|
-
backgroundColor: {
|
|
36
|
-
default: "default";
|
|
37
|
-
};
|
|
38
|
-
url: {
|
|
39
|
-
default: "";
|
|
40
|
-
};
|
|
41
|
-
caption: {
|
|
42
|
-
default: "";
|
|
43
|
-
};
|
|
44
|
-
width: {
|
|
45
|
-
default: 512;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
content: "none";
|
|
49
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
50
|
-
};
|
|
51
|
-
customParagraph: {
|
|
52
|
-
config: {
|
|
53
|
-
type: "customParagraph";
|
|
54
|
-
propSchema: {
|
|
55
|
-
backgroundColor: {
|
|
56
|
-
default: "default";
|
|
57
|
-
};
|
|
58
|
-
textColor: {
|
|
59
|
-
default: "default";
|
|
60
|
-
};
|
|
61
|
-
textAlignment: {
|
|
62
|
-
default: "left";
|
|
63
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
content: "inline";
|
|
67
|
-
};
|
|
68
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
69
|
-
type: "customParagraph";
|
|
70
|
-
propSchema: {
|
|
71
|
-
backgroundColor: {
|
|
72
|
-
default: "default";
|
|
73
|
-
};
|
|
74
|
-
textColor: {
|
|
75
|
-
default: "default";
|
|
76
|
-
};
|
|
77
|
-
textAlignment: {
|
|
78
|
-
default: "left";
|
|
79
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
content: "inline";
|
|
83
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
84
|
-
};
|
|
85
|
-
simpleCustomParagraph: {
|
|
86
|
-
config: {
|
|
87
|
-
type: "simpleCustomParagraph";
|
|
88
|
-
propSchema: {
|
|
89
|
-
backgroundColor: {
|
|
90
|
-
default: "default";
|
|
91
|
-
};
|
|
92
|
-
textColor: {
|
|
93
|
-
default: "default";
|
|
94
|
-
};
|
|
95
|
-
textAlignment: {
|
|
96
|
-
default: "left";
|
|
97
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
content: "inline";
|
|
101
|
-
};
|
|
102
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
103
|
-
type: "simpleCustomParagraph";
|
|
104
|
-
propSchema: {
|
|
105
|
-
backgroundColor: {
|
|
106
|
-
default: "default";
|
|
107
|
-
};
|
|
108
|
-
textColor: {
|
|
109
|
-
default: "default";
|
|
110
|
-
};
|
|
111
|
-
textAlignment: {
|
|
112
|
-
default: "left";
|
|
113
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
content: "inline";
|
|
117
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
118
|
-
};
|
|
119
|
-
paragraph: {
|
|
120
|
-
config: {
|
|
121
|
-
type: "paragraph";
|
|
122
|
-
content: "inline";
|
|
123
|
-
propSchema: {
|
|
124
|
-
backgroundColor: {
|
|
125
|
-
default: "default";
|
|
126
|
-
};
|
|
127
|
-
textColor: {
|
|
128
|
-
default: "default";
|
|
129
|
-
};
|
|
130
|
-
textAlignment: {
|
|
131
|
-
default: "left";
|
|
132
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
137
|
-
type: "paragraph";
|
|
138
|
-
content: "inline";
|
|
139
|
-
propSchema: {
|
|
140
|
-
backgroundColor: {
|
|
141
|
-
default: "default";
|
|
142
|
-
};
|
|
143
|
-
textColor: {
|
|
144
|
-
default: "default";
|
|
145
|
-
};
|
|
146
|
-
textAlignment: {
|
|
147
|
-
default: "left";
|
|
148
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
152
|
-
};
|
|
153
|
-
heading: {
|
|
154
|
-
config: {
|
|
155
|
-
type: "heading";
|
|
156
|
-
content: "inline";
|
|
157
|
-
propSchema: {
|
|
158
|
-
level: {
|
|
159
|
-
default: number;
|
|
160
|
-
values: readonly [1, 2, 3];
|
|
161
|
-
};
|
|
162
|
-
backgroundColor: {
|
|
163
|
-
default: "default";
|
|
164
|
-
};
|
|
165
|
-
textColor: {
|
|
166
|
-
default: "default";
|
|
167
|
-
};
|
|
168
|
-
textAlignment: {
|
|
169
|
-
default: "left";
|
|
170
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
175
|
-
type: "heading";
|
|
176
|
-
content: "inline";
|
|
177
|
-
propSchema: {
|
|
178
|
-
level: {
|
|
179
|
-
default: number;
|
|
180
|
-
values: readonly [1, 2, 3];
|
|
181
|
-
};
|
|
182
|
-
backgroundColor: {
|
|
183
|
-
default: "default";
|
|
184
|
-
};
|
|
185
|
-
textColor: {
|
|
186
|
-
default: "default";
|
|
187
|
-
};
|
|
188
|
-
textAlignment: {
|
|
189
|
-
default: "left";
|
|
190
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
194
|
-
};
|
|
195
|
-
bulletListItem: {
|
|
196
|
-
config: {
|
|
197
|
-
type: "bulletListItem";
|
|
198
|
-
content: "inline";
|
|
199
|
-
propSchema: {
|
|
200
|
-
backgroundColor: {
|
|
201
|
-
default: "default";
|
|
202
|
-
};
|
|
203
|
-
textColor: {
|
|
204
|
-
default: "default";
|
|
205
|
-
};
|
|
206
|
-
textAlignment: {
|
|
207
|
-
default: "left";
|
|
208
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
213
|
-
type: "bulletListItem";
|
|
214
|
-
content: "inline";
|
|
215
|
-
propSchema: {
|
|
216
|
-
backgroundColor: {
|
|
217
|
-
default: "default";
|
|
218
|
-
};
|
|
219
|
-
textColor: {
|
|
220
|
-
default: "default";
|
|
221
|
-
};
|
|
222
|
-
textAlignment: {
|
|
223
|
-
default: "left";
|
|
224
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
228
|
-
};
|
|
229
|
-
numberedListItem: {
|
|
230
|
-
config: {
|
|
231
|
-
type: "numberedListItem";
|
|
232
|
-
content: "inline";
|
|
233
|
-
propSchema: {
|
|
234
|
-
backgroundColor: {
|
|
235
|
-
default: "default";
|
|
236
|
-
};
|
|
237
|
-
textColor: {
|
|
238
|
-
default: "default";
|
|
239
|
-
};
|
|
240
|
-
textAlignment: {
|
|
241
|
-
default: "left";
|
|
242
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
247
|
-
type: "numberedListItem";
|
|
248
|
-
content: "inline";
|
|
249
|
-
propSchema: {
|
|
250
|
-
backgroundColor: {
|
|
251
|
-
default: "default";
|
|
252
|
-
};
|
|
253
|
-
textColor: {
|
|
254
|
-
default: "default";
|
|
255
|
-
};
|
|
256
|
-
textAlignment: {
|
|
257
|
-
default: "left";
|
|
258
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
262
|
-
};
|
|
263
|
-
image: {
|
|
264
|
-
config: {
|
|
265
|
-
type: "image";
|
|
266
|
-
propSchema: {
|
|
267
|
-
textAlignment: {
|
|
268
|
-
default: "left";
|
|
269
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
270
|
-
};
|
|
271
|
-
backgroundColor: {
|
|
272
|
-
default: "default";
|
|
273
|
-
};
|
|
274
|
-
url: {
|
|
275
|
-
default: "";
|
|
276
|
-
};
|
|
277
|
-
caption: {
|
|
278
|
-
default: "";
|
|
279
|
-
};
|
|
280
|
-
width: {
|
|
281
|
-
default: 512;
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
content: "none";
|
|
285
|
-
};
|
|
286
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
287
|
-
type: "image";
|
|
288
|
-
propSchema: {
|
|
289
|
-
textAlignment: {
|
|
290
|
-
default: "left";
|
|
291
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
292
|
-
};
|
|
293
|
-
backgroundColor: {
|
|
294
|
-
default: "default";
|
|
295
|
-
};
|
|
296
|
-
url: {
|
|
297
|
-
default: "";
|
|
298
|
-
};
|
|
299
|
-
caption: {
|
|
300
|
-
default: "";
|
|
301
|
-
};
|
|
302
|
-
width: {
|
|
303
|
-
default: 512;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
content: "none";
|
|
307
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
308
|
-
};
|
|
309
|
-
table: {
|
|
310
|
-
config: {
|
|
311
|
-
type: "table";
|
|
312
|
-
content: "table";
|
|
313
|
-
propSchema: {
|
|
314
|
-
backgroundColor: {
|
|
315
|
-
default: "default";
|
|
316
|
-
};
|
|
317
|
-
textColor: {
|
|
318
|
-
default: "default";
|
|
319
|
-
};
|
|
320
|
-
textAlignment: {
|
|
321
|
-
default: "left";
|
|
322
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
327
|
-
type: "table";
|
|
328
|
-
content: "table";
|
|
329
|
-
propSchema: {
|
|
330
|
-
backgroundColor: {
|
|
331
|
-
default: "default";
|
|
332
|
-
};
|
|
333
|
-
textColor: {
|
|
334
|
-
default: "default";
|
|
335
|
-
};
|
|
336
|
-
textAlignment: {
|
|
337
|
-
default: "left";
|
|
338
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
export declare const customBlocksTestCases: EditorTestCases<BlockSchemaFromSpecs<typeof customSpecs>, DefaultInlineContentSchema, DefaultStyleSchema>;
|
|
345
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { EditorTestCases } from "..";
|
|
2
|
-
import { DefaultBlockSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
-
import { InlineContentSchemaFromSpecs } from "../../../extensions/Blocks/api/inlineContent/types";
|
|
4
|
-
declare const customInlineContent: {
|
|
5
|
-
mention: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
|
|
6
|
-
type: "mention";
|
|
7
|
-
propSchema: {
|
|
8
|
-
user: {
|
|
9
|
-
default: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
content: "none";
|
|
13
|
-
}>;
|
|
14
|
-
tag: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
|
|
15
|
-
type: "tag";
|
|
16
|
-
propSchema: {};
|
|
17
|
-
content: "styled";
|
|
18
|
-
}>;
|
|
19
|
-
text: {
|
|
20
|
-
config: "text";
|
|
21
|
-
implementation: any;
|
|
22
|
-
};
|
|
23
|
-
link: {
|
|
24
|
-
config: "link";
|
|
25
|
-
implementation: any;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare const customInlineContentTestCases: EditorTestCases<DefaultBlockSchema, InlineContentSchemaFromSpecs<typeof customInlineContent>, DefaultStyleSchema>;
|
|
29
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { EditorTestCases } from "..";
|
|
2
|
-
import { DefaultBlockSchema, DefaultInlineContentSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
-
import { StyleSchemaFromSpecs } from "../../../extensions/Blocks/api/styles/types";
|
|
4
|
-
declare const customStyles: {
|
|
5
|
-
small: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
|
|
6
|
-
type: string;
|
|
7
|
-
propSchema: "boolean";
|
|
8
|
-
}>;
|
|
9
|
-
fontSize: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
|
|
10
|
-
type: string;
|
|
11
|
-
propSchema: "string";
|
|
12
|
-
}>;
|
|
13
|
-
bold: {
|
|
14
|
-
config: {
|
|
15
|
-
type: string;
|
|
16
|
-
propSchema: "boolean";
|
|
17
|
-
};
|
|
18
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
19
|
-
};
|
|
20
|
-
italic: {
|
|
21
|
-
config: {
|
|
22
|
-
type: string;
|
|
23
|
-
propSchema: "boolean";
|
|
24
|
-
};
|
|
25
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
26
|
-
};
|
|
27
|
-
underline: {
|
|
28
|
-
config: {
|
|
29
|
-
type: string;
|
|
30
|
-
propSchema: "boolean";
|
|
31
|
-
};
|
|
32
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
33
|
-
};
|
|
34
|
-
strike: {
|
|
35
|
-
config: {
|
|
36
|
-
type: string;
|
|
37
|
-
propSchema: "boolean";
|
|
38
|
-
};
|
|
39
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
40
|
-
};
|
|
41
|
-
code: {
|
|
42
|
-
config: {
|
|
43
|
-
type: string;
|
|
44
|
-
propSchema: "boolean";
|
|
45
|
-
};
|
|
46
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
47
|
-
};
|
|
48
|
-
textColor: {
|
|
49
|
-
config: {
|
|
50
|
-
type: string;
|
|
51
|
-
propSchema: "string";
|
|
52
|
-
};
|
|
53
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
54
|
-
};
|
|
55
|
-
backgroundColor: {
|
|
56
|
-
config: {
|
|
57
|
-
type: string;
|
|
58
|
-
propSchema: "string";
|
|
59
|
-
};
|
|
60
|
-
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export declare const customStylesTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, StyleSchemaFromSpecs<typeof customStyles>>;
|
|
64
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { EditorTestCases } from "..";
|
|
2
|
-
import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
-
export declare const defaultSchemaTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BlockNoteEditor } from "../../BlockNoteEditor";
|
|
2
|
-
import { BlockSchema, PartialBlock } from "../../extensions/Blocks/api/blocks/types";
|
|
3
|
-
import { InlineContentSchema } from "../../extensions/Blocks/api/inlineContent/types";
|
|
4
|
-
import { StyleSchema } from "../../extensions/Blocks/api/styles/types";
|
|
5
|
-
export type EditorTestCases<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
6
|
-
name: string;
|
|
7
|
-
createEditor: () => BlockNoteEditor<B, I, S>;
|
|
8
|
-
documents: Array<{
|
|
9
|
-
name: string;
|
|
10
|
-
blocks: PartialBlock<B, I, S>[];
|
|
11
|
-
}>;
|
|
12
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "prosemirror-state";
|
|
2
|
-
/**
|
|
3
|
-
* This plugin tracks transformation of Block node attributes, so we can support CSS transitions.
|
|
4
|
-
*
|
|
5
|
-
* Problem it solves: ProseMirror recreates the DOM when transactions happen. So when a transaction changes a Node attribute,
|
|
6
|
-
* it results in a completely new DOM element. This means CSS transitions don't work.
|
|
7
|
-
*
|
|
8
|
-
* Solution: When attributes change on a node, this plugin sets a data-* attribute with the "previous" value. This way we can still use CSS transitions. (See block.module.css)
|
|
9
|
-
*/
|
|
10
|
-
export declare const PreviousBlockTypePlugin: () => Plugin<{
|
|
11
|
-
prevTransactionOldBlockAttrs: any;
|
|
12
|
-
currentTransactionOldBlockAttrs: any;
|
|
13
|
-
updatedBlocks: Set<string>;
|
|
14
|
-
}>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ParseRule } from "@tiptap/pm/model";
|
|
2
|
-
import { BlockNoteEditor } from "../../../../BlockNoteEditor";
|
|
3
|
-
import { InlineContentSchema } from "../inlineContent/types";
|
|
4
|
-
import { StyleSchema } from "../styles/types";
|
|
5
|
-
import { BlockConfig, BlockFromConfig, BlockSchemaWithBlock, PartialBlockFromConfig } from "./types";
|
|
6
|
-
export type CustomBlockConfig = BlockConfig & {
|
|
7
|
-
content: "inline" | "none";
|
|
8
|
-
};
|
|
9
|
-
export type CustomBlockImplementation<T extends CustomBlockConfig, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
10
|
-
render: (
|
|
11
|
-
/**
|
|
12
|
-
* The custom block to render
|
|
13
|
-
*/
|
|
14
|
-
block: BlockFromConfig<T, I, S>,
|
|
15
|
-
/**
|
|
16
|
-
* The BlockNote editor instance
|
|
17
|
-
* This is typed generically. If you want an editor with your custom schema, you need to
|
|
18
|
-
* cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
|
|
19
|
-
*/
|
|
20
|
-
editor: BlockNoteEditor<BlockSchemaWithBlock<T["type"], T>, I, S>) => {
|
|
21
|
-
dom: HTMLElement;
|
|
22
|
-
contentDOM?: HTMLElement;
|
|
23
|
-
destroy?: () => void;
|
|
24
|
-
};
|
|
25
|
-
toExternalHTML?: (block: BlockFromConfig<T, I, S>, editor: BlockNoteEditor<BlockSchemaWithBlock<T["type"], T>, I, S>) => {
|
|
26
|
-
dom: HTMLElement;
|
|
27
|
-
contentDOM?: HTMLElement;
|
|
28
|
-
};
|
|
29
|
-
parse?: (el: HTMLElement) => PartialBlockFromConfig<T, I, S>["props"] | undefined;
|
|
30
|
-
};
|
|
31
|
-
export declare function getParseRules(config: BlockConfig, customParseFunction: CustomBlockImplementation<any, any, any>["parse"]): ParseRule[];
|
|
32
|
-
export declare function createBlockSpec<T extends CustomBlockConfig, I extends InlineContentSchema, S extends StyleSchema>(blockConfig: T, blockImplementation: CustomBlockImplementation<T, I, S>): {
|
|
33
|
-
config: T;
|
|
34
|
-
implementation: import("./types").TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>;
|
|
35
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Attributes, Editor, Extension, Node, NodeConfig } from "@tiptap/core";
|
|
2
|
-
import { BlockNoteEditor } from "../../../../BlockNoteEditor";
|
|
3
|
-
import { InlineContentSchema } from "../inlineContent/types";
|
|
4
|
-
import { StyleSchema } from "../styles/types";
|
|
5
|
-
import { BlockConfig, BlockSchemaFromSpecs, BlockSchemaWithBlock, BlockSpecs, Props, PropSchema, SpecificBlock, TiptapBlockImplementation } from "./types";
|
|
6
|
-
export declare function camelToDataKebab(str: string): string;
|
|
7
|
-
export declare function propsToAttributes(propSchema: PropSchema): Attributes;
|
|
8
|
-
export declare function getBlockFromPos<BType extends string, Config extends BlockConfig, BSchema extends BlockSchemaWithBlock<BType, Config>, I extends InlineContentSchema, S extends StyleSchema>(getPos: (() => number) | boolean, editor: BlockNoteEditor<BSchema, I, S>, tipTapEditor: Editor, type: BType): SpecificBlock<BSchema, BType, I, S>;
|
|
9
|
-
export declare function wrapInBlockStructure<BType extends string, PSchema extends PropSchema>(element: {
|
|
10
|
-
dom: HTMLElement;
|
|
11
|
-
contentDOM?: HTMLElement;
|
|
12
|
-
destroy?: () => void;
|
|
13
|
-
}, blockType: BType, blockProps: Props<PSchema>, propSchema: PSchema, domAttributes?: Record<string, string>): {
|
|
14
|
-
dom: HTMLElement;
|
|
15
|
-
contentDOM?: HTMLElement;
|
|
16
|
-
destroy?: () => void;
|
|
17
|
-
};
|
|
18
|
-
type StronglyTypedTipTapNode<Name extends string, Content extends "inline*" | "tableRow+" | ""> = Node & {
|
|
19
|
-
name: Name;
|
|
20
|
-
config: {
|
|
21
|
-
content: Content;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare function createStronglyTypedTiptapNode<Name extends string, Content extends "inline*" | "tableRow+" | "">(config: NodeConfig & {
|
|
25
|
-
name: Name;
|
|
26
|
-
content: Content;
|
|
27
|
-
}): StronglyTypedTipTapNode<Name, Content>;
|
|
28
|
-
export declare function createInternalBlockSpec<T extends BlockConfig>(config: T, implementation: TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>): {
|
|
29
|
-
config: T;
|
|
30
|
-
implementation: TiptapBlockImplementation<T, any, InlineContentSchema, StyleSchema>;
|
|
31
|
-
};
|
|
32
|
-
export declare function createBlockSpecFromStronglyTypedTiptapNode<T extends Node, P extends PropSchema>(node: T, propSchema: P, requiredExtensions?: Array<Extension | Node>): {
|
|
33
|
-
config: {
|
|
34
|
-
type: T["name"];
|
|
35
|
-
content: T["config"]["content"] extends "inline*" ? "inline" : T["config"]["content"] extends "tableRow+" ? "table" : "none";
|
|
36
|
-
propSchema: P;
|
|
37
|
-
};
|
|
38
|
-
implementation: TiptapBlockImplementation<{
|
|
39
|
-
type: T["name"];
|
|
40
|
-
content: T["config"]["content"] extends "inline*" ? "inline" : T["config"]["content"] extends "tableRow+" ? "table" : "none";
|
|
41
|
-
propSchema: P;
|
|
42
|
-
}, any, InlineContentSchema, StyleSchema>;
|
|
43
|
-
};
|
|
44
|
-
export declare function getBlockSchemaFromSpecs<T extends BlockSpecs>(specs: T): BlockSchemaFromSpecs<T>;
|
|
45
|
-
export {};
|