@blocknote/core 0.15.11 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/blocknote.js +3349 -2773
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +6 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/webpack-stats.json +1 -1
  6. package/package.json +5 -2
  7. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +3087 -0
  8. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +132 -0
  9. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +71 -0
  10. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +2276 -0
  11. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +131 -0
  12. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +103 -0
  13. package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +3767 -0
  14. package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +192 -0
  15. package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +178 -0
  16. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +1136 -0
  17. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +34 -0
  18. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +100 -0
  19. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +4931 -0
  20. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +222 -0
  21. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +70 -0
  22. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +2924 -0
  23. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +136 -0
  24. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +48 -0
  25. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +8376 -0
  26. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +300 -0
  27. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +199 -0
  28. package/src/api/blockManipulation/insertContentAt.ts +96 -0
  29. package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +316 -0
  30. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +53 -0
  31. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +130 -0
  32. package/src/api/blockManipulation/setupTestEnv.ts +179 -0
  33. package/src/api/clipboard/__snapshots__/childToParent.html +1 -0
  34. package/src/api/clipboard/__snapshots__/childrenToNextParent.html +1 -0
  35. package/src/api/clipboard/__snapshots__/childrenToNextParentsChildren.html +1 -0
  36. package/src/api/clipboard/__snapshots__/image.html +1 -0
  37. package/src/api/clipboard/__snapshots__/multipleStyledText.html +1 -0
  38. package/src/api/clipboard/__snapshots__/nestedImage.html +1 -0
  39. package/src/api/clipboard/__snapshots__/partialChildToParent.html +1 -0
  40. package/src/api/clipboard/__snapshots__/styledText.html +1 -0
  41. package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -0
  42. package/src/api/clipboard/__snapshots__/tableCell.html +1 -0
  43. package/src/api/clipboard/__snapshots__/tableCellText.html +1 -0
  44. package/src/api/clipboard/__snapshots__/tableRow.html +1 -0
  45. package/src/api/clipboard/__snapshots__/unstyledText.html +1 -0
  46. package/src/api/clipboard/clipboard.test.ts +283 -0
  47. package/src/api/{parsers → clipboard/fromClipboard}/fileDropExtension.ts +8 -4
  48. package/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.ts +12 -7
  49. package/src/api/{parsers → clipboard/fromClipboard}/pasteExtension.ts +19 -8
  50. package/src/api/clipboard/toClipboard/copyExtension.ts +243 -0
  51. package/src/api/exporters/html/__snapshots__/complex/misc/external.html +1 -1
  52. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -1
  53. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -1
  54. package/src/api/exporters/html/externalHTMLExporter.ts +42 -87
  55. package/src/api/exporters/html/htmlConversion.test.ts +19 -156
  56. package/src/api/exporters/html/internalHTMLSerializer.ts +21 -69
  57. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +263 -0
  58. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +158 -0
  59. package/src/api/exporters/markdown/markdownExporter.test.ts +10 -10
  60. package/src/api/exporters/markdown/markdownExporter.ts +11 -7
  61. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +2 -2
  62. package/src/api/getBlockInfoFromPos.ts +172 -90
  63. package/src/api/nodeConversions/blockToNode.ts +257 -0
  64. package/src/api/nodeConversions/fragmentToBlocks.ts +60 -0
  65. package/src/api/nodeConversions/nodeConversions.test.ts +9 -8
  66. package/src/api/nodeConversions/{nodeConversions.ts → nodeToBlock.ts} +20 -262
  67. package/src/api/parsers/html/parseHTML.test.ts +5 -8
  68. package/src/api/parsers/html/parseHTML.ts +8 -4
  69. package/src/api/parsers/html/util/nestedLists.test.ts +2 -2
  70. package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +319 -0
  71. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +81 -0
  72. package/src/api/parsers/{html/__snapshots__/paste/parse-deep-nested-content.json → markdown/__snapshots__/pasted/issue-226-2.json} +35 -110
  73. package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +81 -0
  74. package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +81 -0
  75. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +61 -0
  76. package/src/api/parsers/markdown/parseMarkdown.test.ts +16 -1
  77. package/src/api/parsers/markdown/parseMarkdown.ts +8 -4
  78. package/src/api/testUtil/cases/customBlocks.ts +11 -11
  79. package/src/api/testUtil/cases/customInlineContent.ts +6 -6
  80. package/src/api/testUtil/cases/customStyles.ts +6 -6
  81. package/src/api/testUtil/cases/defaultSchema.ts +4 -4
  82. package/src/api/testUtil/index.ts +6 -6
  83. package/src/api/testUtil/partialBlockTestUtil.ts +5 -5
  84. package/src/api/testUtil/paste.ts +46 -0
  85. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +5 -5
  86. package/src/blocks/FileBlockContent/FileBlockContent.ts +4 -4
  87. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +2 -2
  88. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +61 -39
  89. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +5 -5
  90. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +30 -18
  91. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +67 -33
  92. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +23 -19
  93. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +22 -24
  94. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +31 -19
  95. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +16 -11
  96. package/src/blocks/TableBlockContent/TableBlockContent.ts +4 -5
  97. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +5 -5
  98. package/src/blocks/defaultBlockHelpers.ts +4 -4
  99. package/src/blocks/defaultBlockTypeGuards.ts +5 -5
  100. package/src/blocks/defaultBlocks.ts +13 -13
  101. package/src/blocks/defaultProps.ts +1 -1
  102. package/src/editor/BlockNoteEditor.test.ts +14 -7
  103. package/src/editor/BlockNoteEditor.ts +82 -149
  104. package/src/editor/BlockNoteExtensions.ts +15 -11
  105. package/src/editor/BlockNoteSchema.ts +7 -7
  106. package/src/editor/BlockNoteTipTapEditor.ts +5 -3
  107. package/src/editor/cursorPositionTypes.ts +7 -2
  108. package/src/editor/selectionTypes.ts +6 -2
  109. package/src/editor/transformPasted.ts +34 -2
  110. package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +1 -1
  111. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +1 -1
  112. package/src/extensions/FilePanel/FilePanelPlugin.ts +4 -4
  113. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +8 -4
  114. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +333 -0
  115. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +9 -4
  116. package/src/extensions/{NonEditableBlocks/NonEditableBlockPlugin.ts → NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts} +2 -2
  117. package/src/extensions/Placeholder/PlaceholderPlugin.ts +1 -1
  118. package/src/extensions/SideMenu/SideMenuPlugin.ts +72 -402
  119. package/src/extensions/SideMenu/dragging.ts +251 -0
  120. package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +1 -1
  121. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +8 -4
  122. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +8 -4
  123. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +19 -15
  124. package/src/extensions/TableHandles/TableHandlesPlugin.ts +11 -7
  125. package/src/extensions/TextColor/TextColorExtension.ts +1 -1
  126. package/src/extensions/TextColor/TextColorMark.ts +1 -1
  127. package/src/i18n/dictionary.ts +1 -1
  128. package/src/i18n/locales/ar.ts +1 -1
  129. package/src/i18n/locales/fr.ts +1 -1
  130. package/src/i18n/locales/hr.ts +308 -0
  131. package/src/i18n/locales/index.ts +15 -14
  132. package/src/i18n/locales/is.ts +1 -1
  133. package/src/i18n/locales/ja.ts +1 -1
  134. package/src/i18n/locales/ko.ts +1 -1
  135. package/src/i18n/locales/nl.ts +1 -1
  136. package/src/i18n/locales/pl.ts +1 -1
  137. package/src/i18n/locales/pt.ts +1 -1
  138. package/src/i18n/locales/ru.ts +1 -1
  139. package/src/i18n/locales/vi.ts +1 -1
  140. package/src/i18n/locales/zh.ts +1 -1
  141. package/src/index.ts +45 -44
  142. package/src/pm-nodes/BlockContainer.ts +3 -647
  143. package/src/pm-nodes/BlockGroup.ts +2 -2
  144. package/src/pm-nodes/index.ts +3 -3
  145. package/src/schema/blocks/createSpec.ts +24 -14
  146. package/src/schema/blocks/internal.ts +9 -9
  147. package/src/schema/blocks/types.ts +4 -4
  148. package/src/schema/index.ts +10 -10
  149. package/src/schema/inlineContent/createSpec.ts +9 -10
  150. package/src/schema/inlineContent/internal.ts +3 -3
  151. package/src/schema/inlineContent/types.ts +2 -2
  152. package/src/schema/styles/createSpec.ts +4 -3
  153. package/src/schema/styles/internal.ts +1 -1
  154. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +4 -0
  155. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +7 -0
  156. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.d.ts +1 -0
  157. package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.d.ts +5 -0
  158. package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.test.d.ts +1 -0
  159. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +7 -0
  160. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
  161. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +7 -0
  162. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.d.ts +1 -0
  163. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +5 -0
  164. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.test.d.ts +1 -0
  165. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +11 -0
  166. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.test.d.ts +1 -0
  167. package/types/src/api/blockManipulation/insertContentAt.d.ts +6 -0
  168. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -0
  169. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.d.ts +1 -0
  170. package/types/src/api/blockManipulation/setupTestEnv.d.ts +492 -0
  171. package/types/src/api/clipboard/clipboard.test.d.ts +1 -0
  172. package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +6 -0
  173. package/types/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.d.ts +2 -2
  174. package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +6 -0
  175. package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +12 -0
  176. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +7 -8
  177. package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +6 -10
  178. package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +10 -0
  179. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +11 -0
  180. package/types/src/api/exporters/markdown/markdownExporter.d.ts +3 -3
  181. package/types/src/api/getBlockInfoFromPos.d.ts +63 -20
  182. package/types/src/api/nodeConversions/blockToNode.d.ts +15 -0
  183. package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +7 -0
  184. package/types/src/api/nodeConversions/nodeToBlock.d.ts +16 -0
  185. package/types/src/api/parsers/html/parseHTML.d.ts +2 -2
  186. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -2
  187. package/types/src/api/testUtil/cases/customBlocks.d.ts +39 -39
  188. package/types/src/api/testUtil/cases/customInlineContent.d.ts +35 -35
  189. package/types/src/api/testUtil/cases/customStyles.d.ts +35 -35
  190. package/types/src/api/testUtil/cases/defaultSchema.d.ts +2 -2
  191. package/types/src/api/testUtil/index.d.ts +6 -6
  192. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +4 -4
  193. package/types/src/api/testUtil/paste.d.ts +2 -0
  194. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +4 -4
  195. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +4 -4
  196. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +2 -2
  197. package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
  198. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +4 -4
  199. package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
  200. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
  201. package/types/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +2 -2
  202. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
  203. package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
  204. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
  205. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +4 -4
  206. package/types/src/blocks/defaultBlockHelpers.d.ts +3 -3
  207. package/types/src/blocks/defaultBlockTypeGuards.d.ts +4 -4
  208. package/types/src/blocks/defaultBlocks.d.ts +38 -38
  209. package/types/src/blocks/defaultProps.d.ts +1 -1
  210. package/types/src/editor/BlockNoteEditor.d.ts +28 -16
  211. package/types/src/editor/BlockNoteExtensions.d.ts +3 -3
  212. package/types/src/editor/BlockNoteSchema.d.ts +4 -4
  213. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
  214. package/types/src/editor/cursorPositionTypes.d.ts +3 -2
  215. package/types/src/editor/selectionTypes.d.ts +2 -2
  216. package/types/src/editor/transformPasted.d.ts +8 -1
  217. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
  218. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
  219. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +4 -4
  220. package/types/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.d.ts +5 -0
  221. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +4 -4
  222. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -0
  223. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
  224. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +12 -28
  225. package/types/src/extensions/SideMenu/dragging.d.ts +17 -0
  226. package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +1 -1
  227. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +4 -4
  228. package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +3 -3
  229. package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +4 -4
  230. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
  231. package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
  232. package/types/src/i18n/dictionary.d.ts +1 -1
  233. package/types/src/i18n/locales/ar.d.ts +1 -1
  234. package/types/src/i18n/locales/fr.d.ts +1 -1
  235. package/types/src/i18n/locales/hr.d.ts +239 -0
  236. package/types/src/i18n/locales/index.d.ts +15 -14
  237. package/types/src/i18n/locales/is.d.ts +1 -1
  238. package/types/src/i18n/locales/ja.d.ts +1 -1
  239. package/types/src/i18n/locales/ko.d.ts +1 -1
  240. package/types/src/i18n/locales/nl.d.ts +1 -1
  241. package/types/src/i18n/locales/pl.d.ts +1 -1
  242. package/types/src/i18n/locales/pt.d.ts +1 -1
  243. package/types/src/i18n/locales/ru.d.ts +1 -1
  244. package/types/src/i18n/locales/vi.d.ts +1 -1
  245. package/types/src/i18n/locales/zh.d.ts +1 -1
  246. package/types/src/index.d.ts +45 -44
  247. package/types/src/pm-nodes/BlockContainer.d.ts +2 -16
  248. package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
  249. package/types/src/pm-nodes/index.d.ts +3 -3
  250. package/types/src/schema/blocks/createSpec.d.ts +5 -5
  251. package/types/src/schema/blocks/internal.d.ts +5 -5
  252. package/types/src/schema/blocks/types.d.ts +4 -4
  253. package/types/src/schema/index.d.ts +10 -10
  254. package/types/src/schema/inlineContent/createSpec.d.ts +3 -3
  255. package/types/src/schema/inlineContent/internal.d.ts +2 -2
  256. package/types/src/schema/inlineContent/types.d.ts +2 -2
  257. package/types/src/schema/styles/createSpec.d.ts +1 -1
  258. package/types/src/schema/styles/internal.d.ts +1 -1
  259. package/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap +0 -714
  260. package/src/api/blockManipulation/blockManipulation.test.ts +0 -292
  261. package/src/api/blockManipulation/blockManipulation.ts +0 -350
  262. package/src/api/exporters/copyExtension.ts +0 -164
  263. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionLeavesBlockChildren.html +0 -1
  264. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionSpansBlocksChildren.html +0 -1
  265. package/src/api/exporters/html/util/sharedHTMLConversion.ts +0 -130
  266. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +0 -218
  267. package/src/api/getCurrentBlockContentType.ts +0 -14
  268. package/src/api/parsers/html/__snapshots__/paste/parse-google-docs-html.json +0 -476
  269. package/types/src/api/blockManipulation/blockManipulation.d.ts +0 -14
  270. package/types/src/api/exporters/copyExtension.d.ts +0 -6
  271. package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +0 -9
  272. package/types/src/api/exporters/html/util/simplifyBlocksRehypePlugin.d.ts +0 -16
  273. package/types/src/api/getCurrentBlockContentType.d.ts +0 -2
  274. package/types/src/api/nodeConversions/nodeConversions.d.ts +0 -24
  275. package/types/src/api/parsers/fileDropExtension.d.ts +0 -6
  276. package/types/src/api/parsers/pasteExtension.d.ts +0 -6
  277. package/types/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.d.ts +0 -2
  278. /package/src/api/{exporters/html/__snapshots_fragment_edge_cases__/selectionWithinBlockChildren.html → clipboard/__snapshots__/multipleChildren.html} +0 -0
  279. /package/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.ts +0 -0
  280. /package/src/api/parsers/html/__snapshots__/{paste/list-test.json → list-test.json} +0 -0
  281. /package/src/api/parsers/html/__snapshots__/{paste/parse-basic-block-types.json → parse-basic-block-types.json} +0 -0
  282. /package/src/api/parsers/html/__snapshots__/{paste/parse-div-with-inline-content.json → parse-div-with-inline-content.json} +0 -0
  283. /package/src/api/parsers/html/__snapshots__/{paste/parse-divs.json → parse-divs.json} +0 -0
  284. /package/src/api/parsers/html/__snapshots__/{paste/parse-fake-image-caption.json → parse-fake-image-caption.json} +0 -0
  285. /package/src/api/parsers/html/__snapshots__/{paste/parse-image-in-paragraph.json → parse-image-in-paragraph.json} +0 -0
  286. /package/src/api/parsers/html/__snapshots__/{paste/parse-mixed-nested-lists.json → parse-mixed-nested-lists.json} +0 -0
  287. /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists-with-paragraphs.json → parse-nested-lists-with-paragraphs.json} +0 -0
  288. /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists.json → parse-nested-lists.json} +0 -0
  289. /package/src/api/parsers/html/__snapshots__/{paste/parse-notion-html.json → parse-notion-html.json} +0 -0
  290. /package/src/api/parsers/html/__snapshots__/{paste/parse-two-divs.json → parse-two-divs.json} +0 -0
  291. /package/types/src/api/blockManipulation/{blockManipulation.test.d.ts → commands/insertBlocks/insertBlocks.test.d.ts} +0 -0
  292. /package/types/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
