@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,579 +0,0 @@
1
- import { Plugin, PluginKey } from "prosemirror-state";
2
- import { Decoration, DecorationSet } from "prosemirror-view";
3
- import { nodeToBlock } from "../../api/nodeConversions/nodeToBlock.js";
4
- import { getNodeById } from "../../api/nodeUtil.js";
5
- import { checkBlockIsDefaultType } from "../../blocks/defaultBlockTypeGuards.js";
6
- import { EventEmitter } from "../../util/EventEmitter.js";
7
- import { getDraggableBlockFromElement } from "../getDraggableBlockFromElement.js";
8
- let dragImageElement;
9
- function setHiddenDragImage(rootEl) {
10
- if (dragImageElement) {
11
- return;
12
- }
13
- dragImageElement = document.createElement("div");
14
- dragImageElement.innerHTML = "_";
15
- dragImageElement.style.opacity = "0";
16
- dragImageElement.style.height = "1px";
17
- dragImageElement.style.width = "1px";
18
- if (rootEl instanceof Document) {
19
- rootEl.body.appendChild(dragImageElement);
20
- }
21
- else {
22
- rootEl.appendChild(dragImageElement);
23
- }
24
- }
25
- function unsetHiddenDragImage(rootEl) {
26
- if (dragImageElement) {
27
- if (rootEl instanceof Document) {
28
- rootEl.body.removeChild(dragImageElement);
29
- }
30
- else {
31
- rootEl.removeChild(dragImageElement);
32
- }
33
- dragImageElement = undefined;
34
- }
35
- }
36
- function getChildIndex(node) {
37
- return Array.prototype.indexOf.call(node.parentElement.childNodes, node);
38
- }
39
- // Finds the DOM element corresponding to the table cell that the target element
40
- // is currently in. If the target element is not in a table cell, returns null.
41
- function domCellAround(target) {
42
- let currentTarget = target;
43
- while (currentTarget &&
44
- currentTarget.nodeName !== "TD" &&
45
- currentTarget.nodeName !== "TH" &&
46
- !currentTarget.classList.contains("tableWrapper")) {
47
- if (currentTarget.classList.contains("ProseMirror")) {
48
- return undefined;
49
- }
50
- const parent = currentTarget.parentNode;
51
- if (!parent || !(parent instanceof Element)) {
52
- return undefined;
53
- }
54
- currentTarget = parent;
55
- }
56
- return currentTarget.nodeName === "TD" || currentTarget.nodeName === "TH"
57
- ? {
58
- type: "cell",
59
- domNode: currentTarget,
60
- tbodyNode: currentTarget.closest("tbody"),
61
- }
62
- : {
63
- type: "wrapper",
64
- domNode: currentTarget,
65
- tbodyNode: currentTarget.querySelector("tbody"),
66
- };
67
- }
68
- // Hides elements in the DOMwith the provided class names.
69
- function hideElements(selector, rootEl) {
70
- const elementsToHide = rootEl.querySelectorAll(selector);
71
- for (let i = 0; i < elementsToHide.length; i++) {
72
- elementsToHide[i].style.visibility = "hidden";
73
- }
74
- }
75
- export class TableHandlesView {
76
- editor;
77
- pmView;
78
- state;
79
- emitUpdate;
80
- tableId;
81
- tablePos;
82
- tableElement;
83
- menuFrozen = false;
84
- mouseState = "up";
85
- prevWasEditable = null;
86
- constructor(editor, pmView, emitUpdate) {
87
- this.editor = editor;
88
- this.pmView = pmView;
89
- this.emitUpdate = () => {
90
- if (!this.state) {
91
- throw new Error("Attempting to update uninitialized image toolbar");
92
- }
93
- emitUpdate(this.state);
94
- };
95
- pmView.dom.addEventListener("mousemove", this.mouseMoveHandler);
96
- pmView.dom.addEventListener("mousedown", this.viewMousedownHandler);
97
- window.addEventListener("mouseup", this.mouseUpHandler);
98
- pmView.root.addEventListener("dragover", this.dragOverHandler);
99
- pmView.root.addEventListener("drop", this.dropHandler);
100
- }
101
- viewMousedownHandler = () => {
102
- this.mouseState = "down";
103
- };
104
- mouseUpHandler = (event) => {
105
- this.mouseState = "up";
106
- this.mouseMoveHandler(event);
107
- };
108
- mouseMoveHandler = (event) => {
109
- if (this.menuFrozen) {
110
- return;
111
- }
112
- if (this.mouseState === "selecting") {
113
- return;
114
- }
115
- if (!(event.target instanceof Element) ||
116
- !this.pmView.dom.contains(event.target)) {
117
- return;
118
- }
119
- const target = domCellAround(event.target);
120
- if (target?.type === "cell" &&
121
- this.mouseState === "down" &&
122
- !this.state?.draggingState) {
123
- // hide draghandles when selecting text as they could be in the way of the user
124
- this.mouseState = "selecting";
125
- if (this.state?.show) {
126
- this.state.show = false;
127
- this.state.showAddOrRemoveRowsButton = false;
128
- this.state.showAddOrRemoveColumnsButton = false;
129
- this.emitUpdate();
130
- }
131
- return;
132
- }
133
- if (!target || !this.editor.isEditable) {
134
- if (this.state?.show) {
135
- this.state.show = false;
136
- this.state.showAddOrRemoveRowsButton = false;
137
- this.state.showAddOrRemoveColumnsButton = false;
138
- this.emitUpdate();
139
- }
140
- return;
141
- }
142
- if (!target.tbodyNode) {
143
- return;
144
- }
145
- const tableRect = target.tbodyNode.getBoundingClientRect();
146
- const blockEl = getDraggableBlockFromElement(target.domNode, this.pmView);
147
- if (!blockEl) {
148
- return;
149
- }
150
- this.tableElement = blockEl.node;
151
- let tableBlock;
152
- const pmNodeInfo = getNodeById(blockEl.id, this.editor._tiptapEditor.state.doc);
153
- if (!pmNodeInfo) {
154
- throw new Error(`Block with ID ${blockEl.id} not found`);
155
- }
156
- const block = nodeToBlock(pmNodeInfo.node, this.editor.schema.blockSchema, this.editor.schema.inlineContentSchema, this.editor.schema.styleSchema, this.editor.blockCache);
157
- if (checkBlockIsDefaultType("table", block, this.editor)) {
158
- this.tablePos = pmNodeInfo.posBeforeNode + 1;
159
- tableBlock = block;
160
- }
161
- if (!tableBlock) {
162
- return;
163
- }
164
- this.tableId = blockEl.id;
165
- const widgetContainer = target.domNode
166
- .closest(".tableWrapper")
167
- ?.querySelector(".table-widgets-container");
168
- if (target?.type === "wrapper") {
169
- // if we're just to the right or below the table, show the extend buttons
170
- // (this is a bit hacky. It would probably be cleaner to render the extend buttons in the Table NodeView instead)
171
- const belowTable = event.clientY >= tableRect.bottom - 1 && // -1 to account for fractions of pixels in "bottom"
172
- event.clientY < tableRect.bottom + 20;
173
- const toRightOfTable = event.clientX >= tableRect.right - 1 &&
174
- event.clientX < tableRect.right + 20;
175
- // without this check, we'd also hide draghandles when hovering over them
176
- const hideHandles = event.clientX > tableRect.right || event.clientY > tableRect.bottom;
177
- this.state = {
178
- ...this.state,
179
- show: true,
180
- showAddOrRemoveRowsButton: belowTable,
181
- showAddOrRemoveColumnsButton: toRightOfTable,
182
- referencePosTable: tableRect,
183
- block: tableBlock,
184
- widgetContainer,
185
- colIndex: hideHandles ? undefined : this.state.colIndex,
186
- rowIndex: hideHandles ? undefined : this.state.rowIndex,
187
- referencePosCell: hideHandles
188
- ? undefined
189
- : this.state.referencePosCell,
190
- };
191
- }
192
- else {
193
- const colIndex = getChildIndex(target.domNode);
194
- const rowIndex = getChildIndex(target.domNode.parentElement);
195
- const cellRect = target.domNode.getBoundingClientRect();
196
- if (this.state !== undefined &&
197
- this.state.show &&
198
- this.tableId === blockEl.id &&
199
- this.state.rowIndex === rowIndex &&
200
- this.state.colIndex === colIndex) {
201
- // no update needed
202
- return;
203
- }
204
- this.state = {
205
- show: true,
206
- showAddOrRemoveColumnsButton: colIndex === tableBlock.content.rows[0].cells.length - 1,
207
- showAddOrRemoveRowsButton: rowIndex === tableBlock.content.rows.length - 1,
208
- referencePosTable: tableRect,
209
- block: tableBlock,
210
- draggingState: undefined,
211
- referencePosCell: cellRect,
212
- colIndex: colIndex,
213
- rowIndex: rowIndex,
214
- widgetContainer,
215
- };
216
- }
217
- this.emitUpdate();
218
- return false;
219
- };
220
- dragOverHandler = (event) => {
221
- if (this.state?.draggingState === undefined) {
222
- return;
223
- }
224
- event.preventDefault();
225
- event.dataTransfer.dropEffect = "move";
226
- hideElements(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline", this.pmView.root);
227
- // The mouse cursor coordinates, bounded to the table's bounding box. The
228
- // bounding box is shrunk by 1px on each side to ensure that the bounded
229
- // coordinates are always inside a table cell.
230
- const boundedMouseCoords = {
231
- left: Math.min(Math.max(event.clientX, this.state.referencePosTable.left + 1), this.state.referencePosTable.right - 1),
232
- top: Math.min(Math.max(event.clientY, this.state.referencePosTable.top + 1), this.state.referencePosTable.bottom - 1),
233
- };
234
- // Gets the table cell element that the bounded mouse cursor coordinates lie
235
- // in.
236
- const tableCellElements = this.pmView.root
237
- .elementsFromPoint(boundedMouseCoords.left, boundedMouseCoords.top)
238
- .filter((element) => element.tagName === "TD" || element.tagName === "TH");
239
- if (tableCellElements.length === 0) {
240
- throw new Error("Could not find table cell element that the mouse cursor is hovering over.");
241
- }
242
- const tableCellElement = tableCellElements[0];
243
- let emitStateUpdate = false;
244
- // Gets current row and column index.
245
- const rowIndex = getChildIndex(tableCellElement.parentElement);
246
- const colIndex = getChildIndex(tableCellElement);
247
- // Checks if the drop cursor needs to be updated. This affects decorations
248
- // only so it doesn't trigger a state update.
249
- const oldIndex = this.state.draggingState.draggedCellOrientation === "row"
250
- ? this.state.rowIndex
251
- : this.state.colIndex;
252
- const newIndex = this.state.draggingState.draggedCellOrientation === "row"
253
- ? rowIndex
254
- : colIndex;
255
- const dispatchDecorationsTransaction = newIndex !== oldIndex;
256
- // Checks if either the hovered cell has changed and updates the row and
257
- // column index. Also updates the reference DOMRect.
258
- if (this.state.rowIndex !== rowIndex || this.state.colIndex !== colIndex) {
259
- this.state.rowIndex = rowIndex;
260
- this.state.colIndex = colIndex;
261
- this.state.referencePosCell = tableCellElement.getBoundingClientRect();
262
- emitStateUpdate = true;
263
- }
264
- // Checks if the mouse cursor position along the axis that the user is
265
- // dragging on has changed and updates it.
266
- const mousePos = this.state.draggingState.draggedCellOrientation === "row"
267
- ? boundedMouseCoords.top
268
- : boundedMouseCoords.left;
269
- if (this.state.draggingState.mousePos !== mousePos) {
270
- this.state.draggingState.mousePos = mousePos;
271
- emitStateUpdate = true;
272
- }
273
- // Emits a state update if any of the fields have changed.
274
- if (emitStateUpdate) {
275
- this.emitUpdate();
276
- }
277
- // Dispatches a dummy transaction to force a decorations update if
278
- // necessary.
279
- if (dispatchDecorationsTransaction) {
280
- this.editor.dispatch(this.pmView.state.tr.setMeta(tableHandlesPluginKey, true));
281
- }
282
- };
283
- dropHandler = (event) => {
284
- this.mouseState = "up";
285
- if (this.state === undefined || this.state.draggingState === undefined) {
286
- return;
287
- }
288
- if (this.state.rowIndex === undefined ||
289
- this.state.colIndex === undefined) {
290
- throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");
291
- }
292
- event.preventDefault();
293
- const { draggingState, colIndex, rowIndex } = this.state;
294
- const rows = this.state.block.content.rows;
295
- if (draggingState.draggedCellOrientation === "row") {
296
- const rowToMove = rows[draggingState.originalIndex];
297
- rows.splice(draggingState.originalIndex, 1);
298
- rows.splice(rowIndex, 0, rowToMove);
299
- }
300
- else {
301
- const cellsToMove = rows.map((row) => row.cells[draggingState.originalIndex]);
302
- rows.forEach((row, rowIndex) => {
303
- row.cells.splice(draggingState.originalIndex, 1);
304
- row.cells.splice(colIndex, 0, cellsToMove[rowIndex]);
305
- });
306
- }
307
- this.editor.updateBlock(this.state.block, {
308
- type: "table",
309
- content: {
310
- type: "tableContent",
311
- rows: rows,
312
- },
313
- });
314
- // Have to reset text cursor position to the block as `updateBlock` moves
315
- // the existing selection out of the block.
316
- this.editor.setTextCursorPosition(this.state.block.id);
317
- };
318
- // Updates drag handles when the table is modified or removed.
319
- update() {
320
- if (!this.state || !this.state.show) {
321
- return;
322
- }
323
- // Hide handles if the table block has been removed.
324
- this.state.block = this.editor.getBlock(this.state.block.id);
325
- if (!this.state.block) {
326
- this.state.show = false;
327
- this.state.showAddOrRemoveRowsButton = false;
328
- this.state.showAddOrRemoveColumnsButton = false;
329
- this.emitUpdate();
330
- return;
331
- }
332
- const rowCount = this.state.block.content.rows.length;
333
- const colCount = this.state.block.content.rows[0].cells.length;
334
- if (this.state.rowIndex !== undefined &&
335
- this.state.colIndex !== undefined) {
336
- // If rows or columns are deleted in the update, the hovered indices for
337
- // those may now be out of bounds. If this is the case, they are moved to
338
- // the new last row or column.
339
- if (this.state.rowIndex >= rowCount) {
340
- this.state.rowIndex = rowCount - 1;
341
- }
342
- if (this.state.colIndex >= colCount) {
343
- this.state.colIndex = colCount - 1;
344
- }
345
- }
346
- // Update bounding boxes.
347
- const tableBody = this.tableElement.querySelector("tbody");
348
- if (!tableBody) {
349
- throw new Error("Table block does not contain a 'tbody' HTML element. This should never happen.");
350
- }
351
- if (this.state.rowIndex !== undefined &&
352
- this.state.colIndex !== undefined) {
353
- const row = tableBody.children[this.state.rowIndex];
354
- const cell = row.children[this.state.colIndex];
355
- this.state.referencePosCell = cell.getBoundingClientRect();
356
- }
357
- this.state.referencePosTable = tableBody.getBoundingClientRect();
358
- this.emitUpdate();
359
- }
360
- destroy() {
361
- this.pmView.dom.removeEventListener("mousemove", this.mouseMoveHandler);
362
- window.removeEventListener("mouseup", this.mouseUpHandler);
363
- this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler);
364
- this.pmView.root.removeEventListener("dragover", this.dragOverHandler);
365
- this.pmView.root.removeEventListener("drop", this.dropHandler);
366
- }
367
- }
368
- export const tableHandlesPluginKey = new PluginKey("TableHandlesPlugin");
369
- export class TableHandlesProsemirrorPlugin extends EventEmitter {
370
- editor;
371
- view;
372
- plugin;
373
- constructor(editor) {
374
- super();
375
- this.editor = editor;
376
- this.plugin = new Plugin({
377
- key: tableHandlesPluginKey,
378
- view: (editorView) => {
379
- this.view = new TableHandlesView(editor, editorView, (state) => {
380
- this.emit("update", state);
381
- });
382
- return this.view;
383
- },
384
- // We use decorations to render the drop cursor when dragging a table row
385
- // or column. The decorations are updated in the `dragOverHandler` method.
386
- props: {
387
- decorations: (state) => {
388
- if (this.view === undefined ||
389
- this.view.state === undefined ||
390
- this.view.state.draggingState === undefined ||
391
- this.view.tablePos === undefined) {
392
- return;
393
- }
394
- const newIndex = this.view.state.draggingState.draggedCellOrientation === "row"
395
- ? this.view.state.rowIndex
396
- : this.view.state.colIndex;
397
- if (newIndex === undefined) {
398
- return;
399
- }
400
- const decorations = [];
401
- if (newIndex === this.view.state.draggingState.originalIndex) {
402
- return DecorationSet.create(state.doc, decorations);
403
- }
404
- // Gets the table to show the drop cursor in.
405
- const tableResolvedPos = state.doc.resolve(this.view.tablePos + 1);
406
- const tableNode = tableResolvedPos.node();
407
- if (this.view.state.draggingState.draggedCellOrientation === "row") {
408
- // Gets the row at the new index.
409
- const rowResolvedPos = state.doc.resolve(tableResolvedPos.posAtIndex(newIndex) + 1);
410
- const rowNode = rowResolvedPos.node();
411
- // Iterates over all cells in the row.
412
- for (let i = 0; i < rowNode.childCount; i++) {
413
- // Gets each cell in the row.
414
- const cellResolvedPos = state.doc.resolve(rowResolvedPos.posAtIndex(i) + 1);
415
- const cellNode = cellResolvedPos.node();
416
- // Creates a decoration at the start or end of each cell,
417
- // depending on whether the new index is before or after the
418
- // original index.
419
- const decorationPos = cellResolvedPos.pos +
420
- (newIndex > this.view.state.draggingState.originalIndex
421
- ? cellNode.nodeSize - 2
422
- : 0);
423
- decorations.push(
424
- // The widget is a small bar which spans the width of the cell.
425
- Decoration.widget(decorationPos, () => {
426
- const widget = document.createElement("div");
427
- widget.className = "bn-table-drop-cursor";
428
- widget.style.left = "0";
429
- widget.style.right = "0";
430
- // This is only necessary because the drop indicator's height
431
- // is an even number of pixels, whereas the border between
432
- // table cells is an odd number of pixels. So this makes the
433
- // positioning slightly more consistent regardless of where
434
- // the row is being dropped.
435
- if (newIndex > this.view.state.draggingState.originalIndex) {
436
- widget.style.bottom = "-2px";
437
- }
438
- else {
439
- widget.style.top = "-3px";
440
- }
441
- widget.style.height = "4px";
442
- return widget;
443
- }));
444
- }
445
- }
446
- else {
447
- // Iterates over all rows in the table.
448
- for (let i = 0; i < tableNode.childCount; i++) {
449
- // Gets each row in the table.
450
- const rowResolvedPos = state.doc.resolve(tableResolvedPos.posAtIndex(i) + 1);
451
- // Gets the cell at the new index in the row.
452
- const cellResolvedPos = state.doc.resolve(rowResolvedPos.posAtIndex(newIndex) + 1);
453
- const cellNode = cellResolvedPos.node();
454
- // Creates a decoration at the start or end of each cell,
455
- // depending on whether the new index is before or after the
456
- // original index.
457
- const decorationPos = cellResolvedPos.pos +
458
- (newIndex > this.view.state.draggingState.originalIndex
459
- ? cellNode.nodeSize - 2
460
- : 0);
461
- decorations.push(
462
- // The widget is a small bar which spans the height of the cell.
463
- Decoration.widget(decorationPos, () => {
464
- const widget = document.createElement("div");
465
- widget.className = "bn-table-drop-cursor";
466
- widget.style.top = "0";
467
- widget.style.bottom = "0";
468
- // This is only necessary because the drop indicator's width
469
- // is an even number of pixels, whereas the border between
470
- // table cells is an odd number of pixels. So this makes the
471
- // positioning slightly more consistent regardless of where
472
- // the column is being dropped.
473
- if (newIndex > this.view.state.draggingState.originalIndex) {
474
- widget.style.right = "-2px";
475
- }
476
- else {
477
- widget.style.left = "-3px";
478
- }
479
- widget.style.width = "4px";
480
- return widget;
481
- }));
482
- }
483
- }
484
- return DecorationSet.create(state.doc, decorations);
485
- },
486
- },
487
- });
488
- }
489
- onUpdate(callback) {
490
- return this.on("update", callback);
491
- }
492
- /**
493
- * Callback that should be set on the `dragStart` event for whichever element
494
- * is used as the column drag handle.
495
- */
496
- colDragStart = (event) => {
497
- if (this.view.state === undefined ||
498
- this.view.state.colIndex === undefined) {
499
- throw new Error("Attempted to drag table column, but no table block was hovered prior.");
500
- }
501
- this.view.state.draggingState = {
502
- draggedCellOrientation: "col",
503
- originalIndex: this.view.state.colIndex,
504
- mousePos: event.clientX,
505
- };
506
- this.view.emitUpdate();
507
- this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(tableHandlesPluginKey, {
508
- draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
509
- originalIndex: this.view.state.colIndex,
510
- newIndex: this.view.state.colIndex,
511
- tablePos: this.view.tablePos,
512
- }));
513
- if (!this.editor.prosemirrorView) {
514
- throw new Error("Editor view not initialized.");
515
- }
516
- setHiddenDragImage(this.editor.prosemirrorView.root);
517
- event.dataTransfer.setDragImage(dragImageElement, 0, 0);
518
- event.dataTransfer.effectAllowed = "move";
519
- };
520
- /**
521
- * Callback that should be set on the `dragStart` event for whichever element
522
- * is used as the row drag handle.
523
- */
524
- rowDragStart = (event) => {
525
- if (this.view.state === undefined ||
526
- this.view.state.rowIndex === undefined) {
527
- throw new Error("Attempted to drag table row, but no table block was hovered prior.");
528
- }
529
- this.view.state.draggingState = {
530
- draggedCellOrientation: "row",
531
- originalIndex: this.view.state.rowIndex,
532
- mousePos: event.clientY,
533
- };
534
- this.view.emitUpdate();
535
- this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(tableHandlesPluginKey, {
536
- draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
537
- originalIndex: this.view.state.rowIndex,
538
- newIndex: this.view.state.rowIndex,
539
- tablePos: this.view.tablePos,
540
- }));
541
- if (!this.editor.prosemirrorView) {
542
- throw new Error("Editor view not initialized.");
543
- }
544
- setHiddenDragImage(this.editor.prosemirrorView.root);
545
- event.dataTransfer.setDragImage(dragImageElement, 0, 0);
546
- event.dataTransfer.effectAllowed = "copyMove";
547
- };
548
- /**
549
- * Callback that should be set on the `dragEnd` event for both the element
550
- * used as the row drag handle, and the one used as the column drag handle.
551
- */
552
- dragEnd = () => {
553
- if (this.view.state === undefined) {
554
- throw new Error("Attempted to drag table row, but no table block was hovered prior.");
555
- }
556
- this.view.state.draggingState = undefined;
557
- this.view.emitUpdate();
558
- this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(tableHandlesPluginKey, null));
559
- if (!this.editor.prosemirrorView) {
560
- throw new Error("Editor view not initialized.");
561
- }
562
- unsetHiddenDragImage(this.editor.prosemirrorView.root);
563
- };
564
- /**
565
- * Freezes the drag handles. When frozen, they will stay attached to the same
566
- * cell regardless of which cell is hovered by the mouse cursor.
567
- */
568
- freezeHandles = () => {
569
- this.view.menuFrozen = true;
570
- };
571
- /**
572
- * Unfreezes the drag handles. When frozen, they will stay attached to the
573
- * same cell regardless of which cell is hovered by the mouse cursor.
574
- */
575
- unfreezeHandles = () => {
576
- this.view.menuFrozen = false;
577
- };
578
- }
579
- //# sourceMappingURL=TableHandlesPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableHandlesPlugin.js","sourceRoot":"","sources":["../../../../src/extens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EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAK,CAAC,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;QAC3C,IAAI,CAAC,IAAK,CAAC,UAAU,EAAE,CAAC;QAExB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAClB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QAED,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF;;;OAGG;IACH,aAAa,GAAG,GAAG,EAAE;QACnB,IAAI,CAAC,IAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IAC/B,CAAC,CAAC;IAEF;;;OAGG;IACH,eAAe,GAAG,GAAG,EAAE;QACrB,IAAI,CAAC,IAAK,CAAC,UAAU,GAAG,KAAK,CAAC;IAChC,CAAC,CAAC;CACH"}
@@ -1,36 +0,0 @@
1
- import { Extension } from "@tiptap/core";
2
- export const TextAlignmentExtension = Extension.create({
3
- name: "textAlignment",
4
- addGlobalAttributes() {
5
- return [
6
- {
7
- // Attribute is applied to block content instead of container so that child blocks don't inherit the text
8
- // alignment styling.
9
- types: [
10
- "paragraph",
11
- "heading",
12
- "bulletListItem",
13
- "numberedListItem",
14
- "checkListItem",
15
- ],
16
- attributes: {
17
- textAlignment: {
18
- default: "left",
19
- parseHTML: (element) => {
20
- return element.getAttribute("data-text-alignment");
21
- },
22
- renderHTML: (attributes) => {
23
- if (attributes.textAlignment === "left") {
24
- return {};
25
- }
26
- return {
27
- "data-text-alignment": attributes.textAlignment,
28
- };
29
- },
30
- },
31
- },
32
- },
33
- ];
34
- },
35
- });
36
- //# sourceMappingURL=TextAlignmentExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextAlignmentExtension.js","sourceRoot":"","sources":["../../../../src/extensions/TextAlignment/TextAlignmentExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,eAAe;IAErB,mBAAmB;QACjB,OAAO;YACL;gBACE,yGAAyG;gBACzG,qBAAqB;gBACrB,KAAK,EAAE;oBACL,WAAW;oBACX,SAAS;oBACT,gBAAgB;oBAChB,kBAAkB;oBAClB,eAAe;iBAChB;gBACD,UAAU,EAAE;oBACV,aAAa,EAAE;wBACb,OAAO,EAAE,MAAM;wBACf,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;4BACrB,OAAO,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;wBACrD,CAAC;wBACD,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;4BACzB,IAAI,UAAU,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;gCACxC,OAAO,EAAE,CAAC;4BACZ,CAAC;4BACD,OAAO;gCACL,qBAAqB,EAAE,UAAU,CAAC,aAAa;6BAChD,CAAC;wBACJ,CAAC;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}