@blocknote/core 0.5.1 → 0.6.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.
Files changed (39) hide show
  1. package/dist/blocknote.js +1126 -1031
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +2 -2
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +2 -2
  7. package/src/BlockNoteEditor.ts +244 -3
  8. package/src/BlockNoteExtensions.ts +3 -2
  9. package/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap +35 -35
  10. package/src/api/formatConversions/__snapshots__/formatConversions.test.ts.snap +10 -10
  11. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +10 -10
  12. package/src/api/nodeConversions/nodeConversions.ts +11 -10
  13. package/src/editor.module.css +11 -2
  14. package/src/extensions/Blocks/api/inlineContentTypes.ts +3 -2
  15. package/src/extensions/Blocks/api/selectionTypes.ts +5 -0
  16. package/src/extensions/Blocks/nodes/Block.module.css +20 -2
  17. package/src/extensions/DraggableBlocks/BlockSideMenuFactoryTypes.ts +5 -6
  18. package/src/extensions/DraggableBlocks/DraggableBlocksExtension.ts +5 -2
  19. package/src/extensions/DraggableBlocks/DraggableBlocksPlugin.ts +76 -113
  20. package/src/extensions/FormattingToolbar/FormattingToolbarExtension.ts +6 -3
  21. package/src/extensions/FormattingToolbar/FormattingToolbarFactoryTypes.ts +2 -34
  22. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +39 -113
  23. package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +56 -39
  24. package/src/extensions/UniqueID/UniqueID.ts +1 -1
  25. package/src/index.ts +1 -0
  26. package/src/shared/plugins/suggestion/SuggestionPlugin.ts +14 -2
  27. package/types/src/BlockNoteEditor.d.ts +79 -0
  28. package/types/src/extensions/Blocks/api/inlineContentTypes.d.ts +3 -2
  29. package/types/src/extensions/Blocks/api/selectionTypes.d.ts +4 -0
  30. package/types/src/extensions/DraggableBlocks/BlockSideMenuFactoryTypes.d.ts +4 -5
  31. package/types/src/extensions/DraggableBlocks/DraggableBlocksExtension.d.ts +3 -1
  32. package/types/src/extensions/DraggableBlocks/DraggableBlocksPlugin.d.ts +14 -16
  33. package/types/src/extensions/FormattingToolbar/FormattingToolbarExtension.d.ts +2 -0
  34. package/types/src/extensions/FormattingToolbar/FormattingToolbarFactoryTypes.d.ts +2 -25
  35. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +9 -4
  36. package/types/src/index.d.ts +1 -0
  37. package/types/src/api/Editor.d.ts +0 -93
  38. package/types/src/extensions/SlashMenu/SlashMenuItem.d.ts +0 -24
  39. package/types/src/extensions/SlashMenu/defaultSlashCommands.d.ts +0 -5
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "homepage": "https://github.com/TypeCellOS/BlockNote",
4
4
  "private": false,
5
5
  "license": "MPL-2.0",
6
- "version": "0.5.1",
6
+ "version": "0.6.1",
7
7
  "files": [
8
8
  "dist",
9
9
  "types",
@@ -109,5 +109,5 @@
109
109
  "access": "public",
110
110
  "registry": "https://registry.npmjs.org/"
111
111
  },
112
- "gitHead": "babb5daf39a4cfa7dff192098b7a7a35b022623f"
112
+ "gitHead": "018be0fdd45fa93b16cdb513720eb7c700cc022b"
113
113
  }
@@ -23,7 +23,13 @@ import {
23
23
  BlockIdentifier,
24
24
  PartialBlock,
25
25
  } from "./extensions/Blocks/api/blockTypes";
26
+ import {
27
+ ColorStyle,
28
+ Styles,
29
+ ToggledStyle,
30
+ } from "./extensions/Blocks/api/inlineContentTypes";
26
31
  import { TextCursorPosition } from "./extensions/Blocks/api/cursorPositionTypes";
32
+ import { Selection } from "./extensions/Blocks/api/selectionTypes";
27
33
  import { getBlockInfoFromPos } from "./extensions/Blocks/helpers/getBlockInfoFromPos";
