@blocknote/core 0.27.2 → 0.29.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 (388) hide show
  1. package/dist/blocknote.cjs +10 -10
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +3032 -3118
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/locales.cjs +1 -1
  6. package/dist/locales.cjs.map +1 -1
  7. package/dist/locales.js +10 -10
  8. package/dist/locales.js.map +1 -1
  9. package/dist/tsconfig.tsbuildinfo +1 -1
  10. package/dist/webpack-stats.json +1 -1
  11. package/package.json +2 -2
  12. package/src/api/__snapshots__/blocks-deleted-nested-deep.json +26 -0
  13. package/src/api/__snapshots__/blocks-deleted-nested.json +68 -0
  14. package/src/api/__snapshots__/blocks-deleted.json +26 -0
  15. package/src/api/__snapshots__/blocks-inserted-nested.json +62 -0
  16. package/src/api/__snapshots__/blocks-inserted.json +20 -0
  17. package/src/api/__snapshots__/blocks-updated-content-inserted.json +42 -0
  18. package/src/api/__snapshots__/blocks-updated-multiple-insert.json +50 -0
  19. package/src/api/__snapshots__/blocks-updated-multiple.json +82 -0
  20. package/src/api/__snapshots__/blocks-updated-nested-deep.json +42 -0
  21. package/src/api/__snapshots__/blocks-updated-nested-multiple.json +118 -0
  22. package/src/api/__snapshots__/blocks-updated-nested.json +78 -0
  23. package/src/api/__snapshots__/blocks-updated-single.json +42 -0
  24. package/src/api/__snapshots__/blocks-updated.json +42 -0
  25. package/src/api/blockManipulation/__snapshots__/transactions.test.ts.snap +34 -0
  26. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +312 -0
  27. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +127 -94
  28. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +19 -37
  29. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +8 -6
  30. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +25 -31
  31. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +93 -91
  32. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +16 -20
  33. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +14 -1
  34. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +18 -56
  35. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +52 -46
  36. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +1051 -0
  37. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +247 -154
  38. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +109 -142
  39. package/src/api/blockManipulation/getBlock/getBlock.ts +23 -48
  40. package/src/api/blockManipulation/insertContentAt.ts +4 -17
  41. package/src/api/blockManipulation/selections/selection.test.ts +32 -16
  42. package/src/api/blockManipulation/selections/selection.ts +25 -51
  43. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +35 -14
  44. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +34 -65
  45. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +8 -10
  46. package/src/api/clipboard/toClipboard/copyExtension.ts +7 -7
  47. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -16
  48. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -17
  49. package/src/api/getBlockInfoFromPos.ts +13 -1
  50. package/src/api/nodeConversions/blockToNode.ts +21 -10
  51. package/src/api/nodeConversions/fragmentToBlocks.ts +5 -18
  52. package/src/api/nodeConversions/nodeToBlock.ts +11 -8
  53. package/src/api/nodeUtil.test.ts +228 -0
  54. package/src/api/nodeUtil.ts +235 -2
  55. package/src/api/parsers/html/parseHTML.ts +2 -10
  56. package/src/api/parsers/markdown/parseMarkdown.ts +2 -8
  57. package/src/api/pmUtil.ts +54 -0
  58. package/src/api/positionMapping.test.ts +370 -0
  59. package/src/api/positionMapping.ts +114 -0
  60. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +2 -2
  61. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +9 -13
  62. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +5 -9
  63. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +19 -31
  64. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +10 -8
  65. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +9 -13
  66. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +1 -1
  67. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +5 -9
  68. package/src/blocks/defaultBlockHelpers.ts +1 -1
  69. package/src/editor/BlockNoteEditor.test.ts +1 -1
  70. package/src/editor/BlockNoteEditor.ts +259 -130
  71. package/src/editor/BlockNoteTipTapEditor.ts +91 -8
  72. package/src/extensions/Comments/CommentsPlugin.ts +32 -34
  73. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +4 -8
  74. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +12 -13
  75. package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +1 -3
  76. package/src/extensions/SideMenu/MultipleNodeSelection.ts +3 -1
  77. package/src/extensions/SideMenu/dragging.ts +1 -1
  78. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +38 -25
  79. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +8 -8
  80. package/src/extensions/TableHandles/TableHandlesPlugin.ts +150 -136
  81. package/src/i18n/locales/de.ts +10 -10
  82. package/src/index.ts +4 -3
  83. package/src/schema/inlineContent/createSpec.ts +1 -5
  84. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +2 -2
  85. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -8
  86. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +9 -10
  87. package/types/src/api/blockManipulation/getBlock/getBlock.d.ts +7 -7
  88. package/types/src/api/blockManipulation/insertContentAt.d.ts +5 -3
  89. package/types/src/api/blockManipulation/selections/selection.d.ts +3 -3
  90. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -5
  91. package/types/src/api/getBlockInfoFromPos.d.ts +8 -1
  92. package/types/src/api/nodeConversions/blockToNode.d.ts +3 -3
  93. package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +1 -2
  94. package/types/src/api/nodeConversions/nodeToBlock.d.ts +2 -2
  95. package/types/src/api/nodeUtil.d.ts +67 -1
  96. package/types/src/api/parsers/html/parseHTML.d.ts +1 -1
  97. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -1
  98. package/types/src/api/pmUtil.d.ts +12 -0
  99. package/types/src/api/positionMapping.d.ts +25 -0
  100. package/types/src/editor/BlockNoteEditor.d.ts +72 -10
  101. package/types/src/editor/BlockNoteTipTapEditor.d.ts +15 -2
  102. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
  103. package/types/src/index.d.ts +1 -2
  104. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +0 -1859
  105. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +0 -40
  106. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +0 -20
  107. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +0 -138
  108. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +0 -138
  109. package/src/api/clipboard/__snapshots__/external/pasteImage.html +0 -153
  110. package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +0 -138
  111. package/src/api/clipboard/__snapshots__/external/pasteTable.html +0 -233
  112. package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +0 -216
  113. package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +0 -1
  114. package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +0 -1
  115. package/src/api/clipboard/__snapshots__/internal/childToParent.html +0 -1
  116. package/src/api/clipboard/__snapshots__/internal/childrenToNextParent.html +0 -1
  117. package/src/api/clipboard/__snapshots__/internal/childrenToNextParentsChildren.html +0 -1
  118. package/src/api/clipboard/__snapshots__/internal/image.html +0 -1
  119. package/src/api/clipboard/__snapshots__/internal/multipleChildren.html +0 -1
  120. package/src/api/clipboard/__snapshots__/internal/multipleStyledText.html +0 -1
  121. package/src/api/clipboard/__snapshots__/internal/nestedImage.html +0 -1
  122. package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +0 -1
  123. package/src/api/clipboard/__snapshots__/internal/partialChildToParent.html +0 -1
  124. package/src/api/clipboard/__snapshots__/internal/styledText.html +0 -1
  125. package/src/api/clipboard/__snapshots__/internal/tableAllCells.html +0 -1
  126. package/src/api/clipboard/__snapshots__/internal/tableCell.html +0 -1
  127. package/src/api/clipboard/__snapshots__/internal/tableCellText.html +0 -1
  128. package/src/api/clipboard/__snapshots__/internal/tableRow.html +0 -1
  129. package/src/api/clipboard/__snapshots__/internal/unstyledText.html +0 -1
  130. package/src/api/clipboard/clipboardExternal.test.ts +0 -161
  131. package/src/api/clipboard/clipboardInternal.test.ts +0 -435
  132. package/src/api/clipboard/testUtil.ts +0 -27
  133. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +0 -1
  134. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +0 -3
  135. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +0 -1
  136. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +0 -1
  137. package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +0 -1
  138. package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +0 -1
  139. package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +0 -1
  140. package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +0 -1
  141. package/src/api/exporters/html/__snapshots__/complex/misc/external.html +0 -1
  142. package/src/api/exporters/html/__snapshots__/complex/misc/internal.html +0 -1
  143. package/src/api/exporters/html/__snapshots__/customBlock/basic/external.html +0 -1
  144. package/src/api/exporters/html/__snapshots__/customBlock/basic/internal.html +0 -1
  145. package/src/api/exporters/html/__snapshots__/customParagraph/basic/external.html +0 -1
  146. package/src/api/exporters/html/__snapshots__/customParagraph/basic/internal.html +0 -1
  147. package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/external.html +0 -1
  148. package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/internal.html +0 -1
  149. package/src/api/exporters/html/__snapshots__/customParagraph/nested/external.html +0 -1
  150. package/src/api/exporters/html/__snapshots__/customParagraph/nested/internal.html +0 -1
  151. package/src/api/exporters/html/__snapshots__/customParagraph/styled/external.html +0 -1
  152. package/src/api/exporters/html/__snapshots__/customParagraph/styled/internal.html +0 -1
  153. package/src/api/exporters/html/__snapshots__/file/basic/external.html +0 -1
  154. package/src/api/exporters/html/__snapshots__/file/basic/internal.html +0 -1
  155. package/src/api/exporters/html/__snapshots__/file/button/external.html +0 -1
  156. package/src/api/exporters/html/__snapshots__/file/button/internal.html +0 -1
  157. package/src/api/exporters/html/__snapshots__/file/nested/external.html +0 -1
  158. package/src/api/exporters/html/__snapshots__/file/nested/internal.html +0 -1
  159. package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +0 -1
  160. package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +0 -1
  161. package/src/api/exporters/html/__snapshots__/file/noName/external.html +0 -1
  162. package/src/api/exporters/html/__snapshots__/file/noName/internal.html +0 -1
  163. package/src/api/exporters/html/__snapshots__/fontSize/basic/external.html +0 -1
  164. package/src/api/exporters/html/__snapshots__/fontSize/basic/internal.html +0 -1
  165. package/src/api/exporters/html/__snapshots__/hardbreak/basic/external.html +0 -1
  166. package/src/api/exporters/html/__snapshots__/hardbreak/basic/internal.html +0 -1
  167. package/src/api/exporters/html/__snapshots__/hardbreak/between-links/external.html +0 -1
  168. package/src/api/exporters/html/__snapshots__/hardbreak/between-links/internal.html +0 -1
  169. package/src/api/exporters/html/__snapshots__/hardbreak/end/external.html +0 -1
  170. package/src/api/exporters/html/__snapshots__/hardbreak/end/internal.html +0 -1
  171. package/src/api/exporters/html/__snapshots__/hardbreak/link/external.html +0 -1
  172. package/src/api/exporters/html/__snapshots__/hardbreak/link/internal.html +0 -1
  173. package/src/api/exporters/html/__snapshots__/hardbreak/multiple/external.html +0 -1
  174. package/src/api/exporters/html/__snapshots__/hardbreak/multiple/internal.html +0 -1
  175. package/src/api/exporters/html/__snapshots__/hardbreak/only/external.html +0 -1
  176. package/src/api/exporters/html/__snapshots__/hardbreak/only/internal.html +0 -1
  177. package/src/api/exporters/html/__snapshots__/hardbreak/start/external.html +0 -1
  178. package/src/api/exporters/html/__snapshots__/hardbreak/start/internal.html +0 -1
  179. package/src/api/exporters/html/__snapshots__/hardbreak/styles/external.html +0 -1
  180. package/src/api/exporters/html/__snapshots__/hardbreak/styles/internal.html +0 -1
  181. package/src/api/exporters/html/__snapshots__/image/basic/external.html +0 -1
  182. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +0 -1
  183. package/src/api/exporters/html/__snapshots__/image/button/external.html +0 -1
  184. package/src/api/exporters/html/__snapshots__/image/button/internal.html +0 -1
  185. package/src/api/exporters/html/__snapshots__/image/nested/external.html +0 -1
  186. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +0 -1
  187. package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +0 -1
  188. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +0 -1
  189. package/src/api/exporters/html/__snapshots__/image/noName/external.html +0 -1
  190. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +0 -1
  191. package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +0 -1
  192. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +0 -1
  193. package/src/api/exporters/html/__snapshots__/link/adjacent/external.html +0 -1
  194. package/src/api/exporters/html/__snapshots__/link/adjacent/internal.html +0 -1
  195. package/src/api/exporters/html/__snapshots__/link/basic/external.html +0 -1
  196. package/src/api/exporters/html/__snapshots__/link/basic/internal.html +0 -1
  197. package/src/api/exporters/html/__snapshots__/link/styled/external.html +0 -1
  198. package/src/api/exporters/html/__snapshots__/link/styled/internal.html +0 -1
  199. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +0 -1
  200. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +0 -1
  201. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +0 -1
  202. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +0 -1
  203. package/src/api/exporters/html/__snapshots__/mention/basic/external.html +0 -1
  204. package/src/api/exporters/html/__snapshots__/mention/basic/internal.html +0 -1
  205. package/src/api/exporters/html/__snapshots__/pageBreak/basic/external.html +0 -1
  206. package/src/api/exporters/html/__snapshots__/pageBreak/basic/internal.html +0 -1
  207. package/src/api/exporters/html/__snapshots__/paragraph/basic/external.html +0 -1
  208. package/src/api/exporters/html/__snapshots__/paragraph/basic/internal.html +0 -1
  209. package/src/api/exporters/html/__snapshots__/paragraph/empty/external.html +0 -1
  210. package/src/api/exporters/html/__snapshots__/paragraph/empty/internal.html +0 -1
  211. package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/external.html +0 -1
  212. package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/internal.html +0 -1
  213. package/src/api/exporters/html/__snapshots__/paragraph/nested/external.html +0 -1
  214. package/src/api/exporters/html/__snapshots__/paragraph/nested/internal.html +0 -1
  215. package/src/api/exporters/html/__snapshots__/paragraph/styled/external.html +0 -1
  216. package/src/api/exporters/html/__snapshots__/paragraph/styled/internal.html +0 -1
  217. package/src/api/exporters/html/__snapshots__/paste/parse-basic-block-types.json +0 -140
  218. package/src/api/exporters/html/__snapshots__/paste/parse-deep-nested-content.json +0 -240
  219. package/src/api/exporters/html/__snapshots__/paste/parse-div-with-inline-content.json +0 -91
  220. package/src/api/exporters/html/__snapshots__/paste/parse-divs.json +0 -19
  221. package/src/api/exporters/html/__snapshots__/paste/parse-fake-image-caption.json +0 -31
  222. package/src/api/exporters/html/__snapshots__/paste/parse-mixed-nested-lists.json +0 -70
  223. package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +0 -70
  224. package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists.json +0 -70
  225. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/external.html +0 -1
  226. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/internal.html +0 -1
  227. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/external.html +0 -1
  228. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/internal.html +0 -1
  229. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/external.html +0 -1
  230. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/internal.html +0 -1
  231. package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +0 -1
  232. package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +0 -1
  233. package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +0 -1
  234. package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +0 -1
  235. package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +0 -1
  236. package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +0 -1
  237. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +0 -1
  238. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +0 -1
  239. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +0 -1
  240. package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +0 -1
  241. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +0 -1
  242. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +0 -1
  243. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +0 -1
  244. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +0 -1
  245. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +0 -1
  246. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +0 -1
  247. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +0 -1
  248. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +0 -1
  249. package/src/api/exporters/html/__snapshots__/small/basic/external.html +0 -1
  250. package/src/api/exporters/html/__snapshots__/small/basic/internal.html +0 -1
  251. package/src/api/exporters/html/__snapshots__/table/allColWidths/external.html +0 -1
  252. package/src/api/exporters/html/__snapshots__/table/allColWidths/internal.html +0 -1
  253. package/src/api/exporters/html/__snapshots__/table/basic/external.html +0 -1
  254. package/src/api/exporters/html/__snapshots__/table/basic/internal.html +0 -1
  255. package/src/api/exporters/html/__snapshots__/table/headerCols/external.html +0 -1
  256. package/src/api/exporters/html/__snapshots__/table/headerCols/internal.html +0 -1
  257. package/src/api/exporters/html/__snapshots__/table/headerRows/external.html +0 -1
  258. package/src/api/exporters/html/__snapshots__/table/headerRows/internal.html +0 -1
  259. package/src/api/exporters/html/__snapshots__/table/headersRows/external.html +0 -1
  260. package/src/api/exporters/html/__snapshots__/table/headersRows/internal.html +0 -1
  261. package/src/api/exporters/html/__snapshots__/table/mixedCellColors/external.html +0 -1
  262. package/src/api/exporters/html/__snapshots__/table/mixedCellColors/internal.html +0 -1
  263. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/external.html +0 -1
  264. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/internal.html +0 -1
  265. package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/external.html +0 -1
  266. package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/internal.html +0 -1
  267. package/src/api/exporters/html/__snapshots__/tag/basic/external.html +0 -1
  268. package/src/api/exporters/html/__snapshots__/tag/basic/internal.html +0 -1
  269. package/src/api/exporters/html/htmlConversion.test.ts +0 -110
  270. package/src/api/exporters/markdown/__snapshots__/codeBlock/contains-newlines/markdown.md +0 -4
  271. package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +0 -3
  272. package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +0 -2
  273. package/src/api/exporters/markdown/__snapshots__/codeBlock/python/markdown.md +0 -3
  274. package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +0 -5
  275. package/src/api/exporters/markdown/__snapshots__/customBlock/basic/markdown.md +0 -5
  276. package/src/api/exporters/markdown/__snapshots__/customParagraph/basic/markdown.md +0 -1
  277. package/src/api/exporters/markdown/__snapshots__/customParagraph/lineBreaks/markdown.md +0 -1
  278. package/src/api/exporters/markdown/__snapshots__/customParagraph/nested/markdown.md +0 -5
  279. package/src/api/exporters/markdown/__snapshots__/customParagraph/styled/markdown.md +0 -1
  280. package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +0 -3
  281. package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +0 -1
  282. package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +0 -7
  283. package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +0 -1
  284. package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +0 -3
  285. package/src/api/exporters/markdown/__snapshots__/fontSize/basic/markdown.md +0 -1
  286. package/src/api/exporters/markdown/__snapshots__/hardbreak/basic/markdown.md +0 -2
  287. package/src/api/exporters/markdown/__snapshots__/hardbreak/between-links/markdown.md +0 -2
  288. package/src/api/exporters/markdown/__snapshots__/hardbreak/end/markdown.md +0 -1
  289. package/src/api/exporters/markdown/__snapshots__/hardbreak/link/markdown.md +0 -2
  290. package/src/api/exporters/markdown/__snapshots__/hardbreak/multiple/markdown.md +0 -3
  291. package/src/api/exporters/markdown/__snapshots__/hardbreak/only/markdown.md +0 -0
  292. package/src/api/exporters/markdown/__snapshots__/hardbreak/start/markdown.md +0 -1
  293. package/src/api/exporters/markdown/__snapshots__/hardbreak/styles/markdown.md +0 -2
  294. package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +0 -3
  295. package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +0 -1
  296. package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +0 -7
  297. package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +0 -1
  298. package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +0 -3
  299. package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +0 -3
  300. package/src/api/exporters/markdown/__snapshots__/link/adjacent/markdown.md +0 -1
  301. package/src/api/exporters/markdown/__snapshots__/link/basic/markdown.md +0 -1
  302. package/src/api/exporters/markdown/__snapshots__/link/styled/markdown.md +0 -1
  303. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +0 -10
  304. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +0 -10
  305. package/src/api/exporters/markdown/__snapshots__/mention/basic/markdown.md +0 -1
  306. package/src/api/exporters/markdown/__snapshots__/pageBreak/basic/markdown.md +0 -0
  307. package/src/api/exporters/markdown/__snapshots__/paragraph/basic/markdown.md +0 -1
  308. package/src/api/exporters/markdown/__snapshots__/paragraph/empty/markdown.md +0 -0
  309. package/src/api/exporters/markdown/__snapshots__/paragraph/lineBreaks/markdown.md +0 -2
  310. package/src/api/exporters/markdown/__snapshots__/paragraph/nested/markdown.md +0 -5
  311. package/src/api/exporters/markdown/__snapshots__/paragraph/styled/markdown.md +0 -1
  312. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/basic/markdown.md +0 -1
  313. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/nested/markdown.md +0 -5
  314. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/styled/markdown.md +0 -1
  315. package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +0 -3
  316. package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +0 -1
  317. package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +0 -7
  318. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +0 -3
  319. package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +0 -1
  320. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +0 -7
  321. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +0 -1
  322. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +0 -3
  323. package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +0 -3
  324. package/src/api/exporters/markdown/__snapshots__/small/basic/markdown.md +0 -1
  325. package/src/api/exporters/markdown/__snapshots__/table/allColWidths/markdown.md +0 -5
  326. package/src/api/exporters/markdown/__snapshots__/table/basic/markdown.md +0 -5
  327. package/src/api/exporters/markdown/__snapshots__/table/headerCols/markdown.md +0 -4
  328. package/src/api/exporters/markdown/__snapshots__/table/headerRows/markdown.md +0 -4
  329. package/src/api/exporters/markdown/__snapshots__/table/mixedCellColors/markdown.md +0 -5
  330. package/src/api/exporters/markdown/__snapshots__/table/mixedColWidths/markdown.md +0 -5
  331. package/src/api/exporters/markdown/__snapshots__/table/mixedRowspansAndColspans/markdown.md +0 -5
  332. package/src/api/exporters/markdown/__snapshots__/tag/basic/markdown.md +0 -1
  333. package/src/api/exporters/markdown/markdownExporter.test.ts +0 -86
  334. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +0 -3473
  335. package/src/api/nodeConversions/nodeConversions.test.ts +0 -83
  336. package/src/api/parsers/html/__snapshots__/list-test.json +0 -177
  337. package/src/api/parsers/html/__snapshots__/parse-2-tables.json +0 -129
  338. package/src/api/parsers/html/__snapshots__/parse-basic-block-types.json +0 -142
  339. package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +0 -62
  340. package/src/api/parsers/html/__snapshots__/parse-div-with-inline-content.json +0 -91
  341. package/src/api/parsers/html/__snapshots__/parse-divs.json +0 -121
  342. package/src/api/parsers/html/__snapshots__/parse-fake-image-caption.json +0 -33
  343. package/src/api/parsers/html/__snapshots__/parse-image-in-paragraph.json +0 -16
  344. package/src/api/parsers/html/__snapshots__/parse-mixed-nested-lists.json +0 -265
  345. package/src/api/parsers/html/__snapshots__/parse-nested-lists-with-paragraphs.json +0 -265
  346. package/src/api/parsers/html/__snapshots__/parse-nested-lists.json +0 -265
  347. package/src/api/parsers/html/__snapshots__/parse-notion-html.json +0 -565
  348. package/src/api/parsers/html/__snapshots__/parse-two-divs.json +0 -36
  349. package/src/api/parsers/html/parseHTML.test.ts +0 -563
  350. package/src/api/parsers/markdown/__snapshots__/complex.json +0 -353
  351. package/src/api/parsers/markdown/__snapshots__/issue-226-1.json +0 -71
  352. package/src/api/parsers/markdown/__snapshots__/issue-226-2.json +0 -144
  353. package/src/api/parsers/markdown/__snapshots__/nested.json +0 -72
  354. package/src/api/parsers/markdown/__snapshots__/non-nested.json +0 -71
  355. package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +0 -319
  356. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +0 -81
  357. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-2.json +0 -165
  358. package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +0 -81
  359. package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +0 -81
  360. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +0 -61
  361. package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +0 -42
  362. package/src/api/parsers/markdown/__snapshots__/styled.json +0 -58
  363. package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +0 -19
  364. package/src/api/parsers/markdown/parseMarkdown.test.ts +0 -135
  365. package/src/api/testUtil/cases/customBlocks.ts +0 -342
  366. package/src/api/testUtil/cases/customInlineContent.ts +0 -113
  367. package/src/api/testUtil/cases/customStyles.ts +0 -102
  368. package/src/api/testUtil/cases/defaultSchema.ts +0 -1493
  369. package/src/api/testUtil/index.ts +0 -19
  370. package/src/api/testUtil/partialBlockTestUtil.ts +0 -198
  371. package/src/api/testUtil/paste.ts +0 -46
  372. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -4
  373. package/types/src/api/clipboard/clipboardInternal.test.d.ts +0 -1
  374. package/types/src/api/clipboard/testUtil.d.ts +0 -541
  375. package/types/src/api/exporters/html/htmlConversion.test.d.ts +0 -1
  376. package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +0 -1
  377. package/types/src/api/nodeConversions/nodeConversions.test.d.ts +0 -1
  378. package/types/src/api/parsers/html/parseHTML.test.d.ts +0 -1
  379. package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +0 -1
  380. package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -670
  381. package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -558
  382. package/types/src/api/testUtil/cases/customStyles.d.ts +0 -552
  383. package/types/src/api/testUtil/cases/defaultSchema.d.ts +0 -4
  384. package/types/src/api/testUtil/index.d.ts +0 -14
  385. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +0 -9
  386. package/types/src/api/testUtil/paste.d.ts +0 -2
  387. /package/types/src/api/{blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts → nodeUtil.test.d.ts} +0 -0
  388. /package/types/src/api/{clipboard/clipboardExternal.test.d.ts → positionMapping.test.d.ts} +0 -0
