@blocknote/core 0.17.1 → 0.19.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 (490) hide show
  1. package/dist/blocknote.js +2774 -1804
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +9 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +27 -0
  6. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +1 -0
  7. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +99 -0
  8. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +1 -0
  9. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +97 -0
  10. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +1 -0
  11. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +88 -0
  12. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +1 -0
  13. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js +116 -0
  14. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js.map +1 -0
  15. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +106 -0
  16. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +1 -0
  17. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +57 -0
  18. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +1 -0
  19. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +43 -0
  20. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -0
  21. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +27 -0
  22. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -0
  23. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +29 -0
  24. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +1 -0
  25. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +157 -0
  26. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +1 -0
  27. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +27 -0
  28. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +1 -0
  29. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +64 -0
  30. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +1 -0
  31. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +145 -0
  32. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +1 -0
  33. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +252 -0
  34. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +1 -0
  35. package/dist/src/api/blockManipulation/insertContentAt.js +64 -0
  36. package/dist/src/api/blockManipulation/insertContentAt.js.map +1 -0
  37. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +76 -0
  38. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +1 -0
  39. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +33 -0
  40. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +1 -0
  41. package/dist/src/api/blockManipulation/setupTestEnv.js +172 -0
  42. package/dist/src/api/blockManipulation/setupTestEnv.js.map +1 -0
  43. package/dist/src/api/clipboard/clipboard.test.js +246 -0
  44. package/dist/src/api/clipboard/clipboard.test.js.map +1 -0
  45. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +8 -0
  46. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +1 -0
  47. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +38 -0
  48. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +1 -0
  49. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +109 -0
  50. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -0
  51. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +26 -0
  52. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +1 -0
  53. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +57 -0
  54. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +1 -0
  55. package/dist/src/api/clipboard/toClipboard/copyExtension.js +132 -0
  56. package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +1 -0
  57. package/dist/src/api/exporters/html/externalHTMLExporter.js +35 -0
  58. package/dist/src/api/exporters/html/externalHTMLExporter.js.map +1 -0
  59. package/dist/src/api/exporters/html/htmlConversion.test.js +72 -0
  60. package/dist/src/api/exporters/html/htmlConversion.test.js.map +1 -0
  61. package/dist/src/api/exporters/html/internalHTMLSerializer.js +21 -0
  62. package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +1 -0
  63. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +141 -0
  64. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +1 -0
  65. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +96 -0
  66. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +1 -0
  67. package/dist/src/api/exporters/markdown/markdownExporter.js +31 -0
  68. package/dist/src/api/exporters/markdown/markdownExporter.js.map +1 -0
  69. package/dist/src/api/exporters/markdown/markdownExporter.test.js +57 -0
  70. package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +1 -0
  71. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +33 -0
  72. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +1 -0
  73. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +37 -0
  74. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +1 -0
  75. package/dist/src/api/getBlockInfoFromPos.js +171 -0
  76. package/dist/src/api/getBlockInfoFromPos.js.map +1 -0
  77. package/dist/src/api/nodeConversions/blockToNode.js +197 -0
  78. package/dist/src/api/nodeConversions/blockToNode.js.map +1 -0
  79. package/dist/src/api/nodeConversions/fragmentToBlocks.js +50 -0
  80. package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +1 -0
  81. package/dist/src/api/nodeConversions/nodeConversions.test.js +54 -0
  82. package/dist/src/api/nodeConversions/nodeConversions.test.js.map +1 -0
  83. package/dist/src/api/nodeConversions/nodeToBlock.js +316 -0
  84. package/dist/src/api/nodeConversions/nodeToBlock.js.map +1 -0
  85. package/dist/src/api/nodeUtil.js +28 -0
  86. package/dist/src/api/nodeUtil.js.map +1 -0
  87. package/dist/src/api/parsers/html/parseHTML.js +19 -0
  88. package/dist/src/api/parsers/html/parseHTML.js.map +1 -0
  89. package/dist/src/api/parsers/html/parseHTML.test.js +470 -0
  90. package/dist/src/api/parsers/html/parseHTML.test.js.map +1 -0
  91. package/dist/src/api/parsers/html/util/nestedLists.js +106 -0
  92. package/dist/src/api/parsers/html/util/nestedLists.js.map +1 -0
  93. package/dist/src/api/parsers/html/util/nestedLists.test.js +166 -0
  94. package/dist/src/api/parsers/html/util/nestedLists.test.js.map +1 -0
  95. package/dist/src/api/parsers/markdown/parseMarkdown.js +52 -0
  96. package/dist/src/api/parsers/markdown/parseMarkdown.js.map +1 -0
  97. package/dist/src/api/parsers/markdown/parseMarkdown.test.js +109 -0
  98. package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +1 -0
  99. package/dist/src/api/testUtil/cases/customBlocks.js +313 -0
  100. package/dist/src/api/testUtil/cases/customBlocks.js.map +1 -0
  101. package/dist/src/api/testUtil/cases/customInlineContent.js +91 -0
  102. package/dist/src/api/testUtil/cases/customInlineContent.js.map +1 -0
  103. package/dist/src/api/testUtil/cases/customStyles.js +83 -0
  104. package/dist/src/api/testUtil/cases/customStyles.js.map +1 -0
  105. package/dist/src/api/testUtil/cases/defaultSchema.js +673 -0
  106. package/dist/src/api/testUtil/cases/defaultSchema.js.map +1 -0
  107. package/dist/src/api/testUtil/index.js +2 -0
  108. package/dist/src/api/testUtil/index.js.map +1 -0
  109. package/dist/src/api/testUtil/partialBlockTestUtil.js +114 -0
  110. package/dist/src/api/testUtil/partialBlockTestUtil.js.map +1 -0
  111. package/dist/src/api/testUtil/paste.js +29 -0
  112. package/dist/src/api/testUtil/paste.js.map +1 -0
  113. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +97 -0
  114. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +1 -0
  115. package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js +5 -0
  116. package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +1 -0
  117. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +273 -0
  118. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +1 -0
  119. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +90 -0
  120. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +1 -0
  121. package/dist/src/blocks/FileBlockContent/FileBlockContent.js +70 -0
  122. package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +1 -0
  123. package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +317 -0
  124. package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +1 -0
  125. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +15 -0
  126. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +1 -0
  127. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +141 -0
  128. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +1 -0
  129. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +106 -0
  130. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +1 -0
  131. package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js +6 -0
  132. package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +1 -0
  133. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +111 -0
  134. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -0
  135. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +218 -0
  136. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -0
  137. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +41 -0
  138. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +1 -0
  139. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +58 -0
  140. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +1 -0
  141. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +128 -0
  142. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -0
  143. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +51 -0
  144. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -0
  145. package/dist/src/blocks/TableBlockContent/TableBlockContent.js +130 -0
  146. package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +1 -0
  147. package/dist/src/blocks/TableBlockContent/TableExtension.js +57 -0
  148. package/dist/src/blocks/TableBlockContent/TableExtension.js.map +1 -0
  149. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +103 -0
  150. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +1 -0
  151. package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js +6 -0
  152. package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +1 -0
  153. package/dist/src/blocks/defaultBlockHelpers.js +50 -0
  154. package/dist/src/blocks/defaultBlockHelpers.js.map +1 -0
  155. package/dist/src/blocks/defaultBlockTypeGuards.js +40 -0
  156. package/dist/src/blocks/defaultBlockTypeGuards.js.map +1 -0
  157. package/dist/src/blocks/defaultBlocks.js +50 -0
  158. package/dist/src/blocks/defaultBlocks.js.map +1 -0
  159. package/dist/src/blocks/defaultProps.js +19 -0
  160. package/dist/src/blocks/defaultProps.js.map +1 -0
  161. package/dist/src/editor/BlockNoteEditor.js +750 -0
  162. package/dist/src/editor/BlockNoteEditor.js.map +1 -0
  163. package/dist/src/editor/BlockNoteEditor.test.js +65 -0
  164. package/dist/src/editor/BlockNoteEditor.test.js.map +1 -0
  165. package/dist/src/editor/BlockNoteExtensions.js +149 -0
  166. package/dist/src/editor/BlockNoteExtensions.js.map +1 -0
  167. package/dist/src/editor/BlockNoteSchema.js +38 -0
  168. package/dist/src/editor/BlockNoteSchema.js.map +1 -0
  169. package/dist/src/editor/BlockNoteTipTapEditor.js +169 -0
  170. package/dist/src/editor/BlockNoteTipTapEditor.js.map +1 -0
  171. package/dist/src/editor/cursorPositionTypes.js +2 -0
  172. package/dist/src/editor/cursorPositionTypes.js.map +1 -0
  173. package/dist/src/editor/defaultColors.js +77 -0
  174. package/dist/src/editor/defaultColors.js.map +1 -0
  175. package/dist/src/editor/selectionTypes.js +2 -0
  176. package/dist/src/editor/selectionTypes.js.map +1 -0
  177. package/dist/src/editor/transformPasted.js +79 -0
  178. package/dist/src/editor/transformPasted.js.map +1 -0
  179. package/dist/src/exporter/Exporter.js +36 -0
  180. package/dist/src/exporter/Exporter.js.map +1 -0
  181. package/dist/src/exporter/index.js +3 -0
  182. package/dist/src/exporter/index.js.map +1 -0
  183. package/dist/src/exporter/mapping.js +12 -0
  184. package/dist/src/exporter/mapping.js.map +1 -0
  185. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +30 -0
  186. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +1 -0
  187. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +39 -0
  188. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +1 -0
  189. package/dist/src/extensions/FilePanel/FilePanelPlugin.js +131 -0
  190. package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +1 -0
  191. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +195 -0
  192. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +1 -0
  193. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +309 -0
  194. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -0
  195. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +247 -0
  196. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +1 -0
  197. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +51 -0
  198. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -0
  199. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +81 -0
  200. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -0
  201. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +183 -0
  202. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +1 -0
  203. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +68 -0
  204. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +1 -0
  205. package/dist/src/extensions/SideMenu/SideMenuPlugin.js +339 -0
  206. package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +1 -0
  207. package/dist/src/extensions/SideMenu/dragging.js +128 -0
  208. package/dist/src/extensions/SideMenu/dragging.js.map +1 -0
  209. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +2 -0
  210. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +1 -0
  211. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +2 -0
  212. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +1 -0
  213. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +245 -0
  214. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +1 -0
  215. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +26 -0
  216. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +1 -0
  217. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +244 -0
  218. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +1 -0
  219. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +553 -0
  220. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +1 -0
  221. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +36 -0
  222. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +1 -0
  223. package/dist/src/extensions/TextColor/TextColorExtension.js +29 -0
  224. package/dist/src/extensions/TextColor/TextColorExtension.js.map +1 -0
  225. package/dist/src/extensions/TextColor/TextColorMark.js +37 -0
  226. package/dist/src/extensions/TextColor/TextColorMark.js.map +1 -0
  227. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +58 -0
  228. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +1 -0
  229. package/dist/src/extensions/UniqueID/UniqueID.js +283 -0
  230. package/dist/src/extensions/UniqueID/UniqueID.js.map +1 -0
  231. package/dist/src/extensions/getDraggableBlockFromElement.js +13 -0
  232. package/dist/src/extensions/getDraggableBlockFromElement.js.map +1 -0
  233. package/dist/src/extensions-shared/UiElementPosition.js +2 -0
  234. package/dist/src/extensions-shared/UiElementPosition.js.map +1 -0
  235. package/dist/src/i18n/dictionary.js +4 -0
  236. package/dist/src/i18n/dictionary.js.map +1 -0
  237. package/dist/src/i18n/locales/ar.js +298 -0
  238. package/dist/src/i18n/locales/ar.js.map +1 -0
  239. package/dist/src/i18n/locales/de.js +313 -0
  240. package/dist/src/i18n/locales/de.js.map +1 -0
  241. package/dist/src/i18n/locales/en.js +314 -0
  242. package/dist/src/i18n/locales/en.js.map +1 -0
  243. package/dist/src/i18n/locales/es.js +312 -0
  244. package/dist/src/i18n/locales/es.js.map +1 -0
  245. package/dist/src/i18n/locales/fr.js +313 -0
  246. package/dist/src/i18n/locales/fr.js.map +1 -0
  247. package/dist/src/i18n/locales/hr.js +308 -0
  248. package/dist/src/i18n/locales/hr.js.map +1 -0
  249. package/dist/src/i18n/locales/index.js +16 -0
  250. package/dist/src/i18n/locales/index.js.map +1 -0
  251. package/dist/src/i18n/locales/is.js +305 -0
  252. package/dist/src/i18n/locales/is.js.map +1 -0
  253. package/dist/src/i18n/locales/ja.js +333 -0
  254. package/dist/src/i18n/locales/ja.js.map +1 -0
  255. package/dist/src/i18n/locales/ko.js +326 -0
  256. package/dist/src/i18n/locales/ko.js.map +1 -0
  257. package/dist/src/i18n/locales/nl.js +313 -0
  258. package/dist/src/i18n/locales/nl.js.map +1 -0
  259. package/dist/src/i18n/locales/pl.js +297 -0
  260. package/dist/src/i18n/locales/pl.js.map +1 -0
  261. package/dist/src/i18n/locales/pt.js +305 -0
  262. package/dist/src/i18n/locales/pt.js.map +1 -0
  263. package/dist/src/i18n/locales/ru.js +340 -0
  264. package/dist/src/i18n/locales/ru.js.map +1 -0
  265. package/dist/src/i18n/locales/vi.js +312 -0
  266. package/dist/src/i18n/locales/vi.js.map +1 -0
  267. package/dist/src/i18n/locales/zh.js +346 -0
  268. package/dist/src/i18n/locales/zh.js.map +1 -0
  269. package/dist/src/index.js +55 -0
  270. package/dist/src/index.js.map +1 -0
  271. package/dist/src/pm-nodes/BlockContainer.js +72 -0
  272. package/dist/src/pm-nodes/BlockContainer.js.map +1 -0
  273. package/dist/src/pm-nodes/BlockGroup.js +43 -0
  274. package/dist/src/pm-nodes/BlockGroup.js.map +1 -0
  275. package/dist/src/pm-nodes/Doc.js +7 -0
  276. package/dist/src/pm-nodes/Doc.js.map +1 -0
  277. package/dist/src/pm-nodes/index.js +4 -0
  278. package/dist/src/pm-nodes/index.js.map +1 -0
  279. package/dist/src/schema/blocks/createSpec.js +126 -0
  280. package/dist/src/schema/blocks/createSpec.js.map +1 -0
  281. package/dist/src/schema/blocks/internal.js +147 -0
  282. package/dist/src/schema/blocks/internal.js.map +1 -0
  283. package/dist/src/schema/blocks/types.js +2 -0
  284. package/dist/src/schema/blocks/types.js.map +1 -0
  285. package/dist/src/schema/index.js +11 -0
  286. package/dist/src/schema/index.js.map +1 -0
  287. package/dist/src/schema/inlineContent/createSpec.js +64 -0
  288. package/dist/src/schema/inlineContent/createSpec.js.map +1 -0
  289. package/dist/src/schema/inlineContent/internal.js +52 -0
  290. package/dist/src/schema/inlineContent/internal.js.map +1 -0
  291. package/dist/src/schema/inlineContent/types.js +10 -0
  292. package/dist/src/schema/inlineContent/types.js.map +1 -0
  293. package/dist/src/schema/propTypes.js +2 -0
  294. package/dist/src/schema/propTypes.js.map +1 -0
  295. package/dist/src/schema/styles/createSpec.js +48 -0
  296. package/dist/src/schema/styles/createSpec.js.map +1 -0
  297. package/dist/src/schema/styles/internal.js +53 -0
  298. package/dist/src/schema/styles/internal.js.map +1 -0
  299. package/dist/src/schema/styles/types.js +2 -0
  300. package/dist/src/schema/styles/types.js.map +1 -0
  301. package/dist/src/util/EventEmitter.js +33 -0
  302. package/dist/src/util/EventEmitter.js.map +1 -0
  303. package/dist/src/util/browser.js +17 -0
  304. package/dist/src/util/browser.js.map +1 -0
  305. package/dist/src/util/combineByGroup.js +20 -0
  306. package/dist/src/util/combineByGroup.js.map +1 -0
  307. package/dist/src/util/esmDependencies.js +35 -0
  308. package/dist/src/util/esmDependencies.js.map +1 -0
  309. package/dist/src/util/string.js +14 -0
  310. package/dist/src/util/string.js.map +1 -0
  311. package/dist/src/util/typescript.js +12 -0
  312. package/dist/src/util/typescript.js.map +1 -0
  313. package/dist/style.css +1 -1
  314. package/dist/tsconfig.tsbuildinfo +1 -0
  315. package/dist/webpack-stats.json +1 -1
  316. package/package.json +9 -7
  317. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +30 -0
  318. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -0
  319. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +25 -0
  320. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +2 -2
  321. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +104 -39
  322. package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +40 -0
  323. package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +3 -5
  324. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +100 -0
  325. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +10 -0
  326. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +1 -1
  327. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +40 -0
  328. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +30 -0
  329. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +8 -4
  330. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +11 -7
  331. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +87 -0
  332. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +5 -5
  333. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +192 -107
  334. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +48 -33
  335. package/src/api/clipboard/clipboard.test.ts +1 -1
  336. package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -0
  337. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +1 -1
  338. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +49 -0
  339. package/src/api/clipboard/fromClipboard/pasteExtension.ts +6 -0
  340. package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
  341. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +1 -0
  342. package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +1 -0
  343. package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +1 -0
  344. package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +1 -0
  345. package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +1 -0
  346. package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +1 -0
  347. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  348. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  349. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
  350. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -1
  351. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -1
  352. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -1
  353. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  354. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  355. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  356. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  357. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
  358. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
  359. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
  360. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
  361. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -1
  362. package/src/api/exporters/html/__snapshots__/table/allColWidths/external.html +1 -0
  363. package/src/api/exporters/html/__snapshots__/table/allColWidths/internal.html +1 -0
  364. package/src/api/exporters/html/__snapshots__/table/basic/external.html +1 -0
  365. package/src/api/exporters/html/__snapshots__/table/basic/internal.html +1 -0
  366. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/external.html +1 -0
  367. package/src/api/exporters/html/__snapshots__/table/mixedColWidths/internal.html +1 -0
  368. package/src/api/exporters/html/htmlConversion.test.ts +1 -4
  369. package/src/api/exporters/html/internalHTMLSerializer.ts +2 -7
  370. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
  371. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +75 -33
  372. package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +3 -0
  373. package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +2 -0
  374. package/src/api/exporters/markdown/__snapshots__/codeBlock/python/markdown.md +3 -0
  375. package/src/api/exporters/markdown/__snapshots__/table/allColWidths/markdown.md +5 -0
  376. package/src/api/exporters/markdown/__snapshots__/table/basic/markdown.md +5 -0
  377. package/src/api/exporters/markdown/__snapshots__/table/mixedColWidths/markdown.md +5 -0
  378. package/src/api/exporters/markdown/markdownExporter.test.ts +1 -4
  379. package/src/api/getBlockInfoFromPos.ts +113 -58
  380. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +711 -0
  381. package/src/api/nodeConversions/blockToNode.ts +62 -26
  382. package/src/api/nodeConversions/fragmentToBlocks.ts +18 -0
  383. package/src/api/nodeConversions/nodeToBlock.ts +35 -22
  384. package/src/api/nodeUtil.ts +1 -1
  385. package/src/api/parsers/html/__snapshots__/parse-notion-html.json +5 -0
  386. package/src/api/parsers/markdown/parseMarkdown.ts +1 -1
  387. package/src/api/testUtil/cases/defaultSchema.ts +95 -0
  388. package/src/api/testUtil/partialBlockTestUtil.ts +41 -4
  389. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +4 -2
  390. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +369 -0
  391. package/src/blocks/CodeBlockContent/defaultSupportedLanguages.ts +96 -0
  392. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +10 -2
  393. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +19 -31
  394. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +4 -2
  395. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +5 -9
  396. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +6 -10
  397. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +1 -1
  398. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -4
  399. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +5 -9
  400. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +4 -8
  401. package/src/blocks/TableBlockContent/TableBlockContent.ts +83 -8
  402. package/src/blocks/TableBlockContent/TableExtension.ts +10 -1
  403. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +4 -2
  404. package/src/blocks/defaultBlockHelpers.ts +7 -2
  405. package/src/blocks/defaultBlocks.ts +4 -0
  406. package/src/editor/Block.css +71 -3
  407. package/src/editor/BlockNoteEditor.test.ts +2 -2
  408. package/src/editor/BlockNoteEditor.ts +18 -21
  409. package/src/editor/BlockNoteExtensions.ts +2 -3
  410. package/src/editor/BlockNoteTipTapEditor.ts +8 -1
  411. package/src/editor/defaultColors.ts +77 -0
  412. package/src/editor/editor.css +43 -5
  413. package/src/editor/transformPasted.ts +6 -3
  414. package/src/exporter/Exporter.ts +101 -0
  415. package/src/exporter/index.ts +2 -0
  416. package/src/exporter/mapping.ts +75 -0
  417. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +8 -0
  418. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +201 -48
  419. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +1 -1
  420. package/src/extensions/Placeholder/PlaceholderPlugin.ts +5 -0
  421. package/src/extensions/SideMenu/SideMenuPlugin.ts +141 -52
  422. package/src/extensions/SideMenu/dragging.ts +3 -54
  423. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +5 -0
  424. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +2 -1
  425. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +22 -6
  426. package/src/extensions/TableHandles/TableHandlesPlugin.ts +225 -120
  427. package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
  428. package/src/extensions/getDraggableBlockFromElement.ts +19 -0
  429. package/src/i18n/locales/ar.ts +6 -0
  430. package/src/i18n/locales/de.ts +299 -294
  431. package/src/i18n/locales/en.ts +6 -0
  432. package/src/i18n/locales/es.ts +310 -274
  433. package/src/i18n/locales/fr.ts +6 -0
  434. package/src/i18n/locales/is.ts +6 -0
  435. package/src/i18n/locales/ja.ts +6 -0
  436. package/src/i18n/locales/ko.ts +6 -0
  437. package/src/i18n/locales/nl.ts +6 -0
  438. package/src/i18n/locales/pl.ts +6 -0
  439. package/src/i18n/locales/pt.ts +10 -4
  440. package/src/i18n/locales/ru.ts +6 -0
  441. package/src/i18n/locales/vi.ts +6 -0
  442. package/src/i18n/locales/zh.ts +6 -0
  443. package/src/index.ts +9 -0
  444. package/src/pm-nodes/BlockContainer.ts +1 -1
  445. package/src/pm-nodes/BlockGroup.ts +2 -2
  446. package/src/pm-nodes/README.md +127 -28
  447. package/src/schema/blocks/createSpec.ts +4 -1
  448. package/src/schema/blocks/internal.ts +12 -2
  449. package/src/schema/blocks/types.ts +3 -1
  450. package/src/util/combineByGroup.ts +25 -0
  451. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +22 -2
  452. package/types/src/api/blockManipulation/commands/nestBlock/nestBlock.d.ts +5 -0
  453. package/types/src/api/blockManipulation/setupTestEnv.d.ts +22 -8
  454. package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
  455. package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +3 -0
  456. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +2 -3
  457. package/types/src/api/getBlockInfoFromPos.d.ts +55 -5
  458. package/types/src/api/nodeConversions/blockToNode.d.ts +1 -1
  459. package/types/src/api/nodeConversions/nodeToBlock.d.ts +3 -1
  460. package/types/src/api/testUtil/cases/customBlocks.d.ts +22 -8
  461. package/types/src/api/testUtil/cases/customInlineContent.d.ts +22 -8
  462. package/types/src/api/testUtil/cases/customStyles.d.ts +22 -8
  463. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
  464. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +1 -0
  465. package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +57 -0
  466. package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
  467. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +1 -0
  468. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +1 -0
  469. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -12
  470. package/types/src/blocks/TableBlockContent/TableExtension.d.ts +3 -0
  471. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +1 -0
  472. package/types/src/blocks/defaultBlocks.d.ts +45 -16
  473. package/types/src/editor/BlockNoteEditor.d.ts +4 -3
  474. package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -0
  475. package/types/src/editor/defaultColors.d.ts +76 -0
  476. package/types/src/exporter/Exporter.d.ts +43 -0
  477. package/types/src/exporter/index.d.ts +2 -0
  478. package/types/src/exporter/mapping.d.ts +30 -0
  479. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +2 -1
  480. package/types/src/extensions/SideMenu/dragging.d.ts +1 -6
  481. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +9 -5
  482. package/types/src/extensions/getDraggableBlockFromElement.d.ts +5 -0
  483. package/types/src/i18n/locales/de.d.ts +6 -0
  484. package/types/src/i18n/locales/en.d.ts +6 -0
  485. package/types/src/i18n/locales/es.d.ts +6 -0
  486. package/types/src/index.d.ts +6 -0
  487. package/types/src/schema/blocks/createSpec.d.ts +1 -1
  488. package/types/src/schema/blocks/internal.d.ts +2 -2
  489. package/types/src/schema/blocks/types.d.ts +3 -1
  490. package/types/src/util/combineByGroup.d.ts +9 -0