2
- import { BlockFromConfig, Props } from "../../schema";
1
+ import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockFromConfig, Props } from "../../schema/index.js";
3
3
  export declare const imagePropSchema: {
4
4
  textAlignment: {
5
5
  default: "left";
@@ -96,7 +96,7 @@ export declare const ImageBlock: {
96
96
  isFileBlock: true;
97
97
  fileBlockAccept: string[];
98
98
  };
99
- implementation: import("../../schema").TiptapBlockImplementation<{
99
+ implementation: import("../../schema/index.js").TiptapBlockImplementation<{
100
100
  type: "image";
101
101
  propSchema: {
102
102
  textAlignment: {
@@ -125,5 +125,5 @@ export declare const ImageBlock: {
125
125
  content: "none";
126
126
  isFileBlock: true;
127
127
  fileBlockAccept: string[];
128
- }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
128
+ }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
129
129
  };
@@ -27,7 +27,7 @@ export declare const BulletListItem: {
27
27
  };
28
28
  };
29
29
  };
30
- implementation: import("../../../schema").TiptapBlockImplementation<{
30
+ implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
31
31
  type: "bulletListItem";
32
32
  content: "inline";
33
33
  propSchema: {
@@ -42,5 +42,5 @@ export declare const BulletListItem: {
42
42
  values: readonly ["left", "center", "right", "justify"];
43
43
  };
44
44
  };
45
- }, any, import("../../../schema").InlineContentSchema, import("../../../schema").StyleSchema>;
45
+ }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
46
46
  };
