@blocknote/core 0.21.0 → 0.22.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 (391) hide show
  1. package/dist/blocknote.js +1023 -999
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +7 -7
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/webpack-stats.json +1 -1
  8. package/package.json +3 -3
  9. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +96 -0
  10. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +96 -0
  11. package/src/api/clipboard/__snapshots__/external/pasteImage.html +111 -0
  12. package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +96 -0
  13. package/src/api/clipboard/__snapshots__/external/pasteTable.html +149 -0
  14. package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +124 -0
  15. package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +1 -0
  16. package/src/api/clipboard/clipboardExternal.test.ts +161 -0
  17. package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +60 -38
  18. package/src/api/clipboard/testUtil.ts +27 -0
  19. package/src/api/clipboard/toClipboard/copyExtension.ts +1 -0
  20. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
  21. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -1
  22. package/src/api/nodeConversions/nodeToBlock.ts +4 -1
  23. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
  24. package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
  25. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -19
  26. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +3 -15
  27. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
  28. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +25 -5
  29. package/src/editor/Block.css +3 -3
  30. package/src/editor/BlockNoteEditor.test.ts +21 -1
  31. package/src/editor/editor.css +6 -6
  32. package/src/editor/transformPasted.ts +57 -4
  33. package/src/schema/blocks/createSpec.ts +1 -1
  34. package/src/schema/blocks/internal.ts +16 -6
  35. package/src/schema/inlineContent/internal.ts +4 -1
  36. package/src/schema/propTypes.ts +41 -18
  37. package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -0
  38. package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
  39. package/types/src/api/clipboard/testUtil.d.ts +509 -0
  40. package/types/src/api/testUtil/cases/customBlocks.d.ts +8 -0
  41. package/types/src/api/testUtil/cases/customInlineContent.d.ts +8 -0
  42. package/types/src/api/testUtil/cases/customStyles.d.ts +8 -0
  43. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
  44. package/types/src/blocks/defaultBlocks.d.ts +16 -0
  45. package/types/src/editor/transformPasted.d.ts +8 -4
  46. package/types/src/schema/propTypes.d.ts +20 -2
  47. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +0 -30
  48. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +0 -1
  49. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +0 -99
  50. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +0 -1
  51. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +0 -97
  52. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +0 -1
  53. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +0 -88
  54. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +0 -1
  55. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +0 -219
  56. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +0 -1
  57. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +0 -175
  58. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +0 -1
  59. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +0 -57
  60. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +0 -1
  61. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +0 -5
  62. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +0 -1
  63. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +0 -31
  64. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +0 -1
  65. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +0 -71
  66. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +0 -1
  67. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +0 -157
  68. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +0 -1
  69. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +0 -27
  70. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +0 -1
  71. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +0 -67
  72. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +0 -1
  73. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +0 -148
  74. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +0 -1
  75. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +0 -252
  76. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +0 -1
  77. package/dist/src/api/blockManipulation/getBlock/getBlock.js +0 -56
  78. package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +0 -1
  79. package/dist/src/api/blockManipulation/insertContentAt.js +0 -64
  80. package/dist/src/api/blockManipulation/insertContentAt.js.map +0 -1
  81. package/dist/src/api/blockManipulation/selections/selection.js +0 -149
  82. package/dist/src/api/blockManipulation/selections/selection.js.map +0 -1
  83. package/dist/src/api/blockManipulation/selections/selection.test.js +0 -39
  84. package/dist/src/api/blockManipulation/selections/selection.test.js.map +0 -1
  85. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +0 -79
  86. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +0 -1
  87. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +0 -33
  88. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +0 -1
  89. package/dist/src/api/blockManipulation/setupTestEnv.js +0 -172
  90. package/dist/src/api/blockManipulation/setupTestEnv.js.map +0 -1
  91. package/dist/src/api/clipboard/clipboard.test.js +0 -249
  92. package/dist/src/api/clipboard/clipboard.test.js.map +0 -1
  93. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +0 -8
  94. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +0 -1
  95. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +0 -38
  96. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +0 -1
  97. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +0 -111
  98. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +0 -1
  99. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +0 -25
  100. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +0 -1
  101. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +0 -57
  102. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +0 -1
  103. package/dist/src/api/clipboard/toClipboard/copyExtension.js +0 -134
  104. package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +0 -1
  105. package/dist/src/api/exporters/html/externalHTMLExporter.js +0 -35
  106. package/dist/src/api/exporters/html/externalHTMLExporter.js.map +0 -1
  107. package/dist/src/api/exporters/html/htmlConversion.test.js +0 -72
  108. package/dist/src/api/exporters/html/htmlConversion.test.js.map +0 -1
  109. package/dist/src/api/exporters/html/internalHTMLSerializer.js +0 -21
  110. package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +0 -1
  111. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +0 -141
  112. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +0 -1
  113. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +0 -96
  114. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +0 -1
  115. package/dist/src/api/exporters/markdown/markdownExporter.js +0 -31
  116. package/dist/src/api/exporters/markdown/markdownExporter.js.map +0 -1
  117. package/dist/src/api/exporters/markdown/markdownExporter.test.js +0 -57
  118. package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +0 -1
  119. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +0 -33
  120. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +0 -1
  121. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +0 -37
  122. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +0 -1
  123. package/dist/src/api/getBlockInfoFromPos.js +0 -165
  124. package/dist/src/api/getBlockInfoFromPos.js.map +0 -1
  125. package/dist/src/api/nodeConversions/blockToNode.js +0 -197
  126. package/dist/src/api/nodeConversions/blockToNode.js.map +0 -1
  127. package/dist/src/api/nodeConversions/fragmentToBlocks.js +0 -50
  128. package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +0 -1
  129. package/dist/src/api/nodeConversions/nodeConversions.test.js +0 -54
  130. package/dist/src/api/nodeConversions/nodeConversions.test.js.map +0 -1
  131. package/dist/src/api/nodeConversions/nodeToBlock.js +0 -316
  132. package/dist/src/api/nodeConversions/nodeToBlock.js.map +0 -1
  133. package/dist/src/api/nodeUtil.js +0 -28
  134. package/dist/src/api/nodeUtil.js.map +0 -1
  135. package/dist/src/api/parsers/html/parseHTML.js +0 -19
  136. package/dist/src/api/parsers/html/parseHTML.js.map +0 -1
  137. package/dist/src/api/parsers/html/parseHTML.test.js +0 -470
  138. package/dist/src/api/parsers/html/parseHTML.test.js.map +0 -1
  139. package/dist/src/api/parsers/html/util/nestedLists.js +0 -106
  140. package/dist/src/api/parsers/html/util/nestedLists.js.map +0 -1
  141. package/dist/src/api/parsers/html/util/nestedLists.test.js +0 -166
  142. package/dist/src/api/parsers/html/util/nestedLists.test.js.map +0 -1
  143. package/dist/src/api/parsers/markdown/parseMarkdown.js +0 -52
  144. package/dist/src/api/parsers/markdown/parseMarkdown.js.map +0 -1
  145. package/dist/src/api/parsers/markdown/parseMarkdown.test.js +0 -112
  146. package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +0 -1
  147. package/dist/src/api/testUtil/cases/customBlocks.js +0 -313
  148. package/dist/src/api/testUtil/cases/customBlocks.js.map +0 -1
  149. package/dist/src/api/testUtil/cases/customInlineContent.js +0 -91
  150. package/dist/src/api/testUtil/cases/customInlineContent.js.map +0 -1
  151. package/dist/src/api/testUtil/cases/customStyles.js +0 -83
  152. package/dist/src/api/testUtil/cases/customStyles.js.map +0 -1
  153. package/dist/src/api/testUtil/cases/defaultSchema.js +0 -673
  154. package/dist/src/api/testUtil/cases/defaultSchema.js.map +0 -1
  155. package/dist/src/api/testUtil/index.js +0 -2
  156. package/dist/src/api/testUtil/index.js.map +0 -1
  157. package/dist/src/api/testUtil/partialBlockTestUtil.js +0 -114
  158. package/dist/src/api/testUtil/partialBlockTestUtil.js.map +0 -1
  159. package/dist/src/api/testUtil/paste.js +0 -29
  160. package/dist/src/api/testUtil/paste.js.map +0 -1
  161. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +0 -104
  162. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +0 -1
  163. package/dist/src/blocks/AudioBlockContent/parseAudioElement.js +0 -5
  164. package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +0 -1
  165. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +0 -281
  166. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +0 -1
  167. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +0 -110
  168. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +0 -1
  169. package/dist/src/blocks/FileBlockContent/FileBlockContent.js +0 -71
  170. package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +0 -1
  171. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +0 -5
  172. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +0 -1
  173. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +0 -10
  174. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +0 -1
  175. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +0 -39
  176. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +0 -1
  177. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +0 -51
  178. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +0 -1
  179. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +0 -17
  180. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +0 -1
  181. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +0 -147
  182. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +0 -1
  183. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +0 -9
  184. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +0 -1
  185. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +0 -11
  186. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +0 -1
  187. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +0 -15
  188. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +0 -1
  189. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +0 -145
  190. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +0 -1
  191. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +0 -114
  192. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +0 -1
  193. package/dist/src/blocks/ImageBlockContent/parseImageElement.js +0 -6
  194. package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +0 -1
  195. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +0 -113
  196. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +0 -1
  197. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +0 -224
  198. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +0 -1
  199. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +0 -45
  200. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +0 -1
  201. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +0 -58
  202. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +0 -1
  203. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +0 -130
  204. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +0 -1
  205. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +0 -52
  206. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +0 -1
  207. package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -129
  208. package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +0 -1
  209. package/dist/src/blocks/TableBlockContent/TableExtension.js +0 -64
  210. package/dist/src/blocks/TableBlockContent/TableExtension.js.map +0 -1
  211. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +0 -114
  212. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +0 -1
  213. package/dist/src/blocks/VideoBlockContent/parseVideoElement.js +0 -6
  214. package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +0 -1
  215. package/dist/src/blocks/defaultBlockHelpers.js +0 -50
  216. package/dist/src/blocks/defaultBlockHelpers.js.map +0 -1
  217. package/dist/src/blocks/defaultBlockTypeGuards.js +0 -40
  218. package/dist/src/blocks/defaultBlockTypeGuards.js.map +0 -1
  219. package/dist/src/blocks/defaultBlocks.js +0 -50
  220. package/dist/src/blocks/defaultBlocks.js.map +0 -1
  221. package/dist/src/blocks/defaultProps.js +0 -19
  222. package/dist/src/blocks/defaultProps.js.map +0 -1
  223. package/dist/src/editor/BlockNoteEditor.js +0 -751
  224. package/dist/src/editor/BlockNoteEditor.js.map +0 -1
  225. package/dist/src/editor/BlockNoteEditor.test.js +0 -65
  226. package/dist/src/editor/BlockNoteEditor.test.js.map +0 -1
  227. package/dist/src/editor/BlockNoteExtensions.js +0 -192
  228. package/dist/src/editor/BlockNoteExtensions.js.map +0 -1
  229. package/dist/src/editor/BlockNoteSchema.js +0 -38
  230. package/dist/src/editor/BlockNoteSchema.js.map +0 -1
  231. package/dist/src/editor/BlockNoteTipTapEditor.js +0 -169
  232. package/dist/src/editor/BlockNoteTipTapEditor.js.map +0 -1
  233. package/dist/src/editor/cursorPositionTypes.js +0 -2
  234. package/dist/src/editor/cursorPositionTypes.js.map +0 -1
  235. package/dist/src/editor/defaultColors.js +0 -77
  236. package/dist/src/editor/defaultColors.js.map +0 -1
  237. package/dist/src/editor/selectionTypes.js +0 -2
  238. package/dist/src/editor/selectionTypes.js.map +0 -1
  239. package/dist/src/editor/transformPasted.js +0 -79
  240. package/dist/src/editor/transformPasted.js.map +0 -1
  241. package/dist/src/exporter/Exporter.js +0 -36
  242. package/dist/src/exporter/Exporter.js.map +0 -1
  243. package/dist/src/exporter/index.js +0 -3
  244. package/dist/src/exporter/index.js.map +0 -1
  245. package/dist/src/exporter/mapping.js +0 -12
  246. package/dist/src/exporter/mapping.js.map +0 -1
  247. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +0 -30
  248. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +0 -1
  249. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +0 -39
  250. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +0 -1
  251. package/dist/src/extensions/FilePanel/FilePanelPlugin.js +0 -131
  252. package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +0 -1
  253. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +0 -197
  254. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +0 -1
  255. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +0 -341
  256. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +0 -1
  257. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +0 -251
  258. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +0 -1
  259. package/dist/src/extensions/LinkToolbar/protocols.js +0 -14
  260. package/dist/src/extensions/LinkToolbar/protocols.js.map +0 -1
  261. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +0 -54
  262. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +0 -1
  263. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +0 -90
  264. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +0 -1
  265. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +0 -187
  266. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +0 -1
  267. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +0 -68
  268. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +0 -1
  269. package/dist/src/extensions/SideMenu/SideMenuPlugin.js +0 -347
  270. package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +0 -1
  271. package/dist/src/extensions/SideMenu/dragging.js +0 -135
  272. package/dist/src/extensions/SideMenu/dragging.js.map +0 -1
  273. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +0 -2
  274. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +0 -1
  275. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +0 -2
  276. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +0 -1
  277. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +0 -245
  278. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +0 -1
  279. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +0 -26
  280. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +0 -1
  281. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +0 -241
  282. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +0 -1
  283. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +0 -579
  284. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +0 -1
  285. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +0 -36
  286. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +0 -1
  287. package/dist/src/extensions/TextColor/TextColorExtension.js +0 -29
  288. package/dist/src/extensions/TextColor/TextColorExtension.js.map +0 -1
  289. package/dist/src/extensions/TextColor/TextColorMark.js +0 -37
  290. package/dist/src/extensions/TextColor/TextColorMark.js.map +0 -1
  291. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +0 -58
  292. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +0 -1
  293. package/dist/src/extensions/UniqueID/UniqueID.js +0 -283
  294. package/dist/src/extensions/UniqueID/UniqueID.js.map +0 -1
  295. package/dist/src/extensions/getDraggableBlockFromElement.js +0 -13
  296. package/dist/src/extensions/getDraggableBlockFromElement.js.map +0 -1
  297. package/dist/src/extensions-shared/UiElementPosition.js +0 -2
  298. package/dist/src/extensions-shared/UiElementPosition.js.map +0 -1
  299. package/dist/src/i18n/dictionary.js +0 -4
  300. package/dist/src/i18n/dictionary.js.map +0 -1
  301. package/dist/src/i18n/locales/ar.js +0 -298
  302. package/dist/src/i18n/locales/ar.js.map +0 -1
  303. package/dist/src/i18n/locales/de.js +0 -313
  304. package/dist/src/i18n/locales/de.js.map +0 -1
  305. package/dist/src/i18n/locales/en.js +0 -314
  306. package/dist/src/i18n/locales/en.js.map +0 -1
  307. package/dist/src/i18n/locales/es.js +0 -312
  308. package/dist/src/i18n/locales/es.js.map +0 -1
  309. package/dist/src/i18n/locales/fr.js +0 -313
  310. package/dist/src/i18n/locales/fr.js.map +0 -1
  311. package/dist/src/i18n/locales/hr.js +0 -308
  312. package/dist/src/i18n/locales/hr.js.map +0 -1
  313. package/dist/src/i18n/locales/index.js +0 -16
  314. package/dist/src/i18n/locales/index.js.map +0 -1
  315. package/dist/src/i18n/locales/is.js +0 -305
  316. package/dist/src/i18n/locales/is.js.map +0 -1
  317. package/dist/src/i18n/locales/ja.js +0 -333
  318. package/dist/src/i18n/locales/ja.js.map +0 -1
  319. package/dist/src/i18n/locales/ko.js +0 -326
  320. package/dist/src/i18n/locales/ko.js.map +0 -1
  321. package/dist/src/i18n/locales/nl.js +0 -313
  322. package/dist/src/i18n/locales/nl.js.map +0 -1
  323. package/dist/src/i18n/locales/pl.js +0 -297
  324. package/dist/src/i18n/locales/pl.js.map +0 -1
  325. package/dist/src/i18n/locales/pt.js +0 -305
  326. package/dist/src/i18n/locales/pt.js.map +0 -1
  327. package/dist/src/i18n/locales/ru.js +0 -340
  328. package/dist/src/i18n/locales/ru.js.map +0 -1
  329. package/dist/src/i18n/locales/vi.js +0 -312
  330. package/dist/src/i18n/locales/vi.js.map +0 -1
  331. package/dist/src/i18n/locales/zh.js +0 -346
  332. package/dist/src/i18n/locales/zh.js.map +0 -1
  333. package/dist/src/index.js +0 -63
  334. package/dist/src/index.js.map +0 -1
  335. package/dist/src/pm-nodes/BlockContainer.js +0 -72
  336. package/dist/src/pm-nodes/BlockContainer.js.map +0 -1
  337. package/dist/src/pm-nodes/BlockGroup.js +0 -43
  338. package/dist/src/pm-nodes/BlockGroup.js.map +0 -1
  339. package/dist/src/pm-nodes/Doc.js +0 -7
  340. package/dist/src/pm-nodes/Doc.js.map +0 -1
  341. package/dist/src/pm-nodes/index.js +0 -4
  342. package/dist/src/pm-nodes/index.js.map +0 -1
  343. package/dist/src/schema/blocks/createSpec.js +0 -126
  344. package/dist/src/schema/blocks/createSpec.js.map +0 -1
  345. package/dist/src/schema/blocks/internal.js +0 -147
  346. package/dist/src/schema/blocks/internal.js.map +0 -1
  347. package/dist/src/schema/blocks/types.js +0 -2
  348. package/dist/src/schema/blocks/types.js.map +0 -1
  349. package/dist/src/schema/index.js +0 -11
  350. package/dist/src/schema/index.js.map +0 -1
  351. package/dist/src/schema/inlineContent/createSpec.js +0 -64
  352. package/dist/src/schema/inlineContent/createSpec.js.map +0 -1
  353. package/dist/src/schema/inlineContent/internal.js +0 -52
  354. package/dist/src/schema/inlineContent/internal.js.map +0 -1
  355. package/dist/src/schema/inlineContent/types.js +0 -10
  356. package/dist/src/schema/inlineContent/types.js.map +0 -1
  357. package/dist/src/schema/propTypes.js +0 -2
  358. package/dist/src/schema/propTypes.js.map +0 -1
  359. package/dist/src/schema/styles/createSpec.js +0 -48
  360. package/dist/src/schema/styles/createSpec.js.map +0 -1
  361. package/dist/src/schema/styles/internal.js +0 -53
  362. package/dist/src/schema/styles/internal.js.map +0 -1
  363. package/dist/src/schema/styles/types.js +0 -2
  364. package/dist/src/schema/styles/types.js.map +0 -1
  365. package/dist/src/util/EventEmitter.js +0 -33
  366. package/dist/src/util/EventEmitter.js.map +0 -1
  367. package/dist/src/util/browser.js +0 -17
  368. package/dist/src/util/browser.js.map +0 -1
  369. package/dist/src/util/combineByGroup.js +0 -20
  370. package/dist/src/util/combineByGroup.js.map +0 -1
  371. package/dist/src/util/esmDependencies.js +0 -35
  372. package/dist/src/util/esmDependencies.js.map +0 -1
  373. package/dist/src/util/string.js +0 -14
  374. package/dist/src/util/string.js.map +0 -1
  375. package/dist/src/util/typescript.js +0 -12
  376. package/dist/src/util/typescript.js.map +0 -1
  377. /package/src/api/clipboard/__snapshots__/{childToParent.html → internal/childToParent.html} +0 -0
  378. /package/src/api/clipboard/__snapshots__/{childrenToNextParent.html → internal/childrenToNextParent.html} +0 -0
  379. /package/src/api/clipboard/__snapshots__/{childrenToNextParentsChildren.html → internal/childrenToNextParentsChildren.html} +0 -0
  380. /package/src/api/clipboard/__snapshots__/{image.html → internal/image.html} +0 -0
  381. /package/src/api/clipboard/__snapshots__/{multipleChildren.html → internal/multipleChildren.html} +0 -0
  382. /package/src/api/clipboard/__snapshots__/{multipleStyledText.html → internal/multipleStyledText.html} +0 -0
  383. /package/src/api/clipboard/__snapshots__/{nestedImage.html → internal/nestedImage.html} +0 -0
  384. /package/src/api/clipboard/__snapshots__/{partialChildToParent.html → internal/partialChildToParent.html} +0 -0
  385. /package/src/api/clipboard/__snapshots__/{styledText.html → internal/styledText.html} +0 -0
  386. /package/src/api/clipboard/__snapshots__/{tableAllCells.html → internal/tableAllCells.html} +0 -0
  387. /package/src/api/clipboard/__snapshots__/{tableCell.html → internal/tableCell.html} +0 -0
  388. /package/src/api/clipboard/__snapshots__/{tableCellText.html → internal/tableCellText.html} +0 -0
  389. /package/src/api/clipboard/__snapshots__/{tableRow.html → internal/tableRow.html} +0 -0
  390. /package/src/api/clipboard/__snapshots__/{unstyledText.html → internal/unstyledText.html} +0 -0
  391. /package/types/src/api/clipboard/{clipboard.test.d.ts → clipboardExternal.test.d.ts} +0 -0
