@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,19 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "type": "paragraph",
5
- "props": {
6
- "textColor": "default",
7
- "backgroundColor": "default",
8
- "textAlignment": "left"
9
- },
10
- "content": [
11
- {
12
- "type": "text",
13
- "text": "Single Div",
14
- "styles": {}
15
- }
16
- ],
17
- "children": []
18
- }
19
- ]
@@ -1,31 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "type": "image",
5
- "props": {
6
- "backgroundColor": "default",
7
- "textAlignment": "left",
8
- "url": "exampleURL",
9
- "caption": "",
10
- "width": 512
11
- },
12
- "children": []
13
- },
14
- {
15
- "id": "2",
16
- "type": "paragraph",
17
- "props": {
18
- "textColor": "default",
19
- "backgroundColor": "default",
20
- "textAlignment": "left"
21
- },
22
- "content": [
23
- {
24
- "type": "text",
25
- "text": "Image Caption",
26
- "styles": {}
27
- }
28
- ],
29
- "children": []
30
- }
31
- ]
@@ -1,70 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "type": "bulletListItem",
5
- "props": {
6
- "textColor": "default",
7
- "backgroundColor": "default",
8
- "textAlignment": "left"
9
- },
10
- "content": [
11
- {
12
- "type": "text",
13
- "text": "Bullet List Item",
14
- "styles": {}
15
- }
16
- ],
17
- "children": []
18
- },
19
- {
20
- "id": "2",
21
- "type": "numberedListItem",
22
- "props": {
23
- "textColor": "default",
24
- "backgroundColor": "default",
25
- "textAlignment": "left"
26
- },
27
- "content": [
28
- {
29
- "type": "text",
30
- "text": "Nested Numbered List Item",
31
- "styles": {}
32
- }
33
- ],
34
- "children": []
35
- },
36
- {
37
- "id": "3",
38
- "type": "numberedListItem",
39
- "props": {
40
- "textColor": "default",
41
- "backgroundColor": "default",
42
- "textAlignment": "left"
43
- },
44
- "content": [
45
- {
46
- "type": "text",
47
- "text": "Nested Numbered List Item",
48
- "styles": {}
49
- }
50
- ],
51
- "children": []
52
- },
53
- {
54
- "id": "4",
55
- "type": "bulletListItem",
56
- "props": {
57
- "textColor": "default",
58
- "backgroundColor": "default",
59
- "textAlignment": "left"
60
- },
61
- "content": [
62
- {
63
- "type": "text",
64
- "text": "Bullet List Item",
65
- "styles": {}
66
- }
67
- ],
68
- "children": []
69
- }
70
- ]
@@ -1,70 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "type": "bulletListItem",
5
- "props": {
6
- "textColor": "default",
7
- "backgroundColor": "default",
8
- "textAlignment": "left"
9
- },
10
- "content": [
11
- {
12
- "type": "text",
13
- "text": "Bullet List Item",
14
- "styles": {}
15
- }
16
- ],
17
- "children": []
18
- },
19
- {
20
- "id": "2",
21
- "type": "bulletListItem",
22
- "props": {
23
- "textColor": "default",
24
- "backgroundColor": "default",
25
- "textAlignment": "left"
26
- },
27
- "content": [
28
- {
29
- "type": "text",
30
- "text": "Nested Bullet List Item",
31
- "styles": {}
32
- }
33
- ],
34
- "children": []
35
- },
36
- {
37
- "id": "3",
38
- "type": "bulletListItem",
39
- "props": {
40
- "textColor": "default",
41
- "backgroundColor": "default",
42
- "textAlignment": "left"
43
- },
44
- "content": [
45
- {
46
- "type": "text",
47
- "text": "Nested Bullet List Item",
48
- "styles": {}
49
- }
50
- ],
51
- "children": []
52
- },
53
- {
54
- "id": "4",
55
- "type": "bulletListItem",
56
- "props": {
57
- "textColor": "default",
58
- "backgroundColor": "default",
59
- "textAlignment": "left"
60
- },
61
- "content": [
62
- {
63
- "type": "text",
64
- "text": "Bullet List Item",
65
- "styles": {}
66
- }
67
- ],
68
- "children": []
69
- }
70
- ]
@@ -1,70 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "type": "bulletListItem",
5
- "props": {
6
- "textColor": "default",
7
- "backgroundColor": "default",
8
- "textAlignment": "left"
9
- },
10
- "content": [
11
- {
12
- "type": "text",
13
- "text": "Bullet List Item",
14
- "styles": {}
15
- }
16
- ],
17
- "children": []
18
- },
19
- {
20
- "id": "2",
21
- "type": "bulletListItem",
22
- "props": {
23
- "textColor": "default",
24
- "backgroundColor": "default",
25
- "textAlignment": "left"
26
- },
27
- "content": [
28
- {
29
- "type": "text",
30
- "text": "Nested Bullet List Item",
31
- "styles": {}
32
- }
33
- ],
34
- "children": []
35
- },
36
- {
37
- "id": "3",
38
- "type": "bulletListItem",
39
- "props": {
40
- "textColor": "default",
41
- "backgroundColor": "default",
42
- "textAlignment": "left"
43
- },
44
- "content": [
45
- {
46
- "type": "text",
47
- "text": "Nested Bullet List Item",
48
- "styles": {}
49
- }
50
- ],
51
- "children": []
52
- },
53
- {
54
- "id": "4",
55
- "type": "bulletListItem",
56
- "props": {
57
- "textColor": "default",
58
- "backgroundColor": "default",
59
- "textAlignment": "left"
60
- },
61
- "content": [
62
- {
63
- "type": "text",
64
- "text": "Bullet List Item",
65
- "styles": {}
66
- }
67
- ],
68
- "children": []
69
- }
70
- ]
@@ -1 +0,0 @@
1
- <p class="simple-custom-paragraph" data-editable="">Custom Paragraph</p>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleCustomParagraph"><p class="bn-inline-content simple-custom-paragraph" data-editable="">Custom Paragraph</p></div></div></div></div>
@@ -1 +0,0 @@
1
- <p class="simple-custom-paragraph" data-editable="">Custom Paragraph</p><p class="simple-custom-paragraph" data-editable="">Nested Custom Paragraph 1</p><p class="simple-custom-paragraph" data-editable="">Nested Custom Paragraph 2</p>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleCustomParagraph"><p class="bn-inline-content simple-custom-paragraph" data-editable="">Custom Paragraph</p></div><div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="2"><div class="bn-block" data-node-type="blockContainer" data-id="2"><div class="bn-block-content" data-content-type="simpleCustomParagraph"><p class="bn-inline-content simple-custom-paragraph" data-editable="">Nested Custom Paragraph 1</p></div></div></div><div class="bn-block-outer" data-node-type="blockOuter" data-id="3"><div class="bn-block" data-node-type="blockContainer" data-id="3"><div class="bn-block-content" data-content-type="simpleCustomParagraph"><p class="bn-inline-content simple-custom-paragraph" data-editable="">Nested Custom Paragraph 2</p></div></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <p class="simple-custom-paragraph" data-editable="" data-text-color="orange" data-background-color="pink" data-text-alignment="center">Plain <span data-text-color="red">Red Text </span><span data-background-color="blue">Blue Background </span><span data-text-color="red"><span data-background-color="blue">Mixed Colors</span></span></p>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1" data-text-color="orange" data-background-color="pink"><div class="bn-block" data-node-type="blockContainer" data-id="1" data-text-color="orange" data-background-color="pink"><div class="bn-block-content" data-content-type="simpleCustomParagraph" data-text-alignment="center"><p class="bn-inline-content simple-custom-paragraph" data-editable="">Plain <span data-text-color="red">Red Text </span><span data-background-color="blue">Blue Background </span><span data-text-color="red"><span data-background-color="blue">Mixed Colors</span></span></p></div></div></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleFile" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-file-block-content-wrapper"><div class="bn-add-file-button"><div class="bn-add-file-button-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg></div><p class="bn-add-file-button-text">Add file</p></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleFile"><div class="bn-file-block-content-wrapper"><div class="bn-add-file-button"><div class="bn-add-file-button-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg></div><p class="bn-add-file-button-text">Add file</p></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div><div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleFile" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div></div><div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="2"><div class="bn-block" data-node-type="blockContainer" data-id="2"><div class="bn-block-content" data-content-type="simpleFile" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-file-and-caption-wrapper"><div class="bn-file" draggable="false">exampleURL</div><p class="bn-file-caption">Caption</p></div></div></div></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div style="width: 256px;" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div><div class="bn-add-file-button"><div class="bn-add-file-button-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg></div><p class="bn-add-file-button-text">Add image</p></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage"><div class="bn-file-block-content-wrapper"><div class="bn-add-file-button"><div class="bn-add-file-button-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg></div><p class="bn-add-file-button-text">Add image</p></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div style="width: 256px;" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div><div style="width: 256px;" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div></div><div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="2"><div class="bn-block" data-node-type="blockContainer" data-id="2"><div class="bn-block-content" data-content-type="simpleImage" data-name="example" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div><p class="bn-file-caption">Caption</p></div></div></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div style="width: 256px;" data-name="example" data-url="exampleURL" data-preview-width="256"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage" data-name="example" data-url="exampleURL" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="example" draggable="false"></div></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div style="width: 256px;" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="Caption" draggable="false"></div><p class="bn-file-caption">Caption</p></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage" data-url="exampleURL" data-caption="Caption" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-visual-media-wrapper"><img class="bn-visual-media" src="exampleURL" alt="Caption" draggable="false"></div><p class="bn-file-caption">Caption</p></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <div data-name="example" data-url="exampleURL" data-caption="Caption" data-show-preview="false" data-preview-width="256"><div class="bn-file-name-with-icon"><div class="bn-file-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg></div><p class="bn-file-name">example</p></div><p class="bn-file-caption">Caption</p></div>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleImage" data-name="example" data-url="exampleURL" data-caption="Caption" data-show-preview="false" data-preview-width="256"><div class="bn-file-block-content-wrapper"><div class="bn-file-name-with-icon"><div class="bn-file-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg></div><p class="bn-file-name">example</p></div><p class="bn-file-caption">Caption</p></div></div></div></div></div>
@@ -1 +0,0 @@
1
- <p><small data-style-type="small" data-editable="">This is a small text</small></p>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="paragraph"><p class="bn-inline-content"><small data-style-type="small" data-editable="">This is a small text</small></p></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><th colspan="1" rowspan="1"><p>Table Cell</p></th><th colspan="1" rowspan="1"><p>Table Cell</p></th></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><th colspan="1" rowspan="1"><p>Table Cell</p></th><th colspan="1" rowspan="1"><p>Table Cell</p></th><th colspan="1" rowspan="1"><p>Table Cell</p></th></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th></tr><tr><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th><th colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></th></tr><tr><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth=""><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><td data-text-color="blue" data-background-color="red" colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td data-background-color="blue" colspan="1" rowspan="1"><p>Table Cell</p></td><td data-text-color="red" data-background-color="yellow" colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><td data-text-color="blue" data-background-color="red" colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td data-background-color="blue" colspan="1" rowspan="1"><p>Table Cell</p></td><td data-text-color="red" data-background-color="yellow" colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="100"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <table><tr><td data-text-color="blue" data-background-color="red" colspan="2" rowspan="1" colwidth="100,200"><p>Table Cell</p></td><td data-text-color="red" data-background-color="yellow" colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="2" colwidth="100"><p>Table Cell</p></td><td colspan="2" rowspan="1" colwidth="200,300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="table"><table class="bn-inline-content"><tr><td data-text-color="blue" data-background-color="red" colspan="2" rowspan="1" colwidth="100,200"><p>Table Cell</p></td><td data-text-color="red" data-background-color="yellow" colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="2" colwidth="100"><p>Table Cell</p></td><td colspan="2" rowspan="1" colwidth="200,300"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1" colwidth="200"><p>Table Cell</p></td><td colspan="1" rowspan="1" colwidth="300"><p>Table Cell</p></td></tr></table></div></div></div></div>
@@ -1 +0,0 @@
1
- <p>I love <span data-inline-content-type="tag">#<span data-editable="">BlockNote</span></span></p>
@@ -1 +0,0 @@
1
- <div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="paragraph"><p class="bn-inline-content">I love <span data-inline-content-type="tag">#<span data-editable="">BlockNote</span></span></p></div></div></div></div>
@@ -1,110 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, it } from "vitest";
2
-
3
- import { PartialBlock } from "../../../blocks/defaultBlocks.js";
4
- import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
5
- import {
6
- addIdsToBlocks,
7
- partialBlocksToBlocksForTesting,
8
- } from "../../../index.js";
9
- import {
10
- BlockSchema,
11
- InlineContentSchema,
12
- StyleSchema,
13
- } from "../../../schema/index.js";
14
- import { initializeESMDependencies } from "../../../util/esmDependencies.js";
15
- import { customBlocksTestCases } from "../../testUtil/cases/customBlocks.js";
16
- import { customInlineContentTestCases } from "../../testUtil/cases/customInlineContent.js";
17
- import { customStylesTestCases } from "../../testUtil/cases/customStyles.js";
18
- import { defaultSchemaTestCases } from "../../testUtil/cases/defaultSchema.js";
19
- import { createExternalHTMLExporter } from "./externalHTMLExporter.js";
20
- import { createInternalHTMLSerializer } from "./internalHTMLSerializer.js";
21
-
22
- async function convertToHTMLAndCompareSnapshots<
23
- B extends BlockSchema,
24
- I extends InlineContentSchema,
25
- S extends StyleSchema
26
- >(
27
- editor: BlockNoteEditor<B, I, S>,
28
- blocks: PartialBlock<B, I, S>[],
29
- snapshotDirectory: string,
30
- snapshotName: string
31
- ) {
32
- addIdsToBlocks(blocks);
33
-
34
- const serializer = createInternalHTMLSerializer(editor.pmSchema, editor);
35
- const internalHTML = serializer.serializeBlocks(blocks, {});
36
- const internalHTMLSnapshotPath =
37
- "./__snapshots__/" +
38
- snapshotDirectory +
39
- "/" +
40
- snapshotName +
41
- "/internal.html";
42
- await expect(internalHTML).toMatchFileSnapshot(internalHTMLSnapshotPath);
43
-
44
- // turn the internalHTML back into blocks, and make sure no data was lost
45
- const fullBlocks = partialBlocksToBlocksForTesting(editor.schema, blocks);
46
- const parsed = await editor.tryParseHTMLToBlocks(internalHTML);
47
-
48
- expect(parsed).toStrictEqual(fullBlocks);
49
-
50
- await initializeESMDependencies();
51
- // Create the "external" HTML, which is a cleaned up HTML representation, but lossy
52
- const exporter = createExternalHTMLExporter(editor.pmSchema, editor);
53
- const externalHTML = exporter.exportBlocks(blocks, {});
54
- const externalHTMLSnapshotPath =
55
- "./__snapshots__/" +
56
- snapshotDirectory +
57
- "/" +
58
- snapshotName +
59
- "/external.html";
60
- await expect(externalHTML).toMatchFileSnapshot(externalHTMLSnapshotPath);
61
- }
62
-
63
- const testCases = [
64
- defaultSchemaTestCases,
65
- customBlocksTestCases,
66
- customStylesTestCases,
67
- customInlineContentTestCases,
68
- ];
69
-
70
- describe("Test HTML conversion", () => {
71
- for (const testCase of testCases) {
72
- describe("Case: " + testCase.name, () => {
73
- let editor: BlockNoteEditor<any, any, any>;
74
- const div = document.createElement("div");
75
- beforeEach(() => {
76
- editor = testCase.createEditor();
77
-
78
- // Note that we don't necessarily need to mount a root
79
- // Currently, we do mount to a root so that it reflects the "production" use-case more closely.
80
-
81
- // However, it would be nice to increased converage and share the same set of tests for these cases:
82
- // - does render to a root
83
- // - does not render to a root
84
- // - runs in server (jsdom) environment using server-util
85
- editor.mount(div);
86
- });
87
-
88
- afterEach(() => {
89
- editor.mount(undefined);
90
- editor._tiptapEditor.destroy();
91
- editor = undefined as any;
92
-
93
- delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
94
- });
95
-
96
- for (const document of testCase.documents) {
97
- // eslint-disable-next-line no-loop-func
98
- it("Convert " + document.name + " to HTML", async () => {
99
- const nameSplit = document.name.split("/");
100
- await convertToHTMLAndCompareSnapshots(
101
- editor,
102
- document.blocks,
103
- nameSplit[0],
104
- nameSplit[1]
105
- );
106
- });
107
- }
108
- });
109
- }
110
- });
@@ -1,4 +0,0 @@
1
- ```javascript
2
- const hello = 'world';
3
- console.log(hello);
4
- ```
@@ -1,3 +0,0 @@
1
- ```text
2
- console.log('Hello, world!');
3
- ```
@@ -1,3 +0,0 @@
1
- ```python
2
- print('Hello, world!')
3
- ```