@@ -33,7 +33,7 @@ export declare const CheckListItem: {
33
33
  };
34
34
  };
35
35
  };
36
- implementation: import("../../../schema").TiptapBlockImplementation<{
36
+ implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
37
37
  type: "checkListItem";
38
38
  content: "inline";
39
39
  propSchema: {
@@ -51,5 +51,5 @@ export declare const CheckListItem: {
51
51
  values: readonly ["left", "center", "right", "justify"];
52
52
  };
53
53
  };
54
- }, any, import("../../../schema").InlineContentSchema, import("../../../schema").StyleSchema>;
54
+ }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
55
55
  };
@@ -1,2 +1,2 @@
1
- import { Editor } from "@tiptap/core";
2
- export declare const handleEnter: (editor: Editor) => boolean;
1
+ import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ export declare const handleEnter: (editor: BlockNoteEditor<any, any, any>) => boolean;
@@ -27,7 +27,7 @@ export declare const NumberedListItem: {
27
27
  };
28
28
  };
29
29
  };
30
- implementation: import("../../../schema").TiptapBlockImplementation<{
30
+ implementation: import("../../../schema/index.js").TiptapBlockImplementation<{
31
31
  type: "numberedListItem";
32
32
  content: "inline";
33
33
  propSchema: {
@@ -42,5 +42,5 @@ export declare const NumberedListItem: {
42
42
  values: readonly ["left", "center", "right", "justify"];
43
43
  };
44
44
  };
45
- }, any, import("../../../schema").InlineContentSchema, import("../../../schema").StyleSchema>;
45
+ }, any, import("../../../schema/index.js").InlineContentSchema, import("../../../schema/index.js").StyleSchema>;
46
46
  };
