@blocknote/core 0.28.0 → 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 (381) hide show
  1. package/dist/blocknote.cjs +9 -9
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +3221 -3351
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +2 -2
  8. package/src/api/__snapshots__/blocks-deleted-nested-deep.json +26 -0
  9. package/src/api/__snapshots__/blocks-deleted-nested.json +68 -0
  10. package/src/api/__snapshots__/blocks-deleted.json +26 -0
  11. package/src/api/__snapshots__/blocks-inserted-nested.json +62 -0
  12. package/src/api/__snapshots__/blocks-inserted.json +20 -0
  13. package/src/api/__snapshots__/blocks-updated-content-inserted.json +42 -0
  14. package/src/api/__snapshots__/blocks-updated-multiple-insert.json +50 -0
  15. package/src/api/__snapshots__/blocks-updated-multiple.json +82 -0
  16. package/src/api/__snapshots__/blocks-updated-nested-deep.json +42 -0
  17. package/src/api/__snapshots__/blocks-updated-nested-multiple.json +118 -0
  18. package/src/api/__snapshots__/blocks-updated-nested.json +78 -0
  19. package/src/api/__snapshots__/blocks-updated-single.json +42 -0
  20. package/src/api/__snapshots__/blocks-updated.json +42 -0
  21. package/src/api/blockManipulation/__snapshots__/transactions.test.ts.snap +34 -0
  22. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +312 -0
  23. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +127 -94
  24. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +19 -37
  25. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +8 -6
  26. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +25 -31
  27. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +93 -91
  28. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +16 -20
  29. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +14 -1
  30. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +18 -56
  31. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +52 -46
  32. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +1051 -0
  33. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +247 -154
  34. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +109 -142
  35. package/src/api/blockManipulation/getBlock/getBlock.ts +23 -48
  36. package/src/api/blockManipulation/insertContentAt.ts +4 -17
  37. package/src/api/blockManipulation/selections/selection.test.ts +32 -16
  38. package/src/api/blockManipulation/selections/selection.ts +25 -51
  39. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +35 -14
  40. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +34 -65
  41. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +8 -10
  42. package/src/api/clipboard/toClipboard/copyExtension.ts +7 -7
  43. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -16
  44. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -17
  45. package/src/api/getBlockInfoFromPos.ts +13 -1
  46. package/src/api/nodeConversions/blockToNode.ts +21 -10
  47. package/src/api/nodeConversions/fragmentToBlocks.ts +5 -18
  48. package/src/api/nodeConversions/nodeToBlock.ts +11 -8
  49. package/src/api/nodeUtil.test.ts +228 -0
  50. package/src/api/nodeUtil.ts +235 -2
  51. package/src/api/parsers/html/parseHTML.ts +2 -10
  52. package/src/api/parsers/markdown/parseMarkdown.ts +2 -8
  53. package/src/api/pmUtil.ts +54 -0
  54. package/src/api/positionMapping.ts +4 -2
  55. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +2 -2
  56. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +9 -13
  57. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +5 -9
  58. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +19 -31
  59. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +10 -8
  60. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +9 -13
  61. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +1 -1
  62. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +5 -9
  63. package/src/blocks/defaultBlockHelpers.ts +1 -1
  64. package/src/editor/BlockNoteEditor.test.ts +1 -1
  65. package/src/editor/BlockNoteEditor.ts +259 -131
  66. package/src/editor/BlockNoteTipTapEditor.ts +91 -8
  67. package/src/extensions/Comments/CommentsPlugin.ts +32 -34
  68. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +4 -8
  69. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +12 -13
  70. package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +1 -3
  71. package/src/extensions/SideMenu/MultipleNodeSelection.ts +3 -1
  72. package/src/extensions/SideMenu/dragging.ts +1 -1
  73. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +22 -19
  74. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +8 -8
  75. package/src/extensions/TableHandles/TableHandlesPlugin.ts +150 -136
  76. package/src/index.ts +4 -3
  77. package/src/schema/inlineContent/createSpec.ts +1 -5
  78. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +2 -2
  79. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -8
  80. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +9 -10
  81. package/types/src/api/blockManipulation/getBlock/getBlock.d.ts +7 -7
  82. package/types/src/api/blockManipulation/insertContentAt.d.ts +5 -3
  83. package/types/src/api/blockManipulation/selections/selection.d.ts +3 -3
  84. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -5
  85. package/types/src/api/getBlockInfoFromPos.d.ts +8 -1
  86. package/types/src/api/nodeConversions/blockToNode.d.ts +3 -3
  87. package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +1 -2
  88. package/types/src/api/nodeConversions/nodeToBlock.d.ts +2 -2
  89. package/types/src/api/nodeUtil.d.ts +67 -1
  90. package/types/src/api/parsers/html/parseHTML.d.ts +1 -1
  91. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -1
  92. package/types/src/api/pmUtil.d.ts +12 -0
  93. package/types/src/editor/BlockNoteEditor.d.ts +72 -10
  94. package/types/src/editor/BlockNoteTipTapEditor.d.ts +15 -2
  95. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
  96. package/types/src/index.d.ts +1 -2
  97. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +0 -1859
  98. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +0 -40
  99. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +0 -20
  100. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +0 -138
  101. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +0 -138
  102. package/src/api/clipboard/__snapshots__/external/pasteImage.html +0 -153
  103. package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +0 -138
  104. package/src/api/clipboard/__snapshots__/external/pasteTable.html +0 -233
  105. package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +0 -216
  106. package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +0 -1
  107. package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +0 -1
  108. package/src/api/clipboard/__snapshots__/internal/childToParent.html +0 -1
  109. package/src/api/clipboard/__snapshots__/internal/childrenToNextParent.html +0 -1
  110. package/src/api/clipboard/__snapshots__/internal/childrenToNextParentsChildren.html +0 -1
  111. package/src/api/clipboard/__snapshots__/internal/image.html +0 -1
  112. package/src/api/clipboard/__snapshots__/internal/multipleChildren.html +0 -1
  113. package/src/api/clipboard/__snapshots__/internal/multipleStyledText.html +0 -1
  114. package/src/api/clipboard/__snapshots__/internal/nestedImage.html +0 -1
  115. package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +0 -1
  116. package/src/api/clipboard/__snapshots__/internal/partialChildToParent.html +0 -1
  117. package/src/api/clipboard/__snapshots__/internal/styledText.html +0 -1
  118. package/src/api/clipboard/__snapshots__/internal/tableAllCells.html +0 -1
  119. package/src/api/clipboard/__snapshots__/internal/tableCell.html +0 -1
  120. package/src/api/clipboard/__snapshots__/internal/tableCellText.html +0 -1
  121. package/src/api/clipboard/__snapshots__/internal/tableRow.html +0 -1
  122. package/src/api/clipboard/__snapshots__/internal/unstyledText.html +0 -1
  123. package/src/api/clipboard/clipboardExternal.test.ts +0 -161
  124. package/src/api/clipboard/clipboardInternal.test.ts +0 -435
  125. package/src/api/clipboard/testUtil.ts +0 -27
  126. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +0 -1
  127. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +0 -3
  128. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +0 -1
  129. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +0 -1
  130. package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +0 -1
  131. package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +0 -1
  132. package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +0 -1
  133. package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +0 -1
  134. package/src/api/exporters/html/__snapshots__/complex/misc/external.html +0 -1
  135. package/src/api/exporters/html/__snapshots__/complex/misc/internal.html +0 -1
  136. package/src/api/exporters/html/__snapshots__/customBlock/basic/external.html +0 -1
  137. package/src/api/exporters/html/__snapshots__/customBlock/basic/internal.html +0 -1
  138. package/src/api/exporters/html/__snapshots__/customParagraph/basic/external.html +0 -1
  139. package/src/api/exporters/html/__snapshots__/customParagraph/basic/internal.html +0 -1
  140. package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/external.html +0 -1
  141. package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/internal.html +0 -1
  142. package/src/api/exporters/html/__snapshots__/customParagraph/nested/external.html +0 -1
  143. package/src/api/exporters/html/__snapshots__/customParagraph/nested/internal.html +0 -1
  144. package/src/api/exporters/html/__snapshots__/customParagraph/styled/external.html +0 -1
  145. package/src/api/exporters/html/__snapshots__/customParagraph/styled/internal.html +0 -1
  146. package/src/api/exporters/html/__snapshots__/file/basic/external.html +0 -1
  147. package/src/api/exporters/html/__snapshots__/file/basic/internal.html +0 -1
  148. package/src/api/exporters/html/__snapshots__/file/button/external.html +0 -1
  149. package/src/api/exporters/html/__snapshots__/file/button/internal.html +0 -1
  150. package/src/api/exporters/html/__snapshots__/file/nested/external.html +0 -1
  151. package/src/api/exporters/html/__snapshots__/file/nested/internal.html +0 -1
  152. package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +0 -1
  153. package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +0 -1
  154. package/src/api/exporters/html/__snapshots__/file/noName/external.html +0 -1
  155. package/src/api/exporters/html/__snapshots__/file/noName/internal.html +0 -1
  156. package/src/api/exporters/html/__snapshots__/fontSize/basic/external.html +0 -1
  157. package/src/api/exporters/html/__snapshots__/fontSize/basic/internal.html +0 -1
  158. package/src/api/exporters/html/__snapshots__/hardbreak/basic/external.html +0 -1
  159. package/src/api/exporters/html/__snapshots__/hardbreak/basic/internal.html +0 -1
  160. package/src/api/exporters/html/__snapshots__/hardbreak/between-links/external.html +0 -1
  161. package/src/api/exporters/html/__snapshots__/hardbreak/between-links/internal.html +0 -1
  162. package/src/api/exporters/html/__snapshots__/hardbreak/end/external.html +0 -1
  163. package/src/api/exporters/html/__snapshots__/hardbreak/end/internal.html +0 -1
  164. package/src/api/exporters/html/__snapshots__/hardbreak/link/external.html +0 -1
  165. package/src/api/exporters/html/__snapshots__/hardbreak/link/internal.html +0 -1
  166. package/src/api/exporters/html/__snapshots__/hardbreak/multiple/external.html +0 -1
  167. package/src/api/exporters/html/__snapshots__/hardbreak/multiple/internal.html +0 -1
  168. package/src/api/exporters/html/__snapshots__/hardbreak/only/external.html +0 -1
  169. package/src/api/exporters/html/__snapshots__/hardbreak/only/internal.html +0 -1
  170. package/src/api/exporters/html/__snapshots__/hardbreak/start/external.html +0 -1
  171. package/src/api/exporters/html/__snapshots__/hardbreak/start/internal.html +0 -1
  172. package/src/api/exporters/html/__snapshots__/hardbreak/styles/external.html +0 -1
  173. package/src/api/exporters/html/__snapshots__/hardbreak/styles/internal.html +0 -1
  174. package/src/api/exporters/html/__snapshots__/image/basic/external.html +0 -1
  175. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +0 -1
  176. package/src/api/exporters/html/__snapshots__/image/button/external.html +0 -1
  177. package/src/api/exporters/html/__snapshots__/image/button/internal.html +0 -1
  178. package/src/api/exporters/html/__snapshots__/image/nested/external.html +0 -1
  179. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +0 -1
  180. package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +0 -1
  181. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +0 -1
  182. package/src/api/exporters/html/__snapshots__/image/noName/external.html +0 -1
  183. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +0 -1
  184. package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +0 -1
  185. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +0 -1
  186. package/src/api/exporters/html/__snapshots__/link/adjacent/external.html +0 -1
  187. package/src/api/exporters/html/__snapshots__/link/adjacent/internal.html +0 -1
  188. package/src/api/exporters/html/__snapshots__/link/basic/external.html +0 -1
  189. package/src/api/exporters/html/__snapshots__/link/basic/internal.html +0 -1
  190. package/src/api/exporters/html/__snapshots__/link/styled/external.html +0 -1
  191. package/src/api/exporters/html/__snapshots__/link/styled/internal.html +0 -1
  192. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +0 -1
  193. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +0 -1
  194. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +0 -1
  195. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +0 -1
  196. package/src/api/exporters/html/__snapshots__/mention/basic/external.html +0 -1
  197. package/src/api/exporters/html/__snapshots__/mention/basic/internal.html +0 -1
  198. package/src/api/exporters/html/__snapshots__/pageBreak/basic/external.html +0 -1
  199. package/src/api/exporters/html/__snapshots__/pageBreak/basic/internal.html +0 -1
  200. package/src/api/exporters/html/__snapshots__/paragraph/basic/external.html +0 -1
  201. package/src/api/exporters/html/__snapshots__/paragraph/basic/internal.html +0 -1
  202. package/src/api/exporters/html/__snapshots__/paragraph/empty/external.html +0 -1
  203. package/src/api/exporters/html/__snapshots__/paragraph/empty/internal.html +0 -1
  204. package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/external.html +0 -1
  205. package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/internal.html +0 -1
  206. package/src/api/exporters/html/__snapshots__/paragraph/nested/external.html +0 -1
  207. package/src/api/exporters/html/__snapshots__/paragraph/nested/internal.html +0 -1
  208. package/src/api/exporters/html/__snapshots__/paragraph/styled/external.html +0 -1
  209. package/src/api/exporters/html/__snapshots__/paragraph/styled/internal.html +0 -1
  210. package/src/api/exporters/html/__snapshots__/paste/parse-basic-block-types.json +0 -140
  211. package/src/api/exporters/html/__snapshots__/paste/parse-deep-nested-content.json +0 -240
  212. package/src/api/exporters/html/__snapshots__/paste/parse-div-with-inline-content.json +0 -91
  213. package/src/api/exporters/html/__snapshots__/paste/parse-divs.json +0 -19
  214. package/src/api/exporters/html/__snapshots__/paste/parse-fake-image-caption.json +0 -31
  215. package/src/api/exporters/html/__snapshots__/paste/parse-mixed-nested-lists.json +0 -70
  216. package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +0 -70
  217. package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists.json +0 -70
  218. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/external.html +0 -1
  219. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/internal.html +0 -1
  220. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/external.html +0 -1
  221. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/internal.html +0 -1
  222. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/external.html +0 -1
  223. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/internal.html +0 -1
  224. package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +0 -1
  225. package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +0 -1
  226. package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +0 -1
  227. package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +0 -1
  228. package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +0 -1
  229. package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +0 -1
  230. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +0 -1
  231. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +0 -1
  232. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +0 -1
  233. package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +0 -1
  234. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +0 -1
  235. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +0 -1
  236. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +0 -1
  237. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +0 -1
  238. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +0 -1
  239. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +0 -1
  240. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +0 -1
  241. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +0 -1
  242. package/src/api/exporters/html/__snapshots__/small/basic/external.html +0 -1
  243. package/src/api/exporters/html/__snapshots__/small/basic/internal.html +0 -1
  244. package/src/api/exporters/html/__snapshots__/table/allColWidths/external.html +0 -1
  245. package/src/api/exporters/html/__snapshots__/table/allColWidths/internal.html +0 -1
  246. package/src/api/exporters/html/__snapshots__/table/basic/external.html +0 -1
  247. package/src/api/exporters/html/__snapshots__/table/basic/internal.html +0 -1
  248. package/src/api/exporters/html/__snapshots__/table/headerCols/external.html +0 -1
  249. package/src/api/exporters/html/__snapshots__/table/headerCols/internal.html +0 -1
  250. package/src/api/exporters/html/__snapshots__/table/headerRows/external.html +0 -1
  251. package/src/api/exporters/html/__snapshots__/table/headerRows/internal.html +0 -1
  252. package/src/api/exporters/html/__snapshots__/table/headersRows/external.html +0 -1
  253. package/src/api/exporters/html/__snapshots__/table/headersRows/internal.html +0 -1
  254. package/src/api/exporters/html/__snapshots__/table/mixedCellColors/external.html +0 -1
  255. package/src/api/exporters/html/__snapshots__/table/mixedCellColors/internal.html +0 -1
  256. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/external.html +0 -1
  257. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/internal.html +0 -1
  258. package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/external.html +0 -1
  259. package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/internal.html +0 -1
  260. package/src/api/exporters/html/__snapshots__/tag/basic/external.html +0 -1
  261. package/src/api/exporters/html/__snapshots__/tag/basic/internal.html +0 -1
  262. package/src/api/exporters/html/htmlConversion.test.ts +0 -110
  263. package/src/api/exporters/markdown/__snapshots__/codeBlock/contains-newlines/markdown.md +0 -4
  264. package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +0 -3
  265. package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +0 -2
  266. package/src/api/exporters/markdown/__snapshots__/codeBlock/python/markdown.md +0 -3
  267. package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +0 -5
  268. package/src/api/exporters/markdown/__snapshots__/customBlock/basic/markdown.md +0 -5
  269. package/src/api/exporters/markdown/__snapshots__/customParagraph/basic/markdown.md +0 -1
  270. package/src/api/exporters/markdown/__snapshots__/customParagraph/lineBreaks/markdown.md +0 -1
  271. package/src/api/exporters/markdown/__snapshots__/customParagraph/nested/markdown.md +0 -5
  272. package/src/api/exporters/markdown/__snapshots__/customParagraph/styled/markdown.md +0 -1
  273. package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +0 -3
  274. package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +0 -1
  275. package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +0 -7
  276. package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +0 -1
  277. package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +0 -3
  278. package/src/api/exporters/markdown/__snapshots__/fontSize/basic/markdown.md +0 -1
  279. package/src/api/exporters/markdown/__snapshots__/hardbreak/basic/markdown.md +0 -2
  280. package/src/api/exporters/markdown/__snapshots__/hardbreak/between-links/markdown.md +0 -2
  281. package/src/api/exporters/markdown/__snapshots__/hardbreak/end/markdown.md +0 -1
  282. package/src/api/exporters/markdown/__snapshots__/hardbreak/link/markdown.md +0 -2
  283. package/src/api/exporters/markdown/__snapshots__/hardbreak/multiple/markdown.md +0 -3
  284. package/src/api/exporters/markdown/__snapshots__/hardbreak/only/markdown.md +0 -0
  285. package/src/api/exporters/markdown/__snapshots__/hardbreak/start/markdown.md +0 -1
  286. package/src/api/exporters/markdown/__snapshots__/hardbreak/styles/markdown.md +0 -2
  287. package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +0 -3
  288. package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +0 -1
  289. package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +0 -7
  290. package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +0 -1
  291. package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +0 -3
  292. package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +0 -3
  293. package/src/api/exporters/markdown/__snapshots__/link/adjacent/markdown.md +0 -1
  294. package/src/api/exporters/markdown/__snapshots__/link/basic/markdown.md +0 -1
  295. package/src/api/exporters/markdown/__snapshots__/link/styled/markdown.md +0 -1
  296. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +0 -10
  297. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +0 -10
  298. package/src/api/exporters/markdown/__snapshots__/mention/basic/markdown.md +0 -1
  299. package/src/api/exporters/markdown/__snapshots__/pageBreak/basic/markdown.md +0 -0
  300. package/src/api/exporters/markdown/__snapshots__/paragraph/basic/markdown.md +0 -1
  301. package/src/api/exporters/markdown/__snapshots__/paragraph/empty/markdown.md +0 -0
  302. package/src/api/exporters/markdown/__snapshots__/paragraph/lineBreaks/markdown.md +0 -2
  303. package/src/api/exporters/markdown/__snapshots__/paragraph/nested/markdown.md +0 -5
  304. package/src/api/exporters/markdown/__snapshots__/paragraph/styled/markdown.md +0 -1
  305. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/basic/markdown.md +0 -1
  306. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/nested/markdown.md +0 -5
  307. package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/styled/markdown.md +0 -1
  308. package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +0 -3
  309. package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +0 -1
  310. package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +0 -7
  311. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +0 -3
  312. package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +0 -1
  313. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +0 -7
  314. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +0 -1
  315. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +0 -3
  316. package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +0 -3
  317. package/src/api/exporters/markdown/__snapshots__/small/basic/markdown.md +0 -1
  318. package/src/api/exporters/markdown/__snapshots__/table/allColWidths/markdown.md +0 -5
  319. package/src/api/exporters/markdown/__snapshots__/table/basic/markdown.md +0 -5
  320. package/src/api/exporters/markdown/__snapshots__/table/headerCols/markdown.md +0 -4
  321. package/src/api/exporters/markdown/__snapshots__/table/headerRows/markdown.md +0 -4
  322. package/src/api/exporters/markdown/__snapshots__/table/mixedCellColors/markdown.md +0 -5
  323. package/src/api/exporters/markdown/__snapshots__/table/mixedColWidths/markdown.md +0 -5
  324. package/src/api/exporters/markdown/__snapshots__/table/mixedRowspansAndColspans/markdown.md +0 -5
  325. package/src/api/exporters/markdown/__snapshots__/tag/basic/markdown.md +0 -1
  326. package/src/api/exporters/markdown/markdownExporter.test.ts +0 -86
  327. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +0 -3473
  328. package/src/api/nodeConversions/nodeConversions.test.ts +0 -83
  329. package/src/api/parsers/html/__snapshots__/list-test.json +0 -177
  330. package/src/api/parsers/html/__snapshots__/parse-2-tables.json +0 -129
  331. package/src/api/parsers/html/__snapshots__/parse-basic-block-types.json +0 -142
  332. package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +0 -62
  333. package/src/api/parsers/html/__snapshots__/parse-div-with-inline-content.json +0 -91
  334. package/src/api/parsers/html/__snapshots__/parse-divs.json +0 -121
  335. package/src/api/parsers/html/__snapshots__/parse-fake-image-caption.json +0 -33
  336. package/src/api/parsers/html/__snapshots__/parse-image-in-paragraph.json +0 -16
  337. package/src/api/parsers/html/__snapshots__/parse-mixed-nested-lists.json +0 -265
  338. package/src/api/parsers/html/__snapshots__/parse-nested-lists-with-paragraphs.json +0 -265
  339. package/src/api/parsers/html/__snapshots__/parse-nested-lists.json +0 -265
  340. package/src/api/parsers/html/__snapshots__/parse-notion-html.json +0 -565
  341. package/src/api/parsers/html/__snapshots__/parse-two-divs.json +0 -36
  342. package/src/api/parsers/html/parseHTML.test.ts +0 -563
  343. package/src/api/parsers/markdown/__snapshots__/complex.json +0 -353
  344. package/src/api/parsers/markdown/__snapshots__/issue-226-1.json +0 -71
  345. package/src/api/parsers/markdown/__snapshots__/issue-226-2.json +0 -144
  346. package/src/api/parsers/markdown/__snapshots__/nested.json +0 -72
  347. package/src/api/parsers/markdown/__snapshots__/non-nested.json +0 -71
  348. package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +0 -319
  349. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +0 -81
  350. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-2.json +0 -165
  351. package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +0 -81
  352. package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +0 -81
  353. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +0 -61
  354. package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +0 -42
  355. package/src/api/parsers/markdown/__snapshots__/styled.json +0 -58
  356. package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +0 -19
  357. package/src/api/parsers/markdown/parseMarkdown.test.ts +0 -135
  358. package/src/api/testUtil/cases/customBlocks.ts +0 -342
  359. package/src/api/testUtil/cases/customInlineContent.ts +0 -113
  360. package/src/api/testUtil/cases/customStyles.ts +0 -102
  361. package/src/api/testUtil/cases/defaultSchema.ts +0 -1493
  362. package/src/api/testUtil/index.ts +0 -19
  363. package/src/api/testUtil/partialBlockTestUtil.ts +0 -198
  364. package/src/api/testUtil/paste.ts +0 -46
  365. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -4
  366. package/types/src/api/clipboard/clipboardExternal.test.d.ts +0 -1
  367. package/types/src/api/clipboard/clipboardInternal.test.d.ts +0 -1
  368. package/types/src/api/clipboard/testUtil.d.ts +0 -541
  369. package/types/src/api/exporters/html/htmlConversion.test.d.ts +0 -1
  370. package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +0 -1
  371. package/types/src/api/nodeConversions/nodeConversions.test.d.ts +0 -1
  372. package/types/src/api/parsers/html/parseHTML.test.d.ts +0 -1
  373. package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +0 -1
  374. package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -670
  375. package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -558
  376. package/types/src/api/testUtil/cases/customStyles.d.ts +0 -552
  377. package/types/src/api/testUtil/cases/defaultSchema.d.ts +0 -4
  378. package/types/src/api/testUtil/index.d.ts +0 -14
  379. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +0 -9
  380. package/types/src/api/testUtil/paste.d.ts +0 -2
  381. /package/types/src/api/{blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts → nodeUtil.test.d.ts} +0 -0
