@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,110 +0,0 @@
1
- import { bundledLanguagesInfo } from "shiki";
2
- export const defaultSupportedLanguages = [
3
- {
4
- id: "text",
5
- name: "Plain Text",
6
- match: ["text", "txt", "plain"],
7
- },
8
- ...bundledLanguagesInfo
9
- .filter((lang) => {
10
- return [
11
- "c",
12
- "cpp",
13
- "css",
14
- "glsl",
15
- "graphql",
16
- "haml",
17
- "html",
18
- "java",
19
- "javascript",
20
- "json",
21
- "jsonc",
22
- "jsonl",
23
- "jsx",
24
- "julia",
25
- "less",
26
- "markdown",
27
- "mdx",
28
- "php",
29
- "postcss",
30
- "pug",
31
- "python",
32
- "r",
33
- "regexp",
34
- "sass",
35
- "scss",
36
- "shellscript",
37
- "sql",
38
- "svelte",
39
- "typescript",
40
- "vue",
41
- "vue-html",
42
- "wasm",
43
- "wgsl",
44
- "xml",
45
- "yaml",
46
- ].includes(lang.id);
47
- })
48
- .map((lang) => ({
49
- match: [lang.id, ...(lang.aliases || [])],
50
- id: lang.id,
51
- name: lang.name,
52
- })),
53
- { id: "tsx", name: "TSX", match: ["tsx", "typescriptreact"] },
54
- {
55
- id: "haskell",
56
- name: "Haskell",
57
- match: ["haskell", "hs"],
58
- },
59
- {
60
- id: "csharp",
61
- name: "C#",
62
- match: ["c#", "csharp", "cs"],
63
- },
64
- {
65
- id: "latex",
66
- name: "LaTeX",
67
- match: ["latex"],
68
- },
69
- {
70
- id: "lua",
71
- name: "Lua",
72
- match: ["lua"],
73
- },
74
- {
75
- id: "mermaid",
76
- name: "Mermaid",
77
- match: ["mermaid", "mmd"],
78
- },
79
- {
80
- id: "ruby",
81
- name: "Ruby",
82
- match: ["ruby", "rb"],
83
- },
84
- {
85
- id: "rust",
86
- name: "Rust",
87
- match: ["rust", "rs"],
88
- },
89
- {
90
- id: "scala",
91
- name: "Scala",
92
- match: ["scala"],
93
- },
94
- {
95
- id: "swift",
96
- name: "Swift",
97
- match: ["swift"],
98
- },
99
- {
100
- id: "kotlin",
101
- name: "Kotlin",
102
- match: ["kotlin", "kt", "kts"],
103
- },
104
- {
105
- id: "objective-c",
106
- name: "Objective C",
107
- match: ["objective-c", "objc"],
108
- },
109
- ];
110
- //# sourceMappingURL=defaultSupportedLanguages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaultSupportedLanguages.js","sourceRoot":"","sources":["../../../../src/blocks/CodeBlockContent/defaultSupportedLanguages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAQ7C,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;KAChC;IACD,GAAG,oBAAoB;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,OAAO;YACL,GAAG;YACH,KAAK;YACL,KAAK;YACL,MAAM;YACN,SAAS;YACT,MAAM;YACN,MAAM;YACN,MAAM;YACN,YAAY;YACZ,MAAM;YACN,OAAO;YACP,OAAO;YACP,KAAK;YACL,OAAO;YACP,MAAM;YACN,UAAU;YACV,KAAK;YACL,KAAK;YACL,SAAS;YACT,KAAK;YACL,QAAQ;YACR,GAAG;YACH,QAAQ;YACR,MAAM;YACN,MAAM;YACN,aAAa;YACb,KAAK;YACL,QAAQ;YACR,YAAY;YACZ,KAAK;YACL,UAAU;YACV,MAAM;YACN,MAAM;YACN,KAAK;YACL,MAAM;SACP,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACd,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,I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K,CAAC;KAC/B;IACD;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;KAC/B;CACF,CAAC"}
@@ -1,71 +0,0 @@
1
- import { createBlockSpec, } from "../../schema/index.js";
2
- import { defaultProps } from "../defaultProps.js";
3
- import { parseEmbedElement } from "./helpers/parse/parseEmbedElement.js";
4
- import { parseFigureElement } from "./helpers/parse/parseFigureElement.js";
5
- import { createFileBlockWrapper } from "./helpers/render/createFileBlockWrapper.js";
6
- import { createLinkWithCaption } from "./helpers/toExternalHTML/createLinkWithCaption.js";
7
- export const filePropSchema = {
8
- backgroundColor: defaultProps.backgroundColor,
9
- // File name.
10
- name: {
11
- default: "",
12
- },
13
- // File url.
14
- url: {
15
- default: "",
16
- },
17
- // File caption.
18
- caption: {
19
- default: "",
20
- },
21
- };
22
- export const fileBlockConfig = {
23
- type: "file",
24
- propSchema: filePropSchema,
25
- content: "none",
26
- isFileBlock: true,
27
- };
28
- export const fileRender = (block, editor) => {
29
- return createFileBlockWrapper(block, editor);
30
- };
31
- export const fileParse = (element) => {
32
- if (element.tagName === "EMBED") {
33
- return parseEmbedElement(element);
34
- }
35
- if (element.tagName === "FIGURE") {
36
- const parsedFigure = parseFigureElement(element, "embed");
37
- if (!parsedFigure) {
38
- return undefined;
39
- }
40
- const { targetElement, caption } = parsedFigure;
41
- return {
42
- ...parseEmbedElement(targetElement),
43
- caption,
44
- };
45
- }
46
- return undefined;
47
- };
48
- export const fileToExternalHTML = (block) => {
49
- if (!block.props.url) {
50
- const div = document.createElement("p");
51
- div.textContent = "Add file";
52
- return {
53
- dom: div,
54
- };
55
- }
56
- const fileSrcLink = document.createElement("a");
57
- fileSrcLink.href = block.props.url;
58
- fileSrcLink.textContent = block.props.name || block.props.url;
59
- if (block.props.caption) {
60
- return createLinkWithCaption(fileSrcLink, block.props.caption);
61
- }
62
- return {
63
- dom: fileSrcLink,
64
- };
65
- };
66
- export const FileBlock = createBlockSpec(fileBlockConfig, {
67
- render: fileRender,
68
- parse: fileParse,
69
- toExternalHTML: fileToExternalHTML,
70
- });
71
- //# sourceMappingURL=FileBlockContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/FileBlockContent/FileBlockContent.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAE1F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe,EAAE,YAAY,CAAC,eAAe;IAC7C,aAAa;IACb,IAAI,EAAE;QACJ,OAAO,EAAE,EAAW;KACrB;IACD,YAAY;IACZ,GAAG,EAAE;QACH,OAAO,EAAE,EAAW;KACrB;IACD,gBAAgB;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,EAAW;KACrB;CACmB,CAAC;AAEvB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAe;IACrB,UAAU,EAAE,cAAc;IAC1B,OAAO,EAAE,MAAM;IACf,WAAW,EAAE,IAAI;CACQ,CAAC;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAwD,EACxD,MAAsC,EACtC,EAAE;IACF,OAAO,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAoB,EAAE,EAAE;IAChD,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAChC,O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ACxD,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,kBAAkB;CACnC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export const parseEmbedElement = (embedElement) => {
2
- const url = embedElement.src || undefined;
3
- return { url };
4
- };
5
- //# sourceMappingURL=parseEmbedElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseEmbedElement.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,EAAE;IAClE,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC;IAE1C,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export const parseFigureElement = (figureElement, targetTag) => {
2
- const targetElement = figureElement.querySelector(targetTag);
3
- if (!targetElement) {
4
- return undefined;
5
- }
6
- const captionElement = figureElement.querySelector("figcaption");
7
- const caption = captionElement?.textContent ?? undefined;
8
- return { targetElement, caption };
9
- };
10
- //# sourceMappingURL=parseFigureElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseFigureElement.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,aAA0B,EAC1B,SAAiB,EACjB,EAAE;IACF,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAC/C,SAAS,CACY,CAAC;IACxB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,cAAc,EAAE,WAAW,IAAI,SAAS,CAAC;IAEzD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC,CAAC"}
@@ -1,39 +0,0 @@
1
- export const createAddFileButton = (block, editor, buttonText, buttonIcon) => {
2
- const addFileButton = document.createElement("div");
3
- addFileButton.className = "bn-add-file-button";
4
- const addFileButtonIcon = document.createElement("div");
5
- addFileButtonIcon.className = "bn-add-file-button-icon";
6
- if (buttonIcon) {
7
- addFileButtonIcon.appendChild(buttonIcon);
8
- }
9
- else {
10
- addFileButtonIcon.innerHTML =
11
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';
12
- }
13
- addFileButton.appendChild(addFileButtonIcon);
14
- const addFileButtonText = document.createElement("p");
15
- addFileButtonText.className = "bn-add-file-button-text";
16
- addFileButtonText.innerHTML =
17
- buttonText || editor.dictionary.file_blocks.file.add_button_text;
18
- addFileButton.appendChild(addFileButtonText);
19
- // Prevents focus from moving to the button.
20
- const addFileButtonMouseDownHandler = (event) => {
21
- event.preventDefault();
22
- };
23
- // Opens the file toolbar.
24
- const addFileButtonClickHandler = () => {
25
- editor.dispatch(editor._tiptapEditor.state.tr.setMeta(editor.filePanel.plugin, {
26
- block: block,
27
- }));
28
- };
29
- addFileButton.addEventListener("mousedown", addFileButtonMouseDownHandler, true);
30
- addFileButton.addEventListener("click", addFileButtonClickHandler, true);
31
- return {
32
- dom: addFileButton,
33
- destroy: () => {
34
- addFileButton.removeEventListener("mousedown", addFileButtonMouseDownHandler, true);
35
- addFileButton.removeEventListener("click", addFileButtonClickHandler, true);
36
- },
37
- };
38
- };
39
- //# sourceMappingURL=createAddFileButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAddFileButton.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createAddFileButton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,CAC5B,WAAW,EACX,6BAA6B,EAC7B,IAAI,CACL,CAAC;IACF,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,yBAAyB,EAAE,IAAI,CAAC,CAAC;IAEzE,OAAO;QACL,GAAG,EAAE,aAAa;QAClB,OAAO,EAAE,GAAG,EAAE;YACZ,aAAa,CAAC,mBAAmB,CAC/B,WAAW,EACX,6BAA6B,EAC7B,IAAI,CACL,CAAC;YACF,aAAa,CAAC,mBAAmB,CAC/B,OAAO,EACP,yBAAyB,EACzB,IAAI,CACL,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,51 +0,0 @@
1
- import { createAddFileButton } from "./createAddFileButton.js";
2
- import { createFileNameWithIcon } from "./createFileNameWithIcon.js";
3
- export const createFileBlockWrapper = (block, editor, element, buttonText, buttonIcon) => {
4
- const wrapper = document.createElement("div");
5
- wrapper.className = "bn-file-block-content-wrapper";
6
- // Show the add file button if the file has not been uploaded yet. Change to
7
- // show a loader if a file upload for the block begins.
8
- if (block.props.url === "") {
9
- const addFileButton = createAddFileButton(block, editor, buttonText, buttonIcon);
10
- wrapper.appendChild(addFileButton.dom);
11
- const destroyUploadStartHandler = editor.onUploadStart((blockId) => {
12
- if (blockId === block.id) {
13
- wrapper.removeChild(addFileButton.dom);
14
- const loading = document.createElement("div");
15
- loading.className = "bn-file-loading-preview";
16
- loading.textContent = "Loading...";
17
- wrapper.appendChild(loading);
18
- }
19
- });
20
- return {
21
- dom: wrapper,
22
- destroy: () => {
23
- destroyUploadStartHandler();
24
- addFileButton.destroy();
25
- },
26
- };
27
- }
28
- const ret = { dom: wrapper };
29
- // Show the file preview, or the file name and icon.
30
- if (block.props.showPreview === false || !element) {
31
- // Show file name and icon.
32
- const fileNameWithIcon = createFileNameWithIcon(block);
33
- wrapper.appendChild(fileNameWithIcon.dom);
34
- ret.destroy = () => {
35
- fileNameWithIcon.destroy?.();
36
- };
37
- }
38
- else {
39
- // Show file preview.
40
- wrapper.appendChild(element.dom);
41
- }
42
- // Show the caption if there is one.
43
- if (block.props.caption) {
44
- const caption = document.createElement("p");
45
- caption.className = "bn-file-caption";
46
- caption.textContent = block.props.caption;
47
- wrapper.appendChild(caption);
48
- }
49
- return ret;
50
- };
51
- //# sourceMappingURL=createFileBlockWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createFileBlockWrapper.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAiD,EACjD,MAIC,EACD,OAAoD,EACpD,UAAmB,EACnB,UAAwB,EACxB,EAAE;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,SAAS,GAAG,+BAA+B,CAAC;IAEpD,4EAA4E;IAC5E,uDAAuD;IACvD,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,aAAa,GAAG,mBAAmB,CACvC,KAAK,EACL,MAAM,EACN,UAAU,EACV,UAAU,CACX,CAAC;QACF,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,yBAAyB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE;YACjE,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;gBACzB,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBAEvC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAC9C,OAAO,CAAC,SAAS,GAAG,yBAAyB,CAAC;gBAC9C,OAAO,CAAC,WAAW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path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`;
2
- export const createFileNameWithIcon = (block) => {
3
- const file = document.createElement("div");
4
- file.className = "bn-file-name-with-icon";
5
- const icon = document.createElement("div");
6
- icon.className = "bn-file-icon";
7
- icon.innerHTML = FILE_ICON_SVG;
8
- file.appendChild(icon);
9
- const fileName = document.createElement("p");
10
- fileName.className = "bn-file-name";
11
- fileName.textContent = block.props.name;
12
- file.appendChild(fileName);
13
- return {
14
- dom: file,
15
- };
16
- };
17
- //# sourceMappingURL=createFileNameWithIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createFileNameWithIcon.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,qQAAqQ,CAAC;AAEnS,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAiD,EACL,EAAE;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC;IAE1C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC;IAChC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;IAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7C,QAAQ,CAAC,SAAS,GAAG,cAAc,CAAC;IACpC,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE3B,OAAO;QACL,GAAG,EAAE,IAAI;KACV,CAAC;AACJ,CAAC,CAAC"}
@@ -1,147 +0,0 @@
1
- import { createFileBlockWrapper } from "./createFileBlockWrapper.js";
2
- export const createResizableFileBlockWrapper = (block, editor, element, resizeHandlesContainerElement, buttonText, buttonIcon) => {
3
- const { dom, destroy } = createFileBlockWrapper(block, editor, element, buttonText, buttonIcon);
4
- const wrapper = dom;
5
- if (block.props.url && block.props.showPreview) {
6
- wrapper.style.width = `${block.props.previewWidth}px`;
7
- }
8
- const leftResizeHandle = document.createElement("div");
9
- leftResizeHandle.className = "bn-resize-handle";
10
- leftResizeHandle.style.left = "4px";
11
- const rightResizeHandle = document.createElement("div");
12
- rightResizeHandle.className = "bn-resize-handle";
13
- rightResizeHandle.style.right = "4px";
14
- // Temporary parameters set when the user begins resizing the element, used to
15
- // calculate the new width of the element.
16
- let resizeParams;
17
- let width = block.props.previewWidth;
18
- // Updates the element width with an updated width depending on the cursor X
19
- // offset from when the resize began, and which resize handle is being used.
20
- const windowMouseMoveHandler = (event) => {
21
- if (!resizeParams) {
22
- if (!editor.isEditable &&
23
- resizeHandlesContainerElement.contains(leftResizeHandle) &&
24
- resizeHandlesContainerElement.contains(rightResizeHandle)) {
25
- resizeHandlesContainerElement.removeChild(leftResizeHandle);
26
- resizeHandlesContainerElement.removeChild(rightResizeHandle);
27
- }
28
- return;
29
- }
30
- let newWidth;
31
- if (block.props.textAlignment === "center") {
32
- if (resizeParams.handleUsed === "left") {
33
- newWidth =
34
- resizeParams.initialWidth +
35
- (resizeParams.initialClientX - event.clientX) * 2;
36
- }
37
- else {
38
- newWidth =
39
- resizeParams.initialWidth +
40
- (event.clientX - resizeParams.initialClientX) * 2;
41
- }
42
- }
43
- else {
44
- if (resizeParams.handleUsed === "left") {
45
- newWidth =
46
- resizeParams.initialWidth +
47
- resizeParams.initialClientX -
48
- event.clientX;
49
- }
50
- else {
51
- newWidth =
52
- resizeParams.initialWidth +
53
- event.clientX -
54
- resizeParams.initialClientX;
55
- }
56
- }
57
- // Min element width in px.
58
- const minWidth = 64;
59
- // Ensures the element is not wider than the editor and not narrower than a
60
- // predetermined minimum width.
61
- width = Math.max(newWidth, minWidth);
62
- wrapper.style.width = `${width}px`;
63
- };
64
- // Stops mouse movements from resizing the element and updates the block's
65
- // `width` prop to the new value.
66
- const windowMouseUpHandler = (event) => {
67
- // Hides the drag handles if the cursor is no longer over the element.
68
- if ((!event.target ||
69
- !wrapper.contains(event.target) ||
70
- !editor.isEditable) &&
71
- resizeHandlesContainerElement.contains(leftResizeHandle) &&
72
- resizeHandlesContainerElement.contains(rightResizeHandle)) {
73
- resizeHandlesContainerElement.removeChild(leftResizeHandle);
74
- resizeHandlesContainerElement.removeChild(rightResizeHandle);
75
- }
76
- if (!resizeParams) {
77
- return;
78
- }
79
- resizeParams = undefined;
80
- editor.updateBlock(block, {
81
- props: {
82
- previewWidth: width,
83
- },
84
- });
85
- };
86
- // Shows the resize handles when hovering over the wrapper with the cursor.
87
- const wrapperMouseEnterHandler = () => {
88
- if (editor.isEditable) {
89
- resizeHandlesContainerElement.appendChild(leftResizeHandle);
90
- resizeHandlesContainerElement.appendChild(rightResizeHandle);
91
- }
92
- };
93
- // Hides the resize handles when the cursor leaves the wrapper, unless the
94
- // cursor moves to one of the resize handles.
95
- const wrapperMouseLeaveHandler = (event) => {
96
- if (event.relatedTarget === leftResizeHandle ||
97
- event.relatedTarget === rightResizeHandle) {
98
- return;
99
- }
100
- if (resizeParams) {
101
- return;
102
- }
103
- if (editor.isEditable &&
104
- resizeHandlesContainerElement.contains(leftResizeHandle) &&
105
- resizeHandlesContainerElement.contains(rightResizeHandle)) {
106
- resizeHandlesContainerElement.removeChild(leftResizeHandle);
107
- resizeHandlesContainerElement.removeChild(rightResizeHandle);
108
- }
109
- };
110
- // Sets the resize params, allowing the user to begin resizing the element by
111
- // moving the cursor left or right.
112
- const leftResizeHandleMouseDownHandler = (event) => {
113
- event.preventDefault();
114
- resizeParams = {
115
- handleUsed: "left",
116
- initialWidth: wrapper.clientWidth,
117
- initialClientX: event.clientX,
118
- };
119
- };
120
- const rightResizeHandleMouseDownHandler = (event) => {
121
- event.preventDefault();
122
- resizeParams = {
123
- handleUsed: "right",
124
- initialWidth: wrapper.clientWidth,
125
- initialClientX: event.clientX,
126
- };
127
- };
128
- window.addEventListener("mousemove", windowMouseMoveHandler);
129
- window.addEventListener("mouseup", windowMouseUpHandler);
130
- wrapper.addEventListener("mouseenter", wrapperMouseEnterHandler);
131
- wrapper.addEventListener("mouseleave", wrapperMouseLeaveHandler);
132
- leftResizeHandle.addEventListener("mousedown", leftResizeHandleMouseDownHandler);
133
- rightResizeHandle.addEventListener("mousedown", rightResizeHandleMouseDownHandler);
134
- return {
135
- dom: wrapper,
136
- destroy: () => {
137
- destroy?.();
138
- window.removeEventListener("mousemove", windowMouseMoveHandler);
139
- window.removeEventListener("mouseup", windowMouseUpHandler);
140
- wrapper.removeEventListener("mouseenter", wrapperMouseEnterHandler);
141
- wrapper.removeEventListener("mouseleave", wrapperMouseLeaveHandler);
142
- leftResizeHandle.removeEventListener("mousedown", leftResizeHandleMouseDownHandler);
143
- rightResizeHandle.removeEventListener("mousedown", rightResizeHandleMouseDownHandler);
144
- },
145
- };
146
- };
147
- //# sourceMappingURL=createResizableFileBlockWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createResizableFileBlockWrapper.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,KAAiD,EACjD,MAAsC,EACtC,OAAmD,EACnD,6BAA0C,EAC1C,UAAkB,EAClB,UAAuB,EACoB,EAAE;IAC7C,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,sBAAsB,CAC7C,KAAK,EACL,MAAM,EACN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AC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export const createFigureWithCaption = (element, caption) => {
2
- const figure = document.createElement("figure");
3
- const captionElement = document.createElement("figcaption");
4
- captionElement.textContent = caption;
5
- figure.appendChild(element);
6
- figure.appendChild(captionElement);
7
- return { dom: figure };
8
- };
9
- //# sourceMappingURL=createFigureWithCaption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createFigureWithCaption.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAAoB,EACpB,OAAe,EACf,EAAE;IACF,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5D,cAAc,CAAC,WAAW,GAAG,OAAO,CAAC;IAErC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAEnC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- export const createLinkWithCaption = (element, caption) => {
2
- const wrapper = document.createElement("div");
3
- const fileCaption = document.createElement("p");
4
- fileCaption.textContent = caption;
5
- wrapper.appendChild(element);
6
- wrapper.appendChild(fileCaption);
7
- return {
8
- dom: wrapper,
9
- };
10
- };
11
- //# sourceMappingURL=createLinkWithCaption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createLinkWithCaption.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,OAAoB,EACpB,OAAe,EACf,EAAE;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAChD,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC;IAElC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO;QACL,GAAG,EAAE,OAAO;KACb,CAAC;AACJ,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Uploads a file to tmpfiles.org and returns the URL to the uploaded file.
3
- *
4
- * @warning This function should only be used for development purposes, replace with your own backend!
5
- */
6
- export const uploadToTmpFilesDotOrg_DEV_ONLY = async (file) => {
7
- const body = new FormData();
8
- body.append("file", file);
9
- const ret = await fetch("https://tmpfiles.org/api/v1/upload", {
10
- method: "POST",
11
- body: body,
12
- });
13
- return (await ret.json()).data.url.replace("tmpfiles.org/", "tmpfiles.org/dl/");
14
- };
15
- //# sourceMappingURL=uploadToTmpFilesDotOrg_DEV_ONLY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadToTmpFilesDotOrg_DEV_ONLY.js","sourceRoot":"","sources":["../../../../src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,EAClD,IAAU,EACO,EAAE;IACnB,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,oCAAoC,EAAE;QAC5D,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CACxC,eAAe,EACf,kBAAkB,CACnB,CAAC;AACJ,CAAC,CAAC"}