@@ -33,7 +33,7 @@ export declare const Paragraph: {
33
33
  };
34
34
  };
35
35
  };
36
- implementation: import("../../schema").TiptapBlockImplementation<{
36
+ implementation: import("../../schema/index.js").TiptapBlockImplementation<{
37
37
  type: "paragraph";
38
38
  content: "inline";
39
39
  propSchema: {
@@ -48,5 +48,5 @@ export declare const Paragraph: {
48
48
  values: readonly ["left", "center", "right", "justify"];
49
49
  };
50
50
  };
51
- }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
51
+ }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
52
52
  };
@@ -34,7 +34,7 @@ export declare const Table: {
34
34
  };
35
35
  };
36
36
  };
37
- implementation: import("../../schema").TiptapBlockImplementation<{
37
+ implementation: import("../../schema/index.js").TiptapBlockImplementation<{
38
38
  type: "table";
39
39
  content: "table";
40
40
  propSchema: {
@@ -49,5 +49,5 @@ export declare const Table: {
49
49
  values: readonly ["left", "center", "right", "justify"];
50
50
  };
51
51
  };
52
- }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
52
+ }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
53
53
  };
@@ -1,5 +1,5 @@
1
- import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
2
- import { BlockFromConfig, Props } from "../../schema";
1
+ import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockFromConfig, Props } from "../../schema/index.js";
3
3
  export declare const videoPropSchema: {
4
4
  textAlignment: {
5
5
  default: "left";
@@ -96,7 +96,7 @@ export declare const VideoBlock: {
96
96
  isFileBlock: true;
97
97
  fileBlockAccept: string[];
98
98
  };
99
- implementation: import("../../schema").TiptapBlockImplementation<{
99
+ implementation: import("../../schema/index.js").TiptapBlockImplementation<{
100
100
  type: "video";
101
101
  propSchema: {
102
102
  textAlignment: {
@@ -125,5 +125,5 @@ export declare const VideoBlock: {
125
125
  content: "none";
126
126
  isFileBlock: true;
127
127
  fileBlockAccept: string[];
128
- }, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
128
+ }, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
129
129
  };
@@ -1,10 +1,10 @@
1
- import type { BlockNoteEditor } from "../editor/BlockNoteEditor";
2
- import type { BlockNoDefaults, InlineContentSchema, StyleSchema } from "../schema";
1
+ import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
2
+ import type { BlockNoDefaults, InlineContentSchema, StyleSchema } from "../schema/index.js";
3
3
  export declare function createDefaultBlockDOMOutputSpec(blockName: string, htmlTag: string, blockContentHTMLAttributes: Record<string, string>, inlineContentHTMLAttributes: Record<string, string>): {
4
4
  dom: HTMLDivElement;
5
5
  contentDOM: HTMLElement;
6
6
  };
7
- export declare const defaultBlockToHTML: <BSchema extends Record<string, import("../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(block: BlockNoDefaults<BSchema, I, S>, editor: BlockNoteEditor<BSchema, I, S>) => {
7
+ export declare const defaultBlockToHTML: <BSchema extends Record<string, import("../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(block: BlockNoDefaults<BSchema, I, S>, editor: BlockNoteEditor<BSchema, I, S>) => {
8
8
  dom: HTMLElement;
9
9
  contentDOM?: HTMLElement;
10
10
  };
@@ -1,7 +1,7 @@
1
- import type { BlockNoteEditor } from "../editor/BlockNoteEditor";
2
- import { BlockFromConfig, BlockSchema, FileBlockConfig, InlineContentSchema, StyleSchema } from "../schema";
3
- import { Block, DefaultBlockSchema, DefaultInlineContentSchema } from "./defaultBlocks";
4
- import { defaultProps } from "./defaultProps";
1
+ import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
2
+ import { BlockFromConfig, BlockSchema, FileBlockConfig, InlineContentSchema, StyleSchema } from "../schema/index.js";
3
+ import { Block, DefaultBlockSchema, DefaultInlineContentSchema } from "./defaultBlocks.js";
4
+ import { defaultProps } from "./defaultProps.js";
5
5
  export declare function checkDefaultBlockTypeInSchema<BlockType extends keyof DefaultBlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blockType: BlockType, editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<{
6
6
  Type: DefaultBlockSchema[BlockType];
7
7
  }, I, S>;
@@ -1,4 +1,4 @@
1
- import { BlockNoDefaults, BlockSchema, InlineContentSchema, PartialBlockNoDefaults, StyleSchema } from "../schema";
1
+ import { BlockNoDefaults, BlockSchema, InlineContentSchema, PartialBlockNoDefaults, StyleSchema } from "../schema/index.js";
2
2
  export declare const defaultBlockSpecs: {
3
3
  paragraph: {
4
4
  config: {
@@ -17,7 +17,7 @@ export declare const defaultBlockSpecs: {
17
17
  };
18
18
  };
19
19
  };
20
- implementation: import("../schema").TiptapBlockImplementation<{
20
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
21
21
  type: "paragraph";
22
22
  content: "inline";
23
23
  propSchema: {
@@ -55,7 +55,7 @@ export declare const defaultBlockSpecs: {
55
55
  };
56
56
  };
57
57
  };
58
- implementation: import("../schema").TiptapBlockImplementation<{
58
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
59
59
  type: "heading";
60
60
  content: "inline";
61
61
  propSchema: {
@@ -93,7 +93,7 @@ export declare const defaultBlockSpecs: {
93
93
  };
94
94
  };
95
95
  };
96
- implementation: import("../schema").TiptapBlockImplementation<{
96
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
97
97
  type: "bulletListItem";
98
98
  content: "inline";
99
99
  propSchema: {
@@ -127,7 +127,7 @@ export declare const defaultBlockSpecs: {
127
127
  };
128
128
  };
129
129
  };
130
- implementation: import("../schema").TiptapBlockImplementation<{
130
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
131
131
  type: "numberedListItem";
132
132
  content: "inline";
133
133
  propSchema: {
@@ -164,7 +164,7 @@ export declare const defaultBlockSpecs: {
164
164
  };
165
165
  };
166
166
  };
167
- implementation: import("../schema").TiptapBlockImplementation<{
167
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
168
168
  type: "checkListItem";
169
169
  content: "inline";
170
170
  propSchema: {
@@ -201,7 +201,7 @@ export declare const defaultBlockSpecs: {
201
201
  };
202
202
  };
203
203
  };
204
- implementation: import("../schema").TiptapBlockImplementation<{
204
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
205
205
  type: "table";
206
206
  content: "table";
207
207
  propSchema: {
@@ -238,7 +238,7 @@ export declare const defaultBlockSpecs: {
238
238
  content: "none";
239
239
  isFileBlock: true;
240
240
  };
241
- implementation: import("../schema").TiptapBlockImplementation<{
241
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
242
242
  type: "file";
243
243
  propSchema: {
244
244
  backgroundColor: {
@@ -289,7 +289,7 @@ export declare const defaultBlockSpecs: {
289
289
  isFileBlock: true;
290
290
  fileBlockAccept: string[];
291
291
  };
292
- implementation: import("../schema").TiptapBlockImplementation<{
292
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
293
293
  type: "image";
294
294
  propSchema: {
295
295
  textAlignment: {
@@ -351,7 +351,7 @@ export declare const defaultBlockSpecs: {
351
351
  isFileBlock: true;
352
352
  fileBlockAccept: string[];
353
353
  };
354
- implementation: import("../schema").TiptapBlockImplementation<{
354
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
355
355
  type: "video";
356
356
  propSchema: {
357
357
  textAlignment: {
@@ -406,7 +406,7 @@ export declare const defaultBlockSpecs: {
406
406
  isFileBlock: true;
407
407
  fileBlockAccept: string[];
408
408
  };
409
- implementation: import("../schema").TiptapBlockImplementation<{
409
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
410
410
  type: "audio";
411
411
  propSchema: {
412
412
  backgroundColor: {
@@ -431,7 +431,7 @@ export declare const defaultBlockSpecs: {
431
431
  }, any, InlineContentSchema, StyleSchema>;
432
432
  };
433
433
  };
434
- export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpecs<{
434
+ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchemaFromSpecs<{
435
435
  paragraph: {
436
436
  config: {
437
437
  type: "paragraph";
@@ -449,7 +449,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
449
449
  };
450
450
  };
451
451
  };
452
- implementation: import("../schema").TiptapBlockImplementation<{
452
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
453
453
  type: "paragraph";
454
454
  content: "inline";
455
455
  propSchema: {
@@ -487,7 +487,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
487
487
  };
488
488
  };
489
489
  };
490
- implementation: import("../schema").TiptapBlockImplementation<{
490
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
491
491
  type: "heading";
492
492
  content: "inline";
493
493
  propSchema: {
@@ -525,7 +525,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
525
525
  };
526
526
  };
527
527
  };
528
- implementation: import("../schema").TiptapBlockImplementation<{
528
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
529
529
  type: "bulletListItem";
530
530
  content: "inline";
531
531
  propSchema: {
@@ -559,7 +559,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
559
559
  };
560
560
  };
561
561
  };
562
- implementation: import("../schema").TiptapBlockImplementation<{
562
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
563
563
  type: "numberedListItem";
564
564
  content: "inline";
565
565
  propSchema: {
@@ -596,7 +596,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
596
596
  };
597
597
  };
598
598
  };
599
- implementation: import("../schema").TiptapBlockImplementation<{
599
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
600
600
  type: "checkListItem";
601
601
  content: "inline";
602
602
  propSchema: {
@@ -633,7 +633,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
633
633
  };
634
634
  };
635
635
  };
636
- implementation: import("../schema").TiptapBlockImplementation<{
636
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
637
637
  type: "table";
638
638
  content: "table";
639
639
  propSchema: {
@@ -670,7 +670,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
670
670
  content: "none";
671
671
  isFileBlock: true;
672
672
  };
673
- implementation: import("../schema").TiptapBlockImplementation<{
673
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
674
674
  type: "file";
675
675
  propSchema: {
676
676
  backgroundColor: {
@@ -721,7 +721,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
721
721
  isFileBlock: true;
722
722
  fileBlockAccept: string[];
723
723
  };
724
- implementation: import("../schema").TiptapBlockImplementation<{
724
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
725
725
  type: "image";
726
726
  propSchema: {
727
727
  textAlignment: {
@@ -783,7 +783,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
783
783
  isFileBlock: true;
784
784
  fileBlockAccept: string[];
785
785
  };
786
- implementation: import("../schema").TiptapBlockImplementation<{
786
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
787
787
  type: "video";
788
788
  propSchema: {
789
789
  textAlignment: {
@@ -838,7 +838,7 @@ export declare const defaultBlockSchema: import("../schema").BlockSchemaFromSpec
838
838
  isFileBlock: true;
839
839
  fileBlockAccept: string[];
840
840
  };
841
- implementation: import("../schema").TiptapBlockImplementation<{
841
+ implementation: import("../schema/index.js").TiptapBlockImplementation<{
842
842
  type: "audio";
843
843
  propSchema: {
844
844
  backgroundColor: {
@@ -871,100 +871,100 @@ export declare const defaultStyleSpecs: {
871
871
  type: string;
872
872
  propSchema: "boolean";
873
873
  };
874
- implementation: import("../schema").StyleImplementation;
874
+ implementation: import("../schema/index.js").StyleImplementation;
875
875
  };
876
876
  italic: {
877
877
  config: {
878
878
  type: string;
879
879
  propSchema: "boolean";
880
880
  };
881
- implementation: import("../schema").StyleImplementation;
881
+ implementation: import("../schema/index.js").StyleImplementation;
882
882
  };
883
883
  underline: {
884
884
  config: {
885
885
  type: string;
886
886
  propSchema: "boolean";
887
887
  };
888
- implementation: import("../schema").StyleImplementation;
888
+ implementation: import("../schema/index.js").StyleImplementation;
889
889
  };
890
890
  strike: {
891
891
  config: {
892
892
  type: string;
893
893
  propSchema: "boolean";
894
894
  };
895
- implementation: import("../schema").StyleImplementation;
895
+ implementation: import("../schema/index.js").StyleImplementation;
896
896
  };
897
897
  code: {
898
898
  config: {
899
899
  type: string;
900
900
  propSchema: "boolean";
901
901
  };
902
- implementation: import("../schema").StyleImplementation;
902
+ implementation: import("../schema/index.js").StyleImplementation;
903
903
  };
904
904
  textColor: {
905
905
  config: {
906
906
  type: string;
907
907
  propSchema: "string";
908
908
  };
909
- implementation: import("../schema").StyleImplementation;
909
+ implementation: import("../schema/index.js").StyleImplementation;
910
910
  };
911
911
  backgroundColor: {
912
912
  config: {
913
913
  type: string;
914
914
  propSchema: "string";
915
915
  };
916
- implementation: import("../schema").StyleImplementation;
916
+ implementation: import("../schema/index.js").StyleImplementation;
917
917
  };
918
918
  };
919
- export declare const defaultStyleSchema: import("../schema").StyleSchemaFromSpecs<{
919
+ export declare const defaultStyleSchema: import("../schema/index.js").StyleSchemaFromSpecs<{
920
920
  bold: {
921
921
  config: {
922
922
  type: string;
923
923
  propSchema: "boolean";
924
924
  };
925
- implementation: import("../schema").StyleImplementation;
925
+ implementation: import("../schema/index.js").StyleImplementation;
926
926
  };
927
927
  italic: {
928
928
  config: {
929
929
  type: string;
930
930
  propSchema: "boolean";
931
931
  };
932
- implementation: import("../schema").StyleImplementation;
932
+ implementation: import("../schema/index.js").StyleImplementation;
933
933
  };
934
934
  underline: {
935
935
  config: {
936
936
  type: string;
937
937
  propSchema: "boolean";
938
938
  };
939
- implementation: import("../schema").StyleImplementation;
939
+ implementation: import("../schema/index.js").StyleImplementation;
940
940
  };
941
941
  strike: {
942
942
  config: {
943
943
  type: string;
944
944
  propSchema: "boolean";
945
945
  };
946
- implementation: import("../schema").StyleImplementation;
946
+ implementation: import("../schema/index.js").StyleImplementation;
947
947
  };
948
948
  code: {
949
949
  config: {
950
950
  type: string;
951
951
  propSchema: "boolean";
952
952
  };
953
- implementation: import("../schema").StyleImplementation;
953
+ implementation: import("../schema/index.js").StyleImplementation;
954
954
  };
955
955
  textColor: {
956
956
  config: {
957
957
  type: string;
958
958
  propSchema: "string";
959
959
  };
960
- implementation: import("../schema").StyleImplementation;
960
+ implementation: import("../schema/index.js").StyleImplementation;
961
961
  };
962
962
  backgroundColor: {
963
963
  config: {
964
964
  type: string;
965
965
  propSchema: "string";
966
966
  };
967
- implementation: import("../schema").StyleImplementation;
967
+ implementation: import("../schema/index.js").StyleImplementation;
968
968
  };
969
969
  }>;
970
970
  export type _DefaultStyleSchema = typeof defaultStyleSchema;
@@ -979,7 +979,7 @@ export declare const defaultInlineContentSpecs: {
979
979
  implementation: any;
980
980
  };
981
981
  };
982
- export declare const defaultInlineContentSchema: import("../schema").InlineContentSchemaFromSpecs<{
982
+ export declare const defaultInlineContentSchema: import("../schema/index.js").InlineContentSchemaFromSpecs<{
983
983
  text: {
984
984
  config: "text";
985
985
  implementation: any;
@@ -1,4 +1,4 @@
1
- import type { Props } from "../schema";
1
+ import type { Props } from "../schema/index.js";
2
2
  export declare const defaultProps: {
3
3
  backgroundColor: {
4
4
  default: "default";
@@ -1,20 +1,20 @@
1
1
  import { EditorOptions } from "@tiptap/core";
2
2
  import { Node, Schema } from "prosemirror-model";
3
3
  import * as Y from "yjs";
4
- import { Block, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from "../blocks/defaultBlocks";
5
- import { FilePanelProsemirrorPlugin } from "../extensions/FilePanel/FilePanelPlugin";
6
- import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin";
7
- import { LinkToolbarProsemirrorPlugin } from "../extensions/LinkToolbar/LinkToolbarPlugin";
8
- import { SideMenuProsemirrorPlugin } from "../extensions/SideMenu/SideMenuPlugin";
9
- import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin";
10
- import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin";
11
- import { BlockIdentifier, BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, PartialInlineContent, StyleSchema, StyleSpecs, Styles } from "../schema";
12
- import { NoInfer } from "../util/typescript";
13
- import { TextCursorPosition } from "./cursorPositionTypes";
14
- import { Selection } from "./selectionTypes";
15
- import { BlockNoteSchema } from "./BlockNoteSchema";
16
- import { BlockNoteTipTapEditor } from "./BlockNoteTipTapEditor";
17
- import { Dictionary } from "../i18n/dictionary";
4
+ import { Block, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from "../blocks/defaultBlocks.js";
5
+ import { FilePanelProsemirrorPlugin } from "../extensions/FilePanel/FilePanelPlugin.js";
6
+ import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin.js";
7
+ import { LinkToolbarProsemirrorPlugin } from "../extensions/LinkToolbar/LinkToolbarPlugin.js";
8
+ import { SideMenuProsemirrorPlugin } from "../extensions/SideMenu/SideMenuPlugin.js";
9
+ import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin.js";
10
+ import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin.js";
11
+ import { BlockIdentifier, BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, PartialInlineContent, StyleSchema, StyleSpecs, Styles } from "../schema/index.js";
12
+ import { NoInfer } from "../util/typescript.js";
13
+ import { TextCursorPosition } from "./cursorPositionTypes.js";
14
+ import { Selection } from "./selectionTypes.js";
15
+ import { BlockNoteSchema } from "./BlockNoteSchema.js";
16
+ import { BlockNoteTipTapEditor } from "./BlockNoteTipTapEditor.js";
17
+ import { Dictionary } from "../i18n/dictionary.js";
18
18
  import { Transaction } from "@tiptap/pm/state";
19
19
  import "../style.css";
20
20
  export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> = {
@@ -244,9 +244,9 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
244
244
  * @param blocksToInsert An array of partial blocks that should be inserted.
245
245
  * @param referenceBlock An identifier for an existing block, at which the new blocks should be inserted.
246
246
  * @param placement Whether the blocks should be inserted just before, just after, or nested inside the
247
- * `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
247
+ * `referenceBlock`.
248
248
  */
249
- insertBlocks(blocksToInsert: PartialBlock<BSchema, ISchema, SSchema>[], referenceBlock: BlockIdentifier, placement?: "before" | "after" | "nested"): Block<BSchema, ISchema, SSchema>[];
249
+ insertBlocks(blocksToInsert: PartialBlock<BSchema, ISchema, SSchema>[], referenceBlock: BlockIdentifier, placement?: "before" | "after"): Block<BSchema, ISchema, SSchema>[];
250
250
  /**
251
251
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
252
252
  * defined. These undefined fields are kept as-is from the existing block. Throws an error if the block to update could
@@ -326,6 +326,18 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
326
326
  * Lifts the block containing the text cursor out of its parent.
327
327
  */
328
328
  unnestBlock(): void;
329
+ /**
330
+ * Moves the block containing the text cursor up. If the previous block has
331
+ * children, moves it to the end of its children. If there is no previous
332
+ * block, but the current block is nested, moves it out of & before its parent.
333
+ */
334
+ moveBlockUp(): void;
335
+ /**
336
+ * Moves the block containing the text cursor down. If the next block has
337
+ * children, moves it to the start of its children. If there is no next block,
338
+ * but the current block is nested, moves it out of & after its parent.
339
+ */
340
+ moveBlockDown(): void;
329
341
  /**
330
342
  * Exports blocks into a simplified HTML string. To better conform to HTML standards, children of blocks which aren't list
331
343
  * items are un-nested in the output HTML.
@@ -1,10 +1,10 @@
1
- import type { BlockNoteEditor } from "./BlockNoteEditor";
1
+ import type { BlockNoteEditor } from "./BlockNoteEditor.js";
2
2
  import * as Y from "yjs";
3
- import { BlockNoteDOMAttributes, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema";
3
+ import { BlockNoteDOMAttributes, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema/index.js";
4
4
  /**
5
5
  * Get all the Tiptap extensions BlockNote is configured with by default
6
6
  */
7
- export declare const getBlockNoteExtensions: <BSchema extends Record<string, import("../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(opts: {
7
+ export declare const getBlockNoteExtensions: <BSchema extends Record<string, import("../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(opts: {
8
8
  editor: BlockNoteEditor<BSchema, I, S>;
9
9
  domAttributes: Partial<BlockNoteDOMAttributes>;
10
10
  blockSpecs: BlockSpecs;
@@ -1,7 +1,7 @@
1
- import { defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "../blocks/defaultBlocks";
2
- import { BlockSchema, BlockSchemaFromSpecs, BlockSpecs, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs } from "../schema";
3
- import type { BlockNoDefaults, PartialBlockNoDefaults } from "../schema/blocks/types";
4
- import type { BlockNoteEditor } from "./BlockNoteEditor";
1
+ import { defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "../blocks/defaultBlocks.js";
2
+ import type { BlockNoDefaults, PartialBlockNoDefaults } from "../schema/blocks/types.js";
3
+ import { BlockSchema, BlockSchemaFromSpecs, BlockSpecs, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs } from "../schema/index.js";
4
+ import type { BlockNoteEditor } from "./BlockNoteEditor.js";
5
5
  export declare class BlockNoteSchema<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> {
6
6
  readonly blockSpecs: BlockSpecs;
7
7
  readonly inlineContentSpecs: InlineContentSpecs;
@@ -1,8 +1,8 @@
1
1
  import { EditorOptions } from "@tiptap/core";
2
2
  import { Editor as TiptapEditor } from "@tiptap/core";
3
3
  import { EditorState, Transaction } from "@tiptap/pm/state";
4
- import { PartialBlock } from "../blocks/defaultBlocks";
5
- import { StyleSchema } from "../schema";
4
+ import { PartialBlock } from "../blocks/defaultBlocks.js";
5
+ import { StyleSchema } from "../schema/index.js";
6
6
  export type BlockNoteTipTapEditorOptions = Partial<Omit<EditorOptions, "content">> & {
7
7
  content: PartialBlock<any, any, any>[];
8
8
  };
@@ -1,7 +1,8 @@
1
- import { Block } from "../blocks/defaultBlocks";
2
- import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
1
+ import { Block } from "../blocks/defaultBlocks.js";
2
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema/index.js";
3
3
  export type TextCursorPosition<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
4
4
  block: Block<BSchema, I, S>;
5
5
  prevBlock: Block<BSchema, I, S> | undefined;
6
6
  nextBlock: Block<BSchema, I, S> | undefined;
7
+ parentBlock: Block<BSchema, I, S> | undefined;
7
8
  };
@@ -1,5 +1,5 @@
1
- import { Block } from "../blocks/defaultBlocks";
2
- import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema";
1
+ import { Block } from "../blocks/defaultBlocks.js";
2
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../schema/index.js";
3
3
  export type Selection<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
4
4
  blocks: Block<BSchema, I, S>[];
5
5
  };
@@ -1,5 +1,12 @@
1
- import { Slice } from "@tiptap/pm/model";
1
+ import { Fragment, Schema, Slice } from "@tiptap/pm/model";
2
2
  import { EditorView } from "@tiptap/pm/view";
3
+ /**
4
+ * Wrap adjacent tableRow items in a table.
5
+ *
6
+ * This makes sure the content that we paste is always a table (and not a tableRow)
7
+ * A table works better for the remaing paste handling logic, as it's actually a blockContent node
8
+ */
9
+ export declare function wrapTableRows(f: Fragment, schema: Schema): Fragment;
3
10
  /**
4
11
  * fix for https://github.com/ProseMirror/prosemirror/issues/1430#issuecomment-1822570821
5
12
  *
@@ -3,5 +3,5 @@ export declare const BackgroundColor: {
3
3
  type: string;
4
4
  propSchema: "string";
5
5
  };
6
- implementation: import("../../schema").StyleImplementation;
6
+ implementation: import("../../schema/index.js").StyleImplementation;
7
7
  };