@@ -1,1493 +0,0 @@
1
- import { EditorTestCases } from "../index.js";
2
-
3
- import { uploadToTmpFilesDotOrg_DEV_ONLY } from "../../../blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js";
4
- import {
5
- DefaultBlockSchema,
6
- DefaultInlineContentSchema,
7
- DefaultStyleSchema,
8
- } from "../../../blocks/defaultBlocks.js";
9
- import {
10
- pageBreakSchema,
11
- withPageBreak,
12
- } from "../../../blocks/PageBreakBlockContent/schema.js";
13
- import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
14
- import { BlockNoteSchema } from "../../../editor/BlockNoteSchema.js";
15
-
16
- export const defaultSchemaTestCases: EditorTestCases<
17
- DefaultBlockSchema & typeof pageBreakSchema.blockSchema,
18
- DefaultInlineContentSchema,
19
- DefaultStyleSchema
20
- > = {
21
- name: "default schema",
22
- createEditor: () => {
23
- return BlockNoteEditor.create({
24
- schema: withPageBreak(BlockNoteSchema.create()),
25
- uploadFile: uploadToTmpFilesDotOrg_DEV_ONLY,
26
- codeBlock: {
27
- supportedLanguages: {
28
- javascript: {
29
- name: "JavaScript",
30
- aliases: ["js"],
31
- },
32
- python: {
33
- name: "Python",
34
- aliases: ["py"],
35
- },
36
- },
37
- },
38
- });
39
- },
40
- documents: [
41
- {
42
- name: "paragraph/empty",
43
- blocks: [
44
- {
45
- type: "paragraph",
46
- },
47
- ],
48
- },
49
- {
50
- name: "paragraph/basic",
51
- blocks: [
52
- {
53
- type: "paragraph",
54
- content: "Paragraph",
55
- },
56
- ],
57
- },
58
- {
59
- name: "paragraph/styled",
60
- blocks: [
61
- {
62
- type: "paragraph",
63
- props: {
64
- textAlignment: "center",
65
- textColor: "orange",
66
- backgroundColor: "pink",
67
- },
68
- content: [
69
- {
70
- type: "text",
71
- styles: {},
72
- text: "Plain ",
73
- },
74
- {
75
- type: "text",
76
- styles: {
77
- textColor: "red",
78
- },
79
- text: "Red Text ",
80
- },
81
- {
82
- type: "text",
83
- styles: {
84
- backgroundColor: "blue",
85
- },
86
- text: "Blue Background ",
87
- },
88
- {
89
- type: "text",
90
- styles: {
91
- textColor: "red",
92
- backgroundColor: "blue",
93
- },
94
- text: "Mixed Colors",
95
- },
96
- ],
97
- },
98
- ],
99
- },
100
- {
101
- name: "paragraph/nested",
102
- blocks: [
103
- {
104
- type: "paragraph",
105
- content: "Paragraph",
106
- children: [
107
- {
108
- type: "paragraph",
109
- content: "Nested Paragraph 1",
110
- },
111
- {
112
- type: "paragraph",
113
- content: "Nested Paragraph 2",
114
- },
115
- ],
116
- },
117
- ],
118
- },
119
- {
120
- name: "paragraph/lineBreaks",
121
- blocks: [
122
- {
123
- type: "paragraph",
124
- content: "Line 1\nLine 2",
125
- },
126
- ],
127
- },
128
- {
129
- name: "lists/basic",
130
- blocks: [
131
- {
132
- type: "bulletListItem",
133
- content: "Bullet List Item 1",
134
- },
135
- {
136
- type: "bulletListItem",
137
- content: "Bullet List Item 2",
138
- },
139
- {
140
- type: "numberedListItem",
141
- content: "Numbered List Item 1",
142
- },
143
- {
144
- type: "numberedListItem",
145
- content: "Numbered List Item 2",
146
- },
147
- {
148
- type: "checkListItem",
149
- content: "Check List Item 1",
150
- },
151
- {
152
- type: "checkListItem",
153
- props: {
154
- checked: true,
155
- },
156
- content: "Check List Item 2",
157
- },
158
- ],
159
- },
160
- {
161
- name: "lists/nested",
162
- blocks: [
163
- {
164
- type: "bulletListItem",
165
- content: "Bullet List Item 1",
166
- },
167
- {
168
- type: "bulletListItem",
169
- content: "Bullet List Item 2",
170
- children: [
171
- {
172
- type: "numberedListItem",
173
- content: "Numbered List Item 1",
174
- },
175
- {
176
- type: "numberedListItem",
177
- content: "Numbered List Item 2",
178
- children: [
179
- {
180
- type: "checkListItem",
181
- content: "Check List Item 1",
182
- },
183
- {
184
- type: "checkListItem",
185
- props: {
186
- checked: true,
187
- },
188
- content: "Check List Item 2",
189
- },
190
- ],
191
- },
192
- ],
193
- },
194
- ],
195
- },
196
- {
197
- name: "codeBlock/empty",
198
- blocks: [
199
- {
200
- type: "codeBlock",
201
- },
202
- ],
203
- },
204
- {
205
- name: "codeBlock/defaultLanguage",
206
- blocks: [
207
- {
208
- type: "codeBlock",
209
- content: "console.log('Hello, world!');",
210
- },
211
- ],
212
- },
213
- {
214
- name: "codeBlock/python",
215
- blocks: [
216
- {
217
- type: "codeBlock",
218
- props: { language: "python" },
219
- content: "print('Hello, world!')",
220
- },
221
- ],
222
- },
223
- {
224
- name: "codeBlock/contains-newlines",
225
- blocks: [
226
- {
227
- type: "codeBlock",
228
- props: { language: "javascript" },
229
- content: "const hello = 'world';\nconsole.log(hello);\n",
230
- },
231
- ],
232
- },
233
- {
234
- name: "pageBreak/basic",
235
- blocks: [
236
- {
237
- type: "pageBreak",
238
- },
239
- ],
240
- },
241
- {
242
- name: "file/button",
243
- blocks: [
244
- {
245
- type: "file",
246
- },
247
- ],
248
- },
249
- {
250
- name: "file/basic",
251
- blocks: [
252
- {
253
- type: "file",
254
- props: {
255
- name: "example",
256
- url: "exampleURL",
257
- caption: "Caption",
258
- },
259
- },
260
- ],
261
- },
262
- {
263
- name: "file/noName",
264
- blocks: [
265
- {
266
- type: "file",
267
- props: {
268
- url: "exampleURL",
269
- caption: "Caption",
270
- },
271
- },
272
- ],
273
- },
274
- {
275
- name: "file/noCaption",
276
- blocks: [
277
- {
278
- type: "file",
279
- props: {
280
- name: "example",
281
- url: "exampleURL",
282
- },
283
- },
284
- ],
285
- },
286
- {
287
- name: "file/nested",
288
- blocks: [
289
- {
290
- type: "file",
291
- props: {
292
- name: "example",
293
- url: "exampleURL",
294
- caption: "Caption",
295
- },
296
- children: [
297
- {
298
- type: "file",
299
- props: {
300
- name: "example",
301
- url: "exampleURL",
302
- caption: "Caption",
303
- },
304
- },
305
- ],
306
- },
307
- ],
308
- },
309
- // Because images need to fetch the download URL async, their internal HTML
310
- // is initially rendered without a `src` attribute, which is reflected in
311
- // the tests.
312
- {
313
- name: "image/button",
314
- blocks: [
315
- {
316
- type: "image",
317
- },
318
- ],
319
- },
320
- {
321
- name: "image/basic",
322
- blocks: [
323
- {
324
- type: "image",
325
- props: {
326
- name: "example",
327
- url: "exampleURL",
328
- caption: "Caption",
329
- previewWidth: 256,
330
- },
331
- },
332
- ],
333
- },
334
- {
335
- name: "image/noName",
336
- blocks: [
337
- {
338
- type: "image",
339
- props: {
340
- url: "exampleURL",
341
- caption: "Caption",
342
- previewWidth: 256,
343
- },
344
- },
345
- ],
346
- },
347
- {
348
- name: "image/noCaption",
349
- blocks: [
350
- {
351
- type: "image",
352
- props: {
353
- name: "example",
354
- url: "exampleURL",
355
- previewWidth: 256,
356
- },
357
- },
358
- ],
359
- },
360
- {
361
- name: "image/noPreview",
362
- blocks: [
363
- {
364
- type: "image",
365
- props: {
366
- name: "example",
367
- url: "exampleURL",
368
- caption: "Caption",
369
- showPreview: false,
370
- previewWidth: 256,
371
- },
372
- },
373
- ],
374
- },
375
- {
376
- name: "image/nested",
377
- blocks: [
378
- {
379
- type: "image",
380
- props: {
381
- url: "exampleURL",
382
- caption: "Caption",
383
- previewWidth: 256,
384
- },
385
- children: [
386
- {
387
- type: "image",
388
- props: {
389
- url: "exampleURL",
390
- caption: "Caption",
391
- previewWidth: 256,
392
- },
393
- },
394
- ],
395
- },
396
- ],
397
- },
398
- {
399
- name: "table/basic",
400
- blocks: [
401
- {
402
- type: "table",
403
- content: {
404
- type: "tableContent",
405
- rows: [
406
- {
407
- cells: [
408
- {
409
- type: "tableCell",
410
- content: ["Table Cell"],
411
- props: {
412
- backgroundColor: "default",
413
- colspan: 1,
414
- rowspan: 1,
415
- textAlignment: "left",
416
- textColor: "default",
417
- },
418
- },
419
- {
420
- type: "tableCell",
421
- content: ["Table Cell"],
422
- props: {
423
- backgroundColor: "default",
424
- colspan: 1,
425
- rowspan: 1,
426
- textAlignment: "left",
427
- textColor: "default",
428
- },
429
- },
430
- {
431
- type: "tableCell",
432
- content: ["Table Cell"],
433
- props: {
434
- backgroundColor: "default",
435
- colspan: 1,
436
- rowspan: 1,
437
- textAlignment: "left",
438
- textColor: "default",
439
- },
440
- },
441
- ],
442
- },
443
- {
444
- cells: [
445
- {
446
- type: "tableCell",
447
- content: ["Table Cell"],
448
- props: {
449
- backgroundColor: "default",
450
- colspan: 1,
451
- rowspan: 1,
452
- textAlignment: "left",
453
- textColor: "default",
454
- },
455
- },
456
- {
457
- type: "tableCell",
458
- content: ["Table Cell"],
459
- props: {
460
- backgroundColor: "default",
461
- colspan: 1,
462
- rowspan: 1,
463
- textAlignment: "left",
464
- textColor: "default",
465
- },
466
- },
467
- {
468
- type: "tableCell",
469
- content: ["Table Cell"],
470
- props: {
471
- backgroundColor: "default",
472
- colspan: 1,
473
- rowspan: 1,
474
- textAlignment: "left",
475
- textColor: "default",
476
- },
477
- },
478
- ],
479
- },
480
- {
481
- cells: [
482
- {
483
- type: "tableCell",
484
- content: ["Table Cell"],
485
- props: {
486
- backgroundColor: "default",
487
- colspan: 1,
488
- rowspan: 1,
489
- textAlignment: "left",
490
- textColor: "default",
491
- },
492
- },
493
- {
494
- type: "tableCell",
495
- content: ["Table Cell"],
496
- props: {
497
- backgroundColor: "default",
498
- colspan: 1,
499
- rowspan: 1,
500
- textAlignment: "left",
501
- textColor: "default",
502
- },
503
- },
504
- {
505
- type: "tableCell",
506
- content: ["Table Cell"],
507
- props: {
508
- backgroundColor: "default",
509
- colspan: 1,
510
- rowspan: 1,
511
- textAlignment: "left",
512
- textColor: "default",
513
- },
514
- },
515
- ],
516
- },
517
- ],
518
- },
519
- },
520
- ],
521
- },
522
- {
523
- name: "table/allColWidths",
524
- blocks: [
525
- {
526
- type: "table",
527
- content: {
528
- type: "tableContent",
529
- columnWidths: [100, 200, 300],
530
- rows: [
531
- {
532
- cells: [
533
- {
534
- type: "tableCell",
535
- content: ["Table Cell"],
536
- props: {
537
- backgroundColor: "default",
538
- colspan: 1,
539
- rowspan: 1,
540
- textAlignment: "left",
541
- textColor: "default",
542
- },
543
- },
544
- {
545
- type: "tableCell",
546
- content: ["Table Cell"],
547
- props: {
548
- backgroundColor: "default",
549
- colspan: 1,
550
- rowspan: 1,
551
- textAlignment: "left",
552
- textColor: "default",
553
- },
554
- },
555
- {
556
- type: "tableCell",
557
- content: ["Table Cell"],
558
- props: {
559
- backgroundColor: "default",
560
- colspan: 1,
561
- rowspan: 1,
562
- textAlignment: "left",
563
- textColor: "default",
564
- },
565
- },
566
- ],
567
- },
568
- {
569
- cells: [
570
- {
571
- type: "tableCell",
572
- content: ["Table Cell"],
573
- props: {
574
- backgroundColor: "default",
575
- colspan: 1,
576
- rowspan: 1,
577
- textAlignment: "left",
578
- textColor: "default",
579
- },
580
- },
581
- {
582
- type: "tableCell",
583
- content: ["Table Cell"],
584
- props: {
585
- backgroundColor: "default",
586
- colspan: 1,
587
- rowspan: 1,
588
- textAlignment: "left",
589
- textColor: "default",
590
- },
591
- },
592
- {
593
- type: "tableCell",
594
- content: ["Table Cell"],
595
- props: {
596
- backgroundColor: "default",
597
- colspan: 1,
598
- rowspan: 1,
599
- textAlignment: "left",
600
- textColor: "default",
601
- },
602
- },
603
- ],
604
- },
605
- {
606
- cells: [
607
- {
608
- type: "tableCell",
609
- content: ["Table Cell"],
610
- props: {
611
- backgroundColor: "default",
612
- colspan: 1,
613
- rowspan: 1,
614
- textAlignment: "left",
615
- textColor: "default",
616
- },
617
- },
618
- {
619
- type: "tableCell",
620
- content: ["Table Cell"],
621
- props: {
622
- backgroundColor: "default",
623
- colspan: 1,
624
- rowspan: 1,
625
- textAlignment: "left",
626
- textColor: "default",
627
- },
628
- },
629
- {
630
- type: "tableCell",
631
- content: ["Table Cell"],
632
- props: {
633
- backgroundColor: "default",
634
- colspan: 1,
635
- rowspan: 1,
636
- textAlignment: "left",
637
- textColor: "default",
638
- },
639
- },
640
- ],
641
- },
642
- ],
643
- },
644
- },
645
- ],
646
- },
647
- {
648
- name: "table/mixedColWidths",
649
- blocks: [
650
- {
651
- type: "table",
652
- content: {
653
- type: "tableContent",
654
- columnWidths: [100, undefined, 300],
655
- rows: [
656
- {
657
- cells: [
658
- {
659
- type: "tableCell",
660
- content: ["Table Cell"],
661
- props: {
662
- backgroundColor: "default",
663
- colspan: 1,
664
- rowspan: 1,
665
- textAlignment: "left",
666
- textColor: "default",
667
- },
668
- },
669
- {
670
- type: "tableCell",
671
- content: ["Table Cell"],
672
- props: {
673
- backgroundColor: "default",
674
- colspan: 1,
675
- rowspan: 1,
676
- textAlignment: "left",
677
- textColor: "default",
678
- },
679
- },
680
- {
681
- type: "tableCell",
682
- content: ["Table Cell"],
683
- props: {
684
- backgroundColor: "default",
685
- colspan: 1,
686
- rowspan: 1,
687
- textAlignment: "left",
688
- textColor: "default",
689
- },
690
- },
691
- ],
692
- },
693
- {
694
- cells: [
695
- {
696
- type: "tableCell",
697
- content: ["Table Cell"],
698
- props: {
699
- backgroundColor: "default",
700
- colspan: 1,
701
- rowspan: 1,
702
- textAlignment: "left",
703
- textColor: "default",
704
- },
705
- },
706
- {
707
- type: "tableCell",
708
- content: ["Table Cell"],
709
- props: {
710
- backgroundColor: "default",
711
- colspan: 1,
712
- rowspan: 1,
713
- textAlignment: "left",
714
- textColor: "default",
715
- },
716
- },
717
- {
718
- type: "tableCell",
719
- content: ["Table Cell"],
720
- props: {
721
- backgroundColor: "default",
722
- colspan: 1,
723
- rowspan: 1,
724
- textAlignment: "left",
725
- textColor: "default",
726
- },
727
- },
728
- ],
729
- },
730
- {
731
- cells: [
732
- {
733
- type: "tableCell",
734
- content: ["Table Cell"],
735
- props: {
736
- backgroundColor: "default",
737
- colspan: 1,
738
- rowspan: 1,
739
- textAlignment: "left",
740
- textColor: "default",
741
- },
742
- },
743
- {
744
- type: "tableCell",
745
- content: ["Table Cell"],
746
- props: {
747
- backgroundColor: "default",
748
- colspan: 1,
749
- rowspan: 1,
750
- textAlignment: "left",
751
- textColor: "default",
752
- },
753
- },
754
- {
755
- type: "tableCell",
756
- content: ["Table Cell"],
757
- props: {
758
- backgroundColor: "default",
759
- colspan: 1,
760
- rowspan: 1,
761
- textAlignment: "left",
762
- textColor: "default",
763
- },
764
- },
765
- ],
766
- },
767
- ],
768
- },
769
- },
770
- ],
771
- },
772
- {
773
- name: "table/mixedCellColors",
774
- blocks: [
775
- {
776
- type: "table",
777
- content: {
778
- type: "tableContent",
779
- columnWidths: [100, undefined, 300],
780
- rows: [
781
- {
782
- cells: [
783
- {
784
- type: "tableCell",
785
- content: ["Table Cell"],
786
- props: {
787
- backgroundColor: "red",
788
- colspan: 1,
789
- rowspan: 1,
790
- textAlignment: "left",
791
- textColor: "blue",
792
- },
793
- },
794
- {
795
- type: "tableCell",
796
- content: ["Table Cell"],
797
- props: {
798
- backgroundColor: "blue",
799
- colspan: 1,
800
- rowspan: 1,
801
- textAlignment: "left",
802
- textColor: "default",
803
- },
804
- },
805
- {
806
- type: "tableCell",
807
- content: ["Table Cell"],
808
- props: {
809
- backgroundColor: "yellow",
810
- colspan: 1,
811
- rowspan: 1,
812
- textAlignment: "left",
813
- textColor: "red",
814
- },
815
- },
816
- ],
817
- },
818
- {
819
- cells: [
820
- {
821
- type: "tableCell",
822
- content: ["Table Cell"],
823
- props: {
824
- backgroundColor: "default",
825
- colspan: 1,
826
- rowspan: 1,
827
- textAlignment: "left",
828
- textColor: "default",
829
- },
830
- },
831
- {
832
- type: "tableCell",
833
- content: ["Table Cell"],
834
- props: {
835
- backgroundColor: "default",
836
- colspan: 1,
837
- rowspan: 1,
838
- textAlignment: "left",
839
- textColor: "default",
840
- },
841
- },
842
- {
843
- type: "tableCell",
844
- content: ["Table Cell"],
845
- props: {
846
- backgroundColor: "default",
847
- colspan: 1,
848
- rowspan: 1,
849
- textAlignment: "left",
850
- textColor: "default",
851
- },
852
- },
853
- ],
854
- },
855
- {
856
- cells: [
857
- {
858
- type: "tableCell",
859
- content: ["Table Cell"],
860
- props: {
861
- backgroundColor: "default",
862
- colspan: 1,
863
- rowspan: 1,
864
- textAlignment: "left",
865
- textColor: "default",
866
- },
867
- },
868
- {
869
- type: "tableCell",
870
- content: ["Table Cell"],
871
- props: {
872
- backgroundColor: "default",
873
- colspan: 1,
874
- rowspan: 1,
875
- textAlignment: "left",
876
- textColor: "default",
877
- },
878
- },
879
- {
880
- type: "tableCell",
881
- content: ["Table Cell"],
882
- props: {
883
- backgroundColor: "default",
884
- colspan: 1,
885
- rowspan: 1,
886
- textAlignment: "left",
887
- textColor: "default",
888
- },
889
- },
890
- ],
891
- },
892
- ],
893
- },
894
- },
895
- ],
896
- },
897
- {
898
- name: "table/mixedRowspansAndColspans",
899
- blocks: [
900
- {
901
- type: "table",
902
- content: {
903
- type: "tableContent",
904
- columnWidths: [100, 200, 300],
905
- rows: [
906
- {
907
- cells: [
908
- {
909
- type: "tableCell",
910
- content: ["Table Cell"],
911
- props: {
912
- backgroundColor: "red",
913
- colspan: 2,
914
- rowspan: 1,
915
- textAlignment: "left",
916
- textColor: "blue",
917
- },
918
- },
919
- {
920
- type: "tableCell",
921
- content: ["Table Cell"],
922
- props: {
923
- backgroundColor: "yellow",
924
- colspan: 1,
925
- rowspan: 1,
926
- textAlignment: "left",
927
- textColor: "red",
928
- },
929
- },
930
- ],
931
- },
932
- {
933
- cells: [
934
- {
935
- type: "tableCell",
936
- content: ["Table Cell"],
937
- props: {
938
- backgroundColor: "default",
939
- colspan: 1,
940
- rowspan: 2,
941
- textAlignment: "left",
942
- textColor: "default",
943
- },
944
- },
945
- {
946
- type: "tableCell",
947
- content: ["Table Cell"],
948
- props: {
949
- backgroundColor: "default",
950
- colspan: 2,
951
- rowspan: 1,
952
- textAlignment: "left",
953
- textColor: "default",
954
- },
955
- },
956
- ],
957
- },
958
- {
959
- cells: [
960
- {
961
- type: "tableCell",
962
- content: ["Table Cell"],
963
- props: {
964
- backgroundColor: "default",
965
- colspan: 1,
966
- rowspan: 1,
967
- textAlignment: "left",
968
- textColor: "default",
969
- },
970
- },
971
- {
972
- type: "tableCell",
973
- content: ["Table Cell"],
974
- props: {
975
- backgroundColor: "default",
976
- colspan: 1,
977
- rowspan: 1,
978
- textAlignment: "left",
979
- textColor: "default",
980
- },
981
- },
982
- ],
983
- },
984
- ],
985
- },
986
- },
987
- ],
988
- },
989
- {
990
- name: "table/headerRows",
991
- blocks: [
992
- {
993
- type: "table",
994
- content: {
995
- headerRows: 1,
996
- type: "tableContent",
997
- rows: [
998
- {
999
- cells: [
1000
- {
1001
- type: "tableCell",
1002
- content: ["Table Cell"],
1003
- props: {
1004
- backgroundColor: "default",
1005
- colspan: 1,
1006
- rowspan: 1,
1007
- textAlignment: "left",
1008
- textColor: "default",
1009
- },
1010
- },
1011
- {
1012
- type: "tableCell",
1013
- content: ["Table Cell"],
1014
- props: {
1015
- backgroundColor: "default",
1016
- colspan: 1,
1017
- rowspan: 1,
1018
- textAlignment: "left",
1019
- textColor: "default",
1020
- },
1021
- },
1022
- {
1023
- type: "tableCell",
1024
- content: ["Table Cell"],
1025
- props: {
1026
- backgroundColor: "default",
1027
- colspan: 1,
1028
- rowspan: 1,
1029
- textAlignment: "left",
1030
- textColor: "default",
1031
- },
1032
- },
1033
- ],
1034
- },
1035
- {
1036
- cells: [
1037
- {
1038
- type: "tableCell",
1039
- content: ["Table Cell"],
1040
- props: {
1041
- backgroundColor: "default",
1042
- colspan: 1,
1043
- rowspan: 1,
1044
- textAlignment: "left",
1045
- textColor: "default",
1046
- },
1047
- },
1048
- {
1049
- type: "tableCell",
1050
- content: ["Table Cell"],
1051
- props: {
1052
- backgroundColor: "default",
1053
- colspan: 1,
1054
- rowspan: 1,
1055
- textAlignment: "left",
1056
- textColor: "default",
1057
- },
1058
- },
1059
- {
1060
- type: "tableCell",
1061
- content: ["Table Cell"],
1062
- props: {
1063
- backgroundColor: "default",
1064
- colspan: 1,
1065
- rowspan: 1,
1066
- textAlignment: "left",
1067
- textColor: "default",
1068
- },
1069
- },
1070
- ],
1071
- },
1072
- {
1073
- cells: [
1074
- {
1075
- type: "tableCell",
1076
- content: ["Table Cell"],
1077
- props: {
1078
- backgroundColor: "default",
1079
- colspan: 1,
1080
- rowspan: 1,
1081
- textAlignment: "left",
1082
- textColor: "default",
1083
- },
1084
- },
1085
- {
1086
- type: "tableCell",
1087
- content: ["Table Cell"],
1088
- props: {
1089
- backgroundColor: "default",
1090
- colspan: 1,
1091
- rowspan: 1,
1092
- textAlignment: "left",
1093
- textColor: "default",
1094
- },
1095
- },
1096
- {
1097
- type: "tableCell",
1098
- content: ["Table Cell"],
1099
- props: {
1100
- backgroundColor: "default",
1101
- colspan: 1,
1102
- rowspan: 1,
1103
- textAlignment: "left",
1104
- textColor: "default",
1105
- },
1106
- },
1107
- ],
1108
- },
1109
- ],
1110
- },
1111
- },
1112
- ],
1113
- },
1114
- {
1115
- name: "table/headerCols",
1116
- blocks: [
1117
- {
1118
- type: "table",
1119
- content: {
1120
- headerCols: 1,
1121
- type: "tableContent",
1122
- rows: [
1123
- {
1124
- cells: [
1125
- {
1126
- type: "tableCell",
1127
- content: ["Table Cell"],
1128
- props: {
1129
- backgroundColor: "default",
1130
- colspan: 1,
1131
- rowspan: 1,
1132
- textAlignment: "left",
1133
- textColor: "default",
1134
- },
1135
- },
1136
- {
1137
- type: "tableCell",
1138
- content: ["Table Cell"],
1139
- props: {
1140
- backgroundColor: "default",
1141
- colspan: 1,
1142
- rowspan: 1,
1143
- textAlignment: "left",
1144
- textColor: "default",
1145
- },
1146
- },
1147
- {
1148
- type: "tableCell",
1149
- content: ["Table Cell"],
1150
- props: {
1151
- backgroundColor: "default",
1152
- colspan: 1,
1153
- rowspan: 1,
1154
- textAlignment: "left",
1155
- textColor: "default",
1156
- },
1157
- },
1158
- ],
1159
- },
1160
- {
1161
- cells: [
1162
- {
1163
- type: "tableCell",
1164
- content: ["Table Cell"],
1165
- props: {
1166
- backgroundColor: "default",
1167
- colspan: 1,
1168
- rowspan: 1,
1169
- textAlignment: "left",
1170
- textColor: "default",
1171
- },
1172
- },
1173
- {
1174
- type: "tableCell",
1175
- content: ["Table Cell"],
1176
- props: {
1177
- backgroundColor: "default",
1178
- colspan: 1,
1179
- rowspan: 1,
1180
- textAlignment: "left",
1181
- textColor: "default",
1182
- },
1183
- },
1184
- {
1185
- type: "tableCell",
1186
- content: ["Table Cell"],
1187
- props: {
1188
- backgroundColor: "default",
1189
- colspan: 1,
1190
- rowspan: 1,
1191
- textAlignment: "left",
1192
- textColor: "default",
1193
- },
1194
- },
1195
- ],
1196
- },
1197
- {
1198
- cells: [
1199
- {
1200
- type: "tableCell",
1201
- content: ["Table Cell"],
1202
- props: {
1203
- backgroundColor: "default",
1204
- colspan: 1,
1205
- rowspan: 1,
1206
- textAlignment: "left",
1207
- textColor: "default",
1208
- },
1209
- },
1210
- {
1211
- type: "tableCell",
1212
- content: ["Table Cell"],
1213
- props: {
1214
- backgroundColor: "default",
1215
- colspan: 1,
1216
- rowspan: 1,
1217
- textAlignment: "left",
1218
- textColor: "default",
1219
- },
1220
- },
1221
- {
1222
- type: "tableCell",
1223
- content: ["Table Cell"],
1224
- props: {
1225
- backgroundColor: "default",
1226
- colspan: 1,
1227
- rowspan: 1,
1228
- textAlignment: "left",
1229
- textColor: "default",
1230
- },
1231
- },
1232
- ],
1233
- },
1234
- ],
1235
- },
1236
- },
1237
- ],
1238
- },
1239
- {
1240
- name: "link/basic",
1241
- blocks: [
1242
- {
1243
- // id: UniqueID.options.generateID(),
1244
- type: "paragraph",
1245
- content: [
1246
- {
1247
- type: "link",
1248
- href: "https://www.website.com",
1249
- content: "Website",
1250
- },
1251
- ],
1252
- },
1253
- ],
1254
- },
1255
- {
1256
- name: "link/styled",
1257
- blocks: [
1258
- {
1259
- // id: UniqueID.options.generateID(),
1260
- type: "paragraph",
1261
- content: [
1262
- {
1263
- type: "link",
1264
- href: "https://www.website.com",
1265
- content: [
1266
- {
1267
- type: "text",
1268
- text: "Web",
1269
- styles: {
1270
- bold: true,
1271
- },
1272
- },
1273
- {
1274
- type: "text",
1275
- text: "site",
1276
- styles: {},
1277
- },
1278
- ],
1279
- },
1280
- ],
1281
- },
1282
- ],
1283
- },
1284
- {
1285
- name: "link/adjacent",
1286
- blocks: [
1287
- {
1288
- // id: UniqueID.options.generateID(),
1289
- type: "paragraph",
1290
- content: [
1291
- {
1292
- type: "link",
1293
- href: "https://www.website.com",
1294
- content: "Website",
1295
- },
1296
- {
1297
- type: "link",
1298
- href: "https://www.website2.com",
1299
- content: "Website2",
1300
- },
1301
- ],
1302
- },
1303
- ],
1304
- },
1305
- {
1306
- name: "hardbreak/basic",
1307
- blocks: [
1308
- {
1309
- // id: UniqueID.options.generateID(),
1310
- type: "paragraph",
1311
- content: [
1312
- {
1313
- type: "text",
1314
- text: "Text1\nText2",
1315
- styles: {},
1316
- },
1317
- ],
1318
- },
1319
- ],
1320
- },
1321
- {
1322
- name: "hardbreak/multiple",
1323
- blocks: [
1324
- {
1325
- // id: UniqueID.options.generateID(),
1326
- type: "paragraph",
1327
- content: [
1328
- {
1329
- type: "text",
1330
- text: "Text1\nText2\nText3",
1331
- styles: {},
1332
- },
1333
- ],
1334
- },
1335
- ],
1336
- },
1337
- {
1338
- name: "hardbreak/start",
1339
- blocks: [
1340
- {
1341
- // id: UniqueID.options.generateID(),
1342
- type: "paragraph",
1343
- content: [
1344
- {
1345
- type: "text",
1346
- text: "\nText1",
1347
- styles: {},
1348
- },
1349
- ],
1350
- },
1351
- ],
1352
- },
1353
- {
1354
- name: "hardbreak/end",
1355
- blocks: [
1356
- {
1357
- // id: UniqueID.options.generateID(),
1358
- type: "paragraph",
1359
- content: [
1360
- {
1361
- type: "text",
1362
- text: "Text1\n",
1363
- styles: {},
1364
- },
1365
- ],
1366
- },
1367
- ],
1368
- },
1369
- {
1370
- name: "hardbreak/only",
1371
- blocks: [
1372
- {
1373
- // id: UniqueID.options.generateID(),
1374
- type: "paragraph",
1375
- content: [
1376
- {
1377
- type: "text",
1378
- text: "\n",
1379
- styles: {},
1380
- },
1381
- ],
1382
- },
1383
- ],
1384
- },
1385
- {
1386
- name: "hardbreak/styles",
1387
- blocks: [
1388
- {
1389
- // id: UniqueID.options.generateID(),
1390
- type: "paragraph",
1391
- content: [
1392
- {
1393
- type: "text",
1394
- text: "Text1\n",
1395
- styles: {},
1396
- },
1397
- {
1398
- type: "text",
1399
- text: "Text2",
1400
- styles: { bold: true },
1401
- },
1402
- ],
1403
- },
1404
- ],
1405
- },
1406
- {
1407
- name: "hardbreak/link",
1408
- blocks: [
1409
- {
1410
- // id: UniqueID.options.generateID(),
1411
- type: "paragraph",
1412
- content: [
1413
- {
1414
- type: "link",
1415
- href: "https://www.website.com",
1416
- content: "Link1\nLink1",
1417
- },
1418
- ],
1419
- },
1420
- ],
1421
- },
1422
- {
1423
- name: "hardbreak/between-links",
1424
- blocks: [
1425
- {
1426
- // id: UniqueID.options.generateID(),
1427
- type: "paragraph",
1428
- content: [
1429
- {
1430
- type: "link",
1431
- href: "https://www.website.com",
1432
- content: "Link1\n",
1433
- },
1434
- {
1435
- type: "link",
1436
- href: "https://www.website2.com",
1437
- content: "Link2",
1438
- },
1439
- ],
1440
- },
1441
- ],
1442
- },
1443
- {
1444
- name: "complex/misc",
1445
- blocks: [
1446
- {
1447
- // id: UniqueID.options.generateID(),
1448
- type: "heading",
1449
- props: {
1450
- backgroundColor: "blue",
1451
- textColor: "yellow",
1452
- textAlignment: "right",
1453
- level: 2,
1454
- },
1455
- content: [
1456
- {
1457
- type: "text",
1458
- text: "Heading ",
1459
- styles: {
1460
- bold: true,
1461
- underline: true,
1462
- },
1463
- },
1464
- {
1465
- type: "text",
1466
- text: "2",
1467
- styles: {
1468
- italic: true,
1469
- strike: true,
1470
- },
1471
- },
1472
- ],
1473
- children: [
1474
- {
1475
- // id: UniqueID.options.generateID(),
1476
- type: "paragraph",
1477
- props: {
1478
- backgroundColor: "red",
1479
- },
1480
- content: "Paragraph",
1481
- children: [],
1482
- },
1483
- {
1484
- // id: UniqueID.options.generateID(),
1485
- type: "bulletListItem",
1486
- props: {},
1487
- },
1488
- ],
1489
- },
1490
- ],
1491
- },
1492
- ],
1493
- };