@blocknote/core 0.16.0 → 0.17.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 (248) hide show
  1. package/dist/blocknote.js +3287 -2755
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +6 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/webpack-stats.json +1 -1
  6. package/package.json +5 -2
  7. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +3087 -0
  8. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +132 -0
  9. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +71 -0
  10. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +2276 -0
  11. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +131 -0
  12. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +103 -0
  13. package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +3767 -0
  14. package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +192 -0
  15. package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +178 -0
  16. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +1136 -0
  17. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +34 -0
  18. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +100 -0
  19. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +4931 -0
  20. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +222 -0
  21. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +70 -0
  22. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +2924 -0
  23. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +136 -0
  24. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +48 -0
  25. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +8376 -0
  26. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +300 -0
  27. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +199 -0
  28. package/src/api/blockManipulation/insertContentAt.ts +96 -0
  29. package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +316 -0
  30. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +53 -0
  31. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +130 -0
  32. package/src/api/blockManipulation/setupTestEnv.ts +179 -0
  33. package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -1
  34. package/src/api/clipboard/clipboard.test.ts +5 -6
  35. package/src/api/clipboard/fromClipboard/fileDropExtension.ts +8 -4
  36. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +11 -6
  37. package/src/api/clipboard/fromClipboard/pasteExtension.ts +8 -4
  38. package/src/api/clipboard/toClipboard/copyExtension.ts +113 -61
  39. package/src/api/exporters/html/__snapshots__/complex/misc/external.html +1 -1
  40. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -1
  41. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -1
  42. package/src/api/exporters/html/externalHTMLExporter.ts +42 -94
  43. package/src/api/exporters/html/htmlConversion.test.ts +19 -13
  44. package/src/api/exporters/html/internalHTMLSerializer.ts +21 -72
  45. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +263 -0
  46. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +158 -0
  47. package/src/api/exporters/markdown/markdownExporter.test.ts +10 -10
  48. package/src/api/exporters/markdown/markdownExporter.ts +11 -7
  49. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +2 -2
  50. package/src/api/getBlockInfoFromPos.ts +172 -90
  51. package/src/api/nodeConversions/blockToNode.ts +257 -0
  52. package/src/api/nodeConversions/fragmentToBlocks.ts +60 -0
  53. package/src/api/nodeConversions/nodeConversions.test.ts +9 -8
  54. package/src/api/nodeConversions/{nodeConversions.ts → nodeToBlock.ts} +20 -262
  55. package/src/api/parsers/html/parseHTML.test.ts +2 -2
  56. package/src/api/parsers/html/parseHTML.ts +8 -4
  57. package/src/api/parsers/html/util/nestedLists.test.ts +2 -2
  58. package/src/api/parsers/markdown/parseMarkdown.test.ts +2 -2
  59. package/src/api/parsers/markdown/parseMarkdown.ts +8 -4
  60. package/src/api/testUtil/cases/customBlocks.ts +11 -11
  61. package/src/api/testUtil/cases/customInlineContent.ts +6 -6
  62. package/src/api/testUtil/cases/customStyles.ts +6 -6
  63. package/src/api/testUtil/cases/defaultSchema.ts +4 -4
  64. package/src/api/testUtil/index.ts +6 -6
  65. package/src/api/testUtil/partialBlockTestUtil.ts +5 -5
  66. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +5 -5
  67. package/src/blocks/FileBlockContent/FileBlockContent.ts +4 -4
  68. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +2 -2
  69. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +61 -39
  70. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +5 -5
  71. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +30 -18
  72. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +67 -33
  73. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +23 -19
  74. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +22 -24
  75. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +31 -19
  76. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +16 -11
  77. package/src/blocks/TableBlockContent/TableBlockContent.ts +4 -4
  78. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +5 -5
  79. package/src/blocks/defaultBlockHelpers.ts +4 -4
  80. package/src/blocks/defaultBlockTypeGuards.ts +5 -5
  81. package/src/blocks/defaultBlocks.ts +13 -13
  82. package/src/blocks/defaultProps.ts +1 -1
  83. package/src/editor/BlockNoteEditor.test.ts +14 -7
  84. package/src/editor/BlockNoteEditor.ts +82 -149
  85. package/src/editor/BlockNoteExtensions.ts +15 -11
  86. package/src/editor/BlockNoteSchema.ts +7 -7
  87. package/src/editor/BlockNoteTipTapEditor.ts +5 -3
  88. package/src/editor/cursorPositionTypes.ts +7 -2
  89. package/src/editor/selectionTypes.ts +6 -2
  90. package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +1 -1
  91. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +1 -1
  92. package/src/extensions/FilePanel/FilePanelPlugin.ts +4 -4
  93. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +8 -4
  94. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +333 -0
  95. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +9 -4
  96. package/src/extensions/{NonEditableBlocks/NonEditableBlockPlugin.ts → NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts} +2 -2
  97. package/src/extensions/Placeholder/PlaceholderPlugin.ts +1 -1
  98. package/src/extensions/SideMenu/SideMenuPlugin.ts +72 -401
  99. package/src/extensions/SideMenu/dragging.ts +251 -0
  100. package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +1 -1
  101. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +8 -4
  102. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +8 -4
  103. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +19 -15
  104. package/src/extensions/TableHandles/TableHandlesPlugin.ts +11 -7
  105. package/src/extensions/TextColor/TextColorExtension.ts +1 -1
  106. package/src/extensions/TextColor/TextColorMark.ts +1 -1
  107. package/src/i18n/dictionary.ts +1 -1
  108. package/src/i18n/locales/ar.ts +1 -1
  109. package/src/i18n/locales/fr.ts +1 -1
  110. package/src/i18n/locales/hr.ts +308 -0
  111. package/src/i18n/locales/index.ts +15 -14
  112. package/src/i18n/locales/is.ts +1 -1
  113. package/src/i18n/locales/ja.ts +1 -1
  114. package/src/i18n/locales/ko.ts +1 -1
  115. package/src/i18n/locales/nl.ts +1 -1
  116. package/src/i18n/locales/pl.ts +1 -1
  117. package/src/i18n/locales/pt.ts +1 -1
  118. package/src/i18n/locales/ru.ts +1 -1
  119. package/src/i18n/locales/vi.ts +1 -1
  120. package/src/i18n/locales/zh.ts +1 -1
  121. package/src/index.ts +45 -44
  122. package/src/pm-nodes/BlockContainer.ts +3 -647
  123. package/src/pm-nodes/BlockGroup.ts +2 -2
  124. package/src/pm-nodes/index.ts +3 -3
  125. package/src/schema/blocks/createSpec.ts +8 -7
  126. package/src/schema/blocks/internal.ts +9 -9
  127. package/src/schema/blocks/types.ts +4 -4
  128. package/src/schema/index.ts +10 -10
  129. package/src/schema/inlineContent/createSpec.ts +9 -10
  130. package/src/schema/inlineContent/internal.ts +3 -3
  131. package/src/schema/inlineContent/types.ts +2 -2
  132. package/src/schema/styles/createSpec.ts +4 -3
  133. package/src/schema/styles/internal.ts +1 -1
  134. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +4 -0
  135. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +7 -0
  136. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.d.ts +1 -0
  137. package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.d.ts +5 -0
  138. package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.test.d.ts +1 -0
  139. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +7 -0
  140. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
  141. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +7 -0
  142. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.d.ts +1 -0
  143. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +5 -0
  144. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.test.d.ts +1 -0
  145. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +11 -0
  146. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.test.d.ts +1 -0
  147. package/types/src/api/blockManipulation/insertContentAt.d.ts +6 -0
  148. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -0
  149. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.d.ts +1 -0
  150. package/types/src/api/blockManipulation/setupTestEnv.d.ts +492 -0
  151. package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +3 -3
  152. package/types/src/api/clipboard/fromClipboard/handleFileInsertion.d.ts +1 -1
  153. package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +2 -2
  154. package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +5 -5
  155. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +7 -9
  156. package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +6 -10
  157. package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +10 -0
  158. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +11 -0
  159. package/types/src/api/exporters/markdown/markdownExporter.d.ts +3 -3
  160. package/types/src/api/getBlockInfoFromPos.d.ts +63 -20
  161. package/types/src/api/nodeConversions/blockToNode.d.ts +15 -0
  162. package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +7 -0
  163. package/types/src/api/nodeConversions/nodeToBlock.d.ts +16 -0
  164. package/types/src/api/parsers/html/parseHTML.d.ts +2 -2
  165. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -2
  166. package/types/src/api/testUtil/cases/customBlocks.d.ts +39 -39
  167. package/types/src/api/testUtil/cases/customInlineContent.d.ts +35 -35
  168. package/types/src/api/testUtil/cases/customStyles.d.ts +35 -35
  169. package/types/src/api/testUtil/cases/defaultSchema.d.ts +2 -2
  170. package/types/src/api/testUtil/index.d.ts +6 -6
  171. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +4 -4
  172. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +4 -4
  173. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +4 -4
  174. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +2 -2
  175. package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
  176. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +4 -4
  177. package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
  178. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
  179. package/types/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +2 -2
  180. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
  181. package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
  182. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
  183. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +4 -4
  184. package/types/src/blocks/defaultBlockHelpers.d.ts +3 -3
  185. package/types/src/blocks/defaultBlockTypeGuards.d.ts +4 -4
  186. package/types/src/blocks/defaultBlocks.d.ts +38 -38
  187. package/types/src/blocks/defaultProps.d.ts +1 -1
  188. package/types/src/editor/BlockNoteEditor.d.ts +28 -16
  189. package/types/src/editor/BlockNoteExtensions.d.ts +3 -3
  190. package/types/src/editor/BlockNoteSchema.d.ts +4 -4
  191. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
  192. package/types/src/editor/cursorPositionTypes.d.ts +3 -2
  193. package/types/src/editor/selectionTypes.d.ts +2 -2
  194. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
  195. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
  196. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +4 -4
  197. package/types/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.d.ts +5 -0
  198. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +4 -4
  199. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -0
  200. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
  201. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +12 -28
  202. package/types/src/extensions/SideMenu/dragging.d.ts +17 -0
  203. package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +1 -1
  204. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +4 -4
  205. package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +3 -3
  206. package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +4 -4
  207. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
  208. package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
  209. package/types/src/i18n/dictionary.d.ts +1 -1
  210. package/types/src/i18n/locales/ar.d.ts +1 -1
  211. package/types/src/i18n/locales/fr.d.ts +1 -1
  212. package/types/src/i18n/locales/hr.d.ts +239 -0
  213. package/types/src/i18n/locales/index.d.ts +15 -14
  214. package/types/src/i18n/locales/is.d.ts +1 -1
  215. package/types/src/i18n/locales/ja.d.ts +1 -1
  216. package/types/src/i18n/locales/ko.d.ts +1 -1
  217. package/types/src/i18n/locales/nl.d.ts +1 -1
  218. package/types/src/i18n/locales/pl.d.ts +1 -1
  219. package/types/src/i18n/locales/pt.d.ts +1 -1
  220. package/types/src/i18n/locales/ru.d.ts +1 -1
  221. package/types/src/i18n/locales/vi.d.ts +1 -1
  222. package/types/src/i18n/locales/zh.d.ts +1 -1
  223. package/types/src/index.d.ts +45 -44
  224. package/types/src/pm-nodes/BlockContainer.d.ts +2 -16
  225. package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
  226. package/types/src/pm-nodes/index.d.ts +3 -3
  227. package/types/src/schema/blocks/createSpec.d.ts +5 -5
  228. package/types/src/schema/blocks/internal.d.ts +5 -5
  229. package/types/src/schema/blocks/types.d.ts +4 -4
  230. package/types/src/schema/index.d.ts +10 -10
  231. package/types/src/schema/inlineContent/createSpec.d.ts +3 -3
  232. package/types/src/schema/inlineContent/internal.d.ts +2 -2
  233. package/types/src/schema/inlineContent/types.d.ts +2 -2
  234. package/types/src/schema/styles/createSpec.d.ts +1 -1
  235. package/types/src/schema/styles/internal.d.ts +1 -1
  236. package/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap +0 -714
  237. package/src/api/blockManipulation/blockManipulation.test.ts +0 -292
  238. package/src/api/blockManipulation/blockManipulation.ts +0 -350
  239. package/src/api/exporters/html/util/sharedHTMLConversion.ts +0 -130
  240. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +0 -218
  241. package/src/api/getCurrentBlockContentType.ts +0 -14
  242. package/types/src/api/blockManipulation/blockManipulation.d.ts +0 -14
  243. package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +0 -9
  244. package/types/src/api/exporters/html/util/simplifyBlocksRehypePlugin.d.ts +0 -16
  245. package/types/src/api/getCurrentBlockContentType.d.ts +0 -2
  246. package/types/src/api/nodeConversions/nodeConversions.d.ts +0 -24
  247. package/types/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.d.ts +0 -2
  248. /package/types/src/api/blockManipulation/{blockManipulation.test.d.ts → commands/insertBlocks/insertBlocks.test.d.ts} +0 -0