@@ -1,347 +0,0 @@
1
- import { Plugin, PluginKey } from "prosemirror-state";
2
- import { EventEmitter } from "../../util/EventEmitter.js";
3
- import { initializeESMDependencies } from "../../util/esmDependencies.js";
4
- import { getDraggableBlockFromElement } from "../getDraggableBlockFromElement.js";
5
- import { dragStart, unsetDragImage } from "./dragging.js";
6
- const PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP = 0.1;
7
- function getBlockFromCoords(view, coords, adjustForColumns = true) {
8
- const elements = view.root.elementsFromPoint(coords.left, coords.top);
9
- for (const element of elements) {
10
- if (!view.dom.contains(element)) {
11
- // probably a ui overlay like formatting toolbar etc
12
- continue;
13
- }
14
- if (adjustForColumns) {
15
- const column = element.closest("[data-node-type=columnList]");
16
- if (column) {
17
- return getBlockFromCoords(view, {
18
- left: coords.left + 50, // bit hacky, but if we're inside a column, offset x position to right to account for the width of sidemenu itself
19
- top: coords.top,
20
- }, false);
21
- }
22
- }
23
- return getDraggableBlockFromElement(element, view);
24
- }
25
- return undefined;
26
- }
27
- function getBlockFromMousePos(mousePos, view) {
28
- // Editor itself may have padding or other styling which affects
29
- // size/position, so we get the boundingRect of the first child (i.e. the
30
- // blockGroup that wraps all blocks in the editor) for more accurate side
31
- // menu placement.
32
- if (!view.dom.firstChild) {
33
- return;
34
- }
35
- const editorBoundingBox = view.dom.firstChild.getBoundingClientRect();
36
- // this.horizontalPosAnchor = editorBoundingBox.x;
37
- // Gets block at mouse cursor's vertical position.
38
- const coords = {
39
- left: mousePos.x,
40
- top: mousePos.y,
41
- };
42
- const mouseLeftOfEditor = coords.left < editorBoundingBox.left;
43
- const mouseRightOfEditor = coords.left > editorBoundingBox.right;
44
- if (mouseLeftOfEditor) {
45
- coords.left = editorBoundingBox.left + 10;
46
- }
47
- if (mouseRightOfEditor) {
48
- coords.left = editorBoundingBox.right - 10;
49
- }
50
- let block = getBlockFromCoords(view, coords);
51
- if (!mouseRightOfEditor && block) {
52
- // note: this case is not necessary when we're on the right side of the editor
53
- /* Now, because blocks can be nested
54
- | BlockA |
55
- x | BlockB y|
56
-
57
- hovering over position x (the "margin of block B") will return block A instead of block B.
58
- to fix this, we get the block from the right side of block A (position y, which will fall in BlockB correctly)
59
- */
60
- const rect = block.node.getBoundingClientRect();
61
- coords.left = rect.right - 10;
62
- block = getBlockFromCoords(view, coords, false);
63
- }
64
- return block;
65
- }
66
- /**
67
- * With the sidemenu plugin we can position a menu next to a hovered block.
68
- */
69
- export class SideMenuView {
70
- editor;
71
- pmView;
72
- state;
73
- emitUpdate;
74
- mousePos;
75
- hoveredBlock;
76
- menuFrozen = false;
77
- constructor(editor, pmView, emitUpdate) {
78
- this.editor = editor;
79
- this.pmView = pmView;
80
- this.emitUpdate = () => {
81
- if (!this.state) {
82
- throw new Error("Attempting to update uninitialized side menu");
83
- }
84
- emitUpdate(this.state);
85
- };
86
- this.pmView.root.addEventListener("drop", this.onDrop, true);
87
- this.pmView.root.addEventListener("dragover", this.onDragOver);
88
- initializeESMDependencies();
89
- // Shows or updates menu position whenever the cursor moves, if the menu isn't frozen.
90
- this.pmView.root.addEventListener("mousemove", this.onMouseMove, true);
91
- // Hides and unfreezes the menu whenever the user presses a key.
92
- this.pmView.root.addEventListener("keydown", this.onKeyDown, true);
93
- }
94
- updateState = (state) => {
95
- this.state = state;
96
- this.emitUpdate(this.state);
97
- };
98
- updateStateFromMousePos = () => {
99
- if (this.menuFrozen || !this.mousePos) {
100
- return;
101
- }
102
- const block = getBlockFromMousePos(this.mousePos, this.pmView);
103
- // Closes the menu if the mouse cursor is beyond the editor vertically.
104
- if (!block || !this.editor.isEditable) {
105
- if (this.state?.show) {
106
- this.state.show = false;
107
- this.updateState(this.state);
108
- }
109
- return;
110
- }
111
- // Doesn't update if the menu is already open and the mouse cursor is still hovering the same block.
112
- if (this.state?.show &&
113
- this.hoveredBlock?.hasAttribute("data-id") &&
114
- this.hoveredBlock?.getAttribute("data-id") === block.id) {
115
- return;
116
- }
117
- this.hoveredBlock = block.node;
118
- // Gets the block's content node, which lets to ignore child blocks when determining the block menu's position.
119
- // TODO: needed?
120
- const blockContent = block.node.firstChild;
121
- if (!blockContent) {
122
- return;
123
- }
124
- // TODO: needed?
125
- // Shows or updates elements.
126
- if (this.editor.isEditable) {
127
- const blockContentBoundingBox = blockContent.getBoundingClientRect();
128
- const column = block.node.closest("[data-node-type=column]");
129
- this.updateState({
130
- show: true,
131
- referencePos: new DOMRect(column
132
- ? // We take the first child as column elements have some default
133
- // padding. This is a little weird since this child element will
134
- // be the first block, but since it's always non-nested and we
135
- // only take the x coordinate, it's ok.
136
- column.firstElementChild.getBoundingClientRect().x
137
- : this.pmView.dom.firstChild.getBoundingClientRect().x, blockContentBoundingBox.y, blockContentBoundingBox.width, blockContentBoundingBox.height),
138
- block: this.editor.getBlock(this.hoveredBlock.getAttribute("data-id")),
139
- });
140
- }
141
- };
142
- /**
143
- * If the event is outside the editor contents,
144
- * we dispatch a fake event, so that we can still drop the content
145
- * when dragging / dropping to the side of the editor
146
- */
147
- onDrop = (event) => {
148
- this.editor._tiptapEditor.commands.blur();
149
- if (event.synthetic ||
150
- !event.dataTransfer?.types.includes("blocknote/html")) {
151
- return;
152
- }
153
- const pos = this.pmView.posAtCoords({
154
- left: event.clientX,
155
- top: event.clientY,
156
- });
157
- if (!pos || pos.inside === -1) {
158
- const evt = this.createSyntheticEvent(event);
159
- // console.log("dispatch fake drop");
160
- this.pmView.dom.dispatchEvent(evt);
161
- }
162
- };
163
- /**
164
- * If the event is outside the editor contents,
165
- * we dispatch a fake event, so that we can still drop the content
166
- * when dragging / dropping to the side of the editor
167
- */
168
- onDragOver = (event) => {
169
- if (event.synthetic ||
170
- !event.dataTransfer?.types.includes("blocknote/html")) {
171
- return;
172
- }
173
- const pos = this.pmView.posAtCoords({
174
- left: event.clientX,
175
- top: event.clientY,
176
- });
177
- if (!pos || (pos.inside === -1 && this.pmView.dom.firstChild)) {
178
- const evt = this.createSyntheticEvent(event);
179
- // console.log("dispatch fake dragover");
180
- this.pmView.dom.dispatchEvent(evt);
181
- }
182
- };
183
- onKeyDown = (_event) => {
184
- if (this.state?.show && this.editor.isFocused()) {
185
- // Typing in editor should hide side menu
186
- this.state.show = false;
187
- this.emitUpdate(this.state);
188
- }
189
- };
190
- onMouseMove = (event) => {
191
- if (this.menuFrozen) {
192
- return;
193
- }
194
- this.mousePos = { x: event.clientX, y: event.clientY };
195
- // We want the full area of the editor to check if the cursor is hovering
196
- // above it though.
197
- const editorOuterBoundingBox = this.pmView.dom.getBoundingClientRect();
198
- const cursorWithinEditor = this.mousePos.x > editorOuterBoundingBox.left &&
199
- this.mousePos.x < editorOuterBoundingBox.right &&
200
- this.mousePos.y > editorOuterBoundingBox.top &&
201
- this.mousePos.y < editorOuterBoundingBox.bottom;
202
- // TODO: remove parentElement, but then we need to remove padding from boundingbox or find a different solution
203
- const editorWrapper = this.pmView.dom.parentElement;
204
- // Doesn't update if the mouse hovers an element that's over the editor but
205
- // isn't a part of it or the side menu.
206
- if (
207
- // Cursor is within the editor area
208
- cursorWithinEditor &&
209
- // An element is hovered
210
- event &&
211
- event.target &&
212
- // Element is outside the editor
213
- !(editorWrapper === event.target ||
214
- editorWrapper.contains(event.target))) {
215
- if (this.state?.show) {
216
- this.state.show = false;
217
- this.emitUpdate(this.state);
218
- }
219
- return;
220
- }
221
- this.updateStateFromMousePos();
222
- };
223
- createSyntheticEvent(event) {
224
- const evt = new Event(event.type, event);
225
- const editorBoundingBox = this.pmView.dom.firstChild.getBoundingClientRect();
226
- evt.clientX = event.clientX;
227
- evt.clientY = event.clientY;
228
- if (event.clientX < editorBoundingBox.left &&
229
- event.clientX >
230
- editorBoundingBox.left -
231
- editorBoundingBox.width *
232
- PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP) {
233
- // when we're slightly left of the editor, we can drop to the side of the block
234
- evt.clientX =
235
- editorBoundingBox.left +
236
- (editorBoundingBox.width *
237
- PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP) /
238
- 2;
239
- }
240
- else if (event.clientX > editorBoundingBox.right &&
241
- event.clientX <
242
- editorBoundingBox.right +
243
- editorBoundingBox.width *
244
- PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP) {
245
- // when we're slightly right of the editor, we can drop to the side of the block
246
- evt.clientX =
247
- editorBoundingBox.right -
248
- (editorBoundingBox.width *
249
- PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP) /
250
- 2;
251
- }
252
- else if (event.clientX < editorBoundingBox.left ||
253
- event.clientX > editorBoundingBox.right) {
254
- // when mouse is outside of the editor on x axis, drop it somewhere safe (but not to the side of a block)
255
- evt.clientX =
256
- editorBoundingBox.left +
257
- PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP *
258
- editorBoundingBox.width *
259
- 2; // put it somewhere in first block, but safe outside of the PERCENTAGE_OF_BLOCK_WIDTH_CONSIDERED_SIDE_DROP margin
260
- }
261
- evt.clientY = Math.min(Math.max(event.clientY, editorBoundingBox.top), editorBoundingBox.top + editorBoundingBox.height);
262
- evt.dataTransfer = event.dataTransfer;
263
- evt.preventDefault = () => event.preventDefault();
264
- evt.synthetic = true; // prevent recursion
265
- return evt;
266
- }
267
- // Needed in cases where the editor state updates without the mouse cursor
268
- // moving, as some state updates can require a side menu update. For example,
269
- // adding a button to the side menu which removes the block can cause the
270
- // block below to jump up into the place of the removed block when clicked,
271
- // allowing the user to click the button again without moving the cursor. This
272
- // would otherwise not update the side menu, and so clicking the button again
273
- // would attempt to remove the same block again, causing an error.
274
- update(_view, prevState) {
275
- const docChanged = !prevState.doc.eq(this.pmView.state.doc);
276
- if (docChanged && this.state?.show) {
277
- this.updateStateFromMousePos();
278
- }
279
- }
280
- destroy() {
281
- if (this.state?.show) {
282
- this.state.show = false;
283
- this.emitUpdate(this.state);
284
- }
285
- this.pmView.root.removeEventListener("mousemove", this.onMouseMove, true);
286
- this.pmView.root.removeEventListener("dragover", this.onDragOver);
287
- this.pmView.root.removeEventListener("drop", this.onDrop, true);
288
- this.pmView.root.removeEventListener("keydown", this.onKeyDown, true);
289
- }
290
- }
291
- export const sideMenuPluginKey = new PluginKey("SideMenuPlugin");
292
- export class SideMenuProsemirrorPlugin extends EventEmitter {
293
- editor;
294
- view;
295
- plugin;
296
- constructor(editor) {
297
- super();
298
- this.editor = editor;
299
- this.plugin = new Plugin({
300
- key: sideMenuPluginKey,
301
- view: (editorView) => {
302
- this.view = new SideMenuView(editor, editorView, (state) => {
303
- this.emit("update", state);
304
- });
305
- return this.view;
306
- },
307
- });
308
- }
309
- onUpdate(callback) {
310
- return this.on("update", callback);
311
- }
312
- /**
313
- * Handles drag & drop events for blocks.
314
- */
315
- blockDragStart = (event, block) => {
316
- dragStart(event, block, this.editor);
317
- };
318
- /**
319
- * Handles drag & drop events for blocks.
320
- */
321
- blockDragEnd = () => {
322
- if (this.editor.prosemirrorView) {
323
- unsetDragImage(this.editor.prosemirrorView.root);
324
- }
325
- };
326
- /**
327
- * Freezes the side menu. When frozen, the side menu will stay
328
- * attached to the same block regardless of which block is hovered by the
329
- * mouse cursor.
330
- */
331
- freezeMenu = () => {
332
- this.view.menuFrozen = true;
333
- this.view.state.show = true;
334
- this.view.emitUpdate(this.view.state);
335
- };
336
- /**
337
- * Unfreezes the side menu. When frozen, the side menu will stay
338
- * attached to the same block regardless of which block is hovered by the
339
- * mouse cursor.
340
- */
341
- unfreezeMenu = () => {
342
- this.view.menuFrozen = false;
343
- this.view.state.show = false;
344
- this.view.emitUpdate(this.view.state);
345
- };
346
- }
347
- //# sourceMappingURL=SideMenuPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SideMenuPlugin.js","sourceRoot":"","sources":["../../../../src/extensions/SideMenu/SideMenuPlugin.ts"],"names":[],"mappings":"AACA,OAAO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,CAAC,CAAC;IAC3C,CAAC,CAAC;CACH"}
@@ -1,135 +0,0 @@
1
- import { NodeSelection } from "prosemirror-state";
2
- import * as pmView from "prosemirror-view";
3
- import { createExternalHTMLExporter } from "../../api/exporters/html/externalHTMLExporter.js";
4
- import { cleanHTMLToMarkdown } from "../../api/exporters/markdown/markdownExporter.js";
5
- import { fragmentToBlocks } from "../../api/nodeConversions/fragmentToBlocks.js";
6
- import { getNodeById } from "../../api/nodeUtil.js";
7
- import { MultipleNodeSelection } from "./MultipleNodeSelection.js";
8
- let dragImageElement;
9
- function blockPositionsFromSelection(selection, doc) {
10
- // Absolute positions just before the first block spanned by the selection, and just after the last block. Having the
11
- // selection start and end just before and just after the target blocks ensures no whitespace/line breaks are left
12
- // behind after dragging & dropping them.
13
- let beforeFirstBlockPos;
14
- let afterLastBlockPos;
15
- // Even the user starts dragging blocks but drops them in the same place, the selection will still be moved just
16
- // before & just after the blocks spanned by the selection, and therefore doesn't need to change if they try to drag
17
- // the same blocks again. If this happens, the anchor & head move out of the block content node they were originally
18
- // in. If the anchor should update but the head shouldn't and vice versa, it means the user selection is outside a
19
- // block content node, which should never happen.
20
- const selectionStartInBlockContent = doc.resolve(selection.from).node().type.spec.group === "blockContent";
21
- const selectionEndInBlockContent = doc.resolve(selection.to).node().type.spec.group === "blockContent";
22
- // Ensures that entire outermost nodes are selected if the selection spans multiple nesting levels.
23
- const minDepth = Math.min(selection.$anchor.depth, selection.$head.depth);
24
- if (selectionStartInBlockContent && selectionEndInBlockContent) {
25
- // Absolute positions at the start of the first block in the selection and at the end of the last block. User
26
- // selections will always start and end in block content nodes, but we want the start and end positions of their
27
- // parent block nodes, which is why minDepth - 1 is used.
28
- const startFirstBlockPos = selection.$from.start(minDepth - 1);
29
- const endLastBlockPos = selection.$to.end(minDepth - 1);
30
- // Shifting start and end positions by one moves them just outside the first and last selected blocks.
31
- beforeFirstBlockPos = doc.resolve(startFirstBlockPos - 1).pos;
32
- afterLastBlockPos = doc.resolve(endLastBlockPos + 1).pos;
33
- }
34
- else {
35
- beforeFirstBlockPos = selection.from;
36
- afterLastBlockPos = selection.to;
37
- }
38
- return { from: beforeFirstBlockPos, to: afterLastBlockPos };
39
- }
40
- function setDragImage(view, from, to = from) {
41
- if (from === to) {
42
- // Moves to position to be just after the first (and only) selected block.
43
- to += view.state.doc.resolve(from + 1).node().nodeSize;
44
- }
45
- // Parent element is cloned to remove all unselected children without affecting the editor content.
46
- const parentClone = view.domAtPos(from).node.cloneNode(true);
47
- const parent = view.domAtPos(from).node;
48
- const getElementIndex = (parentElement, targetElement) => Array.prototype.indexOf.call(parentElement.children, targetElement);
49
- const firstSelectedBlockIndex = getElementIndex(parent,
50
- // Expects from position to be just before the first selected block.
51
- view.domAtPos(from + 1).node.parentElement);
52
- const lastSelectedBlockIndex = getElementIndex(parent,
53
- // Expects to position to be just after the last selected block.
54
- view.domAtPos(to - 1).node.parentElement);
55
- for (let i = parent.childElementCount - 1; i >= 0; i--) {
56
- if (i > lastSelectedBlockIndex || i < firstSelectedBlockIndex) {
57
- parentClone.removeChild(parentClone.children[i]);
58
- }
59
- }
60
- // dataTransfer.setDragImage(element) only works if element is attached to the DOM.
61
- unsetDragImage(view.root);
62
- dragImageElement = parentClone;
63
- // TODO: This is hacky, need a better way of assigning classes to the editor so that they can also be applied to the
64
- // drag preview.
65
- const classes = view.dom.className.split(" ");
66
- const inheritedClasses = classes
67
- .filter((className) => className !== "ProseMirror" &&
68
- className !== "bn-root" &&
69
- className !== "bn-editor")
70
- .join(" ");
71
- dragImageElement.className =
72
- dragImageElement.className + " bn-drag-preview " + inheritedClasses;
73
- if (view.root instanceof ShadowRoot) {
74
- view.root.appendChild(dragImageElement);
75
- }
76
- else {
77
- view.root.body.appendChild(dragImageElement);
78
- }
79
- }
80
- export function unsetDragImage(rootEl) {
81
- if (dragImageElement !== undefined) {
82
- if (rootEl instanceof ShadowRoot) {
83
- rootEl.removeChild(dragImageElement);
84
- }
85
- else {
86
- rootEl.body.removeChild(dragImageElement);
87
- }
88
- dragImageElement = undefined;
89
- }
90
- }
91
- export function dragStart(e, block, editor) {
92
- if (!e.dataTransfer) {
93
- return;
94
- }
95
- const view = editor.prosemirrorView;
96
- if (!view) {
97
- return;
98
- }
99
- const posInfo = getNodeById(block.id, view.state.doc);
100
- if (!posInfo) {
101
- throw new Error(`Block with ID ${block.id} not found`);
102
- }
103
- const pos = posInfo.posBeforeNode;
104
- if (pos != null) {
105
- const selection = view.state.selection;
106
- const doc = view.state.doc;
107
- const { from, to } = blockPositionsFromSelection(selection, doc);
108
- const draggedBlockInSelection = from <= pos && pos < to;
109
- const multipleBlocksSelected = selection.$anchor.node() !== selection.$head.node() ||
110
- selection instanceof MultipleNodeSelection;
111
- if (draggedBlockInSelection && multipleBlocksSelected) {
112
- view.dispatch(view.state.tr.setSelection(MultipleNodeSelection.create(doc, from, to)));
113
- setDragImage(view, from, to);
114
- }
115
- else {
116
- view.dispatch(view.state.tr.setSelection(NodeSelection.create(view.state.doc, pos)));
117
- setDragImage(view, pos);
118
- }
119
- const selectedSlice = view.state.selection.content();
120
- const schema = editor.pmSchema;
121
- const clipboardHTML = pmView.__serializeForClipboard(view, selectedSlice).dom.innerHTML;
122
- const externalHTMLExporter = createExternalHTMLExporter(schema, editor);
123
- const blocks = fragmentToBlocks(selectedSlice.content, editor.schema);
124
- const externalHTML = externalHTMLExporter.exportBlocks(blocks, {});
125
- const plainText = cleanHTMLToMarkdown(externalHTML);
126
- e.dataTransfer.clearData();
127
- e.dataTransfer.setData("blocknote/html", clipboardHTML);
128
- e.dataTransfer.setData("text/html", externalHTML);
129
- e.dataTransfer.setData("text/plain", plainText);
130
- e.dataTransfer.effectAllowed = "move";
131
- e.dataTransfer.setDragImage(dragImageElement, 0, 0);
132
- view.dragging = { slice: selectedSlice, move: true };
133
- }
134
- }
135
- //# sourceMappingURL=dragging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dragging.js","sourceRoot":"","sources":["../../../../src/extensions/SideMenu/drag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C,gBAAgB,EAAE,aAAa,CAAC,CAAC;QACxD,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAClD,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QAChD,CAAC,CAAC,YAAY,CAAC,aAAa,GAAG,MAAM,CAAC;QACtC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,gBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvD,CAAC;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DefaultGridSuggestionItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultGridSuggestionItem.js","sourceRoot":"","sources":["../../../../src/extensions/SuggestionMenu/DefaultGridSuggestionItem.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DefaultSuggestionItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultSuggestionItem.js","sourceRoot":"","sources":["../../../../src/extensions/SuggestionMenu/DefaultSuggestionItem.ts"],"names":[],"mappings":""}