@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,29 +0,0 @@
1
- import { Extension } from "@tiptap/core";
2
- import { defaultProps } from "../../blocks/defaultProps.js";
3
- export const TextColorExtension = Extension.create({
4
- name: "blockTextColor",
5
- addGlobalAttributes() {
6
- return [
7
- {
8
- types: ["blockContainer"],
9
- attributes: {
10
- textColor: {
11
- default: defaultProps.textColor.default,
12
- parseHTML: (element) => element.hasAttribute("data-text-color")
13
- ? element.getAttribute("data-text-color")
14
- : defaultProps.textColor.default,
15
- renderHTML: (attributes) => {
16
- if (attributes.textColor === defaultProps.textColor.default) {
17
- return {};
18
- }
19
- return {
20
- "data-text-color": attributes.textColor,
21
- };
22
- },
23
- },
24
- },
25
- },
26
- ];
27
- },
28
- });
29
- //# sourceMappingURL=TextColorExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextColorExtension.js","sourceRoot":"","sources":["../../../../src/extensions/TextColor/TextColorExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,gBAAgB;IAEtB,mBAAmB;QACjB,OAAO;YACL;gBACE,KAAK,EAAE,CAAC,gBAAgB,CAAC;gBACzB,UAAU,EAAE;oBACV,SAAS,EAAE;wBACT,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,OAAO;wBACvC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CACrB,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;4BACrC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;4BACzC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO;wBACpC,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;4BACzB,IAAI,UAAU,CAAC,SAAS,KAAK,YAAY,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gCAC5D,OAAO,EAAE,CAAC;4BACZ,CAAC;4BACD,OAAO;gCACL,iBAAiB,EAAE,UAAU,CAAC,SAAS;6BACxC,CAAC;wBACJ,CAAC;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,37 +0,0 @@
1
- import { Mark } from "@tiptap/core";
2
- import { createStyleSpecFromTipTapMark } from "../../schema/index.js";
3
- const TextColorMark = Mark.create({
4
- name: "textColor",
5
- addAttributes() {
6
- return {
7
- stringValue: {
8
- default: undefined,
9
- parseHTML: (element) => element.getAttribute("data-text-color"),
10
- renderHTML: (attributes) => ({
11
- "data-text-color": attributes.stringValue,
12
- }),
13
- },
14
- };
15
- },
16
- parseHTML() {
17
- return [
18
- {
19
- tag: "span",
20
- getAttrs: (element) => {
21
- if (typeof element === "string") {
22
- return false;
23
- }
24
- if (element.hasAttribute("data-text-color")) {
25
- return { stringValue: element.getAttribute("data-text-color") };
26
- }
27
- return false;
28
- },
29
- },
30
- ];
31
- },
32
- renderHTML({ HTMLAttributes }) {
33
- return ["span", HTMLAttributes, 0];
34
- },
35
- });
36
- export const TextColor = createStyleSpecFromTipTapMark(TextColorMark, "string");
37
- //# sourceMappingURL=TextColorMark.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextColorMark.js","sourceRoot":"","sources":["../../../../src/extensions/TextColor/TextColorMark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,WAAW;IAEjB,aAAa;QACX,OAAO;YACL,WAAW,EAAE;gBACX,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;gBAC/D,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;oBAC3B,iBAAiB,EAAE,UAAU,CAAC,WAAW;iBAC1C,CAAC;aACH;SACF,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,MAAM;gBACX,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;oBACpB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;wBAChC,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,IAAI,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;wBAC5C,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAClE,CAAC;oBAED,OAAO,KAAK,CAAC;gBACf,CAAC;aACF;SACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,6BAA6B,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC"}
@@ -1,58 +0,0 @@
1
- import { Extension } from "@tiptap/core";
2
- import { Plugin, PluginKey } from "prosemirror-state";
3
- /**
4
- * Add a trailing node to the document so the user can always click at the bottom of the document and start typing
5
- */
6
- export const TrailingNode = Extension.create({
7
- name: "trailingNode",
8
- addProseMirrorPlugins() {
9
- const plugin = new PluginKey(this.name);
10
- // const disabledNodes = Object.entries(this.editor.schema.nodes)
11
- // .map(([, value]) => value)
12
- // .filter((node) => this.options.notAfter.includes(node.name));
13
- return [
14
- new Plugin({
15
- key: plugin,
16
- appendTransaction: (_, __, state) => {
17
- const { doc, tr, schema } = state;
18
- const shouldInsertNodeAtEnd = plugin.getState(state);
19
- const endPosition = doc.content.size - 2;
20
- const type = schema.nodes["blockContainer"];
21
- const contentType = schema.nodes["paragraph"];
22
- if (!shouldInsertNodeAtEnd) {
23
- return;
24
- }
25
- return tr.insert(endPosition, type.create(undefined, contentType.create()));
26
- },
27
- state: {
28
- init: (_, _state) => {
29
- // (maybe fix): use same logic as apply() here
30
- // so it works when initializing
31
- },
32
- apply: (tr, value) => {
33
- if (!tr.docChanged) {
34
- return value;
35
- }
36
- let lastNode = tr.doc.lastChild;
37
- if (!lastNode || lastNode.type.name !== "blockGroup") {
38
- throw new Error("Expected blockGroup");
39
- }
40
- lastNode = lastNode.lastChild;
41
- if (!lastNode || lastNode.type.name !== "blockContainer") {
42
- return true; // not a blockContainer, but for example Columns. Insert trailing node
43
- }
44
- const lastContentNode = lastNode.firstChild;
45
- if (!lastContentNode) {
46
- throw new Error("Expected blockContent");
47
- }
48
- // If last node is not empty (size > 4) or it doesn't contain
49
- // inline content, we need to add a trailing node.
50
- return (lastNode.nodeSize > 4 ||
51
- lastContentNode.type.spec.content !== "inline*");
52
- },
53
- },
54
- }),
55
- ];
56
- },
57
- });
58
- //# sourceMappingURL=TrailingNodeExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrailingNodeExtension.js","sourceRoot":"","sources":["../../../../src/extensions/TrailingNode/TrailingNodeExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AActD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAsB;IAChE,IAAI,EAAE,cAAc;IAEpB,qBAAqB;QACnB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,iEAAiE;QACjE,+BAA+B;QAC/B,kEAAkE;QAElE,OAAO;YACL,IAAI,MAAM,CA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AC,IAAI,KAAK,gBAAgB,EAAE,CAAC;4BACzD,OAAO,IAAI,CAAC,CAAC,sEAAsE;wBACrF,CAAC;wBAED,MAAM,eAAe,GAAG,QAAQ,CAAC,UAAU,CAAC;wBAE5C,IAAI,CAAC,eAAe,EAAE,CAAC;4BACrB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;wBAC3C,CAAC;wBAED,6DAA6D;wBAC7D,kDAAkD;wBAClD,OAAO,CACL,QAAQ,CAAC,QAAQ,GAAG,CAAC;4BACrB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAChD,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,283 +0,0 @@
1
- import { combineTransactionSteps, Extension, findChildrenInRange, getChangedRanges, } from "@tiptap/core";
2
- import { Fragment, Slice } from "prosemirror-model";
3
- import { Plugin, PluginKey } from "prosemirror-state";
4
- import { v4 } from "uuid";
5
- /**
6
- * Code from Tiptap UniqueID extension (https://tiptap.dev/api/extensions/unique-id)
7
- * This extension is licensed under MIT (even though it's part of Tiptap pro).
8
- *
9
- * If you're a user of BlockNote, we still recommend to support their awesome work and become a sponsor!
10
- * https://tiptap.dev/pro
11
- */
12
- /**
13
- * Removes duplicated values within an array.
14
- * Supports numbers, strings and objects.
15
- */
16
- function removeDuplicates(array, by = JSON.stringify) {
17
- const seen = {};
18
- return array.filter((item) => {
19
- const key = by(item);
20
- return Object.prototype.hasOwnProperty.call(seen, key)
21
- ? false
22
- : (seen[key] = true);
23
- });
24
- }
25
- /**
26
- * Returns a list of duplicated items within an array.
27
- */
28
- function findDuplicates(items) {
29
- const filtered = items.filter((el, index) => items.indexOf(el) !== index);
30
- const duplicates = removeDuplicates(filtered);
31
- return duplicates;
32
- }
33
- const UniqueID = Extension.create({
34
- name: "uniqueID",
35
- // we’ll set a very high priority to make sure this runs first
36
- // and is compatible with `appendTransaction` hooks of other extensions
37
- priority: 10000,
38
- addOptions() {
39
- return {
40
- attributeName: "id",
41
- types: [],
42
- setIdAttribute: false,
43
- generateID: () => {
44
- // Use mock ID if tests are running.
45
- if (typeof window !== "undefined" && window.__TEST_OPTIONS) {
46
- const testOptions = window.__TEST_OPTIONS;
47
- if (testOptions.mockID === undefined) {
48
- testOptions.mockID = 0;
49
- }
50
- else {
51
- testOptions.mockID++;
52
- }
53
- return testOptions.mockID.toString();
54
- }
55
- return v4();
56
- },
57
- filterTransaction: null,
58
- };
59
- },
60
- addGlobalAttributes() {
61
- return [
62
- {
63
- types: this.options.types,
64
- attributes: {
65
- [this.options.attributeName]: {
66
- default: null,
67
- parseHTML: (element) => element.getAttribute(`data-${this.options.attributeName}`),
68
- renderHTML: (attributes) => {
69
- const defaultIdAttributes = {
70
- [`data-${this.options.attributeName}`]: attributes[this.options.attributeName],
71
- };
72
- if (this.options.setIdAttribute) {
73
- return {
74
- ...defaultIdAttributes,
75
- id: attributes[this.options.attributeName],
76
- };
77
- }
78
- else {
79
- return defaultIdAttributes;
80
- }
81
- },
82
- },
83
- },
84
- },
85
- ];
86
- },
87
- // check initial content for missing ids
88
- // onCreate() {
89
- // // Don’t do this when the collaboration extension is active
90
- // // because this may update the content, so Y.js tries to merge these changes.
91
- // // This leads to empty block nodes.
92
- // // See: https://github.com/ueberdosis/tiptap/issues/2400
93
- // if (
94
- // this.editor.extensionManager.extensions.find(
95
- // (extension) => extension.name === "collaboration"
96
- // )
97
- // ) {
98
- // return;
99
- // }
100
- // const { view, state } = this.editor;
101
- // const { tr, doc } = state;
102
- // const { types, attributeName, generateID } = this.options;
103
- // const nodesWithoutId = findChildren(doc, (node) => {
104
- // return (
105
- // types.includes(node.type.name) && node.attrs[attributeName] === null
106
- // );
107
- // });
108
- // nodesWithoutId.forEach(({ node, pos }) => {
109
- // tr.setNodeMarkup(pos, undefined, {
110
- // ...node.attrs,
111
- // [attributeName]: generateID(),
112
- // });
113
- // });
114
- // tr.setMeta("addToHistory", false);
115
- // view.dispatch(tr);
116
- // },
117
- addProseMirrorPlugins() {
118
- let dragSourceElement = null;
119
- let transformPasted = false;
120
- return [
121
- new Plugin({
122
- key: new PluginKey("uniqueID"),
123
- appendTransaction: (transactions, oldState, newState) => {
124
- // console.log("appendTransaction");
125
- const docChanges = transactions.some((transaction) => transaction.docChanged) &&
126
- !oldState.doc.eq(newState.doc);
127
- const filterTransactions = this.options.filterTransaction &&
128
- transactions.some((tr) => {
129
- let _a, _b;
130
- return !((_b = (_a = this.options).filterTransaction) === null ||
131
- _b === void 0
132
- ? void 0
133
- : _b.call(_a, tr));
134
- });
135
- if (!docChanges || filterTransactions) {
136
- return;
137
- }
138
- const { tr } = newState;
139
- const { types, attributeName, generateID } = this.options;
140
- const transform = combineTransactionSteps(oldState.doc, transactions);
141
- const { mapping } = transform;
142
- // get changed ranges based on the old state
143
- const changes = getChangedRanges(transform);
144
- changes.forEach(({ newRange }) => {
145
- const newNodes = findChildrenInRange(newState.doc, newRange, (node) => {
146
- return types.includes(node.type.name);
147
- });
148
- const newIds = newNodes
149
- .map(({ node }) => node.attrs[attributeName])
150
- .filter((id) => id !== null);
151
- const duplicatedNewIds = findDuplicates(newIds);
152
- newNodes.forEach(({ node, pos }) => {
153
- let _a;
154
- // instead of checking `node.attrs[attributeName]` directly
155
- // we look at the current state of the node within `tr.doc`.
156
- // this helps to prevent adding new ids to the same node
157
- // if the node changed multiple times within one transaction
158
- const id = (_a = tr.doc.nodeAt(pos)) === null || _a === void 0
159
- ? void 0
160
- : _a.attrs[attributeName];
161
- if (id === null) {
162
- // edge case, when using collaboration, yjs will set the id to null in `_forceRerender`
163
- // when loading the editor
164
- // this checks for this case and keeps it at initialBlockId so there will be no change
165
- const initialDoc = oldState.doc.type.createAndFill().content;
166
- const wasInitial = oldState.doc.content.findDiffStart(initialDoc) === null;
167
- if (wasInitial) {
168
- // the old state was the "initial content"
169
- const jsonNode = JSON.parse(JSON.stringify(newState.doc.toJSON()));
170
- jsonNode.content[0].content[0].attrs.id = "initialBlockId";
171
- // would the new state with the fix also be the "initial content"?
172
- if (JSON.stringify(jsonNode.content) ===
173
- JSON.stringify(initialDoc.toJSON())) {
174
- // yes, apply the fix
175
- tr.setNodeMarkup(pos, undefined, {
176
- ...node.attrs,
177
- [attributeName]: "initialBlockId",
178
- });
179
- return;
180
- }
181
- }
182
- tr.setNodeMarkup(pos, undefined, {
183
- ...node.attrs,
184
- [attributeName]: generateID(),
185
- });
186
- return;
187
- }
188
- // check if the node doesn’t exist in the old state
189
- const { deleted } = mapping.invert().mapResult(pos);
190
- const newNode = deleted && duplicatedNewIds.includes(id);
191
- if (newNode) {
192
- tr.setNodeMarkup(pos, undefined, {
193
- ...node.attrs,
194
- [attributeName]: generateID(),
195
- });
196
- }
197
- });
198
- });
199
- if (!tr.steps.length) {
200
- return;
201
- }
202
- return tr;
203
- },
204
- // we register a global drag handler to track the current drag source element
205
- view(view) {
206
- const handleDragstart = (event) => {
207
- let _a;
208
- dragSourceElement = ((_a = view.dom.parentElement) === null || _a === void 0
209
- ? void 0
210
- : _a.contains(event.target))
211
- ? view.dom.parentElement
212
- : null;
213
- };
214
- window.addEventListener("dragstart", handleDragstart);
215
- return {
216
- destroy() {
217
- window.removeEventListener("dragstart", handleDragstart);
218
- },
219
- };
220
- },
221
- props: {
222
- // `handleDOMEvents` is called before `transformPasted`
223
- // so we can do some checks before
224
- handleDOMEvents: {
225
- // only create new ids for dropped content while holding `alt`
226
- // or content is dragged from another editor
227
- drop: (view, event) => {
228
- let _a;
229
- if (dragSourceElement !== view.dom.parentElement ||
230
- ((_a = event.dataTransfer) === null || _a === void 0
231
- ? void 0
232
- : _a.effectAllowed) === "copy") {
233
- dragSourceElement = null;
234
- transformPasted = true;
235
- }
236
- return false;
237
- },
238
- // always create new ids on pasted content
239
- paste: () => {
240
- transformPasted = true;
241
- return false;
242
- },
243
- },
244
- // we’ll remove ids for every pasted node
245
- // so we can create a new one within `appendTransaction`
246
- transformPasted: (slice) => {
247
- if (!transformPasted) {
248
- return slice;
249
- }
250
- const { types, attributeName } = this.options;
251
- const removeId = (fragment) => {
252
- const list = [];
253
- fragment.forEach((node) => {
254
- // don’t touch text nodes
255
- if (node.isText) {
256
- list.push(node);
257
- return;
258
- }
259
- // check for any other child nodes
260
- if (!types.includes(node.type.name)) {
261
- list.push(node.copy(removeId(node.content)));
262
- return;
263
- }
264
- // remove id
265
- const nodeWithoutId = node.type.create({
266
- ...node.attrs,
267
- [attributeName]: null,
268
- }, removeId(node.content), node.marks);
269
- list.push(nodeWithoutId);
270
- });
271
- return Fragment.from(list);
272
- };
273
- // reset check
274
- transformPasted = false;
275
- return new Slice(removeId(slice.content), slice.openStart, slice.openEnd);
276
- },
277
- },
278
- }),
279
- ];
280
- },
281
- });
282
- export { UniqueID as default, UniqueID };
283
- //# sourceMappingURL=UniqueID.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UniqueID.js","sourceRoot":"","sources":["../../../../src/extensions/UniqueID/UniqueID.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B;;;;;;GAMG;AAEH;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAU,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS;IACvD,MAAM,IAAI,GAAQ,EAAE,CAAC;IACrB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC;Y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C,IAAI,CAAC,CAAC;wBAC7B,CAAC,CAAC;wBACF,cAAc;wBACd,eAAe,GAAG,KAAK,CAAC;wBACxB,OAAO,IAAI,KAAK,CACd,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EACvB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,OAAO,CACd,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- export function getDraggableBlockFromElement(element, view) {
2
- while (element &&
3
- element.parentElement &&
4
- element.parentElement !== view.dom &&
5
- element.getAttribute?.("data-node-type") !== "blockContainer") {
6
- element = element.parentElement;
7
- }
8
- if (element.getAttribute?.("data-node-type") !== "blockContainer") {
9
- return undefined;
10
- }
11
- return { node: element, id: element.getAttribute("data-id") };
12
- }
13
- //# sourceMappingURL=getDraggableBlockFromElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDraggableBlockFromElement.js","sourceRoot":"","sources":["../../../src/extensions/getDraggableBlockFromElement.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,4BAA4B,CAC1C,OAAgB,EAChB,IAAgB;IAEhB,OACE,OAAO;QACP,OAAO,CAAC,aAAa;QACrB,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,GAAG;QAClC,OAAO,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,KAAK,gBAAgB,EAC7D,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAClC,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,KAAK,gBAAgB,EAAE,CAAC;QAClE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAsB,EAAE,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAE,EAAE,CAAC;AAChF,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=UiElementPosition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UiElementPosition.js","sourceRoot":"","sources":["../../../src/extensions-shared/UiElementPosition.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- // function scramble(dict: any) {
2
- // const newDict: any = {} as any;
3
- export {};
4
- //# sourceMappingURL=dictionary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/i18n/dictionary.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,oCAAoC"}