28
34
  import {
29
35
  BaseSlashMenuItem,
@@ -69,14 +75,26 @@ export type BlockNoteEditorOptions = {
69
75
  * A callback function that runs whenever the text cursor position changes.
70
76
  */
71
77
  onTextCursorPositionChange: (editor: BlockNoteEditor) => void;
78
+ /**
79
+ * Locks the editor from being editable by the user if set to `false`.
80
+ */
81
+ editable: boolean;
82
+ /**
83
+ * The content that should be in the editor when it's created, represented as an array of partial block objects.
84
+ */
72
85
  initialContent: PartialBlock[];
73
-
74
86
  /**
75
87
  * Use default BlockNote font and reset the styles of <p> <li> <h1> elements etc., that are used in BlockNote.
76
88
  *
77
89
  * @default true
78
90
  */
79
91
  defaultStyles: boolean;
92
+ /**
93
+ * Whether to use the light or dark theme.
94
+ *
95
+ * @default "light"
96
+ */
97
+ theme: "light" | "dark";
80
98
 
81
99
  // tiptap options, undocumented
82
100
  _tiptapOptions: any;
@@ -96,6 +114,10 @@ export class BlockNoteEditor {
96
114
  return this._tiptapEditor.view.dom as HTMLDivElement;
97
115
  }
98
116
 
117
+ public focus() {
118
+ this._tiptapEditor.view.focus();
119
+ }
120
+
99
121
  constructor(options: Partial<BlockNoteEditorOptions> = {}) {
100
122
  // apply defaults
101
123
  options = {
@@ -134,12 +156,14 @@ export class BlockNoteEditor {
134
156
  onSelectionUpdate: () => {
135
157
  options.onTextCursorPositionChange?.(this);
136
158
  },
159
+ editable: options.editable === undefined ? true : options.editable,
137
160
  extensions:
138
161
  options.enableBlockNoteExtensions === false
139
162
  ? options._tiptapOptions?.extensions
140
163
  : [...(options._tiptapOptions?.extensions || []), ...extensions],
141
164
  editorProps: {
142
165
  attributes: {
166
+ "data-theme": options.theme || "light",
143
167
  ...(options.editorDOMAttributes || {}),
144
168
  class: [
145
169
  styles.bnEditor,
@@ -222,7 +246,7 @@ export class BlockNoteEditor {
222
246
 
223
247
  function traverseBlockArray(blockArray: Block[]): boolean {
224
248
  for (const block of blockArray) {
225
- if (callback(block) === false) {
249
+ if (!callback(block)) {
226
250
  return false;
227
251
  }
228
252
 
@@ -230,7 +254,7 @@ export class BlockNoteEditor {
230
254
  ? block.children.slice().reverse()
231
255
  : block.children;
232
256
 
233
- if (traverseBlockArray(children) === false) {
257
+ if (!traverseBlockArray(children)) {
234
258
  return false;
235
259
  }
236
260
  }
@@ -312,6 +336,60 @@ export class BlockNoteEditor {
312
336
  }
313
337
  }
314
338
 
339
+ /**
340
+ * Gets a snapshot of the current selection.
341
+ */
342
+ public getSelection(): Selection | undefined {
343
+ if (
344
+ this._tiptapEditor.state.selection.from ===
345
+ this._tiptapEditor.state.selection.to
346
+ ) {
347
+ return undefined;
348
+ }
349
+
350
+ const blocks: Block[] = [];
351
+
352
+ this._tiptapEditor.state.doc.descendants((node, pos) => {
353
+ if (node.type.spec.group !== "blockContent") {
354
+ return true;
355
+ }
356
+
357
+ if (
358
+ pos + node.nodeSize < this._tiptapEditor.state.selection.from ||
359
+ pos > this._tiptapEditor.state.selection.to
360
+ ) {
361
+ return true;
362
+ }
363
+
364
+ blocks.push(
365
+ nodeToBlock(
366
+ this._tiptapEditor.state.doc.resolve(pos).node(),
367
+ this.blockCache
368
+ )
369
+ );
370
+
371
+ return false;
372
+ });
373
+
374
+ return { blocks: blocks };
375
+ }
376
+
377
+ /**
378
+ * Checks if the editor is currently editable, or if it's locked.
379
+ * @returns True if the editor is editable, false otherwise.
380
+ */
381
+ public get isEditable(): boolean {
382
+ return this._tiptapEditor.isEditable;
383
+ }
384
+
385
+ /**
386
+ * Makes the editor editable or locks it, depending on the argument passed.
387
+ * @param editable True to make the editor editable, or false to lock it.
388
+ */
389
+ public set isEditable(editable: boolean) {
390
+ this._tiptapEditor.setEditable(editable);
391
+ }
392
+
315
393
  /**
316
394
  * Inserts new blocks into the editor. If a block's `id` is undefined, BlockNote generates one automatically. Throws an
317
395
  * error if the reference block could not be found.
@@ -361,6 +439,169 @@ export class BlockNoteEditor {
361
439
  replaceBlocks(blocksToRemove, blocksToInsert, this._tiptapEditor);
362
440
  }
363
441
 
442
+ /**
443
+ * Gets the active text styles at the text cursor position or at the end of the current selection if it's active.
444
+ */
445
+ public getActiveStyles() {
446
+ const styles: Styles = {};
447
+ const marks = this._tiptapEditor.state.selection.$to.marks();
448
+
449
+ const toggleStyles = new Set<ToggledStyle>([
450
+ "bold",
451
+ "italic",
452
+ "underline",
453
+ "strike",
454
+ "code",
455
+ ]);
456
+ const colorStyles = new Set<ColorStyle>(["textColor", "backgroundColor"]);
457
+
458
+ for (const mark of marks) {
459
+ if (toggleStyles.has(mark.type.name as ToggledStyle)) {
460
+ styles[mark.type.name as ToggledStyle] = true;
461
+ } else if (colorStyles.has(mark.type.name as ColorStyle)) {
462
+ styles[mark.type.name as ColorStyle] = mark.attrs.color;
463
+ }
464
+ }
465
+
466
+ return styles;
467
+ }
468
+
469
+ /**
470
+ * Adds styles to the currently selected content.
471
+ * @param styles The styles to add.
472
+ */
473
+ public addStyles(styles: Styles) {
474
+ const toggleStyles = new Set<ToggledStyle>([
475
+ "bold",
476
+ "italic",
477
+ "underline",
478
+ "strike",
479
+ "code",
480
+ ]);
481
+ const colorStyles = new Set<ColorStyle>(["textColor", "backgroundColor"]);
482
+
483
+ for (const [style, value] of Object.entries(styles)) {
484
+ if (toggleStyles.has(style as ToggledStyle)) {
485
+ this._tiptapEditor.commands.setMark(style);
486
+ } else if (colorStyles.has(style as ColorStyle)) {
487
+ this._tiptapEditor.commands.setMark(style, { color: value });
488
+ }
489
+ }
490
+ }
491
+
492
+ /**
493
+ * Removes styles from the currently selected content.
494
+ * @param styles The styles to remove.
495
+ */
496
+ public removeStyles(styles: Styles) {
497
+ for (const style of Object.keys(styles)) {
498
+ this._tiptapEditor.commands.unsetMark(style);
499
+ }
500
+ }
501
+
502
+ /**
503
+ * Toggles styles on the currently selected content.
504
+ * @param styles The styles to toggle.
505
+ */
506
+ public toggleStyles(styles: Styles) {
507
+ const toggleStyles = new Set<ToggledStyle>([
508
+ "bold",
509
+ "italic",
510
+ "underline",
511
+ "strike",
512
+ "code",
513
+ ]);
514
+ const colorStyles = new Set<ColorStyle>(["textColor", "backgroundColor"]);
515
+
516
+ for (const [style, value] of Object.entries(styles)) {
517
+ if (toggleStyles.has(style as ToggledStyle)) {
518
+ this._tiptapEditor.commands.toggleMark(style);
519
+ } else if (colorStyles.has(style as ColorStyle)) {
520
+ this._tiptapEditor.commands.toggleMark(style, { color: value });
521
+ }
522
+ }
523
+ }
524
+
525
+ /**
526
+ * Gets the currently selected text.
527
+ */
528
+ public getSelectedText() {
529
+ return this._tiptapEditor.state.doc.textBetween(
530
+ this._tiptapEditor.state.selection.from,
531
+ this._tiptapEditor.state.selection.to
532
+ );
533
+ }
534
+
535
+ /**
536
+ * Gets the URL of the last link in the current selection, or `undefined` if there are no links in the selection.
537
+ */
538
+ public getSelectedLinkUrl() {
539
+ return this._tiptapEditor.getAttributes("link").href as string | undefined;
540
+ }
541
+
542
+ /**
543
+ * Creates a new link to replace the selected content.
544
+ * @param url The link URL.
545
+ * @param text The text to display the link with.
546
+ */
547
+ public createLink(url: string, text?: string) {
548
+ if (url === "") {
549
+ return;
550
+ }
551
+
552
+ let { from, to } = this._tiptapEditor.state.selection;
553
+
554
+ if (!text) {
555
+ text = this._tiptapEditor.state.doc.textBetween(from, to);
556
+ }
557
+
558
+ const mark = this._tiptapEditor.schema.mark("link", { href: url });
559
+
560
+ this._tiptapEditor.view.dispatch(
561
+ this._tiptapEditor.view.state.tr
562
+ .insertText(text, from, to)
563
+ .addMark(from, from + text.length, mark)
564
+ );
565
+ }
566
+
567
+ /**
568
+ * Checks if the block containing the text cursor can be nested.
569
+ */
570
+ public canNestBlock() {
571
+ const { startPos, depth } = getBlockInfoFromPos(
572
+ this._tiptapEditor.state.doc,
573
+ this._tiptapEditor.state.selection.from
574
+ )!;
575
+
576
+ return this._tiptapEditor.state.doc.resolve(startPos).index(depth - 1) > 0;
577
+ }
578
+
579
+ /**
580
+ * Nests the block containing the text cursor into the block above it.
581
+ */
582
+ public nestBlock() {
583
+ this._tiptapEditor.commands.sinkListItem("blockContainer");
584
+ }
585
+
586
+ /**
587
+ * Checks if the block containing the text cursor is nested.
588
+ */
589
+ public canUnnestBlock() {
590
+ const { depth } = getBlockInfoFromPos(
591
+ this._tiptapEditor.state.doc,
592
+ this._tiptapEditor.state.selection.from
593
+ )!;
594
+
595
+ return depth > 2;
596
+ }
597
+
598
+ /**
599
+ * Lifts the block containing the text cursor out of its parent.
600
+ */
601
+ public unnestBlock() {
602
+ this._tiptapEditor.commands.liftListItem("blockContainer");
603
+ }
604
+
364
605
  /**
365
606
  * Serializes blocks into an HTML string. To better conform to HTML standards, children of blocks which aren't list
366
607
  * items are un-nested in the output HTML.
@@ -24,8 +24,7 @@ import { FormattingToolbarFactory } from "./extensions/FormattingToolbar/Formatt
24
24
  import HyperlinkMark from "./extensions/HyperlinkToolbar/HyperlinkMark";
25
25
  import { HyperlinkToolbarFactory } from "./extensions/HyperlinkToolbar/HyperlinkToolbarFactoryTypes";
26
26
  import { Placeholder } from "./extensions/Placeholder/PlaceholderExtension";
27
- import { SlashMenuExtension } from "./extensions/SlashMenu";
28
- import { BaseSlashMenuItem } from "./extensions/SlashMenu";
27
+ import { BaseSlashMenuItem, SlashMenuExtension } from "./extensions/SlashMenu";
29
28
  import { TextAlignmentExtension } from "./extensions/TextAlignment/TextAlignmentExtension";
30
29
  import { TextColorExtension } from "./extensions/TextColor/TextColorExtension";
31
30
  import { TextColorMark } from "./extensions/TextColor/TextColorMark";
@@ -100,6 +99,7 @@ export const getBlockNoteExtensions = (opts: {
100
99
  if (opts.uiFactories.blockSideMenuFactory) {
101
100
  ret.push(
102
101
  DraggableBlocksExtension.configure({
102
+ editor: opts.editor,
103
103
  blockSideMenuFactory: opts.uiFactories.blockSideMenuFactory,
104
104
  })
105
105
  );
@@ -108,6 +108,7 @@ export const getBlockNoteExtensions = (opts: {
108
108
  if (opts.uiFactories.formattingToolbarFactory) {
109
109
  ret.push(
110
110
  FormattingToolbarExtension.configure({
111
+ editor: opts.editor,
111
112
  formattingToolbarFactory: opts.uiFactories.formattingToolbarFactory,
112
113
  })
113
114
  );
@@ -13,7 +13,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
13
13
  "type": "text",
14
14
  },
15
15
  ],
16
- "id": 2,
16
+ "id": "2",
17
17
  "props": {
18
18
  "backgroundColor": "default",
19
19
  "level": "1",
@@ -30,7 +30,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
30
30
  "type": "text",
31
31
  },
32
32
  ],
33
- "id": 1,
33
+ "id": "1",
34
34
  "props": {
35
35
  "backgroundColor": "default",
36
36
  "level": "1",
@@ -50,7 +50,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
50
50
  "type": "text",
51
51
  },
52
52
  ],
53
- "id": 4,
53
+ "id": "4",
54
54
  "props": {
55
55
  "backgroundColor": "default",
56
56
  "level": "2",
@@ -67,7 +67,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
67
67
  "type": "text",
68
68
  },
69
69
  ],
70
- "id": 3,
70
+ "id": "3",
71
71
  "props": {
72
72
  "backgroundColor": "default",
73
73
  "level": "2",
@@ -79,7 +79,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
79
79
  {
80
80
  "children": [],
81
81
  "content": [],
82
- "id": 0,
82
+ "id": "0",
83
83
  "props": {
84
84
  "backgroundColor": "default",
85
85
  "textAlignment": "left",
@@ -103,7 +103,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
103
103
  "type": "text",
104
104
  },
105
105
  ],
106
- "id": 2,
106
+ "id": "2",
107
107
  "props": {
108
108
  "backgroundColor": "default",
109
109
  "level": "1",
@@ -120,7 +120,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
120
120
  "type": "text",
121
121
  },
122
122
  ],
123
- "id": 1,
123
+ "id": "1",
124
124
  "props": {
125
125
  "backgroundColor": "default",
126
126
  "textAlignment": "left",
@@ -139,7 +139,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
139
139
  "type": "text",
140
140
  },
141
141
  ],
142
- "id": 4,
142
+ "id": "4",
143
143
  "props": {
144
144
  "backgroundColor": "default",
145
145
  "level": "2",
@@ -156,7 +156,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
156
156
  "type": "text",
157
157
  },
158
158
  ],
159
- "id": 3,
159
+ "id": "3",
160
160
  "props": {
161
161
  "backgroundColor": "default",
162
162
  "level": "2",
@@ -168,7 +168,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
168
168
  {
169
169
  "children": [],
170
170
  "content": [],
171
- "id": 0,
171
+ "id": "0",
172
172
  "props": {
173
173
  "backgroundColor": "default",
174
174
  "textAlignment": "left",
@@ -190,7 +190,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
190
190
  "type": "text",
191
191
  },
192
192
  ],
193
- "id": 1,
193
+ "id": "1",
194
194
  "props": {
195
195
  "backgroundColor": "default",
196
196
  "textAlignment": "left",
@@ -201,7 +201,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blo
201
201
  {
202
202
  "children": [],
203
203
  "content": [],
204
- "id": 0,
204
+ "id": "0",
205
205
  "props": {
206
206
  "backgroundColor": "default",
207
207
  "textAlignment": "left",
@@ -223,7 +223,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
223
223
  "type": "text",
224
224
  },
225
225
  ],
226
- "id": 1,
226
+ "id": "1",
227
227
  "props": {
228
228
  "backgroundColor": "default",
229
229
  "textAlignment": "left",
@@ -234,7 +234,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
234
234
  {
235
235
  "children": [],
236
236
  "content": [],
237
- "id": 0,
237
+ "id": "0",
238
238
  "props": {
239
239
  "backgroundColor": "default",
240
240
  "textAlignment": "left",
@@ -258,7 +258,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
258
258
  "type": "text",
259
259
  },
260
260
  ],
261
- "id": 2,
261
+ "id": "2",
262
262
  "props": {
263
263
  "backgroundColor": "default",
264
264
  "textAlignment": "left",
@@ -283,7 +283,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
283
283
  "type": "text",
284
284
  },
285
285
  ],
286
- "id": 1,
286
+ "id": "1",
287
287
  "props": {
288
288
  "backgroundColor": "default",
289
289
  "level": "3",
@@ -295,7 +295,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
295
295
  {
296
296
  "children": [],
297
297
  "content": [],
298
- "id": 0,
298
+ "id": "0",
299
299
  "props": {
300
300
  "backgroundColor": "default",
301
301
  "textAlignment": "left",
@@ -311,7 +311,7 @@ exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block
311
311
  {
312
312
  "children": [],
313
313
  "content": [],
314
- "id": 0,
314
+ "id": "0",
315
315
  "props": {
316
316
  "backgroundColor": "default",
317
317
  "textAlignment": "left",
@@ -327,7 +327,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
327
327
  {
328
328
  "children": [],
329
329
  "content": [],
330
- "id": 0,
330
+ "id": "0",
331
331
  "props": {
332
332
  "backgroundColor": "default",
333
333
  "textAlignment": "left",
@@ -346,7 +346,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
346
346
  "type": "text",
347
347
  },
348
348
  ],
349
- "id": 2,
349
+ "id": "2",
350
350
  "props": {
351
351
  "backgroundColor": "default",
352
352
  "level": "1",
@@ -363,7 +363,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
363
363
  "type": "text",
364
364
  },
365
365
  ],
366
- "id": 1,
366
+ "id": "1",
367
367
  "props": {
368
368
  "backgroundColor": "default",
369
369
  "level": "1",
@@ -383,7 +383,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
383
383
  "type": "text",
384
384
  },
385
385
  ],
386
- "id": 4,
386
+ "id": "4",
387
387
  "props": {
388
388
  "backgroundColor": "default",
389
389
  "level": "2",
@@ -400,7 +400,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
400
400
  "type": "text",
401
401
  },
402
402
  ],
403
- "id": 3,
403
+ "id": "3",
404
404
  "props": {
405
405
  "backgroundColor": "default",
406
406
  "level": "2",
@@ -412,7 +412,7 @@ exports[`Inserting Blocks with Different Placements > Insert after existing bloc
412
412
  {
413
413
  "children": [],
414
414
  "content": [],
415
- "id": 5,
415
+ "id": "5",
416
416
  "props": {
417
417
  "backgroundColor": "default",
418
418
  "textAlignment": "left",
@@ -436,7 +436,7 @@ exports[`Inserting Blocks with Different Placements > Insert before existing blo
436
436
  "type": "text",
437
437
  },
438
438
  ],
439
- "id": 2,
439
+ "id": "2",
440
440
  "props": {
441
441
  "backgroundColor": "default",
442
442
  "level": "1",
@@ -453,7 +453,7 @@ exports[`Inserting Blocks with Different Placements > Insert before existing blo
453
453
  "type": "text",
454
454
  },
455
455
  ],
456
- "id": 1,
456
+ "id": "1",
457
457
  "props": {
458
458
  "backgroundColor": "default",
459
459
  "level": "1",
@@ -473,7 +473,7 @@ exports[`Inserting Blocks with Different Placements > Insert before existing blo
473
473
  "type": "text",
474
474
  },
475
475
  ],
476
- "id": 4,
476
+ "id": "4",
477
477
  "props": {
478
478
  "backgroundColor": "default",
479
479
  "level": "2",
@@ -490,7 +490,7 @@ exports[`Inserting Blocks with Different Placements > Insert before existing blo
490
490
  "type": "text",
491
491
  },
492
492
  ],
493
- "id": 3,
493
+ "id": "3",
494
494
  "props": {
495
495
  "backgroundColor": "default",
496
496
  "level": "2",
@@ -502,7 +502,7 @@ exports[`Inserting Blocks with Different Placements > Insert before existing blo
502
502
  {
503
503
  "children": [],
504
504
  "content": [],
505
- "id": 0,
505
+ "id": "0",
506
506
  "props": {
507
507
  "backgroundColor": "default",
508
508
  "textAlignment": "left",
@@ -528,7 +528,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
528
528
  "type": "text",
529
529
  },
530
530
  ],
531
- "id": 2,
531
+ "id": "2",
532
532
  "props": {
533
533
  "backgroundColor": "default",
534
534
  "level": "1",
@@ -545,7 +545,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
545
545
  "type": "text",
546
546
  },
547
547
  ],
548
- "id": 1,
548
+ "id": "1",
549
549
  "props": {
550
550
  "backgroundColor": "default",
551
551
  "level": "1",
@@ -565,7 +565,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
565
565
  "type": "text",
566
566
  },
567
567
  ],
568
- "id": 4,
568
+ "id": "4",
569
569
  "props": {
570
570
  "backgroundColor": "default",
571
571
  "level": "2",
@@ -582,7 +582,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
582
582
  "type": "text",
583
583
  },
584
584
  ],
585
- "id": 3,
585
+ "id": "3",
586
586
  "props": {
587
587
  "backgroundColor": "default",
588
588
  "level": "2",
@@ -593,7 +593,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
593
593
  },
594
594
  ],
595
595
  "content": [],
596
- "id": 0,
596
+ "id": "0",
597
597
  "props": {
598
598
  "backgroundColor": "default",
599
599
  "textAlignment": "left",
@@ -604,7 +604,7 @@ exports[`Inserting Blocks with Different Placements > Insert nested inside exist
604
604
  {
605
605
  "children": [],
606
606
  "content": [],
607
- "id": 5,
607
+ "id": "5",
608
608
  "props": {
609
609
  "backgroundColor": "default",
610
610
  "textAlignment": "left",