@@ -1,714 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blocks 1`] = `
4
- [
5
- {
6
- "children": [
7
- {
8
- "children": [],
9
- "content": [
10
- {
11
- "styles": {},
12
- "text": "Nested Heading 1",
13
- "type": "text",
14
- },
15
- ],
16
- "id": "2",
17
- "props": {
18
- "backgroundColor": "default",
19
- "level": 1,
20
- "textAlignment": "left",
21
- "textColor": "default",
22
- },
23
- "type": "heading",
24
- },
25
- ],
26
- "content": [
27
- {
28
- "styles": {},
29
- "text": "Heading 1",
30
- "type": "text",
31
- },
32
- ],
33
- "id": "1",
34
- "props": {
35
- "backgroundColor": "default",
36
- "level": 1,
37
- "textAlignment": "left",
38
- "textColor": "default",
39
- },
40
- "type": "heading",
41
- },
42
- {
43
- "children": [
44
- {
45
- "children": [],
46
- "content": [
47
- {
48
- "styles": {},
49
- "text": "Nested Heading 2",
50
- "type": "text",
51
- },
52
- ],
53
- "id": "4",
54
- "props": {
55
- "backgroundColor": "default",
56
- "level": 2,
57
- "textAlignment": "left",
58
- "textColor": "default",
59
- },
60
- "type": "heading",
61
- },
62
- ],
63
- "content": [
64
- {
65
- "styles": {},
66
- "text": "Heading 2",
67
- "type": "text",
68
- },
69
- ],
70
- "id": "3",
71
- "props": {
72
- "backgroundColor": "default",
73
- "level": 2,
74
- "textAlignment": "left",
75
- "textColor": "default",
76
- },
77
- "type": "heading",
78
- },
79
- {
80
- "children": [],
81
- "content": [],
82
- "id": "0",
83
- "props": {
84
- "backgroundColor": "default",
85
- "textAlignment": "left",
86
- "textColor": "default",
87
- },
88
- "type": "paragraph",
89
- },
90
- ]
91
- `;
92
-
93
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blocks 2`] = `
94
- [
95
- {
96
- "children": [
97
- {
98
- "children": [],
99
- "content": [
100
- {
101
- "styles": {},
102
- "text": "Nested Heading 1",
103
- "type": "text",
104
- },
105
- ],
106
- "id": "2",
107
- "props": {
108
- "backgroundColor": "default",
109
- "level": 1,
110
- "textAlignment": "left",
111
- "textColor": "default",
112
- },
113
- "type": "heading",
114
- },
115
- ],
116
- "content": [
117
- {
118
- "styles": {},
119
- "text": "Heading 1",
120
- "type": "text",
121
- },
122
- ],
123
- "id": "1",
124
- "props": {
125
- "backgroundColor": "default",
126
- "textAlignment": "left",
127
- "textColor": "default",
128
- },
129
- "type": "paragraph",
130
- },
131
- {
132
- "children": [
133
- {
134
- "children": [],
135
- "content": [
136
- {
137
- "styles": {},
138
- "text": "Nested Heading 2",
139
- "type": "text",
140
- },
141
- ],
142
- "id": "4",
143
- "props": {
144
- "backgroundColor": "default",
145
- "level": 2,
146
- "textAlignment": "left",
147
- "textColor": "default",
148
- },
149
- "type": "heading",
150
- },
151
- ],
152
- "content": [
153
- {
154
- "styles": {},
155
- "text": "Heading 2",
156
- "type": "text",
157
- },
158
- ],
159
- "id": "3",
160
- "props": {
161
- "backgroundColor": "default",
162
- "level": 2,
163
- "textAlignment": "left",
164
- "textColor": "default",
165
- },
166
- "type": "heading",
167
- },
168
- {
169
- "children": [],
170
- "content": [],
171
- "id": "0",
172
- "props": {
173
- "backgroundColor": "default",
174
- "textAlignment": "left",
175
- "textColor": "default",
176
- },
177
- "type": "paragraph",
178
- },
179
- ]
180
- `;
181
-
182
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete multiple blocks 3`] = `
183
- [
184
- {
185
- "children": [],
186
- "content": [
187
- {
188
- "styles": {},
189
- "text": "Heading 1",
190
- "type": "text",
191
- },
192
- ],
193
- "id": "1",
194
- "props": {
195
- "backgroundColor": "default",
196
- "textAlignment": "left",
197
- "textColor": "default",
198
- },
199
- "type": "paragraph",
200
- },
201
- {
202
- "children": [],
203
- "content": [],
204
- "id": "0",
205
- "props": {
206
- "backgroundColor": "default",
207
- "textAlignment": "left",
208
- "textColor": "default",
209
- },
210
- "type": "paragraph",
211
- },
212
- ]
213
- `;
214
-
215
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block 1`] = `
216
- [
217
- {
218
- "children": [],
219
- "content": [
220
- {
221
- "styles": {},
222
- "text": "Paragraph",
223
- "type": "text",
224
- },
225
- ],
226
- "id": "1",
227
- "props": {
228
- "backgroundColor": "default",
229
- "textAlignment": "left",
230
- "textColor": "default",
231
- },
232
- "type": "paragraph",
233
- },
234
- {
235
- "children": [],
236
- "content": [],
237
- "id": "0",
238
- "props": {
239
- "backgroundColor": "default",
240
- "textAlignment": "left",
241
- "textColor": "default",
242
- },
243
- "type": "paragraph",
244
- },
245
- ]
246
- `;
247
-
248
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block 2`] = `
249
- [
250
- {
251
- "children": [
252
- {
253
- "children": [],
254
- "content": [
255
- {
256
- "styles": {},
257
- "text": "Paragraph",
258
- "type": "text",
259
- },
260
- ],
261
- "id": "2",
262
- "props": {
263
- "backgroundColor": "default",
264
- "textAlignment": "left",
265
- "textColor": "default",
266
- },
267
- "type": "paragraph",
268
- },
269
- ],
270
- "content": [
271
- {
272
- "styles": {
273
- "textColor": "red",
274
- },
275
- "text": "Heading ",
276
- "type": "text",
277
- },
278
- {
279
- "styles": {
280
- "backgroundColor": "red",
281
- },
282
- "text": "3",
283
- "type": "text",
284
- },
285
- ],
286
- "id": "1",
287
- "props": {
288
- "backgroundColor": "default",
289
- "level": 3,
290
- "textAlignment": "right",
291
- "textColor": "default",
292
- },
293
- "type": "heading",
294
- },
295
- {
296
- "children": [],
297
- "content": [],
298
- "id": "0",
299
- "props": {
300
- "backgroundColor": "default",
301
- "textAlignment": "left",
302
- "textColor": "default",
303
- },
304
- "type": "paragraph",
305
- },
306
- ]
307
- `;
308
-
309
- exports[`Insert, Update, & Delete Blocks > Insert, update, & delete single block 3`] = `
310
- [
311
- {
312
- "children": [],
313
- "content": [],
314
- "id": "0",
315
- "props": {
316
- "backgroundColor": "default",
317
- "textAlignment": "left",
318
- "textColor": "default",
319
- },
320
- "type": "paragraph",
321
- },
322
- ]
323
- `;
324
-
325
- exports[`Inserting Blocks with Different Placements > Insert after existing block 1`] = `
326
- [
327
- {
328
- "children": [],
329
- "content": [],
330
- "id": "0",
331
- "props": {
332
- "backgroundColor": "default",
333
- "textAlignment": "left",
334
- "textColor": "default",
335
- },
336
- "type": "paragraph",
337
- },
338
- {
339
- "children": [
340
- {
341
- "children": [],
342
- "content": [
343
- {
344
- "styles": {},
345
- "text": "Nested Heading 1",
346
- "type": "text",
347
- },
348
- ],
349
- "id": "2",
350
- "props": {
351
- "backgroundColor": "default",
352
- "level": 1,
353
- "textAlignment": "left",
354
- "textColor": "default",
355
- },
356
- "type": "heading",
357
- },
358
- ],
359
- "content": [
360
- {
361
- "styles": {},
362
- "text": "Heading 1",
363
- "type": "text",
364
- },
365
- ],
366
- "id": "1",
367
- "props": {
368
- "backgroundColor": "default",
369
- "level": 1,
370
- "textAlignment": "left",
371
- "textColor": "default",
372
- },
373
- "type": "heading",
374
- },
375
- {
376
- "children": [
377
- {
378
- "children": [],
379
- "content": [
380
- {
381
- "styles": {},
382
- "text": "Nested Heading 2",
383
- "type": "text",
384
- },
385
- ],
386
- "id": "4",
387
- "props": {
388
- "backgroundColor": "default",
389
- "level": 2,
390
- "textAlignment": "left",
391
- "textColor": "default",
392
- },
393
- "type": "heading",
394
- },
395
- ],
396
- "content": [
397
- {
398
- "styles": {},
399
- "text": "Heading 2",
400
- "type": "text",
401
- },
402
- ],
403
- "id": "3",
404
- "props": {
405
- "backgroundColor": "default",
406
- "level": 2,
407
- "textAlignment": "left",
408
- "textColor": "default",
409
- },
410
- "type": "heading",
411
- },
412
- {
413
- "children": [],
414
- "content": [],
415
- "id": "5",
416
- "props": {
417
- "backgroundColor": "default",
418
- "textAlignment": "left",
419
- "textColor": "default",
420
- },
421
- "type": "paragraph",
422
- },
423
- ]
424
- `;
425
-
426
- exports[`Inserting Blocks with Different Placements > Insert before existing block 1`] = `
427
- [
428
- {
429
- "children": [
430
- {
431
- "children": [],
432
- "content": [
433
- {
434
- "styles": {},
435
- "text": "Nested Heading 1",
436
- "type": "text",
437
- },
438
- ],
439
- "id": "2",
440
- "props": {
441
- "backgroundColor": "default",
442
- "level": 1,
443
- "textAlignment": "left",
444
- "textColor": "default",
445
- },
446
- "type": "heading",
447
- },
448
- ],
449
- "content": [
450
- {
451
- "styles": {},
452
- "text": "Heading 1",
453
- "type": "text",
454
- },
455
- ],
456
- "id": "1",
457
- "props": {
458
- "backgroundColor": "default",
459
- "level": 1,
460
- "textAlignment": "left",
461
- "textColor": "default",
462
- },
463
- "type": "heading",
464
- },
465
- {
466
- "children": [
467
- {
468
- "children": [],
469
- "content": [
470
- {
471
- "styles": {},
472
- "text": "Nested Heading 2",
473
- "type": "text",
474
- },
475
- ],
476
- "id": "4",
477
- "props": {
478
- "backgroundColor": "default",
479
- "level": 2,
480
- "textAlignment": "left",
481
- "textColor": "default",
482
- },
483
- "type": "heading",
484
- },
485
- ],
486
- "content": [
487
- {
488
- "styles": {},
489
- "text": "Heading 2",
490
- "type": "text",
491
- },
492
- ],
493
- "id": "3",
494
- "props": {
495
- "backgroundColor": "default",
496
- "level": 2,
497
- "textAlignment": "left",
498
- "textColor": "default",
499
- },
500
- "type": "heading",
501
- },
502
- {
503
- "children": [],
504
- "content": [],
505
- "id": "0",
506
- "props": {
507
- "backgroundColor": "default",
508
- "textAlignment": "left",
509
- "textColor": "default",
510
- },
511
- "type": "paragraph",
512
- },
513
- ]
514
- `;
515
-
516
- exports[`Inserting Blocks with Different Placements > Insert nested inside existing block 1`] = `
517
- [
518
- {
519
- "children": [
520
- {
521
- "children": [
522
- {
523
- "children": [],
524
- "content": [
525
- {
526
- "styles": {},
527
- "text": "Nested Heading 1",
528
- "type": "text",
529
- },
530
- ],
531
- "id": "2",
532
- "props": {
533
- "backgroundColor": "default",
534
- "level": 1,
535
- "textAlignment": "left",
536
- "textColor": "default",
537
- },
538
- "type": "heading",
539
- },
540
- ],
541
- "content": [
542
- {
543
- "styles": {},
544
- "text": "Heading 1",
545
- "type": "text",
546
- },
547
- ],
548
- "id": "1",
549
- "props": {
550
- "backgroundColor": "default",
551
- "level": 1,
552
- "textAlignment": "left",
553
- "textColor": "default",
554
- },
555
- "type": "heading",
556
- },
557
- {
558
- "children": [
559
- {
560
- "children": [],
561
- "content": [
562
- {
563
- "styles": {},
564
- "text": "Nested Heading 2",
565
- "type": "text",
566
- },
567
- ],
568
- "id": "4",
569
- "props": {
570
- "backgroundColor": "default",
571
- "level": 2,
572
- "textAlignment": "left",
573
- "textColor": "default",
574
- },
575
- "type": "heading",
576
- },
577
- ],
578
- "content": [
579
- {
580
- "styles": {},
581
- "text": "Heading 2",
582
- "type": "text",
583
- },
584
- ],
585
- "id": "3",
586
- "props": {
587
- "backgroundColor": "default",
588
- "level": 2,
589
- "textAlignment": "left",
590
- "textColor": "default",
591
- },
592
- "type": "heading",
593
- },
594
- ],
595
- "content": [],
596
- "id": "0",
597
- "props": {
598
- "backgroundColor": "default",
599
- "textAlignment": "left",
600
- "textColor": "default",
601
- },
602
- "type": "paragraph",
603
- },
604
- {
605
- "children": [],
606
- "content": [],
607
- "id": "5",
608
- "props": {
609
- "backgroundColor": "default",
610
- "textAlignment": "left",
611
- "textColor": "default",
612
- },
613
- "type": "paragraph",
614
- },
615
- ]
616
- `;
617
-
618
- exports[`Update Line Breaks > Update custom block with line break 1`] = `
619
- [
620
- {
621
- "children": [],
622
- "content": [
623
- {
624
- "styles": {},
625
- "text": "Line1
626
- Line2",
627
- "type": "text",
628
- },
629
- ],
630
- "id": "1",
631
- "props": {
632
- "backgroundColor": "default",
633
- "textAlignment": "left",
634
- "textColor": "default",
635
- },
636
- "type": "paragraph",
637
- },
638
- {
639
- "children": [],
640
- "content": [
641
- {
642
- "styles": {},
643
- "text": "Updated Custom Block with
644
- line
645
- break",
646
- "type": "text",
647
- },
648
- ],
649
- "id": "2",
650
- "props": {},
651
- "type": "customBlock",
652
- },
653
- {
654
- "children": [],
655
- "content": [],
656
- "id": "0",
657
- "props": {
658
- "backgroundColor": "default",
659
- "textAlignment": "left",
660
- "textColor": "default",
661
- },
662
- "type": "paragraph",
663
- },
664
- ]
665
- `;
666
-
667
- exports[`Update Line Breaks > Update paragraph with line break 1`] = `
668
- [
669
- {
670
- "children": [],
671
- "content": [
672
- {
673
- "styles": {},
674
- "text": "Updated Custom Block with
675
- line
676
- break",
677
- "type": "text",
678
- },
679
- ],
680
- "id": "1",
681
- "props": {
682
- "backgroundColor": "default",
683
- "textAlignment": "left",
684
- "textColor": "default",
685
- },
686
- "type": "paragraph",
687
- },
688
- {
689
- "children": [],
690
- "content": [
691
- {
692
- "styles": {},
693
- "text": "Line1
694
- Line2",
695
- "type": "text",
696
- },
697
- ],
698
- "id": "2",
699
- "props": {},
700
- "type": "customBlock",
701
- },
702
- {
703
- "children": [],
704
- "content": [],
705
- "id": "0",
706
- "props": {
707
- "backgroundColor": "default",
708
- "textAlignment": "left",
709
- "textColor": "default",
710
- },
711
- "type": "paragraph",
712
- },
713
- ]
714
- `;