@@ -1,3473 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert customParagraph/basic to/from prosemirror 1`] = `
4
- {
5
- "attrs": {
6
- "backgroundColor": "default",
7
- "id": "1",
8
- "textColor": "default",
9
- },
10
- "content": [
11
- {
12
- "attrs": {
13
- "textAlignment": "left",
14
- },
15
- "content": [
16
- {
17
- "text": "Custom Paragraph",
18
- "type": "text",
19
- },
20
- ],
21
- "type": "customParagraph",
22
- },
23
- ],
24
- "type": "blockContainer",
25
- }
26
- `;
27
-
28
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert customParagraph/lineBreaks to/from prosemirror 1`] = `
29
- {
30
- "attrs": {
31
- "backgroundColor": "default",
32
- "id": "1",
33
- "textColor": "default",
34
- },
35
- "content": [
36
- {
37
- "attrs": {
38
- "textAlignment": "left",
39
- },
40
- "content": [
41
- {
42
- "text": "Line 1",
43
- "type": "text",
44
- },
45
- {
46
- "type": "hardBreak",
47
- },
48
- {
49
- "text": "Line 2",
50
- "type": "text",
51
- },
52
- ],
53
- "type": "customParagraph",
54
- },
55
- ],
56
- "type": "blockContainer",
57
- }
58
- `;
59
-
60
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert customParagraph/nested to/from prosemirror 1`] = `
61
- {
62
- "attrs": {
63
- "backgroundColor": "default",
64
- "id": "1",
65
- "textColor": "default",
66
- },
67
- "content": [
68
- {
69
- "attrs": {
70
- "textAlignment": "left",
71
- },
72
- "content": [
73
- {
74
- "text": "Custom Paragraph",
75
- "type": "text",
76
- },
77
- ],
78
- "type": "customParagraph",
79
- },
80
- {
81
- "content": [
82
- {
83
- "attrs": {
84
- "backgroundColor": "default",
85
- "id": "2",
86
- "textColor": "default",
87
- },
88
- "content": [
89
- {
90
- "attrs": {
91
- "textAlignment": "left",
92
- },
93
- "content": [
94
- {
95
- "text": "Nested Custom Paragraph 1",
96
- "type": "text",
97
- },
98
- ],
99
- "type": "customParagraph",
100
- },
101
- ],
102
- "type": "blockContainer",
103
- },
104
- {
105
- "attrs": {
106
- "backgroundColor": "default",
107
- "id": "3",
108
- "textColor": "default",
109
- },
110
- "content": [
111
- {
112
- "attrs": {
113
- "textAlignment": "left",
114
- },
115
- "content": [
116
- {
117
- "text": "Nested Custom Paragraph 2",
118
- "type": "text",
119
- },
120
- ],
121
- "type": "customParagraph",
122
- },
123
- ],
124
- "type": "blockContainer",
125
- },
126
- ],
127
- "type": "blockGroup",
128
- },
129
- ],
130
- "type": "blockContainer",
131
- }
132
- `;
133
-
134
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert customParagraph/styled to/from prosemirror 1`] = `
135
- {
136
- "attrs": {
137
- "backgroundColor": "pink",
138
- "id": "1",
139
- "textColor": "orange",
140
- },
141
- "content": [
142
- {
143
- "attrs": {
144
- "textAlignment": "center",
145
- },
146
- "content": [
147
- {
148
- "text": "Plain ",
149
- "type": "text",
150
- },
151
- {
152
- "marks": [
153
- {
154
- "attrs": {
155
- "stringValue": "red",
156
- },
157
- "type": "textColor",
158
- },
159
- ],
160
- "text": "Red Text ",
161
- "type": "text",
162
- },
163
- {
164
- "marks": [
165
- {
166
- "attrs": {
167
- "stringValue": "blue",
168
- },
169
- "type": "backgroundColor",
170
- },
171
- ],
172
- "text": "Blue Background ",
173
- "type": "text",
174
- },
175
- {
176
- "marks": [
177
- {
178
- "attrs": {
179
- "stringValue": "red",
180
- },
181
- "type": "textColor",
182
- },
183
- {
184
- "attrs": {
185
- "stringValue": "blue",
186
- },
187
- "type": "backgroundColor",
188
- },
189
- ],
190
- "text": "Mixed Colors",
191
- "type": "text",
192
- },
193
- ],
194
- "type": "customParagraph",
195
- },
196
- ],
197
- "type": "blockContainer",
198
- }
199
- `;
200
-
201
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleCustomParagraph/basic to/from prosemirror 1`] = `
202
- {
203
- "attrs": {
204
- "backgroundColor": "default",
205
- "id": "1",
206
- "textColor": "default",
207
- },
208
- "content": [
209
- {
210
- "attrs": {
211
- "textAlignment": "left",
212
- },
213
- "content": [
214
- {
215
- "text": "Custom Paragraph",
216
- "type": "text",
217
- },
218
- ],
219
- "type": "simpleCustomParagraph",
220
- },
221
- ],
222
- "type": "blockContainer",
223
- }
224
- `;
225
-
226
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleCustomParagraph/nested to/from prosemirror 1`] = `
227
- {
228
- "attrs": {
229
- "backgroundColor": "default",
230
- "id": "1",
231
- "textColor": "default",
232
- },
233
- "content": [
234
- {
235
- "attrs": {
236
- "textAlignment": "left",
237
- },
238
- "content": [
239
- {
240
- "text": "Custom Paragraph",
241
- "type": "text",
242
- },
243
- ],
244
- "type": "simpleCustomParagraph",
245
- },
246
- {
247
- "content": [
248
- {
249
- "attrs": {
250
- "backgroundColor": "default",
251
- "id": "2",
252
- "textColor": "default",
253
- },
254
- "content": [
255
- {
256
- "attrs": {
257
- "textAlignment": "left",
258
- },
259
- "content": [
260
- {
261
- "text": "Nested Custom Paragraph 1",
262
- "type": "text",
263
- },
264
- ],
265
- "type": "simpleCustomParagraph",
266
- },
267
- ],
268
- "type": "blockContainer",
269
- },
270
- {
271
- "attrs": {
272
- "backgroundColor": "default",
273
- "id": "3",
274
- "textColor": "default",
275
- },
276
- "content": [
277
- {
278
- "attrs": {
279
- "textAlignment": "left",
280
- },
281
- "content": [
282
- {
283
- "text": "Nested Custom Paragraph 2",
284
- "type": "text",
285
- },
286
- ],
287
- "type": "simpleCustomParagraph",
288
- },
289
- ],
290
- "type": "blockContainer",
291
- },
292
- ],
293
- "type": "blockGroup",
294
- },
295
- ],
296
- "type": "blockContainer",
297
- }
298
- `;
299
-
300
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleCustomParagraph/styled to/from prosemirror 1`] = `
301
- {
302
- "attrs": {
303
- "backgroundColor": "pink",
304
- "id": "1",
305
- "textColor": "orange",
306
- },
307
- "content": [
308
- {
309
- "attrs": {
310
- "textAlignment": "center",
311
- },
312
- "content": [
313
- {
314
- "text": "Plain ",
315
- "type": "text",
316
- },
317
- {
318
- "marks": [
319
- {
320
- "attrs": {
321
- "stringValue": "red",
322
- },
323
- "type": "textColor",
324
- },
325
- ],
326
- "text": "Red Text ",
327
- "type": "text",
328
- },
329
- {
330
- "marks": [
331
- {
332
- "attrs": {
333
- "stringValue": "blue",
334
- },
335
- "type": "backgroundColor",
336
- },
337
- ],
338
- "text": "Blue Background ",
339
- "type": "text",
340
- },
341
- {
342
- "marks": [
343
- {
344
- "attrs": {
345
- "stringValue": "red",
346
- },
347
- "type": "textColor",
348
- },
349
- {
350
- "attrs": {
351
- "stringValue": "blue",
352
- },
353
- "type": "backgroundColor",
354
- },
355
- ],
356
- "text": "Mixed Colors",
357
- "type": "text",
358
- },
359
- ],
360
- "type": "simpleCustomParagraph",
361
- },
362
- ],
363
- "type": "blockContainer",
364
- }
365
- `;
366
-
367
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/basic to/from prosemirror 1`] = `
368
- {
369
- "attrs": {
370
- "backgroundColor": "default",
371
- "id": "1",
372
- "textColor": "default",
373
- },
374
- "content": [
375
- {
376
- "attrs": {
377
- "caption": "Caption",
378
- "name": "example",
379
- "previewWidth": 256,
380
- "showPreview": true,
381
- "textAlignment": "left",
382
- "url": "exampleURL",
383
- },
384
- "type": "simpleImage",
385
- },
386
- ],
387
- "type": "blockContainer",
388
- }
389
- `;
390
-
391
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/button to/from prosemirror 1`] = `
392
- {
393
- "attrs": {
394
- "backgroundColor": "default",
395
- "id": "1",
396
- "textColor": "default",
397
- },
398
- "content": [
399
- {
400
- "attrs": {
401
- "caption": "",
402
- "name": "",
403
- "previewWidth": 512,
404
- "showPreview": true,
405
- "textAlignment": "left",
406
- "url": "",
407
- },
408
- "type": "simpleImage",
409
- },
410
- ],
411
- "type": "blockContainer",
412
- }
413
- `;
414
-
415
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/nested to/from prosemirror 1`] = `
416
- {
417
- "attrs": {
418
- "backgroundColor": "default",
419
- "id": "1",
420
- "textColor": "default",
421
- },
422
- "content": [
423
- {
424
- "attrs": {
425
- "caption": "Caption",
426
- "name": "example",
427
- "previewWidth": 256,
428
- "showPreview": true,
429
- "textAlignment": "left",
430
- "url": "exampleURL",
431
- },
432
- "type": "simpleImage",
433
- },
434
- {
435
- "content": [
436
- {
437
- "attrs": {
438
- "backgroundColor": "default",
439
- "id": "2",
440
- "textColor": "default",
441
- },
442
- "content": [
443
- {
444
- "attrs": {
445
- "caption": "Caption",
446
- "name": "example",
447
- "previewWidth": 256,
448
- "showPreview": true,
449
- "textAlignment": "left",
450
- "url": "exampleURL",
451
- },
452
- "type": "simpleImage",
453
- },
454
- ],
455
- "type": "blockContainer",
456
- },
457
- ],
458
- "type": "blockGroup",
459
- },
460
- ],
461
- "type": "blockContainer",
462
- }
463
- `;
464
-
465
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/noCaption to/from prosemirror 1`] = `
466
- {
467
- "attrs": {
468
- "backgroundColor": "default",
469
- "id": "1",
470
- "textColor": "default",
471
- },
472
- "content": [
473
- {
474
- "attrs": {
475
- "caption": "",
476
- "name": "example",
477
- "previewWidth": 256,
478
- "showPreview": true,
479
- "textAlignment": "left",
480
- "url": "exampleURL",
481
- },
482
- "type": "simpleImage",
483
- },
484
- ],
485
- "type": "blockContainer",
486
- }
487
- `;
488
-
489
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/noName to/from prosemirror 1`] = `
490
- {
491
- "attrs": {
492
- "backgroundColor": "default",
493
- "id": "1",
494
- "textColor": "default",
495
- },
496
- "content": [
497
- {
498
- "attrs": {
499
- "caption": "Caption",
500
- "name": "",
501
- "previewWidth": 256,
502
- "showPreview": true,
503
- "textAlignment": "left",
504
- "url": "exampleURL",
505
- },
506
- "type": "simpleImage",
507
- },
508
- ],
509
- "type": "blockContainer",
510
- }
511
- `;
512
-
513
- exports[`Test BlockNote-Prosemirror conversion > Case: custom blocks schema > Convert simpleImage/noPreview to/from prosemirror 1`] = `
514
- {
515
- "attrs": {
516
- "backgroundColor": "default",
517
- "id": "1",
518
- "textColor": "default",
519
- },
520
- "content": [
521
- {
522
- "attrs": {
523
- "caption": "Caption",
524
- "name": "example",
525
- "previewWidth": 256,
526
- "showPreview": false,
527
- "textAlignment": "left",
528
- "url": "exampleURL",
529
- },
530
- "type": "simpleImage",
531
- },
532
- ],
533
- "type": "blockContainer",
534
- }
535
- `;
536
-
537
- exports[`Test BlockNote-Prosemirror conversion > Case: custom inline content schema > Convert mention/basic to/from prosemirror 1`] = `
538
- {
539
- "attrs": {
540
- "backgroundColor": "default",
541
- "id": "1",
542
- "textColor": "default",
543
- },
544
- "content": [
545
- {
546
- "attrs": {
547
- "textAlignment": "left",
548
- },
549
- "content": [
550
- {
551
- "text": "I enjoy working with ",
552
- "type": "text",
553
- },
554
- {
555
- "attrs": {
556
- "user": "Matthew",
557
- },
558
- "type": "mention",
559
- },
560
- ],
561
- "type": "paragraph",
562
- },
563
- ],
564
- "type": "blockContainer",
565
- }
566
- `;
567
-
568
- exports[`Test BlockNote-Prosemirror conversion > Case: custom inline content schema > Convert tag/basic to/from prosemirror 1`] = `
569
- {
570
- "attrs": {
571
- "backgroundColor": "default",
572
- "id": "1",
573
- "textColor": "default",
574
- },
575
- "content": [
576
- {
577
- "attrs": {
578
- "textAlignment": "left",
579
- },
580
- "content": [
581
- {
582
- "text": "I love ",
583
- "type": "text",
584
- },
585
- {
586
- "content": [
587
- {
588
- "text": "BlockNote",
589
- "type": "text",
590
- },
591
- ],
592
- "type": "tag",
593
- },
594
- ],
595
- "type": "paragraph",
596
- },
597
- ],
598
- "type": "blockContainer",
599
- }
600
- `;
601
-
602
- exports[`Test BlockNote-Prosemirror conversion > Case: custom style schema > Convert fontSize/basic to/from prosemirror 1`] = `
603
- {
604
- "attrs": {
605
- "backgroundColor": "default",
606
- "id": "1",
607
- "textColor": "default",
608
- },
609
- "content": [
610
- {
611
- "attrs": {
612
- "textAlignment": "left",
613
- },
614
- "content": [
615
- {
616
- "marks": [
617
- {
618
- "attrs": {
619
- "stringValue": "18px",
620
- },
621
- "type": "fontSize",
622
- },
623
- ],
624
- "text": "This is text with a custom fontSize",
625
- "type": "text",
626
- },
627
- ],
628
- "type": "paragraph",
629
- },
630
- ],
631
- "type": "blockContainer",
632
- }
633
- `;
634
-
635
- exports[`Test BlockNote-Prosemirror conversion > Case: custom style schema > Convert small/basic to/from prosemirror 1`] = `
636
- {
637
- "attrs": {
638
- "backgroundColor": "default",
639
- "id": "1",
640
- "textColor": "default",
641
- },
642
- "content": [
643
- {
644
- "attrs": {
645
- "textAlignment": "left",
646
- },
647
- "content": [
648
- {
649
- "marks": [
650
- {
651
- "type": "small",
652
- },
653
- ],
654
- "text": "This is a small text",
655
- "type": "text",
656
- },
657
- ],
658
- "type": "paragraph",
659
- },
660
- ],
661
- "type": "blockContainer",
662
- }
663
- `;
664
-
665
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/contains-newlines to/from prosemirror 1`] = `
666
- {
667
- "attrs": {
668
- "backgroundColor": "default",
669
- "id": "1",
670
- "textColor": "default",
671
- },
672
- "content": [
673
- {
674
- "attrs": {
675
- "language": "javascript",
676
- },
677
- "content": [
678
- {
679
- "text": "const hello = 'world';
680
- console.log(hello);
681
- ",
682
- "type": "text",
683
- },
684
- ],
685
- "type": "codeBlock",
686
- },
687
- ],
688
- "type": "blockContainer",
689
- }
690
- `;
691
-
692
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/defaultLanguage to/from prosemirror 1`] = `
693
- {
694
- "attrs": {
695
- "backgroundColor": "default",
696
- "id": "1",
697
- "textColor": "default",
698
- },
699
- "content": [
700
- {
701
- "attrs": {
702
- "language": "text",
703
- },
704
- "content": [
705
- {
706
- "text": "console.log('Hello, world!');",
707
- "type": "text",
708
- },
709
- ],
710
- "type": "codeBlock",
711
- },
712
- ],
713
- "type": "blockContainer",
714
- }
715
- `;
716
-
717
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/empty to/from prosemirror 1`] = `
718
- {
719
- "attrs": {
720
- "backgroundColor": "default",
721
- "id": "1",
722
- "textColor": "default",
723
- },
724
- "content": [
725
- {
726
- "attrs": {
727
- "language": "text",
728
- },
729
- "type": "codeBlock",
730
- },
731
- ],
732
- "type": "blockContainer",
733
- }
734
- `;
735
-
736
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/python to/from prosemirror 1`] = `
737
- {
738
- "attrs": {
739
- "backgroundColor": "default",
740
- "id": "1",
741
- "textColor": "default",
742
- },
743
- "content": [
744
- {
745
- "attrs": {
746
- "language": "python",
747
- },
748
- "content": [
749
- {
750
- "text": "print('Hello, world!')",
751
- "type": "text",
752
- },
753
- ],
754
- "type": "codeBlock",
755
- },
756
- ],
757
- "type": "blockContainer",
758
- }
759
- `;
760
-
761
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert complex/misc to/from prosemirror 1`] = `
762
- {
763
- "attrs": {
764
- "backgroundColor": "blue",
765
- "id": "1",
766
- "textColor": "yellow",
767
- },
768
- "content": [
769
- {
770
- "attrs": {
771
- "level": 2,
772
- "textAlignment": "right",
773
- },
774
- "content": [
775
- {
776
- "marks": [
777
- {
778
- "type": "bold",
779
- },
780
- {
781
- "type": "underline",
782
- },
783
- ],
784
- "text": "Heading ",
785
- "type": "text",
786
- },
787
- {
788
- "marks": [
789
- {
790
- "type": "italic",
791
- },
792
- {
793
- "type": "strike",
794
- },
795
- ],
796
- "text": "2",
797
- "type": "text",
798
- },
799
- ],
800
- "type": "heading",
801
- },
802
- {
803
- "content": [
804
- {
805
- "attrs": {
806
- "backgroundColor": "red",
807
- "id": "2",
808
- "textColor": "default",
809
- },
810
- "content": [
811
- {
812
- "attrs": {
813
- "textAlignment": "left",
814
- },
815
- "content": [
816
- {
817
- "text": "Paragraph",
818
- "type": "text",
819
- },
820
- ],
821
- "type": "paragraph",
822
- },
823
- ],
824
- "type": "blockContainer",
825
- },
826
- {
827
- "attrs": {
828
- "backgroundColor": "default",
829
- "id": "3",
830
- "textColor": "default",
831
- },
832
- "content": [
833
- {
834
- "attrs": {
835
- "textAlignment": "left",
836
- },
837
- "type": "bulletListItem",
838
- },
839
- ],
840
- "type": "blockContainer",
841
- },
842
- ],
843
- "type": "blockGroup",
844
- },
845
- ],
846
- "type": "blockContainer",
847
- }
848
- `;
849
-
850
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/basic to/from prosemirror 1`] = `
851
- {
852
- "attrs": {
853
- "backgroundColor": "default",
854
- "id": "1",
855
- "textColor": "default",
856
- },
857
- "content": [
858
- {
859
- "attrs": {
860
- "caption": "Caption",
861
- "name": "example",
862
- "url": "exampleURL",
863
- },
864
- "type": "file",
865
- },
866
- ],
867
- "type": "blockContainer",
868
- }
869
- `;
870
-
871
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/button to/from prosemirror 1`] = `
872
- {
873
- "attrs": {
874
- "backgroundColor": "default",
875
- "id": "1",
876
- "textColor": "default",
877
- },
878
- "content": [
879
- {
880
- "attrs": {
881
- "caption": "",
882
- "name": "",
883
- "url": "",
884
- },
885
- "type": "file",
886
- },
887
- ],
888
- "type": "blockContainer",
889
- }
890
- `;
891
-
892
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/nested to/from prosemirror 1`] = `
893
- {
894
- "attrs": {
895
- "backgroundColor": "default",
896
- "id": "1",
897
- "textColor": "default",
898
- },
899
- "content": [
900
- {
901
- "attrs": {
902
- "caption": "Caption",
903
- "name": "example",
904
- "url": "exampleURL",
905
- },
906
- "type": "file",
907
- },
908
- {
909
- "content": [
910
- {
911
- "attrs": {
912
- "backgroundColor": "default",
913
- "id": "2",
914
- "textColor": "default",
915
- },
916
- "content": [
917
- {
918
- "attrs": {
919
- "caption": "Caption",
920
- "name": "example",
921
- "url": "exampleURL",
922
- },
923
- "type": "file",
924
- },
925
- ],
926
- "type": "blockContainer",
927
- },
928
- ],
929
- "type": "blockGroup",
930
- },
931
- ],
932
- "type": "blockContainer",
933
- }
934
- `;
935
-
936
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/noCaption to/from prosemirror 1`] = `
937
- {
938
- "attrs": {
939
- "backgroundColor": "default",
940
- "id": "1",
941
- "textColor": "default",
942
- },
943
- "content": [
944
- {
945
- "attrs": {
946
- "caption": "",
947
- "name": "example",
948
- "url": "exampleURL",
949
- },
950
- "type": "file",
951
- },
952
- ],
953
- "type": "blockContainer",
954
- }
955
- `;
956
-
957
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert file/noName to/from prosemirror 1`] = `
958
- {
959
- "attrs": {
960
- "backgroundColor": "default",
961
- "id": "1",
962
- "textColor": "default",
963
- },
964
- "content": [
965
- {
966
- "attrs": {
967
- "caption": "Caption",
968
- "name": "",
969
- "url": "exampleURL",
970
- },
971
- "type": "file",
972
- },
973
- ],
974
- "type": "blockContainer",
975
- }
976
- `;
977
-
978
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/basic to/from prosemirror 1`] = `
979
- {
980
- "attrs": {
981
- "backgroundColor": "default",
982
- "id": "1",
983
- "textColor": "default",
984
- },
985
- "content": [
986
- {
987
- "attrs": {
988
- "textAlignment": "left",
989
- },
990
- "content": [
991
- {
992
- "text": "Text1",
993
- "type": "text",
994
- },
995
- {
996
- "type": "hardBreak",
997
- },
998
- {
999
- "text": "Text2",
1000
- "type": "text",
1001
- },
1002
- ],
1003
- "type": "paragraph",
1004
- },
1005
- ],
1006
- "type": "blockContainer",
1007
- }
1008
- `;
1009
-
1010
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/between-links to/from prosemirror 1`] = `
1011
- {
1012
- "attrs": {
1013
- "backgroundColor": "default",
1014
- "id": "1",
1015
- "textColor": "default",
1016
- },
1017
- "content": [
1018
- {
1019
- "attrs": {
1020
- "textAlignment": "left",
1021
- },
1022
- "content": [
1023
- {
1024
- "marks": [
1025
- {
1026
- "attrs": {
1027
- "class": null,
1028
- "href": "https://www.website.com",
1029
- "rel": "noopener noreferrer nofollow",
1030
- "target": "_blank",
1031
- },
1032
- "type": "link",
1033
- },
1034
- ],
1035
- "text": "Link1",
1036
- "type": "text",
1037
- },
1038
- {
1039
- "type": "hardBreak",
1040
- },
1041
- {
1042
- "marks": [
1043
- {
1044
- "attrs": {
1045
- "class": null,
1046
- "href": "https://www.website2.com",
1047
- "rel": "noopener noreferrer nofollow",
1048
- "target": "_blank",
1049
- },
1050
- "type": "link",
1051
- },
1052
- ],
1053
- "text": "Link2",
1054
- "type": "text",
1055
- },
1056
- ],
1057
- "type": "paragraph",
1058
- },
1059
- ],
1060
- "type": "blockContainer",
1061
- }
1062
- `;
1063
-
1064
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/end to/from prosemirror 1`] = `
1065
- {
1066
- "attrs": {
1067
- "backgroundColor": "default",
1068
- "id": "1",
1069
- "textColor": "default",
1070
- },
1071
- "content": [
1072
- {
1073
- "attrs": {
1074
- "textAlignment": "left",
1075
- },
1076
- "content": [
1077
- {
1078
- "text": "Text1",
1079
- "type": "text",
1080
- },
1081
- {
1082
- "type": "hardBreak",
1083
- },
1084
- ],
1085
- "type": "paragraph",
1086
- },
1087
- ],
1088
- "type": "blockContainer",
1089
- }
1090
- `;
1091
-
1092
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/link to/from prosemirror 1`] = `
1093
- {
1094
- "attrs": {
1095
- "backgroundColor": "default",
1096
- "id": "1",
1097
- "textColor": "default",
1098
- },
1099
- "content": [
1100
- {
1101
- "attrs": {
1102
- "textAlignment": "left",
1103
- },
1104
- "content": [
1105
- {
1106
- "marks": [
1107
- {
1108
- "attrs": {
1109
- "class": null,
1110
- "href": "https://www.website.com",
1111
- "rel": "noopener noreferrer nofollow",
1112
- "target": "_blank",
1113
- },
1114
- "type": "link",
1115
- },
1116
- ],
1117
- "text": "Link1",
1118
- "type": "text",
1119
- },
1120
- {
1121
- "type": "hardBreak",
1122
- },
1123
- {
1124
- "marks": [
1125
- {
1126
- "attrs": {
1127
- "class": null,
1128
- "href": "https://www.website.com",
1129
- "rel": "noopener noreferrer nofollow",
1130
- "target": "_blank",
1131
- },
1132
- "type": "link",
1133
- },
1134
- ],
1135
- "text": "Link1",
1136
- "type": "text",
1137
- },
1138
- ],
1139
- "type": "paragraph",
1140
- },
1141
- ],
1142
- "type": "blockContainer",
1143
- }
1144
- `;
1145
-
1146
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/multiple to/from prosemirror 1`] = `
1147
- {
1148
- "attrs": {
1149
- "backgroundColor": "default",
1150
- "id": "1",
1151
- "textColor": "default",
1152
- },
1153
- "content": [
1154
- {
1155
- "attrs": {
1156
- "textAlignment": "left",
1157
- },
1158
- "content": [
1159
- {
1160
- "text": "Text1",
1161
- "type": "text",
1162
- },
1163
- {
1164
- "type": "hardBreak",
1165
- },
1166
- {
1167
- "text": "Text2",
1168
- "type": "text",
1169
- },
1170
- {
1171
- "type": "hardBreak",
1172
- },
1173
- {
1174
- "text": "Text3",
1175
- "type": "text",
1176
- },
1177
- ],
1178
- "type": "paragraph",
1179
- },
1180
- ],
1181
- "type": "blockContainer",
1182
- }
1183
- `;
1184
-
1185
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/only to/from prosemirror 1`] = `
1186
- {
1187
- "attrs": {
1188
- "backgroundColor": "default",
1189
- "id": "1",
1190
- "textColor": "default",
1191
- },
1192
- "content": [
1193
- {
1194
- "attrs": {
1195
- "textAlignment": "left",
1196
- },
1197
- "content": [
1198
- {
1199
- "type": "hardBreak",
1200
- },
1201
- ],
1202
- "type": "paragraph",
1203
- },
1204
- ],
1205
- "type": "blockContainer",
1206
- }
1207
- `;
1208
-
1209
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/start to/from prosemirror 1`] = `
1210
- {
1211
- "attrs": {
1212
- "backgroundColor": "default",
1213
- "id": "1",
1214
- "textColor": "default",
1215
- },
1216
- "content": [
1217
- {
1218
- "attrs": {
1219
- "textAlignment": "left",
1220
- },
1221
- "content": [
1222
- {
1223
- "type": "hardBreak",
1224
- },
1225
- {
1226
- "text": "Text1",
1227
- "type": "text",
1228
- },
1229
- ],
1230
- "type": "paragraph",
1231
- },
1232
- ],
1233
- "type": "blockContainer",
1234
- }
1235
- `;
1236
-
1237
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/styles to/from prosemirror 1`] = `
1238
- {
1239
- "attrs": {
1240
- "backgroundColor": "default",
1241
- "id": "1",
1242
- "textColor": "default",
1243
- },
1244
- "content": [
1245
- {
1246
- "attrs": {
1247
- "textAlignment": "left",
1248
- },
1249
- "content": [
1250
- {
1251
- "text": "Text1",
1252
- "type": "text",
1253
- },
1254
- {
1255
- "type": "hardBreak",
1256
- },
1257
- {
1258
- "marks": [
1259
- {
1260
- "type": "bold",
1261
- },
1262
- ],
1263
- "text": "Text2",
1264
- "type": "text",
1265
- },
1266
- ],
1267
- "type": "paragraph",
1268
- },
1269
- ],
1270
- "type": "blockContainer",
1271
- }
1272
- `;
1273
-
1274
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/basic to/from prosemirror 1`] = `
1275
- {
1276
- "attrs": {
1277
- "backgroundColor": "default",
1278
- "id": "1",
1279
- "textColor": "default",
1280
- },
1281
- "content": [
1282
- {
1283
- "attrs": {
1284
- "caption": "Caption",
1285
- "name": "example",
1286
- "previewWidth": 256,
1287
- "showPreview": true,
1288
- "textAlignment": "left",
1289
- "url": "exampleURL",
1290
- },
1291
- "type": "image",
1292
- },
1293
- ],
1294
- "type": "blockContainer",
1295
- }
1296
- `;
1297
-
1298
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/button to/from prosemirror 1`] = `
1299
- {
1300
- "attrs": {
1301
- "backgroundColor": "default",
1302
- "id": "1",
1303
- "textColor": "default",
1304
- },
1305
- "content": [
1306
- {
1307
- "attrs": {
1308
- "caption": "",
1309
- "name": "",
1310
- "previewWidth": 512,
1311
- "showPreview": true,
1312
- "textAlignment": "left",
1313
- "url": "",
1314
- },
1315
- "type": "image",
1316
- },
1317
- ],
1318
- "type": "blockContainer",
1319
- }
1320
- `;
1321
-
1322
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/nested to/from prosemirror 1`] = `
1323
- {
1324
- "attrs": {
1325
- "backgroundColor": "default",
1326
- "id": "1",
1327
- "textColor": "default",
1328
- },
1329
- "content": [
1330
- {
1331
- "attrs": {
1332
- "caption": "Caption",
1333
- "name": "",
1334
- "previewWidth": 256,
1335
- "showPreview": true,
1336
- "textAlignment": "left",
1337
- "url": "exampleURL",
1338
- },
1339
- "type": "image",
1340
- },
1341
- {
1342
- "content": [
1343
- {
1344
- "attrs": {
1345
- "backgroundColor": "default",
1346
- "id": "2",
1347
- "textColor": "default",
1348
- },
1349
- "content": [
1350
- {
1351
- "attrs": {
1352
- "caption": "Caption",
1353
- "name": "",
1354
- "previewWidth": 256,
1355
- "showPreview": true,
1356
- "textAlignment": "left",
1357
- "url": "exampleURL",
1358
- },
1359
- "type": "image",
1360
- },
1361
- ],
1362
- "type": "blockContainer",
1363
- },
1364
- ],
1365
- "type": "blockGroup",
1366
- },
1367
- ],
1368
- "type": "blockContainer",
1369
- }
1370
- `;
1371
-
1372
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noCaption to/from prosemirror 1`] = `
1373
- {
1374
- "attrs": {
1375
- "backgroundColor": "default",
1376
- "id": "1",
1377
- "textColor": "default",
1378
- },
1379
- "content": [
1380
- {
1381
- "attrs": {
1382
- "caption": "",
1383
- "name": "example",
1384
- "previewWidth": 256,
1385
- "showPreview": true,
1386
- "textAlignment": "left",
1387
- "url": "exampleURL",
1388
- },
1389
- "type": "image",
1390
- },
1391
- ],
1392
- "type": "blockContainer",
1393
- }
1394
- `;
1395
-
1396
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noName to/from prosemirror 1`] = `
1397
- {
1398
- "attrs": {
1399
- "backgroundColor": "default",
1400
- "id": "1",
1401
- "textColor": "default",
1402
- },
1403
- "content": [
1404
- {
1405
- "attrs": {
1406
- "caption": "Caption",
1407
- "name": "",
1408
- "previewWidth": 256,
1409
- "showPreview": true,
1410
- "textAlignment": "left",
1411
- "url": "exampleURL",
1412
- },
1413
- "type": "image",
1414
- },
1415
- ],
1416
- "type": "blockContainer",
1417
- }
1418
- `;
1419
-
1420
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/noPreview to/from prosemirror 1`] = `
1421
- {
1422
- "attrs": {
1423
- "backgroundColor": "default",
1424
- "id": "1",
1425
- "textColor": "default",
1426
- },
1427
- "content": [
1428
- {
1429
- "attrs": {
1430
- "caption": "Caption",
1431
- "name": "example",
1432
- "previewWidth": 256,
1433
- "showPreview": false,
1434
- "textAlignment": "left",
1435
- "url": "exampleURL",
1436
- },
1437
- "type": "image",
1438
- },
1439
- ],
1440
- "type": "blockContainer",
1441
- }
1442
- `;
1443
-
1444
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/adjacent to/from prosemirror 1`] = `
1445
- {
1446
- "attrs": {
1447
- "backgroundColor": "default",
1448
- "id": "1",
1449
- "textColor": "default",
1450
- },
1451
- "content": [
1452
- {
1453
- "attrs": {
1454
- "textAlignment": "left",
1455
- },
1456
- "content": [
1457
- {
1458
- "marks": [
1459
- {
1460
- "attrs": {
1461
- "class": null,
1462
- "href": "https://www.website.com",
1463
- "rel": "noopener noreferrer nofollow",
1464
- "target": "_blank",
1465
- },
1466
- "type": "link",
1467
- },
1468
- ],
1469
- "text": "Website",
1470
- "type": "text",
1471
- },
1472
- {
1473
- "marks": [
1474
- {
1475
- "attrs": {
1476
- "class": null,
1477
- "href": "https://www.website2.com",
1478
- "rel": "noopener noreferrer nofollow",
1479
- "target": "_blank",
1480
- },
1481
- "type": "link",
1482
- },
1483
- ],
1484
- "text": "Website2",
1485
- "type": "text",
1486
- },
1487
- ],
1488
- "type": "paragraph",
1489
- },
1490
- ],
1491
- "type": "blockContainer",
1492
- }
1493
- `;
1494
-
1495
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/basic to/from prosemirror 1`] = `
1496
- {
1497
- "attrs": {
1498
- "backgroundColor": "default",
1499
- "id": "1",
1500
- "textColor": "default",
1501
- },
1502
- "content": [
1503
- {
1504
- "attrs": {
1505
- "textAlignment": "left",
1506
- },
1507
- "content": [
1508
- {
1509
- "marks": [
1510
- {
1511
- "attrs": {
1512
- "class": null,
1513
- "href": "https://www.website.com",
1514
- "rel": "noopener noreferrer nofollow",
1515
- "target": "_blank",
1516
- },
1517
- "type": "link",
1518
- },
1519
- ],
1520
- "text": "Website",
1521
- "type": "text",
1522
- },
1523
- ],
1524
- "type": "paragraph",
1525
- },
1526
- ],
1527
- "type": "blockContainer",
1528
- }
1529
- `;
1530
-
1531
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/styled to/from prosemirror 1`] = `
1532
- {
1533
- "attrs": {
1534
- "backgroundColor": "default",
1535
- "id": "1",
1536
- "textColor": "default",
1537
- },
1538
- "content": [
1539
- {
1540
- "attrs": {
1541
- "textAlignment": "left",
1542
- },
1543
- "content": [
1544
- {
1545
- "marks": [
1546
- {
1547
- "type": "bold",
1548
- },
1549
- {
1550
- "attrs": {
1551
- "class": null,
1552
- "href": "https://www.website.com",
1553
- "rel": "noopener noreferrer nofollow",
1554
- "target": "_blank",
1555
- },
1556
- "type": "link",
1557
- },
1558
- ],
1559
- "text": "Web",
1560
- "type": "text",
1561
- },
1562
- {
1563
- "marks": [
1564
- {
1565
- "attrs": {
1566
- "class": null,
1567
- "href": "https://www.website.com",
1568
- "rel": "noopener noreferrer nofollow",
1569
- "target": "_blank",
1570
- },
1571
- "type": "link",
1572
- },
1573
- ],
1574
- "text": "site",
1575
- "type": "text",
1576
- },
1577
- ],
1578
- "type": "paragraph",
1579
- },
1580
- ],
1581
- "type": "blockContainer",
1582
- }
1583
- `;
1584
-
1585
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert lists/basic to/from prosemirror 1`] = `
1586
- {
1587
- "attrs": {
1588
- "backgroundColor": "default",
1589
- "id": "1",
1590
- "textColor": "default",
1591
- },
1592
- "content": [
1593
- {
1594
- "attrs": {
1595
- "textAlignment": "left",
1596
- },
1597
- "content": [
1598
- {
1599
- "text": "Bullet List Item 1",
1600
- "type": "text",
1601
- },
1602
- ],
1603
- "type": "bulletListItem",
1604
- },
1605
- ],
1606
- "type": "blockContainer",
1607
- }
1608
- `;
1609
-
1610
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert lists/nested to/from prosemirror 1`] = `
1611
- {
1612
- "attrs": {
1613
- "backgroundColor": "default",
1614
- "id": "1",
1615
- "textColor": "default",
1616
- },
1617
- "content": [
1618
- {
1619
- "attrs": {
1620
- "textAlignment": "left",
1621
- },
1622
- "content": [
1623
- {
1624
- "text": "Bullet List Item 1",
1625
- "type": "text",
1626
- },
1627
- ],
1628
- "type": "bulletListItem",
1629
- },
1630
- ],
1631
- "type": "blockContainer",
1632
- }
1633
- `;
1634
-
1635
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert pageBreak/basic to/from prosemirror 1`] = `
1636
- {
1637
- "attrs": {
1638
- "backgroundColor": "default",
1639
- "id": "1",
1640
- "textColor": "default",
1641
- },
1642
- "content": [
1643
- {
1644
- "type": "pageBreak",
1645
- },
1646
- ],
1647
- "type": "blockContainer",
1648
- }
1649
- `;
1650
-
1651
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/basic to/from prosemirror 1`] = `
1652
- {
1653
- "attrs": {
1654
- "backgroundColor": "default",
1655
- "id": "1",
1656
- "textColor": "default",
1657
- },
1658
- "content": [
1659
- {
1660
- "attrs": {
1661
- "textAlignment": "left",
1662
- },
1663
- "content": [
1664
- {
1665
- "text": "Paragraph",
1666
- "type": "text",
1667
- },
1668
- ],
1669
- "type": "paragraph",
1670
- },
1671
- ],
1672
- "type": "blockContainer",
1673
- }
1674
- `;
1675
-
1676
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/empty to/from prosemirror 1`] = `
1677
- {
1678
- "attrs": {
1679
- "backgroundColor": "default",
1680
- "id": "1",
1681
- "textColor": "default",
1682
- },
1683
- "content": [
1684
- {
1685
- "attrs": {
1686
- "textAlignment": "left",
1687
- },
1688
- "type": "paragraph",
1689
- },
1690
- ],
1691
- "type": "blockContainer",
1692
- }
1693
- `;
1694
-
1695
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/lineBreaks to/from prosemirror 1`] = `
1696
- {
1697
- "attrs": {
1698
- "backgroundColor": "default",
1699
- "id": "1",
1700
- "textColor": "default",
1701
- },
1702
- "content": [
1703
- {
1704
- "attrs": {
1705
- "textAlignment": "left",
1706
- },
1707
- "content": [
1708
- {
1709
- "text": "Line 1",
1710
- "type": "text",
1711
- },
1712
- {
1713
- "type": "hardBreak",
1714
- },
1715
- {
1716
- "text": "Line 2",
1717
- "type": "text",
1718
- },
1719
- ],
1720
- "type": "paragraph",
1721
- },
1722
- ],
1723
- "type": "blockContainer",
1724
- }
1725
- `;
1726
-
1727
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/nested to/from prosemirror 1`] = `
1728
- {
1729
- "attrs": {
1730
- "backgroundColor": "default",
1731
- "id": "1",
1732
- "textColor": "default",
1733
- },
1734
- "content": [
1735
- {
1736
- "attrs": {
1737
- "textAlignment": "left",
1738
- },
1739
- "content": [
1740
- {
1741
- "text": "Paragraph",
1742
- "type": "text",
1743
- },
1744
- ],
1745
- "type": "paragraph",
1746
- },
1747
- {
1748
- "content": [
1749
- {
1750
- "attrs": {
1751
- "backgroundColor": "default",
1752
- "id": "2",
1753
- "textColor": "default",
1754
- },
1755
- "content": [
1756
- {
1757
- "attrs": {
1758
- "textAlignment": "left",
1759
- },
1760
- "content": [
1761
- {
1762
- "text": "Nested Paragraph 1",
1763
- "type": "text",
1764
- },
1765
- ],
1766
- "type": "paragraph",
1767
- },
1768
- ],
1769
- "type": "blockContainer",
1770
- },
1771
- {
1772
- "attrs": {
1773
- "backgroundColor": "default",
1774
- "id": "3",
1775
- "textColor": "default",
1776
- },
1777
- "content": [
1778
- {
1779
- "attrs": {
1780
- "textAlignment": "left",
1781
- },
1782
- "content": [
1783
- {
1784
- "text": "Nested Paragraph 2",
1785
- "type": "text",
1786
- },
1787
- ],
1788
- "type": "paragraph",
1789
- },
1790
- ],
1791
- "type": "blockContainer",
1792
- },
1793
- ],
1794
- "type": "blockGroup",
1795
- },
1796
- ],
1797
- "type": "blockContainer",
1798
- }
1799
- `;
1800
-
1801
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/styled to/from prosemirror 1`] = `
1802
- {
1803
- "attrs": {
1804
- "backgroundColor": "pink",
1805
- "id": "1",
1806
- "textColor": "orange",
1807
- },
1808
- "content": [
1809
- {
1810
- "attrs": {
1811
- "textAlignment": "center",
1812
- },
1813
- "content": [
1814
- {
1815
- "text": "Plain ",
1816
- "type": "text",
1817
- },
1818
- {
1819
- "marks": [
1820
- {
1821
- "attrs": {
1822
- "stringValue": "red",
1823
- },
1824
- "type": "textColor",
1825
- },
1826
- ],
1827
- "text": "Red Text ",
1828
- "type": "text",
1829
- },
1830
- {
1831
- "marks": [
1832
- {
1833
- "attrs": {
1834
- "stringValue": "blue",
1835
- },
1836
- "type": "backgroundColor",
1837
- },
1838
- ],
1839
- "text": "Blue Background ",
1840
- "type": "text",
1841
- },
1842
- {
1843
- "marks": [
1844
- {
1845
- "attrs": {
1846
- "stringValue": "red",
1847
- },
1848
- "type": "textColor",
1849
- },
1850
- {
1851
- "attrs": {
1852
- "stringValue": "blue",
1853
- },
1854
- "type": "backgroundColor",
1855
- },
1856
- ],
1857
- "text": "Mixed Colors",
1858
- "type": "text",
1859
- },
1860
- ],
1861
- "type": "paragraph",
1862
- },
1863
- ],
1864
- "type": "blockContainer",
1865
- }
1866
- `;
1867
-
1868
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/allColWidths to/from prosemirror 1`] = `
1869
- {
1870
- "attrs": {
1871
- "backgroundColor": "default",
1872
- "id": "1",
1873
- "textColor": "default",
1874
- },
1875
- "content": [
1876
- {
1877
- "content": [
1878
- {
1879
- "content": [
1880
- {
1881
- "attrs": {
1882
- "backgroundColor": "default",
1883
- "colspan": 1,
1884
- "colwidth": [
1885
- 100,
1886
- ],
1887
- "rowspan": 1,
1888
- "textAlignment": "left",
1889
- "textColor": "default",
1890
- },
1891
- "content": [
1892
- {
1893
- "content": [
1894
- {
1895
- "text": "Table Cell",
1896
- "type": "text",
1897
- },
1898
- ],
1899
- "type": "tableParagraph",
1900
- },
1901
- ],
1902
- "type": "tableCell",
1903
- },
1904
- {
1905
- "attrs": {
1906
- "backgroundColor": "default",
1907
- "colspan": 1,
1908
- "colwidth": [
1909
- 200,
1910
- ],
1911
- "rowspan": 1,
1912
- "textAlignment": "left",
1913
- "textColor": "default",
1914
- },
1915
- "content": [
1916
- {
1917
- "content": [
1918
- {
1919
- "text": "Table Cell",
1920
- "type": "text",
1921
- },
1922
- ],
1923
- "type": "tableParagraph",
1924
- },
1925
- ],
1926
- "type": "tableCell",
1927
- },
1928
- {
1929
- "attrs": {
1930
- "backgroundColor": "default",
1931
- "colspan": 1,
1932
- "colwidth": [
1933
- 300,
1934
- ],
1935
- "rowspan": 1,
1936
- "textAlignment": "left",
1937
- "textColor": "default",
1938
- },
1939
- "content": [
1940
- {
1941
- "content": [
1942
- {
1943
- "text": "Table Cell",
1944
- "type": "text",
1945
- },
1946
- ],
1947
- "type": "tableParagraph",
1948
- },
1949
- ],
1950
- "type": "tableCell",
1951
- },
1952
- ],
1953
- "type": "tableRow",
1954
- },
1955
- {
1956
- "content": [
1957
- {
1958
- "attrs": {
1959
- "backgroundColor": "default",
1960
- "colspan": 1,
1961
- "colwidth": [
1962
- 100,
1963
- ],
1964
- "rowspan": 1,
1965
- "textAlignment": "left",
1966
- "textColor": "default",
1967
- },
1968
- "content": [
1969
- {
1970
- "content": [
1971
- {
1972
- "text": "Table Cell",
1973
- "type": "text",
1974
- },
1975
- ],
1976
- "type": "tableParagraph",
1977
- },
1978
- ],
1979
- "type": "tableCell",
1980
- },
1981
- {
1982
- "attrs": {
1983
- "backgroundColor": "default",
1984
- "colspan": 1,
1985
- "colwidth": [
1986
- 200,
1987
- ],
1988
- "rowspan": 1,
1989
- "textAlignment": "left",
1990
- "textColor": "default",
1991
- },
1992
- "content": [
1993
- {
1994
- "content": [
1995
- {
1996
- "text": "Table Cell",
1997
- "type": "text",
1998
- },
1999
- ],
2000
- "type": "tableParagraph",
2001
- },
2002
- ],
2003
- "type": "tableCell",
2004
- },
2005
- {
2006
- "attrs": {
2007
- "backgroundColor": "default",
2008
- "colspan": 1,
2009
- "colwidth": [
2010
- 300,
2011
- ],
2012
- "rowspan": 1,
2013
- "textAlignment": "left",
2014
- "textColor": "default",
2015
- },
2016
- "content": [
2017
- {
2018
- "content": [
2019
- {
2020
- "text": "Table Cell",
2021
- "type": "text",
2022
- },
2023
- ],
2024
- "type": "tableParagraph",
2025
- },
2026
- ],
2027
- "type": "tableCell",
2028
- },
2029
- ],
2030
- "type": "tableRow",
2031
- },
2032
- {
2033
- "content": [
2034
- {
2035
- "attrs": {
2036
- "backgroundColor": "default",
2037
- "colspan": 1,
2038
- "colwidth": [
2039
- 100,
2040
- ],
2041
- "rowspan": 1,
2042
- "textAlignment": "left",
2043
- "textColor": "default",
2044
- },
2045
- "content": [
2046
- {
2047
- "content": [
2048
- {
2049
- "text": "Table Cell",
2050
- "type": "text",
2051
- },
2052
- ],
2053
- "type": "tableParagraph",
2054
- },
2055
- ],
2056
- "type": "tableCell",
2057
- },
2058
- {
2059
- "attrs": {
2060
- "backgroundColor": "default",
2061
- "colspan": 1,
2062
- "colwidth": [
2063
- 200,
2064
- ],
2065
- "rowspan": 1,
2066
- "textAlignment": "left",
2067
- "textColor": "default",
2068
- },
2069
- "content": [
2070
- {
2071
- "content": [
2072
- {
2073
- "text": "Table Cell",
2074
- "type": "text",
2075
- },
2076
- ],
2077
- "type": "tableParagraph",
2078
- },
2079
- ],
2080
- "type": "tableCell",
2081
- },
2082
- {
2083
- "attrs": {
2084
- "backgroundColor": "default",
2085
- "colspan": 1,
2086
- "colwidth": [
2087
- 300,
2088
- ],
2089
- "rowspan": 1,
2090
- "textAlignment": "left",
2091
- "textColor": "default",
2092
- },
2093
- "content": [
2094
- {
2095
- "content": [
2096
- {
2097
- "text": "Table Cell",
2098
- "type": "text",
2099
- },
2100
- ],
2101
- "type": "tableParagraph",
2102
- },
2103
- ],
2104
- "type": "tableCell",
2105
- },
2106
- ],
2107
- "type": "tableRow",
2108
- },
2109
- ],
2110
- "type": "table",
2111
- },
2112
- ],
2113
- "type": "blockContainer",
2114
- }
2115
- `;
2116
-
2117
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/basic to/from prosemirror 1`] = `
2118
- {
2119
- "attrs": {
2120
- "backgroundColor": "default",
2121
- "id": "1",
2122
- "textColor": "default",
2123
- },
2124
- "content": [
2125
- {
2126
- "content": [
2127
- {
2128
- "content": [
2129
- {
2130
- "attrs": {
2131
- "backgroundColor": "default",
2132
- "colspan": 1,
2133
- "colwidth": null,
2134
- "rowspan": 1,
2135
- "textAlignment": "left",
2136
- "textColor": "default",
2137
- },
2138
- "content": [
2139
- {
2140
- "content": [
2141
- {
2142
- "text": "Table Cell",
2143
- "type": "text",
2144
- },
2145
- ],
2146
- "type": "tableParagraph",
2147
- },
2148
- ],
2149
- "type": "tableCell",
2150
- },
2151
- {
2152
- "attrs": {
2153
- "backgroundColor": "default",
2154
- "colspan": 1,
2155
- "colwidth": null,
2156
- "rowspan": 1,
2157
- "textAlignment": "left",
2158
- "textColor": "default",
2159
- },
2160
- "content": [
2161
- {
2162
- "content": [
2163
- {
2164
- "text": "Table Cell",
2165
- "type": "text",
2166
- },
2167
- ],
2168
- "type": "tableParagraph",
2169
- },
2170
- ],
2171
- "type": "tableCell",
2172
- },
2173
- {
2174
- "attrs": {
2175
- "backgroundColor": "default",
2176
- "colspan": 1,
2177
- "colwidth": null,
2178
- "rowspan": 1,
2179
- "textAlignment": "left",
2180
- "textColor": "default",
2181
- },
2182
- "content": [
2183
- {
2184
- "content": [
2185
- {
2186
- "text": "Table Cell",
2187
- "type": "text",
2188
- },
2189
- ],
2190
- "type": "tableParagraph",
2191
- },
2192
- ],
2193
- "type": "tableCell",
2194
- },
2195
- ],
2196
- "type": "tableRow",
2197
- },
2198
- {
2199
- "content": [
2200
- {
2201
- "attrs": {
2202
- "backgroundColor": "default",
2203
- "colspan": 1,
2204
- "colwidth": null,
2205
- "rowspan": 1,
2206
- "textAlignment": "left",
2207
- "textColor": "default",
2208
- },
2209
- "content": [
2210
- {
2211
- "content": [
2212
- {
2213
- "text": "Table Cell",
2214
- "type": "text",
2215
- },
2216
- ],
2217
- "type": "tableParagraph",
2218
- },
2219
- ],
2220
- "type": "tableCell",
2221
- },
2222
- {
2223
- "attrs": {
2224
- "backgroundColor": "default",
2225
- "colspan": 1,
2226
- "colwidth": null,
2227
- "rowspan": 1,
2228
- "textAlignment": "left",
2229
- "textColor": "default",
2230
- },
2231
- "content": [
2232
- {
2233
- "content": [
2234
- {
2235
- "text": "Table Cell",
2236
- "type": "text",
2237
- },
2238
- ],
2239
- "type": "tableParagraph",
2240
- },
2241
- ],
2242
- "type": "tableCell",
2243
- },
2244
- {
2245
- "attrs": {
2246
- "backgroundColor": "default",
2247
- "colspan": 1,
2248
- "colwidth": null,
2249
- "rowspan": 1,
2250
- "textAlignment": "left",
2251
- "textColor": "default",
2252
- },
2253
- "content": [
2254
- {
2255
- "content": [
2256
- {
2257
- "text": "Table Cell",
2258
- "type": "text",
2259
- },
2260
- ],
2261
- "type": "tableParagraph",
2262
- },
2263
- ],
2264
- "type": "tableCell",
2265
- },
2266
- ],
2267
- "type": "tableRow",
2268
- },
2269
- {
2270
- "content": [
2271
- {
2272
- "attrs": {
2273
- "backgroundColor": "default",
2274
- "colspan": 1,
2275
- "colwidth": null,
2276
- "rowspan": 1,
2277
- "textAlignment": "left",
2278
- "textColor": "default",
2279
- },
2280
- "content": [
2281
- {
2282
- "content": [
2283
- {
2284
- "text": "Table Cell",
2285
- "type": "text",
2286
- },
2287
- ],
2288
- "type": "tableParagraph",
2289
- },
2290
- ],
2291
- "type": "tableCell",
2292
- },
2293
- {
2294
- "attrs": {
2295
- "backgroundColor": "default",
2296
- "colspan": 1,
2297
- "colwidth": null,
2298
- "rowspan": 1,
2299
- "textAlignment": "left",
2300
- "textColor": "default",
2301
- },
2302
- "content": [
2303
- {
2304
- "content": [
2305
- {
2306
- "text": "Table Cell",
2307
- "type": "text",
2308
- },
2309
- ],
2310
- "type": "tableParagraph",
2311
- },
2312
- ],
2313
- "type": "tableCell",
2314
- },
2315
- {
2316
- "attrs": {
2317
- "backgroundColor": "default",
2318
- "colspan": 1,
2319
- "colwidth": null,
2320
- "rowspan": 1,
2321
- "textAlignment": "left",
2322
- "textColor": "default",
2323
- },
2324
- "content": [
2325
- {
2326
- "content": [
2327
- {
2328
- "text": "Table Cell",
2329
- "type": "text",
2330
- },
2331
- ],
2332
- "type": "tableParagraph",
2333
- },
2334
- ],
2335
- "type": "tableCell",
2336
- },
2337
- ],
2338
- "type": "tableRow",
2339
- },
2340
- ],
2341
- "type": "table",
2342
- },
2343
- ],
2344
- "type": "blockContainer",
2345
- }
2346
- `;
2347
-
2348
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/headerCols to/from prosemirror 1`] = `
2349
- {
2350
- "attrs": {
2351
- "backgroundColor": "default",
2352
- "id": "1",
2353
- "textColor": "default",
2354
- },
2355
- "content": [
2356
- {
2357
- "content": [
2358
- {
2359
- "content": [
2360
- {
2361
- "attrs": {
2362
- "backgroundColor": "default",
2363
- "colspan": 1,
2364
- "colwidth": null,
2365
- "rowspan": 1,
2366
- "textAlignment": "left",
2367
- "textColor": "default",
2368
- },
2369
- "content": [
2370
- {
2371
- "content": [
2372
- {
2373
- "text": "Table Cell",
2374
- "type": "text",
2375
- },
2376
- ],
2377
- "type": "tableParagraph",
2378
- },
2379
- ],
2380
- "type": "tableHeader",
2381
- },
2382
- {
2383
- "attrs": {
2384
- "backgroundColor": "default",
2385
- "colspan": 1,
2386
- "colwidth": null,
2387
- "rowspan": 1,
2388
- "textAlignment": "left",
2389
- "textColor": "default",
2390
- },
2391
- "content": [
2392
- {
2393
- "content": [
2394
- {
2395
- "text": "Table Cell",
2396
- "type": "text",
2397
- },
2398
- ],
2399
- "type": "tableParagraph",
2400
- },
2401
- ],
2402
- "type": "tableCell",
2403
- },
2404
- {
2405
- "attrs": {
2406
- "backgroundColor": "default",
2407
- "colspan": 1,
2408
- "colwidth": null,
2409
- "rowspan": 1,
2410
- "textAlignment": "left",
2411
- "textColor": "default",
2412
- },
2413
- "content": [
2414
- {
2415
- "content": [
2416
- {
2417
- "text": "Table Cell",
2418
- "type": "text",
2419
- },
2420
- ],
2421
- "type": "tableParagraph",
2422
- },
2423
- ],
2424
- "type": "tableCell",
2425
- },
2426
- ],
2427
- "type": "tableRow",
2428
- },
2429
- {
2430
- "content": [
2431
- {
2432
- "attrs": {
2433
- "backgroundColor": "default",
2434
- "colspan": 1,
2435
- "colwidth": null,
2436
- "rowspan": 1,
2437
- "textAlignment": "left",
2438
- "textColor": "default",
2439
- },
2440
- "content": [
2441
- {
2442
- "content": [
2443
- {
2444
- "text": "Table Cell",
2445
- "type": "text",
2446
- },
2447
- ],
2448
- "type": "tableParagraph",
2449
- },
2450
- ],
2451
- "type": "tableHeader",
2452
- },
2453
- {
2454
- "attrs": {
2455
- "backgroundColor": "default",
2456
- "colspan": 1,
2457
- "colwidth": null,
2458
- "rowspan": 1,
2459
- "textAlignment": "left",
2460
- "textColor": "default",
2461
- },
2462
- "content": [
2463
- {
2464
- "content": [
2465
- {
2466
- "text": "Table Cell",
2467
- "type": "text",
2468
- },
2469
- ],
2470
- "type": "tableParagraph",
2471
- },
2472
- ],
2473
- "type": "tableCell",
2474
- },
2475
- {
2476
- "attrs": {
2477
- "backgroundColor": "default",
2478
- "colspan": 1,
2479
- "colwidth": null,
2480
- "rowspan": 1,
2481
- "textAlignment": "left",
2482
- "textColor": "default",
2483
- },
2484
- "content": [
2485
- {
2486
- "content": [
2487
- {
2488
- "text": "Table Cell",
2489
- "type": "text",
2490
- },
2491
- ],
2492
- "type": "tableParagraph",
2493
- },
2494
- ],
2495
- "type": "tableCell",
2496
- },
2497
- ],
2498
- "type": "tableRow",
2499
- },
2500
- {
2501
- "content": [
2502
- {
2503
- "attrs": {
2504
- "backgroundColor": "default",
2505
- "colspan": 1,
2506
- "colwidth": null,
2507
- "rowspan": 1,
2508
- "textAlignment": "left",
2509
- "textColor": "default",
2510
- },
2511
- "content": [
2512
- {
2513
- "content": [
2514
- {
2515
- "text": "Table Cell",
2516
- "type": "text",
2517
- },
2518
- ],
2519
- "type": "tableParagraph",
2520
- },
2521
- ],
2522
- "type": "tableHeader",
2523
- },
2524
- {
2525
- "attrs": {
2526
- "backgroundColor": "default",
2527
- "colspan": 1,
2528
- "colwidth": null,
2529
- "rowspan": 1,
2530
- "textAlignment": "left",
2531
- "textColor": "default",
2532
- },
2533
- "content": [
2534
- {
2535
- "content": [
2536
- {
2537
- "text": "Table Cell",
2538
- "type": "text",
2539
- },
2540
- ],
2541
- "type": "tableParagraph",
2542
- },
2543
- ],
2544
- "type": "tableCell",
2545
- },
2546
- {
2547
- "attrs": {
2548
- "backgroundColor": "default",
2549
- "colspan": 1,
2550
- "colwidth": null,
2551
- "rowspan": 1,
2552
- "textAlignment": "left",
2553
- "textColor": "default",
2554
- },
2555
- "content": [
2556
- {
2557
- "content": [
2558
- {
2559
- "text": "Table Cell",
2560
- "type": "text",
2561
- },
2562
- ],
2563
- "type": "tableParagraph",
2564
- },
2565
- ],
2566
- "type": "tableCell",
2567
- },
2568
- ],
2569
- "type": "tableRow",
2570
- },
2571
- ],
2572
- "type": "table",
2573
- },
2574
- ],
2575
- "type": "blockContainer",
2576
- }
2577
- `;
2578
-
2579
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/headerRows to/from prosemirror 1`] = `
2580
- {
2581
- "attrs": {
2582
- "backgroundColor": "default",
2583
- "id": "1",
2584
- "textColor": "default",
2585
- },
2586
- "content": [
2587
- {
2588
- "content": [
2589
- {
2590
- "content": [
2591
- {
2592
- "attrs": {
2593
- "backgroundColor": "default",
2594
- "colspan": 1,
2595
- "colwidth": null,
2596
- "rowspan": 1,
2597
- "textAlignment": "left",
2598
- "textColor": "default",
2599
- },
2600
- "content": [
2601
- {
2602
- "content": [
2603
- {
2604
- "text": "Table Cell",
2605
- "type": "text",
2606
- },
2607
- ],
2608
- "type": "tableParagraph",
2609
- },
2610
- ],
2611
- "type": "tableHeader",
2612
- },
2613
- {
2614
- "attrs": {
2615
- "backgroundColor": "default",
2616
- "colspan": 1,
2617
- "colwidth": null,
2618
- "rowspan": 1,
2619
- "textAlignment": "left",
2620
- "textColor": "default",
2621
- },
2622
- "content": [
2623
- {
2624
- "content": [
2625
- {
2626
- "text": "Table Cell",
2627
- "type": "text",
2628
- },
2629
- ],
2630
- "type": "tableParagraph",
2631
- },
2632
- ],
2633
- "type": "tableHeader",
2634
- },
2635
- {
2636
- "attrs": {
2637
- "backgroundColor": "default",
2638
- "colspan": 1,
2639
- "colwidth": null,
2640
- "rowspan": 1,
2641
- "textAlignment": "left",
2642
- "textColor": "default",
2643
- },
2644
- "content": [
2645
- {
2646
- "content": [
2647
- {
2648
- "text": "Table Cell",
2649
- "type": "text",
2650
- },
2651
- ],
2652
- "type": "tableParagraph",
2653
- },
2654
- ],
2655
- "type": "tableHeader",
2656
- },
2657
- ],
2658
- "type": "tableRow",
2659
- },
2660
- {
2661
- "content": [
2662
- {
2663
- "attrs": {
2664
- "backgroundColor": "default",
2665
- "colspan": 1,
2666
- "colwidth": null,
2667
- "rowspan": 1,
2668
- "textAlignment": "left",
2669
- "textColor": "default",
2670
- },
2671
- "content": [
2672
- {
2673
- "content": [
2674
- {
2675
- "text": "Table Cell",
2676
- "type": "text",
2677
- },
2678
- ],
2679
- "type": "tableParagraph",
2680
- },
2681
- ],
2682
- "type": "tableCell",
2683
- },
2684
- {
2685
- "attrs": {
2686
- "backgroundColor": "default",
2687
- "colspan": 1,
2688
- "colwidth": null,
2689
- "rowspan": 1,
2690
- "textAlignment": "left",
2691
- "textColor": "default",
2692
- },
2693
- "content": [
2694
- {
2695
- "content": [
2696
- {
2697
- "text": "Table Cell",
2698
- "type": "text",
2699
- },
2700
- ],
2701
- "type": "tableParagraph",
2702
- },
2703
- ],
2704
- "type": "tableCell",
2705
- },
2706
- {
2707
- "attrs": {
2708
- "backgroundColor": "default",
2709
- "colspan": 1,
2710
- "colwidth": null,
2711
- "rowspan": 1,
2712
- "textAlignment": "left",
2713
- "textColor": "default",
2714
- },
2715
- "content": [
2716
- {
2717
- "content": [
2718
- {
2719
- "text": "Table Cell",
2720
- "type": "text",
2721
- },
2722
- ],
2723
- "type": "tableParagraph",
2724
- },
2725
- ],
2726
- "type": "tableCell",
2727
- },
2728
- ],
2729
- "type": "tableRow",
2730
- },
2731
- {
2732
- "content": [
2733
- {
2734
- "attrs": {
2735
- "backgroundColor": "default",
2736
- "colspan": 1,
2737
- "colwidth": null,
2738
- "rowspan": 1,
2739
- "textAlignment": "left",
2740
- "textColor": "default",
2741
- },
2742
- "content": [
2743
- {
2744
- "content": [
2745
- {
2746
- "text": "Table Cell",
2747
- "type": "text",
2748
- },
2749
- ],
2750
- "type": "tableParagraph",
2751
- },
2752
- ],
2753
- "type": "tableCell",
2754
- },
2755
- {
2756
- "attrs": {
2757
- "backgroundColor": "default",
2758
- "colspan": 1,
2759
- "colwidth": null,
2760
- "rowspan": 1,
2761
- "textAlignment": "left",
2762
- "textColor": "default",
2763
- },
2764
- "content": [
2765
- {
2766
- "content": [
2767
- {
2768
- "text": "Table Cell",
2769
- "type": "text",
2770
- },
2771
- ],
2772
- "type": "tableParagraph",
2773
- },
2774
- ],
2775
- "type": "tableCell",
2776
- },
2777
- {
2778
- "attrs": {
2779
- "backgroundColor": "default",
2780
- "colspan": 1,
2781
- "colwidth": null,
2782
- "rowspan": 1,
2783
- "textAlignment": "left",
2784
- "textColor": "default",
2785
- },
2786
- "content": [
2787
- {
2788
- "content": [
2789
- {
2790
- "text": "Table Cell",
2791
- "type": "text",
2792
- },
2793
- ],
2794
- "type": "tableParagraph",
2795
- },
2796
- ],
2797
- "type": "tableCell",
2798
- },
2799
- ],
2800
- "type": "tableRow",
2801
- },
2802
- ],
2803
- "type": "table",
2804
- },
2805
- ],
2806
- "type": "blockContainer",
2807
- }
2808
- `;
2809
-
2810
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/mixedCellColors to/from prosemirror 1`] = `
2811
- {
2812
- "attrs": {
2813
- "backgroundColor": "default",
2814
- "id": "1",
2815
- "textColor": "default",
2816
- },
2817
- "content": [
2818
- {
2819
- "content": [
2820
- {
2821
- "content": [
2822
- {
2823
- "attrs": {
2824
- "backgroundColor": "red",
2825
- "colspan": 1,
2826
- "colwidth": [
2827
- 100,
2828
- ],
2829
- "rowspan": 1,
2830
- "textAlignment": "left",
2831
- "textColor": "blue",
2832
- },
2833
- "content": [
2834
- {
2835
- "content": [
2836
- {
2837
- "text": "Table Cell",
2838
- "type": "text",
2839
- },
2840
- ],
2841
- "type": "tableParagraph",
2842
- },
2843
- ],
2844
- "type": "tableCell",
2845
- },
2846
- {
2847
- "attrs": {
2848
- "backgroundColor": "blue",
2849
- "colspan": 1,
2850
- "colwidth": null,
2851
- "rowspan": 1,
2852
- "textAlignment": "left",
2853
- "textColor": "default",
2854
- },
2855
- "content": [
2856
- {
2857
- "content": [
2858
- {
2859
- "text": "Table Cell",
2860
- "type": "text",
2861
- },
2862
- ],
2863
- "type": "tableParagraph",
2864
- },
2865
- ],
2866
- "type": "tableCell",
2867
- },
2868
- {
2869
- "attrs": {
2870
- "backgroundColor": "yellow",
2871
- "colspan": 1,
2872
- "colwidth": [
2873
- 300,
2874
- ],
2875
- "rowspan": 1,
2876
- "textAlignment": "left",
2877
- "textColor": "red",
2878
- },
2879
- "content": [
2880
- {
2881
- "content": [
2882
- {
2883
- "text": "Table Cell",
2884
- "type": "text",
2885
- },
2886
- ],
2887
- "type": "tableParagraph",
2888
- },
2889
- ],
2890
- "type": "tableCell",
2891
- },
2892
- ],
2893
- "type": "tableRow",
2894
- },
2895
- {
2896
- "content": [
2897
- {
2898
- "attrs": {
2899
- "backgroundColor": "default",
2900
- "colspan": 1,
2901
- "colwidth": [
2902
- 100,
2903
- ],
2904
- "rowspan": 1,
2905
- "textAlignment": "left",
2906
- "textColor": "default",
2907
- },
2908
- "content": [
2909
- {
2910
- "content": [
2911
- {
2912
- "text": "Table Cell",
2913
- "type": "text",
2914
- },
2915
- ],
2916
- "type": "tableParagraph",
2917
- },
2918
- ],
2919
- "type": "tableCell",
2920
- },
2921
- {
2922
- "attrs": {
2923
- "backgroundColor": "default",
2924
- "colspan": 1,
2925
- "colwidth": null,
2926
- "rowspan": 1,
2927
- "textAlignment": "left",
2928
- "textColor": "default",
2929
- },
2930
- "content": [
2931
- {
2932
- "content": [
2933
- {
2934
- "text": "Table Cell",
2935
- "type": "text",
2936
- },
2937
- ],
2938
- "type": "tableParagraph",
2939
- },
2940
- ],
2941
- "type": "tableCell",
2942
- },
2943
- {
2944
- "attrs": {
2945
- "backgroundColor": "default",
2946
- "colspan": 1,
2947
- "colwidth": [
2948
- 300,
2949
- ],
2950
- "rowspan": 1,
2951
- "textAlignment": "left",
2952
- "textColor": "default",
2953
- },
2954
- "content": [
2955
- {
2956
- "content": [
2957
- {
2958
- "text": "Table Cell",
2959
- "type": "text",
2960
- },
2961
- ],
2962
- "type": "tableParagraph",
2963
- },
2964
- ],
2965
- "type": "tableCell",
2966
- },
2967
- ],
2968
- "type": "tableRow",
2969
- },
2970
- {
2971
- "content": [
2972
- {
2973
- "attrs": {
2974
- "backgroundColor": "default",
2975
- "colspan": 1,
2976
- "colwidth": [
2977
- 100,
2978
- ],
2979
- "rowspan": 1,
2980
- "textAlignment": "left",
2981
- "textColor": "default",
2982
- },
2983
- "content": [
2984
- {
2985
- "content": [
2986
- {
2987
- "text": "Table Cell",
2988
- "type": "text",
2989
- },
2990
- ],
2991
- "type": "tableParagraph",
2992
- },
2993
- ],
2994
- "type": "tableCell",
2995
- },
2996
- {
2997
- "attrs": {
2998
- "backgroundColor": "default",
2999
- "colspan": 1,
3000
- "colwidth": null,
3001
- "rowspan": 1,
3002
- "textAlignment": "left",
3003
- "textColor": "default",
3004
- },
3005
- "content": [
3006
- {
3007
- "content": [
3008
- {
3009
- "text": "Table Cell",
3010
- "type": "text",
3011
- },
3012
- ],
3013
- "type": "tableParagraph",
3014
- },
3015
- ],
3016
- "type": "tableCell",
3017
- },
3018
- {
3019
- "attrs": {
3020
- "backgroundColor": "default",
3021
- "colspan": 1,
3022
- "colwidth": [
3023
- 300,
3024
- ],
3025
- "rowspan": 1,
3026
- "textAlignment": "left",
3027
- "textColor": "default",
3028
- },
3029
- "content": [
3030
- {
3031
- "content": [
3032
- {
3033
- "text": "Table Cell",
3034
- "type": "text",
3035
- },
3036
- ],
3037
- "type": "tableParagraph",
3038
- },
3039
- ],
3040
- "type": "tableCell",
3041
- },
3042
- ],
3043
- "type": "tableRow",
3044
- },
3045
- ],
3046
- "type": "table",
3047
- },
3048
- ],
3049
- "type": "blockContainer",
3050
- }
3051
- `;
3052
-
3053
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/mixedColWidths to/from prosemirror 1`] = `
3054
- {
3055
- "attrs": {
3056
- "backgroundColor": "default",
3057
- "id": "1",
3058
- "textColor": "default",
3059
- },
3060
- "content": [
3061
- {
3062
- "content": [
3063
- {
3064
- "content": [
3065
- {
3066
- "attrs": {
3067
- "backgroundColor": "default",
3068
- "colspan": 1,
3069
- "colwidth": [
3070
- 100,
3071
- ],
3072
- "rowspan": 1,
3073
- "textAlignment": "left",
3074
- "textColor": "default",
3075
- },
3076
- "content": [
3077
- {
3078
- "content": [
3079
- {
3080
- "text": "Table Cell",
3081
- "type": "text",
3082
- },
3083
- ],
3084
- "type": "tableParagraph",
3085
- },
3086
- ],
3087
- "type": "tableCell",
3088
- },
3089
- {
3090
- "attrs": {
3091
- "backgroundColor": "default",
3092
- "colspan": 1,
3093
- "colwidth": null,
3094
- "rowspan": 1,
3095
- "textAlignment": "left",
3096
- "textColor": "default",
3097
- },
3098
- "content": [
3099
- {
3100
- "content": [
3101
- {
3102
- "text": "Table Cell",
3103
- "type": "text",
3104
- },
3105
- ],
3106
- "type": "tableParagraph",
3107
- },
3108
- ],
3109
- "type": "tableCell",
3110
- },
3111
- {
3112
- "attrs": {
3113
- "backgroundColor": "default",
3114
- "colspan": 1,
3115
- "colwidth": [
3116
- 300,
3117
- ],
3118
- "rowspan": 1,
3119
- "textAlignment": "left",
3120
- "textColor": "default",
3121
- },
3122
- "content": [
3123
- {
3124
- "content": [
3125
- {
3126
- "text": "Table Cell",
3127
- "type": "text",
3128
- },
3129
- ],
3130
- "type": "tableParagraph",
3131
- },
3132
- ],
3133
- "type": "tableCell",
3134
- },
3135
- ],
3136
- "type": "tableRow",
3137
- },
3138
- {
3139
- "content": [
3140
- {
3141
- "attrs": {
3142
- "backgroundColor": "default",
3143
- "colspan": 1,
3144
- "colwidth": [
3145
- 100,
3146
- ],
3147
- "rowspan": 1,
3148
- "textAlignment": "left",
3149
- "textColor": "default",
3150
- },
3151
- "content": [
3152
- {
3153
- "content": [
3154
- {
3155
- "text": "Table Cell",
3156
- "type": "text",
3157
- },
3158
- ],
3159
- "type": "tableParagraph",
3160
- },
3161
- ],
3162
- "type": "tableCell",
3163
- },
3164
- {
3165
- "attrs": {
3166
- "backgroundColor": "default",
3167
- "colspan": 1,
3168
- "colwidth": null,
3169
- "rowspan": 1,
3170
- "textAlignment": "left",
3171
- "textColor": "default",
3172
- },
3173
- "content": [
3174
- {
3175
- "content": [
3176
- {
3177
- "text": "Table Cell",
3178
- "type": "text",
3179
- },
3180
- ],
3181
- "type": "tableParagraph",
3182
- },
3183
- ],
3184
- "type": "tableCell",
3185
- },
3186
- {
3187
- "attrs": {
3188
- "backgroundColor": "default",
3189
- "colspan": 1,
3190
- "colwidth": [
3191
- 300,
3192
- ],
3193
- "rowspan": 1,
3194
- "textAlignment": "left",
3195
- "textColor": "default",
3196
- },
3197
- "content": [
3198
- {
3199
- "content": [
3200
- {
3201
- "text": "Table Cell",
3202
- "type": "text",
3203
- },
3204
- ],
3205
- "type": "tableParagraph",
3206
- },
3207
- ],
3208
- "type": "tableCell",
3209
- },
3210
- ],
3211
- "type": "tableRow",
3212
- },
3213
- {
3214
- "content": [
3215
- {
3216
- "attrs": {
3217
- "backgroundColor": "default",
3218
- "colspan": 1,
3219
- "colwidth": [
3220
- 100,
3221
- ],
3222
- "rowspan": 1,
3223
- "textAlignment": "left",
3224
- "textColor": "default",
3225
- },
3226
- "content": [
3227
- {
3228
- "content": [
3229
- {
3230
- "text": "Table Cell",
3231
- "type": "text",
3232
- },
3233
- ],
3234
- "type": "tableParagraph",
3235
- },
3236
- ],
3237
- "type": "tableCell",
3238
- },
3239
- {
3240
- "attrs": {
3241
- "backgroundColor": "default",
3242
- "colspan": 1,
3243
- "colwidth": null,
3244
- "rowspan": 1,
3245
- "textAlignment": "left",
3246
- "textColor": "default",
3247
- },
3248
- "content": [
3249
- {
3250
- "content": [
3251
- {
3252
- "text": "Table Cell",
3253
- "type": "text",
3254
- },
3255
- ],
3256
- "type": "tableParagraph",
3257
- },
3258
- ],
3259
- "type": "tableCell",
3260
- },
3261
- {
3262
- "attrs": {
3263
- "backgroundColor": "default",
3264
- "colspan": 1,
3265
- "colwidth": [
3266
- 300,
3267
- ],
3268
- "rowspan": 1,
3269
- "textAlignment": "left",
3270
- "textColor": "default",
3271
- },
3272
- "content": [
3273
- {
3274
- "content": [
3275
- {
3276
- "text": "Table Cell",
3277
- "type": "text",
3278
- },
3279
- ],
3280
- "type": "tableParagraph",
3281
- },
3282
- ],
3283
- "type": "tableCell",
3284
- },
3285
- ],
3286
- "type": "tableRow",
3287
- },
3288
- ],
3289
- "type": "table",
3290
- },
3291
- ],
3292
- "type": "blockContainer",
3293
- }
3294
- `;
3295
-
3296
- exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/mixedRowspansAndColspans to/from prosemirror 1`] = `
3297
- {
3298
- "attrs": {
3299
- "backgroundColor": "default",
3300
- "id": "1",
3301
- "textColor": "default",
3302
- },
3303
- "content": [
3304
- {
3305
- "content": [
3306
- {
3307
- "content": [
3308
- {
3309
- "attrs": {
3310
- "backgroundColor": "red",
3311
- "colspan": 2,
3312
- "colwidth": [
3313
- 100,
3314
- 200,
3315
- ],
3316
- "rowspan": 1,
3317
- "textAlignment": "left",
3318
- "textColor": "blue",
3319
- },
3320
- "content": [
3321
- {
3322
- "content": [
3323
- {
3324
- "text": "Table Cell",
3325
- "type": "text",
3326
- },
3327
- ],
3328
- "type": "tableParagraph",
3329
- },
3330
- ],
3331
- "type": "tableCell",
3332
- },
3333
- {
3334
- "attrs": {
3335
- "backgroundColor": "yellow",
3336
- "colspan": 1,
3337
- "colwidth": [
3338
- 300,
3339
- ],
3340
- "rowspan": 1,
3341
- "textAlignment": "left",
3342
- "textColor": "red",
3343
- },
3344
- "content": [
3345
- {
3346
- "content": [
3347
- {
3348
- "text": "Table Cell",
3349
- "type": "text",
3350
- },
3351
- ],
3352
- "type": "tableParagraph",
3353
- },
3354
- ],
3355
- "type": "tableCell",
3356
- },
3357
- ],
3358
- "type": "tableRow",
3359
- },
3360
- {
3361
- "content": [
3362
- {
3363
- "attrs": {
3364
- "backgroundColor": "default",
3365
- "colspan": 1,
3366
- "colwidth": [
3367
- 100,
3368
- ],
3369
- "rowspan": 2,
3370
- "textAlignment": "left",
3371
- "textColor": "default",
3372
- },
3373
- "content": [
3374
- {
3375
- "content": [
3376
- {
3377
- "text": "Table Cell",
3378
- "type": "text",
3379
- },
3380
- ],
3381
- "type": "tableParagraph",
3382
- },
3383
- ],
3384
- "type": "tableCell",
3385
- },
3386
- {
3387
- "attrs": {
3388
- "backgroundColor": "default",
3389
- "colspan": 2,
3390
- "colwidth": [
3391
- 200,
3392
- 300,
3393
- ],
3394
- "rowspan": 1,
3395
- "textAlignment": "left",
3396
- "textColor": "default",
3397
- },
3398
- "content": [
3399
- {
3400
- "content": [
3401
- {
3402
- "text": "Table Cell",
3403
- "type": "text",
3404
- },
3405
- ],
3406
- "type": "tableParagraph",
3407
- },
3408
- ],
3409
- "type": "tableCell",
3410
- },
3411
- ],
3412
- "type": "tableRow",
3413
- },
3414
- {
3415
- "content": [
3416
- {
3417
- "attrs": {
3418
- "backgroundColor": "default",
3419
- "colspan": 1,
3420
- "colwidth": [
3421
- 200,
3422
- ],
3423
- "rowspan": 1,
3424
- "textAlignment": "left",
3425
- "textColor": "default",
3426
- },
3427
- "content": [
3428
- {
3429
- "content": [
3430
- {
3431
- "text": "Table Cell",
3432
- "type": "text",
3433
- },
3434
- ],
3435
- "type": "tableParagraph",
3436
- },
3437
- ],
3438
- "type": "tableCell",
3439
- },
3440
- {
3441
- "attrs": {
3442
- "backgroundColor": "default",
3443
- "colspan": 1,
3444
- "colwidth": [
3445
- 300,
3446
- ],
3447
- "rowspan": 1,
3448
- "textAlignment": "left",
3449
- "textColor": "default",
3450
- },
3451
- "content": [
3452
- {
3453
- "content": [
3454
- {
3455
- "text": "Table Cell",
3456
- "type": "text",
3457
- },
3458
- ],
3459
- "type": "tableParagraph",
3460
- },
3461
- ],
3462
- "type": "tableCell",
3463
- },
3464
- ],
3465
- "type": "tableRow",
3466
- },
3467
- ],
3468
- "type": "table",
3469
- },
3470
- ],
3471
- "type": "blockContainer",
3472
- }
3473
- `;