@@ -1 +1 @@
1
- {"builtAt":1729263486791,"assets":[{"name":"blocknote.umd.cjs","size":208726},{"name":"blocknote.umd.cjs.map","size":759040}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":6582,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":7183,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":6664,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":6796,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":7294,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":7031,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":6876,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":6323,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":6146,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":7079,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":6768,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":6965,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":7638,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":6927,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":6093,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8887,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":4735,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":4807,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":2423,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":343,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3341,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1691,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":299,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":3877,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3588,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":7292,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1357,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2761,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/fileBlockHelpers.ts","size":10029,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/audioBlockHelpers.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/AudioBlockContent.ts","size":3075,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1581,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/imageBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3242,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/videoBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3050,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":548,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":3250,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":4159,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":775,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1338,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3504,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7329,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":1679,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":3811,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1464,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":1462,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":1603,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1123,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1580,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":1071,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlock/moveBlock.ts","size":3630,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts","size":1490,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":1064,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1120,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts","size":2421,"chunks":["a1ee98a"]},{"name":"./src/util/esmDependencies.ts","size":820,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":969,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":837,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1104,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":3584,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":5062,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7365,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":474,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":5673,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":8353,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":7960,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":15879,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":91,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3477,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":1470,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":4580,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":791,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":2319,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":9633,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":928,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":725,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1594,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2029,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":4363,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":1776,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":3438,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":2744,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1096,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4554,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":26241,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":700,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":6441,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":2166,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
1
+ {"builtAt":1730893799043,"assets":[{"name":"blocknote.umd.cjs","size":227916},{"name":"blocknote.umd.cjs.map","size":837299}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":6741,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":7352,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":6830,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":7226,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":7467,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":7031,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":7034,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":6484,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":6280,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":7240,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":6935,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":7153,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":7815,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":7083,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":6234,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8887,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":5714,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":4944,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":3154,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3845,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":544,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1755,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":299,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":3877,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3588,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":7644,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1357,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2761,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/fileBlockHelpers.ts","size":10249,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/audioBlockHelpers.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/AudioBlockContent.ts","size":3124,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/defaultSupportedLanguages.ts","size":1391,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/CodeBlockContent.ts","size":8257,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1581,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/imageBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3291,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":1849,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/videoBlockHelpers.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3099,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":4567,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3957,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":895,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1347,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3436,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7254,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":1903,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":3743,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1403,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":4272,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1147,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1580,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":1071,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlock/moveBlock.ts","size":3601,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2324,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts","size":1486,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":1064,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1120,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts","size":2804,"chunks":["a1ee98a"]},{"name":"./src/util/esmDependencies.ts","size":820,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":969,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":837,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":3584,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":5205,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7365,"chunks":["a1ee98a"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":859,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4439,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":10209,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":8064,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":18537,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":115,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3470,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":723,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":1618,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":4575,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":791,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3228,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":13834,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":928,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":725,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1563,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2038,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1102,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":4407,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":1814,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":3599,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":2825,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1103,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4554,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":26013,"chunks":["a1ee98a"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1075,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":700,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":6859,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":3117,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "*.css"
7
7
  ],
8
8
  "license": "MPL-2.0",
9
- "version": "0.17.1",
9
+ "version": "0.19.0",
10
10
  "files": [
11
11
  "dist",
12
12
  "types",
@@ -63,7 +63,6 @@
63
63
  "@tiptap/extension-code": "^2.7.1",
64
64
  "@tiptap/extension-collaboration": "^2.7.1",
65
65
  "@tiptap/extension-collaboration-cursor": "^2.7.1",
66
- "@tiptap/extension-dropcursor": "^2.7.1",
67
66
  "@tiptap/extension-gapcursor": "^2.7.1",
68
67
  "@tiptap/extension-hard-break": "^2.7.1",
69
68
  "@tiptap/extension-history": "^2.7.1",
@@ -80,9 +79,11 @@
80
79
  "@tiptap/pm": "^2.7.1",
81
80
  "emoji-mart": "^5.6.0",
82
81
  "hast-util-from-dom": "^4.2.0",
83
- "prosemirror-model": "^1.21.0",
82
+ "prosemirror-dropcursor": "^1.8.1",
83
+ "prosemirror-highlight": "^0.9.0",
84
+ "prosemirror-model": "^1.23.0",
84
85
  "prosemirror-state": "^1.4.3",
85
- "prosemirror-tables": "^1.3.7",
86
+ "prosemirror-tables": "^1.6.1",
86
87
  "prosemirror-transform": "^1.9.0",
87
88
  "prosemirror-view": "^1.33.7",
88
89
  "rehype-format": "^5.0.0",
@@ -93,6 +94,7 @@
93
94
  "remark-parse": "^10.0.1",
94
95
  "remark-rehype": "^10.1.0",
95
96
  "remark-stringify": "^10.0.2",
97
+ "shiki": "^1.22.0",
96
98
  "unified": "^10.1.2",
97
99
  "uuid": "^8.3.2",
98
100
  "y-prosemirror": "1.2.12",
@@ -101,10 +103,10 @@
101
103
  },
102
104
  "devDependencies": {
103
105
  "@types/emoji-mart": "^3.0.14",
104
- "@types/hast": "^2.3.4",
106
+ "@types/hast": "^3.0.0",
105
107
  "@types/uuid": "^8.3.4",
106
108
  "eslint": "^8.10.0",
107
- "jsdom": "^21.1.0",
109
+ "jsdom": "^25.0.1",
108
110
  "prettier": "^2.7.1",
109
111
  "rimraf": "^5.0.5",
110
112
  "rollup-plugin-webpack-stats": "^0.2.2",
@@ -122,5 +124,5 @@
122
124
  "access": "public",
123
125
  "registry": "https://registry.npmjs.org/"
124
126
  },
125
- "gitHead": "8867e6411d6e698e667b7ac22697bcf76f763937"
127
+ "gitHead": "c48248efc5ceab7962ed6ba39cf8db0cbf3f0d5c"
126
128
  }
@@ -309,6 +309,11 @@ exports[`Test insertBlocks > Insert multiple blocks after 1`] = `
309
309
  {
310
310
  "children": [],
311
311
  "content": {
312
+ "columnWidths": [
313
+ undefined,
314
+ undefined,
315
+ undefined,
316
+ ],
312
317
  "rows": [
313
318
  {
314
319
  "cells": [
@@ -831,6 +836,11 @@ exports[`Test insertBlocks > Insert multiple blocks before 1`] = `
831
836
  {
832
837
  "children": [],
833
838
  "content": {
839
+ "columnWidths": [
840
+ undefined,
841
+ undefined,
842
+ undefined,
843
+ ],
834
844
  "rows": [
835
845
  {
836
846
  "cells": [
@@ -1313,6 +1323,11 @@ exports[`Test insertBlocks > Insert single basic block after 1`] = `
1313
1323
  {
1314
1324
  "children": [],
1315
1325
  "content": {
1326
+ "columnWidths": [
1327
+ undefined,
1328
+ undefined,
1329
+ undefined,
1330
+ ],
1316
1331
  "rows": [
1317
1332
  {
1318
1333
  "cells": [
@@ -1795,6 +1810,11 @@ exports[`Test insertBlocks > Insert single basic block before 1`] = `
1795
1810
  {
1796
1811
  "children": [],
1797
1812
  "content": {
1813
+ "columnWidths": [
1814
+ undefined,
1815
+ undefined,
1816
+ undefined,
1817
+ ],
1798
1818
  "rows": [
1799
1819
  {
1800
1820
  "cells": [
@@ -2334,6 +2354,11 @@ exports[`Test insertBlocks > Insert single complex block after 1`] = `
2334
2354
  {
2335
2355
  "children": [],
2336
2356
  "content": {
2357
+ "columnWidths": [
2358
+ undefined,
2359
+ undefined,
2360
+ undefined,
2361
+ ],
2337
2362
  "rows": [
2338
2363
  {
2339
2364
  "cells": [
@@ -2873,6 +2898,11 @@ exports[`Test insertBlocks > Insert single complex block before 1`] = `
2873
2898
  {
2874
2899
  "children": [],
2875
2900
  "content": {
2901
+ "columnWidths": [
2902
+ undefined,
2903
+ undefined,
2904
+ undefined,
2905
+ ],
2876
2906
  "rows": [
2877
2907
  {
2878
2908
  "cells": [
@@ -37,6 +37,8 @@ export function insertBlocks<
37
37
  editor._tiptapEditor.state.doc
38
38
  );
39
39
 
40
+ // TODO: we might want to use the ReplaceStep directly here instead of insert,
41
+ // because the fitting algorithm should not be necessary and might even cause unexpected behavior
40
42
  if (placement === "before") {
41
43
  editor.dispatch(
42
44
  editor._tiptapEditor.state.tr.insert(posBeforeNode, nodesToInsert)
@@ -241,6 +241,11 @@ exports[`Test mergeBlocks > Basic 1`] = `
241
241
  {
242
242
  "children": [],
243
243
  "content": {
244
+ "columnWidths": [
245
+ undefined,
246
+ undefined,
247
+ undefined,
248
+ ],
244
249
  "rows": [
245
250
  {
246
251
  "cells": [
@@ -695,6 +700,11 @@ exports[`Test mergeBlocks > Blocks have different types 1`] = `
695
700
  {
696
701
  "children": [],
697
702
  "content": {
703
+ "columnWidths": [
704
+ undefined,
705
+ undefined,
706
+ undefined,
707
+ ],
698
708
  "rows": [
699
709
  {
700
710
  "cells": [
@@ -1149,6 +1159,11 @@ exports[`Test mergeBlocks > First block has children 1`] = `
1149
1159
  {
1150
1160
  "children": [],
1151
1161
  "content": {
1162
+ "columnWidths": [
1163
+ undefined,
1164
+ undefined,
1165
+ undefined,
1166
+ ],
1152
1167
  "rows": [
1153
1168
  {
1154
1169
  "cells": [
@@ -1602,6 +1617,11 @@ exports[`Test mergeBlocks > Second block has children 1`] = `
1602
1617
  {
1603
1618
  "children": [],
1604
1619
  "content": {
1620
+ "columnWidths": [
1621
+ undefined,
1622
+ undefined,
1623
+ undefined,
1624
+ ],
1605
1625
  "rows": [
1606
1626
  {
1607
1627
  "cells": [
@@ -2073,6 +2093,11 @@ exports[`Test mergeBlocks > Second block is empty 1`] = `
2073
2093
  {
2074
2094
  "children": [],
2075
2095
  "content": {
2096
+ "columnWidths": [
2097
+ undefined,
2098
+ undefined,
2099
+ undefined,
2100
+ ],
2076
2101
  "rows": [
2077
2102
  {
2078
2103
  "cells": [
@@ -13,8 +13,8 @@ function mergeBlocks(posBetweenBlocks: number) {
13
13
  }
14
14
 
15
15
  function getPosBeforeSelectedBlock() {
16
- return getBlockInfoFromSelection(getEditor()._tiptapEditor.state)
17
- .blockContainer.beforePos;
16
+ return getBlockInfoFromSelection(getEditor()._tiptapEditor.state).bnBlock
17
+ .beforePos;
18
18
  }
19
19
 
20
20
  describe("Test mergeBlocks", () => {
@@ -1,68 +1,114 @@
1
- import { Node, ResolvedPos } from "prosemirror-model";
1
+ import { Node } from "prosemirror-model";
2
2
  import { EditorState } from "prosemirror-state";
3
3
 
4
- import { getBlockInfoFromResolvedPos } from "../../../getBlockInfoFromPos.js";
4
+ import {
5
+ BlockInfo,
6
+ getBlockInfoFromResolvedPos,
7
+ } from "../../../getBlockInfoFromPos.js";
5
8
 
6
- export const getPrevBlockPos = (doc: Node, $nextBlockPos: ResolvedPos) => {
7
- const prevNode = $nextBlockPos.nodeBefore;
9
+ /**
10
+ * Returns the block info from the parent block
11
+ * or undefined if we're at the root
12
+ */
13
+ export const getParentBlockInfo = (doc: Node, beforePos: number) => {
14
+ const $pos = doc.resolve(beforePos);
8
15
 
9
- if (!prevNode) {
10
- throw new Error(
11
- `Attempted to get previous blockContainer node for merge at position ${$nextBlockPos.pos} but a previous node does not exist`
12
- );
16
+ if ($pos.depth <= 1) {
17
+ return undefined;
13
18
  }
14
19
 
15
- // Finds the nearest previous block, regardless of nesting level.
16
- let prevBlockBeforePos = $nextBlockPos.posAtIndex($nextBlockPos.index() - 1);
17
- let prevBlockInfo = getBlockInfoFromResolvedPos(
18
- doc.resolve(prevBlockBeforePos)
20
+ // get start pos of parent
21
+ const parentBeforePos = $pos.posAtIndex(
22
+ $pos.index($pos.depth - 1),
23
+ $pos.depth - 1
24
+ );
25
+
26
+ const parentBlockInfo = getBlockInfoFromResolvedPos(
27
+ doc.resolve(parentBeforePos)
19
28
  );
29
+ return parentBlockInfo;
30
+ };
20
31
 
21
- while (prevBlockInfo.blockGroup) {
22
- const group = prevBlockInfo.blockGroup.node;
32
+ /**
33
+ * Returns the block info from the sibling block before (above) the given block,
34
+ * or undefined if the given block is the first sibling.
35
+ */
36
+ export const getPrevBlockInfo = (doc: Node, beforePos: number) => {
37
+ const $pos = doc.resolve(beforePos);
23
38
 
24
- prevBlockBeforePos = doc
25
- .resolve(prevBlockInfo.blockGroup.beforePos + 1)
26
- .posAtIndex(group.childCount - 1);
27
- prevBlockInfo = getBlockInfoFromResolvedPos(
28
- doc.resolve(prevBlockBeforePos)
29
- );
39
+ const indexInParent = $pos.index();
40
+
41
+ if (indexInParent === 0) {
42
+ return undefined;
30
43
  }
31
44
 
32
- return doc.resolve(prevBlockBeforePos);
45
+ const prevBlockBeforePos = $pos.posAtIndex(indexInParent - 1);
46
+
47
+ const prevBlockInfo = getBlockInfoFromResolvedPos(
48
+ doc.resolve(prevBlockBeforePos)
49
+ );
50
+ return prevBlockInfo;
33
51
  };
34
52
 
35
- const canMerge = ($prevBlockPos: ResolvedPos, $nextBlockPos: ResolvedPos) => {
36
- const prevBlockInfo = getBlockInfoFromResolvedPos($prevBlockPos);
37
- const nextBlockInfo = getBlockInfoFromResolvedPos($nextBlockPos);
53
+ /**
54
+ * If a block has children like this:
55
+ * A
56
+ * - B
57
+ * - C
58
+ * -- D
59
+ *
60
+ * Then the bottom nested block returned is D.
61
+ */
62
+ export const getBottomNestedBlockInfo = (doc: Node, blockInfo: BlockInfo) => {
63
+ while (blockInfo.childContainer) {
64
+ const group = blockInfo.childContainer.node;
65
+
66
+ const newPos = doc
67
+ .resolve(blockInfo.childContainer.beforePos + 1)
68
+ .posAtIndex(group.childCount - 1);
69
+ blockInfo = getBlockInfoFromResolvedPos(doc.resolve(newPos));
70
+ }
38
71
 
72
+ return blockInfo;
73
+ };
74
+
75
+ const canMerge = (prevBlockInfo: BlockInfo, nextBlockInfo: BlockInfo) => {
39
76
  return (
77
+ prevBlockInfo.isBlockContainer &&
40
78
  prevBlockInfo.blockContent.node.type.spec.content === "inline*" &&
41
- nextBlockInfo.blockContent.node.type.spec.content === "inline*" &&
42
- prevBlockInfo.blockContent.node.childCount > 0
79
+ prevBlockInfo.blockContent.node.childCount > 0 &&
80
+ nextBlockInfo.isBlockContainer &&
81
+ nextBlockInfo.blockContent.node.type.spec.content === "inline*"
43
82
  );
44
83
  };
45
84
 
46
85
  const mergeBlocks = (
47
86
  state: EditorState,
48
87
  dispatch: ((args?: any) => any) | undefined,
49
- $prevBlockPos: ResolvedPos,
50
- $nextBlockPos: ResolvedPos
88
+ prevBlockInfo: BlockInfo,
89
+ nextBlockInfo: BlockInfo
51
90
  ) => {
52
- const nextBlockInfo = getBlockInfoFromResolvedPos($nextBlockPos);
53
-
54
91
  // Un-nests all children of the next block.
55
- if (nextBlockInfo.blockGroup) {
92
+ if (!nextBlockInfo.isBlockContainer) {
93
+ throw new Error(
94
+ `Attempted to merge block at position ${nextBlockInfo.bnBlock.beforePos} into previous block at position ${prevBlockInfo.bnBlock.beforePos}, but next block is not a block container`
95
+ );
96
+ }
97
+
98
+ // Removes a level of nesting all children of the next block by 1 level, if it contains both content and block
99
+ // group nodes.
100
+ if (nextBlockInfo.childContainer) {
56
101
  const childBlocksStart = state.doc.resolve(
57
- nextBlockInfo.blockGroup.beforePos + 1
102
+ nextBlockInfo.childContainer.beforePos + 1
58
103
  );
59
104
  const childBlocksEnd = state.doc.resolve(
60
- nextBlockInfo.blockGroup.afterPos - 1
105
+ nextBlockInfo.childContainer.afterPos - 1
61
106
  );
62
107
  const childBlocksRange = childBlocksStart.blockRange(childBlocksEnd);
63
108
 
64
109
  if (dispatch) {
65
- state.tr.lift(childBlocksRange!, $nextBlockPos.depth);
110
+ const pos = state.doc.resolve(nextBlockInfo.bnBlock.beforePos);
111
+ state.tr.lift(childBlocksRange!, pos.depth);
66
112
  }
67
113
  }
68
114
 
@@ -70,8 +116,13 @@ const mergeBlocks = (
70
116
  // removing the closing tags of the first block and the opening tags of the
71
117
  // second one to stitch them together.
72
118
  if (dispatch) {
73
- const prevBlockInfo = getBlockInfoFromResolvedPos($prevBlockPos);
119
+ if (!prevBlockInfo.isBlockContainer) {
120
+ throw new Error(
121
+ `Attempted to merge block at position ${nextBlockInfo.bnBlock.beforePos} into previous block at position ${prevBlockInfo.bnBlock.beforePos}, but previous block is not a block container`
122
+ );
123
+ }
74
124
 
125
+ // TODO: test merging between a columnList and paragraph, between two columnLists, and v.v.
75
126
  dispatch(
76
127
  state.tr.delete(
77
128
  prevBlockInfo.blockContent.afterPos - 1,
@@ -92,12 +143,26 @@ export const mergeBlocksCommand =
92
143
  state: EditorState;
93
144
  dispatch: ((args?: any) => any) | undefined;
94
145
  }) => {
95
- const $nextBlockPos = state.doc.resolve(posBetweenBlocks);
96
- const $prevBlockPos = getPrevBlockPos(state.doc, $nextBlockPos);
146
+ const $pos = state.doc.resolve(posBetweenBlocks);
147
+ const nextBlockInfo = getBlockInfoFromResolvedPos($pos);
148
+
149
+ const prevBlockInfo = getPrevBlockInfo(
150
+ state.doc,
151
+ nextBlockInfo.bnBlock.beforePos
152
+ );
153
+
154
+ if (!prevBlockInfo) {
155
+ return false;
156
+ }
157
+
158
+ const bottomNestedBlockInfo = getBottomNestedBlockInfo(
159
+ state.doc,
160
+ prevBlockInfo
161
+ );
97
162
 
98
- if (!canMerge($prevBlockPos, $nextBlockPos)) {
163
+ if (!canMerge(bottomNestedBlockInfo, nextBlockInfo)) {
99
164
  return false;
100
165
  }
101
166
 
102
- return mergeBlocks(state, dispatch, $prevBlockPos, $nextBlockPos);
167
+ return mergeBlocks(state, dispatch, bottomNestedBlockInfo, nextBlockInfo);
103
168
  };
@@ -258,6 +258,11 @@ exports[`Test moveBlockDown > Basic 1`] = `
258
258
  {
259
259
  "children": [],
260
260
  "content": {
261
+ "columnWidths": [
262
+ undefined,
263
+ undefined,
264
+ undefined,
265
+ ],
261
266
  "rows": [
262
267
  {
263
268
  "cells": [
@@ -729,6 +734,11 @@ exports[`Test moveBlockDown > Into children 1`] = `
729
734
  {
730
735
  "children": [],
731
736
  "content": {
737
+ "columnWidths": [
738
+ undefined,
739
+ undefined,
740
+ undefined,
741
+ ],
732
742
  "rows": [
733
743
  {
734
744
  "cells": [
@@ -1200,6 +1210,11 @@ exports[`Test moveBlockDown > Last block 1`] = `
1200
1210
  {
1201
1211
  "children": [],
1202
1212
  "content": {
1213
+ "columnWidths": [
1214
+ undefined,
1215
+ undefined,
1216
+ undefined,
1217
+ ],
1203
1218
  "rows": [
1204
1219
  {
1205
1220
  "cells": [
@@ -1671,6 +1686,11 @@ exports[`Test moveBlockDown > Out of children 1`] = `
1671
1686
  {
1672
1687
  "children": [],
1673
1688
  "content": {
1689
+ "columnWidths": [
1690
+ undefined,
1691
+ undefined,
1692
+ undefined,
1693
+ ],
1674
1694
  "rows": [
1675
1695
  {
1676
1696
  "cells": [
@@ -2141,6 +2161,11 @@ exports[`Test moveBlockUp > Basic 1`] = `
2141
2161
  {
2142
2162
  "children": [],
2143
2163
  "content": {
2164
+ "columnWidths": [
2165
+ undefined,
2166
+ undefined,
2167
+ undefined,
2168
+ ],
2144
2169
  "rows": [
2145
2170
  {
2146
2171
  "cells": [
@@ -2612,6 +2637,11 @@ exports[`Test moveBlockUp > First block 1`] = `
2612
2637
  {
2613
2638
  "children": [],
2614
2639
  "content": {
2640
+ "columnWidths": [
2641
+ undefined,
2642
+ undefined,
2643
+ undefined,
2644
+ ],
2615
2645
  "rows": [
2616
2646
  {
2617
2647
  "cells": [
@@ -3083,6 +3113,11 @@ exports[`Test moveBlockUp > Into children 1`] = `
3083
3113
  {
3084
3114
  "children": [],
3085
3115
  "content": {
3116
+ "columnWidths": [
3117
+ undefined,
3118
+ undefined,
3119
+ undefined,
3120
+ ],
3086
3121
  "rows": [
3087
3122
  {
3088
3123
  "cells": [
@@ -3554,6 +3589,11 @@ exports[`Test moveBlockUp > Out of children 1`] = `
3554
3589
  {
3555
3590
  "children": [],
3556
3591
  "content": {
3592
+ "columnWidths": [
3593
+ undefined,
3594
+ undefined,
3595
+ undefined,
3596
+ ],
3557
3597
  "rows": [
3558
3598
  {
3559
3599
  "cells": [
@@ -31,13 +31,11 @@ type BlockSelectionData = (
31
31
  function getBlockSelectionData(
32
32
  editor: BlockNoteEditor<any, any, any>
33
33
  ): BlockSelectionData {
34
- const { blockContainer } = getBlockInfoFromSelection(
35
- editor._tiptapEditor.state
36
- );
34
+ const { bnBlock } = getBlockInfoFromSelection(editor._tiptapEditor.state);
37
35
 
38
36
  const selectionData = {
39
- blockId: blockContainer.node.attrs.id,
40
- blockPos: blockContainer.beforePos,
37
+ blockId: bnBlock.node.attrs.id,
38
+ blockPos: bnBlock.beforePos,
41
39
  };
42
40
 
43
41
  if (editor._tiptapEditor.state.selection instanceof CellSelection) {