@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
package/dist/blocknote.js CHANGED
@@ -1,34 +1,34 @@
1
- var lo = Object.defineProperty;
2
- var co = (e, t, o) => t in e ? lo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var p = (e, t, o) => co(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { Slice as de, Fragment as j, DOMSerializer as bt, DOMParser as uo, Node as po } from "prosemirror-model";
5
- import { Extension as I, combineTransactionSteps as ho, getChangedRanges as mo, findChildrenInRange as fo, Node as q, Mark as ye, InputRule as ee, isTextSelection as kt, callOrReturn as go, getExtensionField as bo, selectionToInsertionEnd as ko, isNodeSelection as Ze, posToDOMRect as Pe, getMarkRange as Je, findChildren as Ye, findParentNode as _o, extensions as ne, Editor as yo, createDocument as wo, getSchema as vo } from "@tiptap/core";
6
- import { Plugin as B, PluginKey as N, TextSelection as O, NodeSelection as ce, Selection as Be, EditorState as xo } from "prosemirror-state";
7
- import { v4 as Co } from "uuid";
8
- import { createHighlightPlugin as Eo } from "prosemirror-highlight";
9
- import { createParser as So } from "prosemirror-highlight/shiki";
10
- import { bundledLanguagesInfo as _t, createHighlighter as Bo } from "shiki";
11
- import { columnResizing as To, tableEditing as Mo, goToNextCell as Qe, TableView as Lo, CellSelection as Re, TableMap as et } from "prosemirror-tables";
12
- import Io from "@tiptap/extension-bold";
13
- import Po from "@tiptap/extension-code";
14
- import Ao from "@tiptap/extension-italic";
15
- import No from "@tiptap/extension-strike";
16
- import jo from "@tiptap/extension-underline";
17
- import { ReplaceStep as Do, ReplaceAroundStep as Ae } from "prosemirror-transform";
18
- import { TableCell as Ho } from "@tiptap/extension-table-cell";
19
- import { TableHeader as Uo } from "@tiptap/extension-table-header";
20
- import { TableRow as Oo } from "@tiptap/extension-table-row";
21
- import Ro from "@tiptap/extension-collaboration";
22
- import Vo from "@tiptap/extension-collaboration-cursor";
23
- import { Gapcursor as zo } from "@tiptap/extension-gapcursor";
24
- import { HardBreak as Fo } from "@tiptap/extension-hard-break";
25
- import { History as Go } from "@tiptap/extension-history";
26
- import { Link as $o } from "@tiptap/extension-link";
27
- import { Text as Wo } from "@tiptap/extension-text";
28
- import * as yt from "prosemirror-view";
29
- import { Decoration as te, DecorationSet as oe, EditorView as Ko } from "prosemirror-view";
30
- import { dropCursor as qo } from "prosemirror-dropcursor";
31
- const Xo = {
1
+ var po = Object.defineProperty;
2
+ var ho = (e, t, o) => t in e ? po(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var p = (e, t, o) => ho(e, typeof t != "symbol" ? t + "" : t, o);
4
+ import { Slice as ee, Fragment as j, DOMSerializer as kt, DOMParser as mo, Node as fo } from "prosemirror-model";
5
+ import { Extension as I, combineTransactionSteps as go, getChangedRanges as bo, findChildrenInRange as ko, Node as q, Mark as we, InputRule as te, isTextSelection as _t, callOrReturn as _o, getExtensionField as yo, selectionToInsertionEnd as wo, isNodeSelection as Je, posToDOMRect as Ae, getMarkRange as Ye, findChildren as Qe, findParentNode as vo, extensions as re, Editor as xo, createDocument as Co, getSchema as Eo } from "@tiptap/core";
6
+ import { Plugin as B, PluginKey as N, TextSelection as O, NodeSelection as ce, Selection as Te, EditorState as So } from "prosemirror-state";
7
+ import { v4 as Bo } from "uuid";
8
+ import { createHighlightPlugin as To } from "prosemirror-highlight";
9
+ import { createParser as Mo } from "prosemirror-highlight/shiki";
10
+ import { bundledLanguagesInfo as yt, createHighlighter as Lo } from "shiki";
11
+ import { columnResizing as Io, tableEditing as Po, goToNextCell as et, TableView as Ao, CellSelection as Ve, TableMap as tt } from "prosemirror-tables";
12
+ import No from "@tiptap/extension-bold";
13
+ import jo from "@tiptap/extension-code";
14
+ import Do from "@tiptap/extension-italic";
15
+ import Ho from "@tiptap/extension-strike";
16
+ import Uo from "@tiptap/extension-underline";
17
+ import { ReplaceStep as Oo, ReplaceAroundStep as Ne } from "prosemirror-transform";
18
+ import { TableCell as Ro } from "@tiptap/extension-table-cell";
19
+ import { TableHeader as Vo } from "@tiptap/extension-table-header";
20
+ import { TableRow as zo } from "@tiptap/extension-table-row";
21
+ import Fo from "@tiptap/extension-collaboration";
22
+ import Go from "@tiptap/extension-collaboration-cursor";
23
+ import { Gapcursor as $o } from "@tiptap/extension-gapcursor";
24
+ import { HardBreak as Wo } from "@tiptap/extension-hard-break";
25
+ import { History as Ko } from "@tiptap/extension-history";
26
+ import { Link as qo } from "@tiptap/extension-link";
27
+ import { Text as Xo } from "@tiptap/extension-text";
28
+ import * as wt from "prosemirror-view";
29
+ import { Decoration as oe, DecorationSet as ie, EditorView as Zo } from "prosemirror-view";
30
+ import { dropCursor as Jo } from "prosemirror-dropcursor";
31
+ const Yo = {
32
32
  slash_menu: {
33
33
  heading: {
34
34
  title: "عنوان 1",
@@ -324,7 +324,7 @@ const Xo = {
324
324
  generic: {
325
325
  ctrl_shortcut: "Ctrl"
326
326
  }
327
- }, Zo = {
327
+ }, Qo = {
328
328
  slash_menu: {
329
329
  heading: {
330
330
  title: "Überschrift 1",
@@ -635,7 +635,7 @@ const Xo = {
635
635
  generic: {
636
636
  ctrl_shortcut: "Strg"
637
637
  }
638
- }, wt = {
638
+ }, vt = {
639
639
  slash_menu: {
640
640
  heading: {
641
641
  title: "Heading 1",
@@ -947,7 +947,7 @@ const Xo = {
947
947
  generic: {
948
948
  ctrl_shortcut: "Ctrl"
949
949
  }
950
- }, Jo = {
950
+ }, ei = {
951
951
  slash_menu: {
952
952
  heading: {
953
953
  title: "Encabezado 1",
@@ -1257,7 +1257,7 @@ const Xo = {
1257
1257
  generic: {
1258
1258
  ctrl_shortcut: "Ctrl"
1259
1259
  }
1260
- }, Yo = {
1260
+ }, ti = {
1261
1261
  slash_menu: {
1262
1262
  heading: {
1263
1263
  title: "Titre 1",
@@ -1568,7 +1568,7 @@ const Xo = {
1568
1568
  generic: {
1569
1569
  ctrl_shortcut: "Ctrl"
1570
1570
  }
1571
- }, Qo = {
1571
+ }, oi = {
1572
1572
  slash_menu: {
1573
1573
  heading: {
1574
1574
  title: "Naslov 1",
@@ -1874,7 +1874,7 @@ const Xo = {
1874
1874
  generic: {
1875
1875
  ctrl_shortcut: "Ctrl"
1876
1876
  }
1877
- }, ei = {
1877
+ }, ii = {
1878
1878
  slash_menu: {
1879
1879
  heading: {
1880
1880
  title: "Fyrirsögn 1",
@@ -2177,7 +2177,7 @@ const Xo = {
2177
2177
  generic: {
2178
2178
  ctrl_shortcut: "Ctrl"
2179
2179
  }
2180
- }, ti = {
2180
+ }, ni = {
2181
2181
  slash_menu: {
2182
2182
  heading: {
2183
2183
  title: "見出し1",
@@ -2508,7 +2508,7 @@ const Xo = {
2508
2508
  generic: {
2509
2509
  ctrl_shortcut: "Ctrl"
2510
2510
  }
2511
- }, oi = {
2511
+ }, ri = {
2512
2512
  slash_menu: {
2513
2513
  heading: {
2514
2514
  title: "제목1",
@@ -2832,7 +2832,7 @@ const Xo = {
2832
2832
  generic: {
2833
2833
  ctrl_shortcut: "Ctrl"
2834
2834
  }
2835
- }, ii = {
2835
+ }, ai = {
2836
2836
  slash_menu: {
2837
2837
  heading: {
2838
2838
  title: "Kop 1",
@@ -3143,7 +3143,7 @@ const Xo = {
3143
3143
  generic: {
3144
3144
  ctrl_shortcut: "Ctrl"
3145
3145
  }
3146
- }, ni = {
3146
+ }, si = {
3147
3147
  slash_menu: {
3148
3148
  heading: {
3149
3149
  title: "Nagłówek 1",
@@ -3438,7 +3438,7 @@ const Xo = {
3438
3438
  generic: {
3439
3439
  ctrl_shortcut: "Ctrl"
3440
3440
  }
3441
- }, ri = {
3441
+ }, li = {
3442
3442
  slash_menu: {
3443
3443
  heading: {
3444
3444
  title: "Título",
@@ -3741,7 +3741,7 @@ const Xo = {
3741
3741
  generic: {
3742
3742
  ctrl_shortcut: "Ctrl"
3743
3743
  }
3744
- }, ai = {
3744
+ }, di = {
3745
3745
  slash_menu: {
3746
3746
  heading: {
3747
3747
  title: "Заголовок 1 уровня",
@@ -4079,7 +4079,7 @@ const Xo = {
4079
4079
  generic: {
4080
4080
  ctrl_shortcut: "Ctrl"
4081
4081
  }
4082
- }, si = {
4082
+ }, ci = {
4083
4083
  slash_menu: {
4084
4084
  heading: {
4085
4085
  title: "Tiêu đề H1",
@@ -4389,7 +4389,7 @@ const Xo = {
4389
4389
  generic: {
4390
4390
  ctrl_shortcut: "Ctrl"
4391
4391
  }
4392
- }, li = {
4392
+ }, ui = {
4393
4393
  slash_menu: {
4394
4394
  heading: {
4395
4395
  title: "一级标题",
@@ -4733,46 +4733,46 @@ const Xo = {
4733
4733
  generic: {
4734
4734
  ctrl_shortcut: "Ctrl"
4735
4735
  }
4736
- }, Wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4736
+ }, Ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4737
4737
  __proto__: null,
4738
- ar: Xo,
4739
- de: Zo,
4740
- en: wt,
4741
- es: Jo,
4742
- fr: Yo,
4743
- hr: Qo,
4744
- is: ei,
4745
- ja: ti,
4746
- ko: oi,
4747
- nl: ii,
4748
- pl: ni,
4749
- pt: ri,
4750
- ru: ai,
4751
- vi: si,
4752
- zh: li
4738
+ ar: Yo,
4739
+ de: Qo,
4740
+ en: vt,
4741
+ es: ei,
4742
+ fr: ti,
4743
+ hr: oi,
4744
+ is: ii,
4745
+ ja: ni,
4746
+ ko: ri,
4747
+ nl: ai,
4748
+ pl: si,
4749
+ pt: li,
4750
+ ru: di,
4751
+ vi: ci,
4752
+ zh: ui
4753
4753
  }, Symbol.toStringTag, { value: "Module" }));
4754
4754
  class D extends Error {
4755
4755
  constructor(t) {
4756
4756
  super(`Unreachable case: ${t}`);
4757
4757
  }
4758
4758
  }
4759
- function Ka(e, t = !0) {
4759
+ function qa(e, t = !0) {
4760
4760
  const { "data-test": o, ...i } = e;
4761
4761
  if (Object.keys(i).length > 0 && t)
4762
4762
  throw new Error("Object must be empty " + JSON.stringify(e));
4763
4763
  }
4764
- function di(e, t = JSON.stringify) {
4764
+ function pi(e, t = JSON.stringify) {
4765
4765
  const o = {};
4766
4766
  return e.filter((i) => {
4767
4767
  const n = t(i);
4768
4768
  return Object.prototype.hasOwnProperty.call(o, n) ? !1 : o[n] = !0;
4769
4769
  });
4770
4770
  }
4771
- function ci(e) {
4771
+ function hi(e) {
4772
4772
  const t = e.filter(
4773
4773
  (i, n) => e.indexOf(i) !== n
4774
4774
  );
4775
- return di(t);
4775
+ return pi(t);
4776
4776
  }
4777
4777
  const ue = I.create({
4778
4778
  name: "uniqueID",
@@ -4789,7 +4789,7 @@ const ue = I.create({
4789
4789
  const e = window.__TEST_OPTIONS;
4790
4790
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
4791
4791
  }
4792
- return Co();
4792
+ return Bo();
4793
4793
  },
4794
4794
  filterTransaction: null
4795
4795
  };
@@ -4858,43 +4858,43 @@ const ue = I.create({
4858
4858
  });
4859
4859
  if (!r || a)
4860
4860
  return;
4861
- const { tr: s } = n, { types: l, attributeName: c, generateID: d } = this.options, u = ho(
4861
+ const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = go(
4862
4862
  i.doc,
4863
4863
  o
4864
4864
  ), { mapping: h } = u;
4865
- if (mo(u).forEach(({ newRange: f }) => {
4866
- const g = fo(
4865
+ if (bo(u).forEach(({ newRange: f }) => {
4866
+ const g = ko(
4867
4867
  n.doc,
4868
4868
  f,
4869
4869
  (C) => l.includes(C.type.name)
4870
- ), b = g.map(({ node: C }) => C.attrs[c]).filter((C) => C !== null), k = ci(b);
4871
- g.forEach(({ node: C, pos: _ }) => {
4870
+ ), b = g.map(({ node: C }) => C.attrs[d]).filter((C) => C !== null), k = hi(b);
4871
+ g.forEach(({ node: C, pos: y }) => {
4872
4872
  let A;
4873
- const Z = (A = s.doc.nodeAt(_)) === null || A === void 0 ? void 0 : A.attrs[c];
4873
+ const Z = (A = s.doc.nodeAt(y)) === null || A === void 0 ? void 0 : A.attrs[d];
4874
4874
  if (Z === null) {
4875
- const x = i.doc.type.createAndFill().content;
4876
- if (i.doc.content.findDiffStart(x) === null) {
4877
- const Xe = JSON.parse(
4875
+ const v = i.doc.type.createAndFill().content;
4876
+ if (i.doc.content.findDiffStart(v) === null) {
4877
+ const Ze = JSON.parse(
4878
4878
  JSON.stringify(n.doc.toJSON())
4879
4879
  );
4880
- if (Xe.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Xe.content) === JSON.stringify(x.toJSON())) {
4881
- s.setNodeMarkup(_, void 0, {
4880
+ if (Ze.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Ze.content) === JSON.stringify(v.toJSON())) {
4881
+ s.setNodeMarkup(y, void 0, {
4882
4882
  ...C.attrs,
4883
- [c]: "initialBlockId"
4883
+ [d]: "initialBlockId"
4884
4884
  });
4885
4885
  return;
4886
4886
  }
4887
4887
  }
4888
- s.setNodeMarkup(_, void 0, {
4888
+ s.setNodeMarkup(y, void 0, {
4889
4889
  ...C.attrs,
4890
- [c]: d()
4890
+ [d]: c()
4891
4891
  });
4892
4892
  return;
4893
4893
  }
4894
- const { deleted: he } = h.invert().mapResult(_);
4895
- he && k.includes(Z) && s.setNodeMarkup(_, void 0, {
4894
+ const { deleted: me } = h.invert().mapResult(y);
4895
+ me && k.includes(Z) && s.setNodeMarkup(y, void 0, {
4896
4896
  ...C.attrs,
4897
- [c]: d()
4897
+ [d]: c()
4898
4898
  });
4899
4899
  });
4900
4900
  }), !!s.steps.length)
@@ -4941,7 +4941,7 @@ const ue = I.create({
4941
4941
  s.push(l.copy(r(l.content)));
4942
4942
  return;
4943
4943
  }
4944
- const c = l.type.create(
4944
+ const d = l.type.create(
4945
4945
  {
4946
4946
  ...l.attrs,
4947
4947
  [n]: null
@@ -4949,10 +4949,10 @@ const ue = I.create({
4949
4949
  r(l.content),
4950
4950
  l.marks
4951
4951
  );
4952
- s.push(c);
4952
+ s.push(d);
4953
4953
  }), j.from(s);
4954
4954
  };
4955
- return t = !1, new de(
4955
+ return t = !1, new ee(
4956
4956
  r(o.content),
4957
4957
  o.openStart,
4958
4958
  o.openEnd
@@ -4963,16 +4963,16 @@ const ue = I.create({
4963
4963
  ];
4964
4964
  }
4965
4965
  });
4966
- function tt(e) {
4966
+ function ot(e) {
4967
4967
  return e.type === "link";
4968
4968
  }
4969
- function vt(e) {
4969
+ function xt(e) {
4970
4970
  return typeof e != "string" && e.type === "link";
4971
4971
  }
4972
- function le(e) {
4972
+ function de(e) {
4973
4973
  return typeof e != "string" && e.type === "text";
4974
4974
  }
4975
- function ot(e, t, o) {
4975
+ function it(e, t, o) {
4976
4976
  const i = [];
4977
4977
  for (const [n, r] of Object.entries(e.styles)) {
4978
4978
  const a = o[n];
@@ -4988,11 +4988,11 @@ function ot(e, t, o) {
4988
4988
  return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
4989
4989
  ` ? t.nodes.hardBreak.createChecked() : t.text(n, i));
4990
4990
  }
4991
- function ui(e, t, o) {
4991
+ function mi(e, t, o) {
4992
4992
  const i = t.marks.link.create({
4993
4993
  href: e.href
4994
4994
  });
4995
- return Ne(e.content, t, o).map(
4995
+ return je(e.content, t, o).map(
4996
4996
  (n) => {
4997
4997
  if (n.type.name === "text")
4998
4998
  return n.mark([...n.marks, i]);
@@ -5002,46 +5002,46 @@ function ui(e, t, o) {
5002
5002
  }
5003
5003
  );
5004
5004
  }
5005
- function Ne(e, t, o) {
5005
+ function je(e, t, o) {
5006
5006
  const i = [];
5007
5007
  if (typeof e == "string")
5008
5008
  return i.push(
5009
- ...ot(
5009
+ ...it(
5010
5010
  { type: "text", text: e, styles: {} },
5011
5011
  t,
5012
5012
  o
5013
5013
  )
5014
5014
  ), i;
5015
5015
  for (const n of e)
5016
- i.push(...ot(n, t, o));
5016
+ i.push(...it(n, t, o));
5017
5017
  return i;
5018
5018
  }
5019
5019
  function H(e, t, o) {
5020
5020
  const i = [];
5021
5021
  for (const n of e)
5022
- typeof n == "string" ? i.push(...Ne(n, t, o)) : vt(n) ? i.push(...ui(n, t, o)) : le(n) ? i.push(...Ne([n], t, o)) : i.push(
5023
- xt(n, t, o)
5022
+ typeof n == "string" ? i.push(...je(n, t, o)) : xt(n) ? i.push(...mi(n, t, o)) : de(n) ? i.push(...je([n], t, o)) : i.push(
5023
+ Ct(n, t, o)
5024
5024
  );
5025
5025
  return i;
5026
5026
  }
5027
- function we(e, t, o) {
5027
+ function ve(e, t, o) {
5028
5028
  var n;
5029
5029
  const i = [];
5030
5030
  for (const r of e.rows) {
5031
5031
  const a = [];
5032
5032
  for (let l = 0; l < r.cells.length; l++) {
5033
- const c = r.cells[l];
5034
- let d;
5035
- if (!c)
5036
- d = t.nodes.tableParagraph.createChecked({});
5037
- else if (typeof c == "string")
5038
- d = t.nodes.tableParagraph.createChecked(
5033
+ const d = r.cells[l];
5034
+ let c;
5035
+ if (!d)
5036
+ c = t.nodes.tableParagraph.createChecked({});
5037
+ else if (typeof d == "string")
5038
+ c = t.nodes.tableParagraph.createChecked(
5039
5039
  {},
5040
- t.text(c)
5040
+ t.text(d)
5041
5041
  );
5042
5042
  else {
5043
- const h = H(c, t, o);
5044
- d = t.nodes.tableParagraph.createChecked({}, h);
5043
+ const h = H(d, t, o);
5044
+ c = t.nodes.tableParagraph.createChecked({}, h);
5045
5045
  }
5046
5046
  const u = t.nodes.tableCell.createChecked(
5047
5047
  {
@@ -5050,7 +5050,7 @@ function we(e, t, o) {
5050
5050
  // we can always assume a length of 1.
5051
5051
  colwidth: (n = e.columnWidths) != null && n[l] ? [e.columnWidths[l]] : null
5052
5052
  },
5053
- d
5053
+ c
5054
5054
  );
5055
5055
  a.push(u);
5056
5056
  }
@@ -5059,7 +5059,7 @@ function we(e, t, o) {
5059
5059
  }
5060
5060
  return i;
5061
5061
  }
5062
- function xt(e, t, o) {
5062
+ function Ct(e, t, o) {
5063
5063
  let i, n = e.type;
5064
5064
  if (n === void 0 && (n = "paragraph"), !t.nodes[n])
5065
5065
  throw new Error(`node type ${n} not found in schema`);
@@ -5072,7 +5072,7 @@ function xt(e, t, o) {
5072
5072
  const r = H(e.content, t, o);
5073
5073
  i = t.nodes[n].createChecked(e.props, r);
5074
5074
  } else if (e.content.type === "tableContent") {
5075
- const r = we(e.content, t, o);
5075
+ const r = ve(e.content, t, o);
5076
5076
  i = t.nodes[n].createChecked(e.props, r);
5077
5077
  } else
5078
5078
  throw new D(e.content.type);
@@ -5087,7 +5087,7 @@ function X(e, t, o) {
5087
5087
  n.push(X(a, t, o));
5088
5088
  const r = t.nodes[e.type];
5089
5089
  if (r.isInGroup("blockContent")) {
5090
- const a = xt(
5090
+ const a = Ct(
5091
5091
  e,
5092
5092
  t,
5093
5093
  o
@@ -5113,13 +5113,13 @@ function X(e, t, o) {
5113
5113
  );
5114
5114
  }
5115
5115
  }
5116
- function Ct(e) {
5116
+ function Et(e) {
5117
5117
  const t = [...e.classList].filter(
5118
5118
  (o) => !o.startsWith("bn-")
5119
5119
  ) || [];
5120
5120
  t.length > 0 ? e.className = t.join(" ") : e.removeAttribute("class");
5121
5121
  }
5122
- function Et(e, t, o, i) {
5122
+ function St(e, t, o, i) {
5123
5123
  let n;
5124
5124
  if (t)
5125
5125
  if (typeof t == "string")
@@ -5135,7 +5135,7 @@ function Et(e, t, o, i) {
5135
5135
  e.schema.styleSchema
5136
5136
  );
5137
5137
  else if (t.type === "tableContent")
5138
- n = we(
5138
+ n = ve(
5139
5139
  t,
5140
5140
  e.pmSchema,
5141
5141
  e.schema.styleSchema
@@ -5144,37 +5144,37 @@ function Et(e, t, o, i) {
5144
5144
  throw new D(t.type);
5145
5145
  else throw new Error("blockContent is required");
5146
5146
  const r = o.serializeFragment(j.from(n), i);
5147
- return r.nodeType === 1 && Ct(r), r;
5147
+ return r.nodeType === 1 && Et(r), r;
5148
5148
  }
5149
- function pi(e, t, o, i, n, r, a) {
5150
- var g, b, k, C, _, A, Z, he;
5149
+ function fi(e, t, o, i, n, r, a) {
5150
+ var g, b, k, C, y, A, Z, me;
5151
5151
  const s = (a == null ? void 0 : a.document) ?? document, l = t.pmSchema.nodes.blockContainer;
5152
- let c = o.props;
5152
+ let d = o.props;
5153
5153
  if (!o.props) {
5154
- c = {};
5155
- for (const [E, x] of Object.entries(
5154
+ d = {};
5155
+ for (const [E, v] of Object.entries(
5156
5156
  t.schema.blockSchema[o.type].propSchema
5157
5157
  ))
5158
- c[E] = x.default;
5158
+ v.default !== void 0 && (d[E] = v.default);
5159
5159
  }
5160
5160
  const u = [...((b = (g = l.spec) == null ? void 0 : g.toDOM) == null ? void 0 : b.call(
5161
5161
  g,
5162
5162
  l.create({
5163
5163
  id: o.id,
5164
- ...c
5164
+ ...d
5165
5165
  })
5166
- )).dom.attributes], h = t.blockImplementations[o.type].implementation.toExternalHTML({ ...o, props: c }, t), m = s.createDocumentFragment();
5166
+ )).dom.attributes], h = t.blockImplementations[o.type].implementation.toExternalHTML({ ...o, props: d }, t), m = s.createDocumentFragment();
5167
5167
  if (h.dom.classList.contains("bn-block-content")) {
5168
5168
  const E = [...u, ...h.dom.attributes].filter(
5169
- (x) => x.name.startsWith("data") && x.name !== "data-content-type" && x.name !== "data-file-block" && x.name !== "data-node-view-wrapper" && x.name !== "data-node-type" && x.name !== "data-id" && x.name !== "data-index" && x.name !== "data-editable"
5169
+ (v) => v.name.startsWith("data") && v.name !== "data-content-type" && v.name !== "data-file-block" && v.name !== "data-node-view-wrapper" && v.name !== "data-node-type" && v.name !== "data-id" && v.name !== "data-index" && v.name !== "data-editable"
5170
5170
  );
5171
- for (const x of E)
5172
- h.dom.firstChild.setAttribute(x.name, x.value);
5173
- Ct(h.dom.firstChild), m.append(...h.dom.childNodes);
5171
+ for (const v of E)
5172
+ h.dom.firstChild.setAttribute(v.name, v.value);
5173
+ Et(h.dom.firstChild), m.append(...h.dom.childNodes);
5174
5174
  } else
5175
5175
  m.append(h.dom);
5176
5176
  if (h.contentDOM && o.content) {
5177
- const E = Et(
5177
+ const E = St(
5178
5178
  t,
5179
5179
  o.content,
5180
5180
  // TODO
@@ -5186,8 +5186,8 @@ function pi(e, t, o, i, n, r, a) {
5186
5186
  let f;
5187
5187
  if (n.has(o.type) ? f = "OL" : r.has(o.type) && (f = "UL"), f) {
5188
5188
  if (((k = e.lastChild) == null ? void 0 : k.nodeName) !== f) {
5189
- const x = s.createElement(f);
5190
- e.append(x);
5189
+ const v = s.createElement(f);
5190
+ f === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && v.setAttribute("start", d.start + ""), e.append(v);
5191
5191
  }
5192
5192
  const E = s.createElement("li");
5193
5193
  E.append(m), e.lastChild.appendChild(E);
@@ -5195,7 +5195,7 @@ function pi(e, t, o, i, n, r, a) {
5195
5195
  e.append(m);
5196
5196
  if (o.children && o.children.length > 0) {
5197
5197
  const E = s.createDocumentFragment();
5198
- if (St(
5198
+ if (Bt(
5199
5199
  E,
5200
5200
  t,
5201
5201
  o.children,
@@ -5203,15 +5203,15 @@ function pi(e, t, o, i, n, r, a) {
5203
5203
  n,
5204
5204
  r,
5205
5205
  a
5206
- ), ((C = e.lastChild) == null ? void 0 : C.nodeName) === "UL" || ((_ = e.lastChild) == null ? void 0 : _.nodeName) === "OL")
5206
+ ), ((C = e.lastChild) == null ? void 0 : C.nodeName) === "UL" || ((y = e.lastChild) == null ? void 0 : y.nodeName) === "OL")
5207
5207
  for (; ((A = E.firstChild) == null ? void 0 : A.nodeName) === "UL" || ((Z = E.firstChild) == null ? void 0 : Z.nodeName) === "OL"; )
5208
5208
  e.lastChild.lastChild.appendChild(E.firstChild);
5209
- t.pmSchema.nodes[o.type].isInGroup("blockContent") ? e.append(E) : (he = h.contentDOM) == null || he.append(E);
5209
+ t.pmSchema.nodes[o.type].isInGroup("blockContent") ? e.append(E) : (me = h.contentDOM) == null || me.append(E);
5210
5210
  }
5211
5211
  }
5212
- const St = (e, t, o, i, n, r, a) => {
5212
+ const Bt = (e, t, o, i, n, r, a) => {
5213
5213
  for (const s of o)
5214
- pi(
5214
+ fi(
5215
5215
  e,
5216
5216
  t,
5217
5217
  s,
@@ -5220,9 +5220,9 @@ const St = (e, t, o, i, n, r, a) => {
5220
5220
  r,
5221
5221
  a
5222
5222
  );
5223
- }, hi = (e, t, o, i, n, r) => {
5223
+ }, gi = (e, t, o, i, n, r) => {
5224
5224
  const s = ((r == null ? void 0 : r.document) ?? document).createDocumentFragment();
5225
- return St(
5225
+ return Bt(
5226
5226
  s,
5227
5227
  e,
5228
5228
  t,
@@ -5231,11 +5231,11 @@ const St = (e, t, o, i, n, r, a) => {
5231
5231
  n,
5232
5232
  r
5233
5233
  ), s;
5234
- }, ve = (e, t) => {
5235
- const o = bt.fromSchema(e);
5234
+ }, xe = (e, t) => {
5235
+ const o = kt.fromSchema(e);
5236
5236
  return {
5237
5237
  exportBlocks: (i, n) => {
5238
- const r = hi(
5238
+ const r = gi(
5239
5239
  t,
5240
5240
  i,
5241
5241
  o,
@@ -5246,7 +5246,7 @@ const St = (e, t, o, i, n, r, a) => {
5246
5246
  return a.append(r), a.innerHTML;
5247
5247
  },
5248
5248
  exportInlineContent: (i, n) => {
5249
- const r = Et(
5249
+ const r = St(
5250
5250
  t,
5251
5251
  i,
5252
5252
  o,
@@ -5256,7 +5256,7 @@ const St = (e, t, o, i, n, r, a) => {
5256
5256
  }
5257
5257
  };
5258
5258
  };
5259
- function mi(e, t, o, i) {
5259
+ function bi(e, t, o, i) {
5260
5260
  let n;
5261
5261
  if (t)
5262
5262
  if (typeof t == "string")
@@ -5272,7 +5272,7 @@ function mi(e, t, o, i) {
5272
5272
  e.schema.styleSchema
5273
5273
  );
5274
5274
  else if (t.type === "tableContent")
5275
- n = we(
5275
+ n = ve(
5276
5276
  t,
5277
5277
  e.pmSchema,
5278
5278
  e.schema.styleSchema
@@ -5282,7 +5282,7 @@ function mi(e, t, o, i) {
5282
5282
  else throw new Error("blockContent is required");
5283
5283
  return o.serializeFragment(j.from(n), i);
5284
5284
  }
5285
- function fi(e, t, o, i, n) {
5285
+ function ki(e, t, o, i, n) {
5286
5286
  var u, h, m, f, g;
5287
5287
  const r = e.pmSchema.nodes.blockContainer;
5288
5288
  let a = t.props;
@@ -5291,11 +5291,11 @@ function fi(e, t, o, i, n) {
5291
5291
  for (const [b, k] of Object.entries(
5292
5292
  e.schema.blockSchema[t.type].propSchema
5293
5293
  ))
5294
- a[b] = k.default;
5294
+ k.default !== void 0 && (a[b] = k.default);
5295
5295
  }
5296
5296
  const l = e.blockImplementations[t.type].implementation.toInternalHTML({ ...t, props: a }, e);
5297
5297
  if (t.type === "numberedListItem" && l.dom.setAttribute("data-index", i.toString()), l.contentDOM && t.content) {
5298
- const b = mi(
5298
+ const b = bi(
5299
5299
  e,
5300
5300
  t.content,
5301
5301
  // TODO
@@ -5306,7 +5306,7 @@ function fi(e, t, o, i, n) {
5306
5306
  }
5307
5307
  if (e.pmSchema.nodes[t.type].isInGroup("bnBlock")) {
5308
5308
  if (t.children && t.children.length > 0) {
5309
- const b = Bt(
5309
+ const b = Tt(
5310
5310
  e,
5311
5311
  t.children,
5312
5312
  o,
@@ -5316,23 +5316,23 @@ function fi(e, t, o, i, n) {
5316
5316
  }
5317
5317
  return l.dom;
5318
5318
  }
5319
- const d = (m = (h = r.spec) == null ? void 0 : h.toDOM) == null ? void 0 : m.call(
5319
+ const c = (m = (h = r.spec) == null ? void 0 : h.toDOM) == null ? void 0 : m.call(
5320
5320
  h,
5321
5321
  r.create({
5322
5322
  id: t.id,
5323
5323
  ...a
5324
5324
  })
5325
5325
  );
5326
- return (f = d.contentDOM) == null || f.appendChild(l.dom), t.children && t.children.length > 0 && ((g = d.contentDOM) == null || g.appendChild(
5327
- Tt(e, t.children, o, n)
5328
- )), d.dom;
5326
+ return (f = c.contentDOM) == null || f.appendChild(l.dom), t.children && t.children.length > 0 && ((g = c.contentDOM) == null || g.appendChild(
5327
+ Mt(e, t.children, o, n)
5328
+ )), c.dom;
5329
5329
  }
5330
- function Bt(e, t, o, i) {
5330
+ function Tt(e, t, o, i) {
5331
5331
  const r = ((i == null ? void 0 : i.document) ?? document).createDocumentFragment();
5332
5332
  let a = 0;
5333
5333
  for (const s of t) {
5334
5334
  s.type === "numberedListItem" ? a++ : a = 0;
5335
- const l = fi(
5335
+ const l = ki(
5336
5336
  e,
5337
5337
  s,
5338
5338
  o,
@@ -5343,14 +5343,14 @@ function Bt(e, t, o, i) {
5343
5343
  }
5344
5344
  return r;
5345
5345
  }
5346
- const Tt = (e, t, o, i) => {
5346
+ const Mt = (e, t, o, i) => {
5347
5347
  var s;
5348
- const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = Bt(e, t, o, i);
5348
+ const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = Tt(e, t, o, i);
5349
5349
  return (s = r.contentDOM) == null || s.appendChild(a), r.dom;
5350
- }, gi = (e, t) => {
5351
- const o = bt.fromSchema(e);
5350
+ }, _i = (e, t) => {
5351
+ const o = kt.fromSchema(e);
5352
5352
  return {
5353
- serializeBlocks: (i, n) => Tt(t, i, o, n).outerHTML
5353
+ serializeBlocks: (i, n) => Mt(t, i, o, n).outerHTML
5354
5354
  };
5355
5355
  };
5356
5356
  function z(e, t) {
@@ -5381,7 +5381,7 @@ function z(e, t) {
5381
5381
  node: a.nodeAfter
5382
5382
  };
5383
5383
  }
5384
- function Ve(e, t) {
5384
+ function ze(e, t) {
5385
5385
  if (!e.type.isInGroup("bnBlock"))
5386
5386
  throw new Error(
5387
5387
  `Attempted to get bnBlock node at position but found node of different type ${e.type}`
@@ -5393,18 +5393,18 @@ function Ve(e, t) {
5393
5393
  };
5394
5394
  if (o.type.name === "blockContainer") {
5395
5395
  let a, s;
5396
- if (o.forEach((l, c) => {
5396
+ if (o.forEach((l, d) => {
5397
5397
  if (l.type.spec.group === "blockContent") {
5398
- const d = l, u = i + c + 1, h = u + l.nodeSize;
5398
+ const c = l, u = i + d + 1, h = u + l.nodeSize;
5399
5399
  a = {
5400
- node: d,
5400
+ node: c,
5401
5401
  beforePos: u,
5402
5402
  afterPos: h
5403
5403
  };
5404
5404
  } else if (l.type.name === "blockGroup") {
5405
- const d = l, u = i + c + 1, h = u + l.nodeSize;
5405
+ const c = l, u = i + d + 1, h = u + l.nodeSize;
5406
5406
  s = {
5407
- node: d,
5407
+ node: c,
5408
5408
  beforePos: u,
5409
5409
  afterPos: h
5410
5410
  };
@@ -5434,16 +5434,16 @@ function Ve(e, t) {
5434
5434
  }
5435
5435
  }
5436
5436
  function F(e) {
5437
- return Ve(e.node, e.posBeforeNode);
5437
+ return ze(e.node, e.posBeforeNode);
5438
5438
  }
5439
5439
  function pe(e) {
5440
5440
  if (!e.nodeAfter)
5441
5441
  throw new Error(
5442
5442
  `Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`
5443
5443
  );
5444
- return Ve(e.nodeAfter, e.pos);
5444
+ return ze(e.nodeAfter, e.pos);
5445
5445
  }
5446
- function y(e) {
5446
+ function _(e) {
5447
5447
  const t = z(e.doc, e.selection.anchor);
5448
5448
  return F(t);
5449
5449
  }
@@ -5455,14 +5455,14 @@ function P(e, t) {
5455
5455
  posBeforeNode: i
5456
5456
  };
5457
5457
  }
5458
- const bi = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5458
+ const yi = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5459
5459
  function V(e, t = "Ctrl") {
5460
- return bi() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5460
+ return yi() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5461
5461
  }
5462
5462
  function G(...e) {
5463
5463
  return e.filter((t) => t).join(" ");
5464
5464
  }
5465
- const qa = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5465
+ const Xa = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5466
5466
  function R(e, t, o, i) {
5467
5467
  const n = document.createElement("div");
5468
5468
  n.className = G(
@@ -5485,7 +5485,7 @@ function R(e, t, o, i) {
5485
5485
  contentDOM: r
5486
5486
  };
5487
5487
  }
5488
- const it = (e, t) => {
5488
+ const nt = (e, t) => {
5489
5489
  let o = X(e, t.pmSchema, t.schema.styleSchema);
5490
5490
  o.type.name === "blockContainer" && (o = o.firstChild);
5491
5491
  const i = t.pmSchema.nodes[o.type.name].spec.toDOM;
@@ -5499,7 +5499,7 @@ const it = (e, t) => {
5499
5499
  "Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property."
5500
5500
  );
5501
5501
  return n;
5502
- }, v = {
5502
+ }, x = {
5503
5503
  backgroundColor: {
5504
5504
  default: "default"
5505
5505
  },
@@ -5510,18 +5510,18 @@ const it = (e, t) => {
5510
5510
  default: "left",
5511
5511
  values: ["left", "center", "right", "justify"]
5512
5512
  }
5513
- }, Mt = ["backgroundColor", "textColor"];
5514
- function be(e) {
5513
+ }, Lt = ["backgroundColor", "textColor"];
5514
+ function ke(e) {
5515
5515
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
5516
5516
  }
5517
- function Xa(e) {
5517
+ function Za(e) {
5518
5518
  const t = e.split("/");
5519
5519
  return !t.length || // invalid?
5520
5520
  t[t.length - 1] === "" ? e : t[t.length - 1];
5521
5521
  }
5522
- function Lt(e) {
5522
+ function he(e) {
5523
5523
  const t = {};
5524
- return Object.entries(e).filter(([o, i]) => !Mt.includes(o)).forEach(([o, i]) => {
5524
+ return Object.entries(e).filter(([o, i]) => !Lt.includes(o)).forEach(([o, i]) => {
5525
5525
  t[o] = {
5526
5526
  default: i.default,
5527
5527
  keepOnSplit: !0,
@@ -5529,24 +5529,24 @@ function Lt(e) {
5529
5529
  // value is the same as its default, we don't display an HTML
5530
5530
  // attribute for it.
5531
5531
  parseHTML: (n) => {
5532
- const r = n.getAttribute(be(o));
5532
+ const r = n.getAttribute(ke(o));
5533
5533
  if (r === null)
5534
5534
  return null;
5535
- if (typeof i.default == "boolean")
5535
+ if (i.default === void 0 && i.type === "boolean" || i.default !== void 0 && typeof i.default == "boolean")
5536
5536
  return r === "true" ? !0 : r === "false" ? !1 : null;
5537
- if (typeof i.default == "number") {
5537
+ if (i.default === void 0 && i.type === "number" || i.default !== void 0 && typeof i.default == "number") {
5538
5538
  const a = parseFloat(r);
5539
5539
  return !Number.isNaN(a) && Number.isFinite(a) ? a : null;
5540
5540
  }
5541
5541
  return r;
5542
5542
  },
5543
5543
  renderHTML: (n) => n[o] !== i.default ? {
5544
- [be(o)]: n[o]
5544
+ [ke(o)]: n[o]
5545
5545
  } : {}
5546
5546
  };
5547
5547
  }), t;
5548
5548
  }
5549
- function ki(e, t, o, i) {
5549
+ function wi(e, t, o, i) {
5550
5550
  if (typeof e == "boolean")
5551
5551
  throw new Error(
5552
5552
  "Cannot find node position as getPos is a boolean, not a function."
@@ -5559,7 +5559,7 @@ function ki(e, t, o, i) {
5559
5559
  throw new Error("Block type does not match");
5560
5560
  return s;
5561
5561
  }
5562
- function me(e, t, o, i, n = !1, r) {
5562
+ function fe(e, t, o, i, n = !1, r) {
5563
5563
  const a = document.createElement("div");
5564
5564
  if (r !== void 0)
5565
5565
  for (const [s, l] of Object.entries(r))
@@ -5568,8 +5568,10 @@ function me(e, t, o, i, n = !1, r) {
5568
5568
  "bn-block-content",
5569
5569
  (r == null ? void 0 : r.class) || ""
5570
5570
  ), a.setAttribute("data-content-type", t);
5571
- for (const [s, l] of Object.entries(o))
5572
- !Mt.includes(s) && l !== i[s].default && a.setAttribute(be(s), l);
5571
+ for (const [s, l] of Object.entries(o)) {
5572
+ const c = i[s].default;
5573
+ !Lt.includes(s) && l !== c && a.setAttribute(ke(s), l);
5574
+ }
5573
5575
  return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = G(
5574
5576
  "bn-inline-content",
5575
5577
  e.contentDOM.className
@@ -5597,8 +5599,8 @@ function W(e, t, o) {
5597
5599
  {
5598
5600
  node: e,
5599
5601
  requiredExtensions: o,
5600
- toInternalHTML: it,
5601
- toExternalHTML: it
5602
+ toInternalHTML: nt,
5603
+ toExternalHTML: nt
5602
5604
  // parse: () => undefined, // parse rules are in node already
5603
5605
  }
5604
5606
  );
@@ -5608,12 +5610,12 @@ function Pt(e) {
5608
5610
  Object.entries(e).map(([t, o]) => [t, o.config])
5609
5611
  );
5610
5612
  }
5611
- function _i(e, t) {
5613
+ function vi(e, t) {
5612
5614
  e.stopEvent = (o) => (o.type === "mousedown" && setTimeout(() => {
5613
5615
  t.view.dom.blur();
5614
5616
  }, 10), !0);
5615
5617
  }
5616
- function yi(e, t) {
5618
+ function xi(e, t) {
5617
5619
  const o = [
5618
5620
  {
5619
5621
  tag: "[data-content-type=" + e.type + "]",
@@ -5630,21 +5632,22 @@ function yi(e, t) {
5630
5632
  }
5631
5633
  }), o;
5632
5634
  }
5633
- function xe(e, t) {
5635
+ function Ce(e, t) {
5634
5636
  const o = $({
5635
5637
  name: e.type,
5636
5638
  content: e.content === "inline" ? "inline*" : "",
5637
5639
  group: "blockContent",
5638
5640
  selectable: e.isSelectable ?? !0,
5641
+ isolating: !0,
5639
5642
  addAttributes() {
5640
- return Lt(e.propSchema);
5643
+ return he(e.propSchema);
5641
5644
  },
5642
5645
  parseHTML() {
5643
- return yi(e, t.parse);
5646
+ return xi(e, t.parse);
5644
5647
  },
5645
5648
  renderHTML({ HTMLAttributes: i }) {
5646
5649
  const n = document.createElement("div");
5647
- return me(
5650
+ return fe(
5648
5651
  {
5649
5652
  dom: n,
5650
5653
  contentDOM: e.content === "inline" ? n : void 0
@@ -5658,20 +5661,20 @@ function xe(e, t) {
5658
5661
  },
5659
5662
  addNodeView() {
5660
5663
  return ({ getPos: i }) => {
5661
- var c;
5662
- const n = this.options.editor, r = ki(
5664
+ var d;
5665
+ const n = this.options.editor, r = wi(
5663
5666
  i,
5664
5667
  n,
5665
5668
  this.editor,
5666
5669
  e.type
5667
- ), a = ((c = this.options.domAttributes) == null ? void 0 : c.blockContent) || {}, s = t.render(r, n), l = me(
5670
+ ), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = fe(
5668
5671
  s,
5669
5672
  r.type,
5670
5673
  r.props,
5671
5674
  e.propSchema,
5672
5675
  a
5673
5676
  );
5674
- return e.isSelectable === !1 && _i(l, this.editor), l;
5677
+ return e.isSelectable === !1 && vi(l, this.editor), l;
5675
5678
  };
5676
5679
  }
5677
5680
  });
@@ -5684,7 +5687,7 @@ function xe(e, t) {
5684
5687
  toInternalHTML: (i, n) => {
5685
5688
  var s;
5686
5689
  const r = ((s = o.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(i, n);
5687
- return me(
5690
+ return fe(
5688
5691
  a,
5689
5692
  i.type,
5690
5693
  i.props,
@@ -5703,7 +5706,7 @@ function xe(e, t) {
5703
5706
  i,
5704
5707
  n
5705
5708
  );
5706
- return a === void 0 && (a = t.render(i, n)), me(
5709
+ return a === void 0 && (a = t.render(i, n)), fe(
5707
5710
  a,
5708
5711
  i.type,
5709
5712
  i.props,
@@ -5724,11 +5727,11 @@ function At(e, t, o) {
5724
5727
  cells: []
5725
5728
  };
5726
5729
  a === 0 && n.content.forEach((l) => {
5727
- var c;
5728
- i.columnWidths.push(((c = l.attrs.colwidth) == null ? void 0 : c[0]) || void 0);
5730
+ var d;
5731
+ i.columnWidths.push(((d = l.attrs.colwidth) == null ? void 0 : d[0]) || void 0);
5729
5732
  }), n.content.forEach((l) => {
5730
5733
  s.cells.push(
5731
- Ce(
5734
+ Ee(
5732
5735
  l.firstChild,
5733
5736
  t,
5734
5737
  o
@@ -5737,16 +5740,16 @@ function At(e, t, o) {
5737
5740
  }), i.rows.push(s);
5738
5741
  }), i;
5739
5742
  }
5740
- function Ce(e, t, o) {
5743
+ function Ee(e, t, o) {
5741
5744
  const i = [];
5742
5745
  let n;
5743
5746
  return e.content.forEach((r) => {
5744
5747
  if (r.type.name === "hardBreak") {
5745
5748
  if (n)
5746
- if (le(n))
5749
+ if (de(n))
5747
5750
  n.text += `
5748
5751
  `;
5749
- else if (tt(n))
5752
+ else if (ot(n))
5750
5753
  n.content[n.content.length - 1].text += `
5751
5754
  `;
5752
5755
  else
@@ -5762,7 +5765,7 @@ function Ce(e, t, o) {
5762
5765
  }
5763
5766
  if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
5764
5767
  n && (i.push(n), n = void 0), i.push(
5765
- je(r, t, o)
5768
+ De(r, t, o)
5766
5769
  );
5767
5770
  return;
5768
5771
  }
@@ -5772,17 +5775,17 @@ function Ce(e, t, o) {
5772
5775
  if (l.type.name === "link")
5773
5776
  s = l;
5774
5777
  else {
5775
- const c = o[l.type.name];
5776
- if (!c)
5778
+ const d = o[l.type.name];
5779
+ if (!d)
5777
5780
  throw new Error(`style ${l.type.name} not found in styleSchema`);
5778
- if (c.propSchema === "boolean")
5779
- a[c.type] = !0;
5780
- else if (c.propSchema === "string")
5781
- a[c.type] = l.attrs.stringValue;
5781
+ if (d.propSchema === "boolean")
5782
+ a[d.type] = !0;
5783
+ else if (d.propSchema === "string")
5784
+ a[d.type] = l.attrs.stringValue;
5782
5785
  else
5783
- throw new D(c.propSchema);
5786
+ throw new D(d.propSchema);
5784
5787
  }
5785
- n ? le(n) ? s ? (i.push(n), n = {
5788
+ n ? de(n) ? s ? (i.push(n), n = {
5786
5789
  type: "link",
5787
5790
  href: s.attrs.href,
5788
5791
  content: [
@@ -5796,7 +5799,7 @@ function Ce(e, t, o) {
5796
5799
  type: "text",
5797
5800
  text: r.textContent,
5798
5801
  styles: a
5799
- }) : tt(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
5802
+ }) : ot(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
5800
5803
  n.content[n.content.length - 1].styles
5801
5804
  ) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
5802
5805
  type: "text",
@@ -5833,18 +5836,18 @@ function Ce(e, t, o) {
5833
5836
  };
5834
5837
  }), n && i.push(n), i;
5835
5838
  }
5836
- function je(e, t, o) {
5839
+ function De(e, t, o) {
5837
5840
  if (e.type.name === "text" || e.type.name === "link")
5838
5841
  throw new Error("unexpected");
5839
5842
  const i = {}, n = t[e.type.name];
5840
5843
  for (const [s, l] of Object.entries(e.attrs)) {
5841
5844
  if (!n)
5842
5845
  throw Error("ic node is of an unrecognized type: " + e.type.name);
5843
- const c = n.propSchema;
5844
- s in c && (i[s] = l);
5846
+ const d = n.propSchema;
5847
+ s in d && (i[s] = l);
5845
5848
  }
5846
5849
  let r;
5847
- return n.content === "styled" ? r = Ce(
5850
+ return n.content === "styled" ? r = Ee(
5848
5851
  e,
5849
5852
  t,
5850
5853
  o
@@ -5863,21 +5866,21 @@ function w(e, t, o, i, n) {
5863
5866
  const r = n == null ? void 0 : n.get(e);
5864
5867
  if (r)
5865
5868
  return r;
5866
- const a = Ve(e, 0);
5869
+ const a = ze(e, 0);
5867
5870
  let s = a.bnBlock.node.attrs.id;
5868
5871
  s === null && (s = ue.options.generateID());
5869
5872
  const l = t[a.blockNoteType];
5870
5873
  if (!l)
5871
5874
  throw Error("Block is of an unrecognized type: " + a.blockNoteType);
5872
- const c = {};
5875
+ const d = {};
5873
5876
  for (const [g, b] of Object.entries({
5874
5877
  ...e.attrs,
5875
5878
  ...a.isBlockContainer ? a.blockContent.node.attrs : {}
5876
5879
  })) {
5877
5880
  const k = l.propSchema;
5878
- g in k && (c[g] = b);
5881
+ g in k && !(k[g].default === void 0 && b === void 0) && (d[g] = b);
5879
5882
  }
5880
- const d = t[a.blockNoteType], u = [];
5883
+ const c = t[a.blockNoteType], u = [];
5881
5884
  (f = a.childContainer) == null || f.node.forEach((g) => {
5882
5885
  u.push(
5883
5886
  w(
@@ -5890,15 +5893,15 @@ function w(e, t, o, i, n) {
5890
5893
  );
5891
5894
  });
5892
5895
  let h;
5893
- if (d.content === "inline") {
5896
+ if (c.content === "inline") {
5894
5897
  if (!a.isBlockContainer)
5895
5898
  throw new Error("impossible");
5896
- h = Ce(
5899
+ h = Ee(
5897
5900
  a.blockContent.node,
5898
5901
  o,
5899
5902
  i
5900
5903
  );
5901
- } else if (d.content === "table") {
5904
+ } else if (c.content === "table") {
5902
5905
  if (!a.isBlockContainer)
5903
5906
  throw new Error("impossible");
5904
5907
  h = At(
@@ -5906,23 +5909,26 @@ function w(e, t, o, i, n) {
5906
5909
  o,
5907
5910
  i
5908
5911
  );
5909
- } else if (d.content === "none")
5912
+ } else if (c.content === "none")
5910
5913
  h = void 0;
5911
5914
  else
5912
- throw new D(d.content);
5915
+ throw new D(c.content);
5913
5916
  const m = {
5914
5917
  id: s,
5915
- type: d.type,
5916
- props: c,
5918
+ type: c.type,
5919
+ props: d,
5917
5920
  content: h,
5918
5921
  children: u
5919
5922
  };
5920
5923
  return n == null || n.set(e, m), m;
5921
5924
  }
5922
- function nt(e, t, o, i) {
5923
- return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [be(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5925
+ function rt(e, t, o, i) {
5926
+ return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => {
5927
+ const a = i[n];
5928
+ return r !== a.default;
5929
+ }).map(([n, r]) => [ke(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5924
5930
  }
5925
- function wi(e) {
5931
+ function Ci(e) {
5926
5932
  return {
5927
5933
  Backspace: ({ editor: t }) => {
5928
5934
  const o = t.state.selection.$from;
@@ -5930,14 +5936,14 @@ function wi(e) {
5930
5936
  }
5931
5937
  };
5932
5938
  }
5933
- function vi(e, t) {
5939
+ function Ei(e, t) {
5934
5940
  return {
5935
5941
  config: e,
5936
5942
  implementation: t
5937
5943
  };
5938
5944
  }
5939
- function xi(e, t) {
5940
- return vi(
5945
+ function Si(e, t) {
5946
+ return Ei(
5941
5947
  {
5942
5948
  type: e.name,
5943
5949
  propSchema: t,
@@ -5953,7 +5959,7 @@ function Nt(e) {
5953
5959
  Object.entries(e).map(([t, o]) => [t, o.config])
5954
5960
  );
5955
5961
  }
5956
- function Ci(e) {
5962
+ function Bi(e) {
5957
5963
  return [
5958
5964
  {
5959
5965
  tag: `[data-inline-content-type="${e.type}"]`,
@@ -5964,7 +5970,7 @@ function Ci(e) {
5964
5970
  }
5965
5971
  ];
5966
5972
  }
5967
- function Za(e, t) {
5973
+ function Ja(e, t) {
5968
5974
  const o = q.create({
5969
5975
  name: e.type,
5970
5976
  inline: !0,
@@ -5973,17 +5979,17 @@ function Za(e, t) {
5973
5979
  atom: e.content === "none",
5974
5980
  content: e.content === "styled" ? "inline*" : "",
5975
5981
  addAttributes() {
5976
- return Lt(e.propSchema);
5982
+ return he(e.propSchema);
5977
5983
  },
5978
5984
  addKeyboardShortcuts() {
5979
- return wi(e);
5985
+ return Ci(e);
5980
5986
  },
5981
5987
  parseHTML() {
5982
- return Ci(e);
5988
+ return Bi(e);
5983
5989
  },
5984
5990
  renderHTML({ node: i }) {
5985
5991
  const n = this.options.editor, r = t.render(
5986
- je(
5992
+ De(
5987
5993
  i,
5988
5994
  n.schema.inlineContentSchema,
5989
5995
  n.schema.styleSchema
@@ -5993,7 +5999,7 @@ function Za(e, t) {
5993
5999
  },
5994
6000
  n
5995
6001
  );
5996
- return nt(
6002
+ return rt(
5997
6003
  r,
5998
6004
  e.type,
5999
6005
  i.attrs,
@@ -6003,7 +6009,7 @@ function Za(e, t) {
6003
6009
  addNodeView() {
6004
6010
  return ({ node: i, getPos: n }) => {
6005
6011
  const r = this.options.editor, a = t.render(
6006
- je(
6012
+ De(
6007
6013
  i,
6008
6014
  r.schema.inlineContentSchema,
6009
6015
  r.schema.styleSchema
@@ -6027,7 +6033,7 @@ function Za(e, t) {
6027
6033
  },
6028
6034
  r
6029
6035
  );
6030
- return nt(
6036
+ return rt(
6031
6037
  a,
6032
6038
  e.type,
6033
6039
  i.attrs,
@@ -6036,12 +6042,12 @@ function Za(e, t) {
6036
6042
  };
6037
6043
  }
6038
6044
  });
6039
- return xi(
6045
+ return Si(
6040
6046
  o,
6041
6047
  e.propSchema
6042
6048
  );
6043
6049
  }
6044
- function Ei(e) {
6050
+ function Ti(e) {
6045
6051
  return e === "boolean" ? {} : {
6046
6052
  stringValue: {
6047
6053
  default: void 0,
@@ -6053,7 +6059,7 @@ function Ei(e) {
6053
6059
  }
6054
6060
  };
6055
6061
  }
6056
- function Si(e, t, o, i) {
6062
+ function Mi(e, t, o, i) {
6057
6063
  return e.dom.setAttribute("data-style-type", t), i === "string" && e.dom.setAttribute("data-value", o), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
6058
6064
  }
6059
6065
  function jt(e, t) {
@@ -6078,7 +6084,7 @@ function Dt(e) {
6078
6084
  Object.entries(e).map(([t, o]) => [t, o.config])
6079
6085
  );
6080
6086
  }
6081
- function Bi(e) {
6087
+ function Li(e) {
6082
6088
  return [
6083
6089
  {
6084
6090
  tag: `[data-style-type="${e.type}"]`,
@@ -6089,14 +6095,14 @@ function Bi(e) {
6089
6095
  }
6090
6096
  ];
6091
6097
  }
6092
- function Ja(e, t) {
6093
- const o = ye.create({
6098
+ function Ya(e, t) {
6099
+ const o = we.create({
6094
6100
  name: e.type,
6095
6101
  addAttributes() {
6096
- return Ei(e.propSchema);
6102
+ return Ti(e.propSchema);
6097
6103
  },
6098
6104
  parseHTML() {
6099
- return Bi(e);
6105
+ return Li(e);
6100
6106
  },
6101
6107
  renderHTML({ mark: i }) {
6102
6108
  let n;
@@ -6106,7 +6112,7 @@ function Ja(e, t) {
6106
6112
  n = t.render(i.attrs.stringValue);
6107
6113
  else
6108
6114
  throw new D(e.propSchema);
6109
- return Si(
6115
+ return Mi(
6110
6116
  n,
6111
6117
  e.type,
6112
6118
  i.attrs.stringValue,
@@ -6118,7 +6124,7 @@ function Ja(e, t) {
6118
6124
  mark: o
6119
6125
  });
6120
6126
  }
6121
- const Ee = (e, t) => {
6127
+ const Se = (e, t) => {
6122
6128
  const o = e.querySelector(
6123
6129
  t
6124
6130
  );
@@ -6126,15 +6132,15 @@ const Ee = (e, t) => {
6126
6132
  return;
6127
6133
  const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
6128
6134
  return { targetElement: o, caption: n };
6129
- }, Ti = (e, t, o, i) => {
6135
+ }, Ii = (e, t, o, i) => {
6130
6136
  const n = document.createElement("div");
6131
6137
  n.className = "bn-add-file-button";
6132
6138
  const r = document.createElement("div");
6133
6139
  r.className = "bn-add-file-button-icon", i ? r.appendChild(i) : r.innerHTML = '<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>', n.appendChild(r);
6134
6140
  const a = document.createElement("p");
6135
6141
  a.className = "bn-add-file-button-text", a.innerHTML = o || t.dictionary.file_blocks.file.add_button_text, n.appendChild(a);
6136
- const s = (c) => {
6137
- c.preventDefault();
6142
+ const s = (d) => {
6143
+ d.preventDefault();
6138
6144
  }, l = () => {
6139
6145
  t.dispatch(
6140
6146
  t._tiptapEditor.state.tr.setMeta(t.filePanel.plugin, {
@@ -6160,30 +6166,30 @@ const Ee = (e, t) => {
6160
6166
  );
6161
6167
  }
6162
6168
  };
6163
- }, Mi = '<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>', Li = (e) => {
6169
+ }, Pi = '<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>', Ai = (e) => {
6164
6170
  const t = document.createElement("div");
6165
6171
  t.className = "bn-file-name-with-icon";
6166
6172
  const o = document.createElement("div");
6167
- o.className = "bn-file-icon", o.innerHTML = Mi, t.appendChild(o);
6173
+ o.className = "bn-file-icon", o.innerHTML = Pi, t.appendChild(o);
6168
6174
  const i = document.createElement("p");
6169
6175
  return i.className = "bn-file-name", i.textContent = e.props.name, t.appendChild(i), {
6170
6176
  dom: t
6171
6177
  };
6172
- }, ze = (e, t, o, i, n) => {
6178
+ }, Fe = (e, t, o, i, n) => {
6173
6179
  const r = document.createElement("div");
6174
6180
  if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
6175
- const s = Ti(
6181
+ const s = Ii(
6176
6182
  e,
6177
6183
  t,
6178
6184
  i,
6179
6185
  n
6180
6186
  );
6181
6187
  r.appendChild(s.dom);
6182
- const l = t.onUploadStart((c) => {
6183
- if (c === e.id) {
6188
+ const l = t.onUploadStart((d) => {
6189
+ if (d === e.id) {
6184
6190
  r.removeChild(s.dom);
6185
- const d = document.createElement("div");
6186
- d.className = "bn-file-loading-preview", d.textContent = "Loading...", r.appendChild(d);
6191
+ const c = document.createElement("div");
6192
+ c.className = "bn-file-loading-preview", c.textContent = "Loading...", r.appendChild(c);
6187
6193
  }
6188
6194
  });
6189
6195
  return {
@@ -6195,7 +6201,7 @@ const Ee = (e, t) => {
6195
6201
  }
6196
6202
  const a = { dom: r };
6197
6203
  if (e.props.showPreview === !1 || !o) {
6198
- const s = Li(e);
6204
+ const s = Ai(e);
6199
6205
  r.appendChild(s.dom), a.destroy = () => {
6200
6206
  var l;
6201
6207
  (l = s.destroy) == null || l.call(s);
@@ -6207,16 +6213,16 @@ const Ee = (e, t) => {
6207
6213
  s.className = "bn-file-caption", s.textContent = e.props.caption, r.appendChild(s);
6208
6214
  }
6209
6215
  return a;
6210
- }, Fe = (e, t) => {
6216
+ }, Ge = (e, t) => {
6211
6217
  const o = document.createElement("figure"), i = document.createElement("figcaption");
6212
6218
  return i.textContent = t, o.appendChild(e), o.appendChild(i), { dom: o };
6213
- }, Se = (e, t) => {
6219
+ }, Be = (e, t) => {
6214
6220
  const o = document.createElement("div"), i = document.createElement("p");
6215
6221
  return i.textContent = t, o.appendChild(e), o.appendChild(i), {
6216
6222
  dom: o
6217
6223
  };
6218
- }, rt = (e) => ({ url: e.src || void 0 }), Ii = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>', Pi = {
6219
- backgroundColor: v.backgroundColor,
6224
+ }, at = (e) => ({ url: e.src || void 0 }), Ni = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>', ji = {
6225
+ backgroundColor: x.backgroundColor,
6220
6226
  // File name.
6221
6227
  name: {
6222
6228
  default: ""
@@ -6232,39 +6238,39 @@ const Ee = (e, t) => {
6232
6238
  showPreview: {
6233
6239
  default: !0
6234
6240
  }
6235
- }, Ai = {
6241
+ }, Di = {
6236
6242
  type: "audio",
6237
- propSchema: Pi,
6243
+ propSchema: ji,
6238
6244
  content: "none",
6239
6245
  isFileBlock: !0,
6240
6246
  fileBlockAccept: ["audio/*"]
6241
- }, Ni = (e, t) => {
6247
+ }, Hi = (e, t) => {
6242
6248
  const o = document.createElement("div");
6243
- o.innerHTML = Ii;
6249
+ o.innerHTML = Ni;
6244
6250
  const i = document.createElement("audio");
6245
6251
  return i.className = "bn-audio", t.resolveFileUrl ? t.resolveFileUrl(e.props.url).then((n) => {
6246
6252
  i.src = n;
6247
- }) : i.src = e.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1, ze(
6253
+ }) : i.src = e.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1, Fe(
6248
6254
  e,
6249
6255
  t,
6250
6256
  { dom: i },
6251
6257
  t.dictionary.file_blocks.audio.add_button_text,
6252
6258
  o.firstElementChild
6253
6259
  );
6254
- }, ji = (e) => {
6260
+ }, Ui = (e) => {
6255
6261
  if (e.tagName === "AUDIO")
6256
- return rt(e);
6262
+ return at(e);
6257
6263
  if (e.tagName === "FIGURE") {
6258
- const t = Ee(e, "audio");
6264
+ const t = Se(e, "audio");
6259
6265
  if (!t)
6260
6266
  return;
6261
6267
  const { targetElement: o, caption: i } = t;
6262
6268
  return {
6263
- ...rt(o),
6269
+ ...at(o),
6264
6270
  caption: i
6265
6271
  };
6266
6272
  }
6267
- }, Di = (e) => {
6273
+ }, Oi = (e) => {
6268
6274
  if (!e.props.url) {
6269
6275
  const o = document.createElement("p");
6270
6276
  return o.textContent = "Add audio", {
@@ -6272,20 +6278,20 @@ const Ee = (e, t) => {
6272
6278
  };
6273
6279
  }
6274
6280
  let t;
6275
- return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Fe(t, e.props.caption) : Se(t, e.props.caption) : {
6281
+ return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Ge(t, e.props.caption) : Be(t, e.props.caption) : {
6276
6282
  dom: t
6277
6283
  };
6278
- }, Hi = xe(Ai, {
6279
- render: Ni,
6280
- parse: ji,
6281
- toExternalHTML: Di
6284
+ }, Ri = Ce(Di, {
6285
+ render: Hi,
6286
+ parse: Ui,
6287
+ toExternalHTML: Oi
6282
6288
  }), Ht = [
6283
6289
  {
6284
6290
  id: "text",
6285
6291
  name: "Plain Text",
6286
6292
  match: ["text", "txt", "plain"]
6287
6293
  },
6288
- ..._t.filter((e) => [
6294
+ ...yt.filter((e) => [
6289
6295
  "c",
6290
6296
  "cpp",
6291
6297
  "css",
@@ -6382,7 +6388,7 @@ const Ee = (e, t) => {
6382
6388
  name: "Objective C",
6383
6389
  match: ["objective-c", "objc"]
6384
6390
  }
6385
- ], De = {
6391
+ ], He = {
6386
6392
  language: {
6387
6393
  default: "javascript",
6388
6394
  values: [...Ht.map((e) => e.id)]
@@ -6414,7 +6420,7 @@ const Ee = (e, t) => {
6414
6420
  if (n)
6415
6421
  i = n.toLowerCase();
6416
6422
  else {
6417
- const s = [...(o == null ? void 0 : o.className.split(" ")) || []].filter((c) => c.startsWith("language-")).map((c) => c.replace("language-", "")), [l] = s;
6423
+ const s = [...(o == null ? void 0 : o.className.split(" ")) || []].filter((d) => d.startsWith("language-")).map((d) => d.replace("language-", "")), [l] = s;
6418
6424
  i = l.toLowerCase();
6419
6425
  }
6420
6426
  return i ? ((r = e.find(({ match: a }) => a.includes(i))) == null ? void 0 : r.id) || this.options.defaultLanguage : null;
@@ -6456,7 +6462,7 @@ const Ee = (e, t) => {
6456
6462
  const e = this.options.supportedLanguages;
6457
6463
  return ({ editor: t, node: o, getPos: i, HTMLAttributes: n }) => {
6458
6464
  var u, h;
6459
- const r = document.createElement("pre"), a = document.createElement("select"), s = document.createElement("div"), { dom: l, contentDOM: c } = R(
6465
+ const r = document.createElement("pre"), a = document.createElement("select"), s = document.createElement("div"), { dom: l, contentDOM: d } = R(
6460
6466
  this.name,
6461
6467
  "code",
6462
6468
  {
@@ -6464,19 +6470,19 @@ const Ee = (e, t) => {
6464
6470
  ...n
6465
6471
  },
6466
6472
  ((h = this.options.domAttributes) == null ? void 0 : h.inlineContent) || {}
6467
- ), d = (m) => {
6473
+ ), c = (m) => {
6468
6474
  const f = m.target.value;
6469
6475
  t.commands.command(({ tr: g }) => (g.setNodeAttribute(i(), "language", f), !0));
6470
6476
  };
6471
6477
  return e.forEach(({ id: m, name: f }) => {
6472
6478
  const g = document.createElement("option");
6473
6479
  g.value = m, g.text = f, a.appendChild(g);
6474
- }), s.contentEditable = "false", a.value = o.attrs.language || this.options.defaultLanguage, l.removeChild(c), l.appendChild(s), l.appendChild(r), r.appendChild(c), s.appendChild(a), a.addEventListener("change", d), {
6480
+ }), s.contentEditable = "false", a.value = o.attrs.language || this.options.defaultLanguage, l.removeChild(d), l.appendChild(s), l.appendChild(r), r.appendChild(d), s.appendChild(a), a.addEventListener("change", c), {
6475
6481
  dom: l,
6476
- contentDOM: c,
6482
+ contentDOM: d,
6477
6483
  update: (m) => m.type === this.type,
6478
6484
  destroy: () => {
6479
- a.removeEventListener("change", d);
6485
+ a.removeEventListener("change", c);
6480
6486
  }
6481
6487
  };
6482
6488
  };
@@ -6484,17 +6490,17 @@ const Ee = (e, t) => {
6484
6490
  addProseMirrorPlugins() {
6485
6491
  let e, t;
6486
6492
  const o = this.options.supportedLanguages;
6487
- return [Eo({
6493
+ return [To({
6488
6494
  parser: (r) => {
6489
6495
  if (!e)
6490
- return Bo({
6496
+ return Lo({
6491
6497
  themes: ["github-dark"],
6492
6498
  langs: []
6493
6499
  }).then((s) => {
6494
6500
  e = s;
6495
6501
  });
6496
6502
  const a = r.language;
6497
- return a && a !== "text" && !e.getLoadedLanguages().includes(a) && o.find(({ id: s }) => s === a) && _t.find(({ id: s }) => s === a) ? e.loadLanguage(a) : (t || (t = So(e)), t(r));
6503
+ return a && a !== "text" && !e.getLoadedLanguages().includes(a) && o.find(({ id: s }) => s === a) && yt.find(({ id: s }) => s === a) ? e.loadLanguage(a) : (t || (t = Mo(e)), t(r));
6498
6504
  },
6499
6505
  languageExtractor: (r) => r.attrs.language,
6500
6506
  nodeTypes: [this.name]
@@ -6503,7 +6509,7 @@ const Ee = (e, t) => {
6503
6509
  addInputRules() {
6504
6510
  const e = this.options.supportedLanguages;
6505
6511
  return [
6506
- new ee({
6512
+ new te({
6507
6513
  find: /^```(.*?)\s$/,
6508
6514
  handler: ({ state: t, range: o, match: i }) => {
6509
6515
  var s;
@@ -6525,7 +6531,7 @@ const Ee = (e, t) => {
6525
6531
  return {
6526
6532
  Delete: ({ editor: e }) => {
6527
6533
  const { selection: t } = e.state, { $from: o } = t;
6528
- if (e.isActive(this.name) && !o.parent.textContent && kt(t)) {
6534
+ if (e.isActive(this.name) && !o.parent.textContent && _t(t)) {
6529
6535
  const i = o.pos - o.parentOffset - 2;
6530
6536
  return e.chain().setNodeSelection(i).deleteSelection().run(), !0;
6531
6537
  }
@@ -6553,24 +6559,24 @@ const Ee = (e, t) => {
6553
6559
  }
6554
6560
  };
6555
6561
  }
6556
- }), Ui = W(
6562
+ }), Vi = W(
6557
6563
  Ut,
6558
- De
6564
+ He
6559
6565
  );
6560
- function Ya(e) {
6566
+ function Qa(e) {
6561
6567
  var t;
6562
6568
  return W(
6563
6569
  Ut.configure(e),
6564
6570
  {
6565
6571
  language: {
6566
- default: e.defaultLanguage || De.language.default,
6567
- values: ((t = e.supportedLanguages) == null ? void 0 : t.map((o) => o.id)) || De.language.values
6572
+ default: e.defaultLanguage || He.language.default,
6573
+ values: ((t = e.supportedLanguages) == null ? void 0 : t.map((o) => o.id)) || He.language.values
6568
6574
  }
6569
6575
  }
6570
6576
  );
6571
6577
  }
6572
- const at = (e) => ({ url: e.src || void 0 }), Oi = {
6573
- backgroundColor: v.backgroundColor,
6578
+ const st = (e) => ({ url: e.src || void 0 }), zi = {
6579
+ backgroundColor: x.backgroundColor,
6574
6580
  // File name.
6575
6581
  name: {
6576
6582
  default: ""
@@ -6583,25 +6589,25 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6583
6589
  caption: {
6584
6590
  default: ""
6585
6591
  }
6586
- }, Ri = {
6592
+ }, Fi = {
6587
6593
  type: "file",
6588
- propSchema: Oi,
6594
+ propSchema: zi,
6589
6595
  content: "none",
6590
6596
  isFileBlock: !0
6591
- }, Vi = (e, t) => ze(e, t), zi = (e) => {
6597
+ }, Gi = (e, t) => Fe(e, t), $i = (e) => {
6592
6598
  if (e.tagName === "EMBED")
6593
- return at(e);
6599
+ return st(e);
6594
6600
  if (e.tagName === "FIGURE") {
6595
- const t = Ee(e, "embed");
6601
+ const t = Se(e, "embed");
6596
6602
  if (!t)
6597
6603
  return;
6598
6604
  const { targetElement: o, caption: i } = t;
6599
6605
  return {
6600
- ...at(o),
6606
+ ...st(o),
6601
6607
  caption: i
6602
6608
  };
6603
6609
  }
6604
- }, Fi = (e) => {
6610
+ }, Wi = (e) => {
6605
6611
  if (!e.props.url) {
6606
6612
  const o = document.createElement("p");
6607
6613
  return o.textContent = "Add file", {
@@ -6609,15 +6615,15 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6609
6615
  };
6610
6616
  }
6611
6617
  const t = document.createElement("a");
6612
- return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? Se(t, e.props.caption) : {
6618
+ return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? Be(t, e.props.caption) : {
6613
6619
  dom: t
6614
6620
  };
6615
- }, Gi = xe(Ri, {
6616
- render: Vi,
6617
- parse: zi,
6618
- toExternalHTML: Fi
6621
+ }, Ki = Ce(Fi, {
6622
+ render: Gi,
6623
+ parse: $i,
6624
+ toExternalHTML: Wi
6619
6625
  }), Ot = (e, t, o, i, n, r) => {
6620
- const { dom: a, destroy: s } = ze(
6626
+ const { dom: a, destroy: s } = Fe(
6621
6627
  e,
6622
6628
  t,
6623
6629
  o,
@@ -6625,60 +6631,60 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6625
6631
  r
6626
6632
  ), l = a;
6627
6633
  e.props.url && e.props.showPreview && (l.style.width = `${e.props.previewWidth}px`);
6628
- const c = document.createElement("div");
6629
- c.className = "bn-resize-handle", c.style.left = "4px";
6630
6634
  const d = document.createElement("div");
6631
- d.className = "bn-resize-handle", d.style.right = "4px";
6635
+ d.className = "bn-resize-handle", d.style.left = "4px";
6636
+ const c = document.createElement("div");
6637
+ c.className = "bn-resize-handle", c.style.right = "4px";
6632
6638
  let u, h = e.props.previewWidth;
6633
- const m = (_) => {
6639
+ const m = (y) => {
6634
6640
  if (!u) {
6635
- !t.isEditable && i.contains(c) && i.contains(d) && (i.removeChild(c), i.removeChild(d));
6641
+ !t.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
6636
6642
  return;
6637
6643
  }
6638
6644
  let A;
6639
- e.props.textAlignment === "center" ? u.handleUsed === "left" ? A = u.initialWidth + (u.initialClientX - _.clientX) * 2 : A = u.initialWidth + (_.clientX - u.initialClientX) * 2 : u.handleUsed === "left" ? A = u.initialWidth + u.initialClientX - _.clientX : A = u.initialWidth + _.clientX - u.initialClientX, h = Math.max(A, 64), l.style.width = `${h}px`;
6640
- }, f = (_) => {
6641
- (!_.target || !l.contains(_.target) || !t.isEditable) && i.contains(c) && i.contains(d) && (i.removeChild(c), i.removeChild(d)), u && (u = void 0, t.updateBlock(e, {
6645
+ e.props.textAlignment === "center" ? u.handleUsed === "left" ? A = u.initialWidth + (u.initialClientX - y.clientX) * 2 : A = u.initialWidth + (y.clientX - u.initialClientX) * 2 : u.handleUsed === "left" ? A = u.initialWidth + u.initialClientX - y.clientX : A = u.initialWidth + y.clientX - u.initialClientX, h = Math.max(A, 64), l.style.width = `${h}px`;
6646
+ }, f = (y) => {
6647
+ (!y.target || !l.contains(y.target) || !t.isEditable) && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c)), u && (u = void 0, t.updateBlock(e, {
6642
6648
  props: {
6643
6649
  previewWidth: h
6644
6650
  }
6645
6651
  }));
6646
6652
  }, g = () => {
6647
- t.isEditable && (i.appendChild(c), i.appendChild(d));
6648
- }, b = (_) => {
6649
- _.relatedTarget === c || _.relatedTarget === d || u || t.isEditable && i.contains(c) && i.contains(d) && (i.removeChild(c), i.removeChild(d));
6650
- }, k = (_) => {
6651
- _.preventDefault(), u = {
6653
+ t.isEditable && (i.appendChild(d), i.appendChild(c));
6654
+ }, b = (y) => {
6655
+ y.relatedTarget === d || y.relatedTarget === c || u || t.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
6656
+ }, k = (y) => {
6657
+ y.preventDefault(), u = {
6652
6658
  handleUsed: "left",
6653
6659
  initialWidth: l.clientWidth,
6654
- initialClientX: _.clientX
6660
+ initialClientX: y.clientX
6655
6661
  };
6656
- }, C = (_) => {
6657
- _.preventDefault(), u = {
6662
+ }, C = (y) => {
6663
+ y.preventDefault(), u = {
6658
6664
  handleUsed: "right",
6659
6665
  initialWidth: l.clientWidth,
6660
- initialClientX: _.clientX
6666
+ initialClientX: y.clientX
6661
6667
  };
6662
6668
  };
6663
- return window.addEventListener("mousemove", m), window.addEventListener("mouseup", f), l.addEventListener("mouseenter", g), l.addEventListener("mouseleave", b), c.addEventListener(
6669
+ return window.addEventListener("mousemove", m), window.addEventListener("mouseup", f), l.addEventListener("mouseenter", g), l.addEventListener("mouseleave", b), d.addEventListener(
6664
6670
  "mousedown",
6665
6671
  k
6666
- ), d.addEventListener(
6672
+ ), c.addEventListener(
6667
6673
  "mousedown",
6668
6674
  C
6669
6675
  ), {
6670
6676
  dom: l,
6671
6677
  destroy: () => {
6672
- s == null || s(), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", f), l.removeEventListener("mouseenter", g), l.removeEventListener("mouseleave", b), c.removeEventListener(
6678
+ s == null || s(), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", f), l.removeEventListener("mouseenter", g), l.removeEventListener("mouseleave", b), d.removeEventListener(
6673
6679
  "mousedown",
6674
6680
  k
6675
- ), d.removeEventListener(
6681
+ ), c.removeEventListener(
6676
6682
  "mousedown",
6677
6683
  C
6678
6684
  );
6679
6685
  }
6680
6686
  };
6681
- }, Qa = async (e) => {
6687
+ }, es = async (e) => {
6682
6688
  const t = new FormData();
6683
6689
  return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
6684
6690
  method: "POST",
@@ -6687,12 +6693,12 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6687
6693
  "tmpfiles.org/",
6688
6694
  "tmpfiles.org/dl/"
6689
6695
  );
6690
- }, st = (e) => {
6696
+ }, lt = (e) => {
6691
6697
  const t = e.src || void 0, o = e.width || void 0;
6692
6698
  return { url: t, previewWidth: o };
6693
- }, $i = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>', Wi = {
6694
- textAlignment: v.textAlignment,
6695
- backgroundColor: v.backgroundColor,
6699
+ }, qi = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>', Xi = {
6700
+ textAlignment: x.textAlignment,
6701
+ backgroundColor: x.backgroundColor,
6696
6702
  // File name.
6697
6703
  name: {
6698
6704
  default: ""
@@ -6712,15 +6718,15 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6712
6718
  previewWidth: {
6713
6719
  default: 512
6714
6720
  }
6715
- }, Ki = {
6721
+ }, Zi = {
6716
6722
  type: "image",
6717
- propSchema: Wi,
6723
+ propSchema: Xi,
6718
6724
  content: "none",
6719
6725
  isFileBlock: !0,
6720
6726
  fileBlockAccept: ["image/*"]
6721
- }, qi = (e, t) => {
6727
+ }, Ji = (e, t) => {
6722
6728
  const o = document.createElement("div");
6723
- o.innerHTML = $i;
6729
+ o.innerHTML = qi;
6724
6730
  const i = document.createElement("div");
6725
6731
  i.className = "bn-visual-media-wrapper";
6726
6732
  const n = document.createElement("img");
@@ -6734,20 +6740,20 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6734
6740
  t.dictionary.file_blocks.image.add_button_text,
6735
6741
  o.firstElementChild
6736
6742
  );
6737
- }, Xi = (e) => {
6743
+ }, Yi = (e) => {
6738
6744
  if (e.tagName === "IMG")
6739
- return st(e);
6745
+ return lt(e);
6740
6746
  if (e.tagName === "FIGURE") {
6741
- const t = Ee(e, "img");
6747
+ const t = Se(e, "img");
6742
6748
  if (!t)
6743
6749
  return;
6744
6750
  const { targetElement: o, caption: i } = t;
6745
6751
  return {
6746
- ...st(o),
6752
+ ...lt(o),
6747
6753
  caption: i
6748
6754
  };
6749
6755
  }
6750
- }, Zi = (e) => {
6756
+ }, Qi = (e) => {
6751
6757
  if (!e.props.url) {
6752
6758
  const o = document.createElement("p");
6753
6759
  return o.textContent = "Add image", {
@@ -6755,25 +6761,25 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6755
6761
  };
6756
6762
  }
6757
6763
  let t;
6758
- return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Fe(t, e.props.caption) : Se(t, e.props.caption) : {
6764
+ return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Ge(t, e.props.caption) : Be(t, e.props.caption) : {
6759
6765
  dom: t
6760
6766
  };
6761
- }, Ji = xe(Ki, {
6762
- render: qi,
6763
- parse: Xi,
6764
- toExternalHTML: Zi
6765
- }), Yi = 35, Rt = 120, es = 31, Qi = I.create({
6767
+ }, en = Ce(Zi, {
6768
+ render: Ji,
6769
+ parse: Yi,
6770
+ toExternalHTML: Qi
6771
+ }), tn = 35, Rt = 120, ts = 31, on = I.create({
6766
6772
  name: "BlockNoteTableExtension",
6767
6773
  addProseMirrorPlugins: () => [
6768
- To({
6769
- cellMinWidth: Yi,
6774
+ Io({
6775
+ cellMinWidth: tn,
6770
6776
  defaultCellMinWidth: Rt,
6771
6777
  // We set this to null as we implement our own node view in the table
6772
6778
  // block content. This node view is the same as what's used by default,
6773
6779
  // but is wrapped in a `blockContent` HTML element.
6774
6780
  View: null
6775
6781
  }),
6776
- Mo()
6782
+ Po()
6777
6783
  ],
6778
6784
  addKeyboardShortcuts() {
6779
6785
  return {
@@ -6787,10 +6793,10 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6787
6793
  },
6788
6794
  // Enables navigating cells using the tab key.
6789
6795
  Tab: () => this.editor.commands.command(
6790
- ({ state: e, dispatch: t, view: o }) => Qe(1)(e, t, o)
6796
+ ({ state: e, dispatch: t, view: o }) => et(1)(e, t, o)
6791
6797
  ),
6792
6798
  "Shift-Tab": () => this.editor.commands.command(
6793
- ({ state: e, dispatch: t, view: o }) => Qe(-1)(e, t, o)
6799
+ ({ state: e, dispatch: t, view: o }) => et(-1)(e, t, o)
6794
6800
  )
6795
6801
  };
6796
6802
  },
@@ -6801,17 +6807,17 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6801
6807
  storage: e.storage
6802
6808
  };
6803
6809
  return {
6804
- tableRole: go(
6805
- bo(e, "tableRole", t)
6810
+ tableRole: _o(
6811
+ yo(e, "tableRole", t)
6806
6812
  )
6807
6813
  };
6808
6814
  }
6809
- }), lt = (e) => {
6815
+ }), dt = (e) => {
6810
6816
  const t = e.src || void 0, o = e.width || void 0;
6811
6817
  return { url: t, previewWidth: o };
6812
- }, en = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>', tn = {
6813
- textAlignment: v.textAlignment,
6814
- backgroundColor: v.backgroundColor,
6818
+ }, nn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>', rn = {
6819
+ textAlignment: x.textAlignment,
6820
+ backgroundColor: x.backgroundColor,
6815
6821
  // File name.
6816
6822
  name: {
6817
6823
  default: ""
@@ -6831,15 +6837,15 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6831
6837
  previewWidth: {
6832
6838
  default: 512
6833
6839
  }
6834
- }, on = {
6840
+ }, an = {
6835
6841
  type: "video",
6836
- propSchema: tn,
6842
+ propSchema: rn,
6837
6843
  content: "none",
6838
6844
  isFileBlock: !0,
6839
6845
  fileBlockAccept: ["video/*"]
6840
- }, nn = (e, t) => {
6846
+ }, sn = (e, t) => {
6841
6847
  const o = document.createElement("div");
6842
- o.innerHTML = en;
6848
+ o.innerHTML = nn;
6843
6849
  const i = document.createElement("div");
6844
6850
  i.className = "bn-visual-media-wrapper";
6845
6851
  const n = document.createElement("video");
@@ -6853,20 +6859,20 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6853
6859
  t.dictionary.file_blocks.video.add_button_text,
6854
6860
  o.firstElementChild
6855
6861
  );
6856
- }, rn = (e) => {
6862
+ }, ln = (e) => {
6857
6863
  if (e.tagName === "VIDEO")
6858
- return lt(e);
6864
+ return dt(e);
6859
6865
  if (e.tagName === "FIGURE") {
6860
- const t = Ee(e, "video");
6866
+ const t = Se(e, "video");
6861
6867
  if (!t)
6862
6868
  return;
6863
6869
  const { targetElement: o, caption: i } = t;
6864
6870
  return {
6865
- ...lt(o),
6871
+ ...dt(o),
6866
6872
  caption: i
6867
6873
  };
6868
6874
  }
6869
- }, an = (e) => {
6875
+ }, dn = (e) => {
6870
6876
  if (!e.props.url) {
6871
6877
  const o = document.createElement("p");
6872
6878
  return o.textContent = "Add video", {
@@ -6874,14 +6880,14 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6874
6880
  };
6875
6881
  }
6876
6882
  let t;
6877
- return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Fe(t, e.props.caption) : Se(t, e.props.caption) : {
6883
+ return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Ge(t, e.props.caption) : Be(t, e.props.caption) : {
6878
6884
  dom: t
6879
6885
  };
6880
- }, sn = xe(on, {
6881
- render: nn,
6882
- parse: rn,
6883
- toExternalHTML: an
6884
- }), ln = ye.create({
6886
+ }, cn = Ce(an, {
6887
+ render: sn,
6888
+ parse: ln,
6889
+ toExternalHTML: dn
6890
+ }), un = we.create({
6885
6891
  name: "backgroundColor",
6886
6892
  addAttributes() {
6887
6893
  return {
@@ -6907,10 +6913,10 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6907
6913
  renderHTML({ HTMLAttributes: e }) {
6908
6914
  return ["span", e, 0];
6909
6915
  }
6910
- }), dn = K(
6911
- ln,
6916
+ }), pn = K(
6917
+ un,
6912
6918
  "string"
6913
- ), cn = ye.create({
6919
+ ), hn = we.create({
6914
6920
  name: "textColor",
6915
6921
  addAttributes() {
6916
6922
  return {
@@ -6934,7 +6940,7 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6934
6940
  renderHTML({ HTMLAttributes: e }) {
6935
6941
  return ["span", e, 0];
6936
6942
  }
6937
- }), un = K(cn, "string"), S = (e, t, o) => ({
6943
+ }), mn = K(hn, "string"), S = (e, t, o) => ({
6938
6944
  state: i,
6939
6945
  dispatch: n
6940
6946
  }) => {
@@ -6944,7 +6950,7 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6944
6950
  if (n) {
6945
6951
  const a = i.schema.nodes[r.blockNoteType], s = i.schema.nodes[o.type || r.blockNoteType], l = s.isInGroup("bnBlock") ? s : i.schema.nodes.blockContainer;
6946
6952
  if (r.isBlockContainer && s.isInGroup("blockContent"))
6947
- dt(o, i, e, r), pn(
6953
+ ct(o, i, e, r), fn(
6948
6954
  o,
6949
6955
  i,
6950
6956
  e,
@@ -6953,9 +6959,9 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6953
6959
  r
6954
6960
  );
6955
6961
  else if (!r.isBlockContainer && s.isInGroup("bnBlock"))
6956
- dt(o, i, e, r);
6962
+ ct(o, i, e, r);
6957
6963
  else {
6958
- const c = w(
6964
+ const d = w(
6959
6965
  r.bnBlock.node,
6960
6966
  e.schema.blockSchema,
6961
6967
  e.schema.inlineContentSchema,
@@ -6967,7 +6973,7 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6967
6973
  r.bnBlock.afterPos,
6968
6974
  X(
6969
6975
  {
6970
- children: c.children,
6976
+ children: d.children,
6971
6977
  // if no children are passed in, use existing children
6972
6978
  ...o
6973
6979
  },
@@ -6983,7 +6989,7 @@ const at = (e) => ({ url: e.src || void 0 }), Oi = {
6983
6989
  }
6984
6990
  return !0;
6985
6991
  };
6986
- function pn(e, t, o, i, n, r) {
6992
+ function fn(e, t, o, i, n, r) {
6987
6993
  let a = "keep";
6988
6994
  if (e.content)
6989
6995
  if (typeof e.content == "string")
@@ -6999,7 +7005,7 @@ function pn(e, t, o, i, n, r) {
6999
7005
  o.schema.styleSchema
7000
7006
  );
7001
7007
  else if (e.content.type === "tableContent")
7002
- a = we(
7008
+ a = ve(
7003
7009
  e.content,
7004
7010
  t.schema,
7005
7011
  o.schema.styleSchema
@@ -7027,15 +7033,15 @@ function pn(e, t, o, i, n, r) {
7027
7033
  )
7028
7034
  );
7029
7035
  }
7030
- function dt(e, t, o, i) {
7036
+ function ct(e, t, o, i) {
7031
7037
  if (e.children !== void 0) {
7032
7038
  const n = e.children.map((r) => X(r, t.schema, o.schema.styleSchema));
7033
7039
  if (i.childContainer)
7034
7040
  t.tr.step(
7035
- new Do(
7041
+ new Oo(
7036
7042
  i.childContainer.beforePos + 1,
7037
7043
  i.childContainer.afterPos - 1,
7038
- new de(j.from(n), 0, 0)
7044
+ new ee(j.from(n), 0, 0)
7039
7045
  )
7040
7046
  );
7041
7047
  else {
@@ -7048,7 +7054,7 @@ function dt(e, t, o, i) {
7048
7054
  }
7049
7055
  }
7050
7056
  }
7051
- function hn(e, t, o) {
7057
+ function gn(e, t, o) {
7052
7058
  const i = e._tiptapEditor, n = typeof t == "string" ? t : t.id, r = P(n, i.state.doc);
7053
7059
  if (!r)
7054
7060
  throw new Error(`Block with ID ${n} not found`);
@@ -7066,35 +7072,22 @@ function hn(e, t, o) {
7066
7072
  e.blockCache
7067
7073
  );
7068
7074
  }
7069
- const mn = {
7070
- ...v,
7075
+ const Vt = {
7076
+ ...x,
7071
7077
  level: { default: 1, values: [1, 2, 3] }
7072
- }, fn = $({
7078
+ }, bn = $({
7073
7079
  name: "heading",
7074
7080
  content: "inline*",
7075
7081
  group: "blockContent",
7076
7082
  addAttributes() {
7077
- return {
7078
- level: {
7079
- default: 1,
7080
- // instead of "level" attributes, use "data-level"
7081
- parseHTML: (e) => {
7082
- const t = e.getAttribute("data-level"), o = parseInt(t);
7083
- if (isFinite(o))
7084
- return o;
7085
- },
7086
- renderHTML: (e) => ({
7087
- "data-level": e.level.toString()
7088
- })
7089
- }
7090
- };
7083
+ return he(Vt);
7091
7084
  },
7092
7085
  addInputRules() {
7093
7086
  return [
7094
- ...[1, 2, 3].map((e) => new ee({
7087
+ ...[1, 2, 3].map((e) => new te({
7095
7088
  find: new RegExp(`^(#{${e}})\\s$`),
7096
7089
  handler: ({ state: t, chain: o, range: i }) => {
7097
- const n = y(t);
7090
+ const n = _(t);
7098
7091
  !n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || o().command(
7099
7092
  S(
7100
7093
  this.options.editor,
@@ -7114,7 +7107,7 @@ const mn = {
7114
7107
  addKeyboardShortcuts() {
7115
7108
  return {
7116
7109
  "Mod-Alt-1": () => {
7117
- const e = y(this.editor.state);
7110
+ const e = _(this.editor.state);
7118
7111
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7119
7112
  S(this.options.editor, e.bnBlock.beforePos, {
7120
7113
  type: "heading",
@@ -7125,7 +7118,7 @@ const mn = {
7125
7118
  );
7126
7119
  },
7127
7120
  "Mod-Alt-2": () => {
7128
- const e = y(this.editor.state);
7121
+ const e = _(this.editor.state);
7129
7122
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7130
7123
  S(this.options.editor, e.bnBlock.beforePos, {
7131
7124
  type: "heading",
@@ -7136,7 +7129,7 @@ const mn = {
7136
7129
  );
7137
7130
  },
7138
7131
  "Mod-Alt-3": () => {
7139
- const e = y(this.editor.state);
7132
+ const e = _(this.editor.state);
7140
7133
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7141
7134
  S(this.options.editor, e.bnBlock.beforePos, {
7142
7135
  type: "heading",
@@ -7185,10 +7178,10 @@ const mn = {
7185
7178
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
7186
7179
  );
7187
7180
  }
7188
- }), gn = W(
7189
- fn,
7190
- mn
7191
- ), Vt = (e, t, o) => ({
7181
+ }), kn = W(
7182
+ bn,
7183
+ Vt
7184
+ ), zt = (e, t, o) => ({
7192
7185
  state: i,
7193
7186
  dispatch: n
7194
7187
  }) => {
@@ -7209,8 +7202,8 @@ const mn = {
7209
7202
  }
7210
7203
  ];
7211
7204
  return n && i.tr.split(e, 2, s), !0;
7212
- }, Ge = (e) => {
7213
- const t = e._tiptapEditor, o = y(t.state);
7205
+ }, $e = (e) => {
7206
+ const t = e._tiptapEditor, o = _(t.state);
7214
7207
  if (!o.isBlockContainer)
7215
7208
  return !1;
7216
7209
  const { bnBlock: i, blockContent: n } = o, r = t.state.selection.anchor === t.state.selection.head;
@@ -7227,12 +7220,12 @@ const mn = {
7227
7220
  () => (
7228
7221
  // Splits the current block, moving content inside that's after the cursor
7229
7222
  // to a new block of the same type below.
7230
- l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command(Vt(a.selection.from, !0)).run(), !0) : !1)
7223
+ l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command(zt(a.selection.from, !0)).run(), !0) : !1)
7231
7224
  )
7232
7225
  ]);
7233
- }, bn = {
7234
- ...v
7235
- }, kn = $({
7226
+ }, _n = {
7227
+ ...x
7228
+ }, yn = $({
7236
7229
  name: "bulletListItem",
7237
7230
  content: "inline*",
7238
7231
  group: "blockContent",
@@ -7242,10 +7235,10 @@ const mn = {
7242
7235
  addInputRules() {
7243
7236
  return [
7244
7237
  // Creates an unordered list when starting with "-", "+", or "*".
7245
- new ee({
7238
+ new te({
7246
7239
  find: new RegExp("^[-+*]\\s$"),
7247
7240
  handler: ({ state: e, chain: t, range: o }) => {
7248
- const i = y(e);
7241
+ const i = _(e);
7249
7242
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || t().command(
7250
7243
  S(
7251
7244
  this.options.editor,
@@ -7262,9 +7255,9 @@ const mn = {
7262
7255
  },
7263
7256
  addKeyboardShortcuts() {
7264
7257
  return {
7265
- Enter: () => Ge(this.options.editor),
7258
+ Enter: () => $e(this.options.editor),
7266
7259
  "Mod-Shift-8": () => {
7267
- const e = y(this.editor.state);
7260
+ const e = _(this.editor.state);
7268
7261
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7269
7262
  S(this.options.editor, e.bnBlock.beforePos, {
7270
7263
  type: "bulletListItem",
@@ -7320,37 +7313,28 @@ const mn = {
7320
7313
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
7321
7314
  );
7322
7315
  }
7323
- }), _n = W(
7324
- kn,
7325
- bn
7326
- ), yn = {
7327
- ...v,
7316
+ }), wn = W(
7317
+ yn,
7318
+ _n
7319
+ ), Ft = {
7320
+ ...x,
7328
7321
  checked: {
7329
7322
  default: !1
7330
7323
  }
7331
- }, wn = $({
7324
+ }, vn = $({
7332
7325
  name: "checkListItem",
7333
7326
  content: "inline*",
7334
7327
  group: "blockContent",
7335
7328
  addAttributes() {
7336
- return {
7337
- checked: {
7338
- default: !1,
7339
- // instead of "checked" attributes, use "data-checked"
7340
- parseHTML: (e) => e.getAttribute("data-checked") === "true" || void 0,
7341
- renderHTML: (e) => e.checked ? {
7342
- "data-checked": e.checked.toString()
7343
- } : {}
7344
- }
7345
- };
7329
+ return he(Ft);
7346
7330
  },
7347
7331
  addInputRules() {
7348
7332
  return [
7349
7333
  // Creates a checklist when starting with "[]" or "[X]".
7350
- new ee({
7334
+ new te({
7351
7335
  find: new RegExp("\\[\\s*\\]\\s$"),
7352
7336
  handler: ({ state: e, chain: t, range: o }) => {
7353
- const i = y(e);
7337
+ const i = _(e);
7354
7338
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || t().command(
7355
7339
  S(
7356
7340
  this.options.editor,
@@ -7365,10 +7349,10 @@ const mn = {
7365
7349
  ).deleteRange({ from: o.from, to: o.to });
7366
7350
  }
7367
7351
  }),
7368
- new ee({
7352
+ new te({
7369
7353
  find: new RegExp("\\[[Xx]\\]\\s$"),
7370
7354
  handler: ({ state: e, chain: t, range: o }) => {
7371
- const i = y(e);
7355
+ const i = _(e);
7372
7356
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || t().command(
7373
7357
  S(
7374
7358
  this.options.editor,
@@ -7387,9 +7371,9 @@ const mn = {
7387
7371
  },
7388
7372
  addKeyboardShortcuts() {
7389
7373
  return {
7390
- Enter: () => Ge(this.options.editor),
7374
+ Enter: () => $e(this.options.editor),
7391
7375
  "Mod-Shift-9": () => {
7392
- const e = y(this.editor.state);
7376
+ const e = _(this.editor.state);
7393
7377
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7394
7378
  S(this.options.editor, e.bnBlock.beforePos, {
7395
7379
  type: "checkListItem",
@@ -7456,7 +7440,7 @@ const mn = {
7456
7440
  // node. This is only possible with a node view as it exposes `getPos`.
7457
7441
  addNodeView() {
7458
7442
  return ({ node: e, getPos: t, editor: o, HTMLAttributes: i }) => {
7459
- var d, u;
7443
+ var c, u;
7460
7444
  const n = document.createElement("div"), r = document.createElement("div");
7461
7445
  r.contentEditable = "false";
7462
7446
  const a = document.createElement("input");
@@ -7490,71 +7474,80 @@ const mn = {
7490
7474
  }
7491
7475
  };
7492
7476
  a.addEventListener("change", s);
7493
- const { dom: l, contentDOM: c } = R(
7477
+ const { dom: l, contentDOM: d } = R(
7494
7478
  this.name,
7495
7479
  "p",
7496
7480
  {
7497
- ...((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {},
7481
+ ...((c = this.options.domAttributes) == null ? void 0 : c.blockContent) || {},
7498
7482
  ...i
7499
7483
  },
7500
7484
  ((u = this.options.domAttributes) == null ? void 0 : u.inlineContent) || {}
7501
7485
  );
7502
7486
  if (typeof t != "boolean") {
7503
7487
  const m = "label-" + this.editor.state.doc.resolve(t()).node().attrs.id;
7504
- a.setAttribute("aria-labelledby", m), c.id = m;
7488
+ a.setAttribute("aria-labelledby", m), d.id = m;
7505
7489
  }
7506
- return l.removeChild(c), l.appendChild(n), n.appendChild(r), n.appendChild(c), r.appendChild(a), {
7490
+ return l.removeChild(d), l.appendChild(n), n.appendChild(r), n.appendChild(d), r.appendChild(a), {
7507
7491
  dom: l,
7508
- contentDOM: c,
7492
+ contentDOM: d,
7509
7493
  destroy: () => {
7510
7494
  a.removeEventListener("change", s);
7511
7495
  }
7512
7496
  };
7513
7497
  };
7514
7498
  }
7515
- }), vn = W(
7516
- wn,
7517
- yn
7518
- ), xn = new N("numbered-list-indexing"), Cn = () => new B({
7519
- key: xn,
7499
+ }), xn = W(
7500
+ vn,
7501
+ Ft
7502
+ ), Cn = new N("numbered-list-indexing"), En = () => new B({
7503
+ key: Cn,
7520
7504
  appendTransaction: (e, t, o) => {
7521
7505
  const i = o.tr;
7522
7506
  i.setMeta("numberedListIndexing", !0);
7523
7507
  let n = !1;
7524
7508
  return o.doc.descendants((r, a) => {
7509
+ var s;
7525
7510
  if (r.type.name === "blockContainer" && r.firstChild.type.name === "numberedListItem") {
7526
- let s = "1";
7527
- const l = F({
7511
+ let l = `${r.firstChild.attrs.start || 1}`;
7512
+ const d = F({
7528
7513
  posBeforeNode: a,
7529
7514
  node: r
7530
7515
  });
7531
- if (!l.isBlockContainer)
7516
+ if (!d.isBlockContainer)
7532
7517
  throw new Error("impossible");
7533
7518
  const c = i.doc.resolve(
7534
- l.bnBlock.beforePos
7519
+ d.bnBlock.beforePos
7535
7520
  ).nodeBefore;
7536
7521
  if (c) {
7537
- const h = F({
7538
- posBeforeNode: l.bnBlock.beforePos - c.nodeSize,
7522
+ const f = F({
7523
+ posBeforeNode: d.bnBlock.beforePos - c.nodeSize,
7539
7524
  node: c
7540
7525
  });
7541
- if (h.blockNoteType === "numberedListItem") {
7542
- if (!h.isBlockContainer)
7526
+ if (f.blockNoteType === "numberedListItem") {
7527
+ if (!f.isBlockContainer)
7543
7528
  throw new Error("impossible");
7544
- const f = h.blockContent.node.attrs.index;
7545
- s = (parseInt(f) + 1).toString();
7529
+ const b = f.blockContent.node.attrs.index;
7530
+ l = (parseInt(b) + 1).toString();
7546
7531
  }
7547
7532
  }
7548
- const d = l.blockContent.node;
7549
- d.attrs.index !== s && (n = !0, i.setNodeMarkup(l.blockContent.beforePos, void 0, {
7550
- ...d.attrs,
7551
- index: s
7552
- }));
7533
+ const u = d.blockContent.node, h = u.attrs.index, m = ((s = c == null ? void 0 : c.firstChild) == null ? void 0 : s.type.name) !== "numberedListItem";
7534
+ if (h !== l || u.attrs.start && !m) {
7535
+ n = !0;
7536
+ const { start: f, ...g } = u.attrs;
7537
+ i.setNodeMarkup(d.blockContent.beforePos, void 0, {
7538
+ ...g,
7539
+ index: l,
7540
+ ...typeof f == "number" && m && {
7541
+ start: f
7542
+ }
7543
+ });
7544
+ }
7553
7545
  }
7554
7546
  }), n ? i : null;
7555
7547
  }
7556
- }), En = {
7557
- ...v
7548
+ }), Gt = {
7549
+ ...x,
7550
+ start: { default: void 0, type: "number" }
7558
7551
  }, Sn = $({
7559
7552
  name: "numberedListItem",
7560
7553
  content: "inline*",
@@ -7562,6 +7555,9 @@ const mn = {
7562
7555
  priority: 90,
7563
7556
  addAttributes() {
7564
7557
  return {
7558
+ ...he(Gt),
7559
+ // the index attribute is only used internally (it's not part of the blocknote schema)
7560
+ // that's why it's defined explicitly here, and not part of the prop schema
7565
7561
  index: {
7566
7562
  default: null,
7567
7563
  parseHTML: (e) => e.getAttribute("data-index"),
@@ -7574,17 +7570,22 @@ const mn = {
7574
7570
  addInputRules() {
7575
7571
  return [
7576
7572
  // Creates an ordered list when starting with "1.".
7577
- new ee({
7578
- find: new RegExp("^1\\.\\s$"),
7579
- handler: ({ state: e, chain: t, range: o }) => {
7580
- const i = y(e);
7581
- !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || t().command(
7573
+ new te({
7574
+ find: new RegExp("^(\\d+)\\.\\s$"),
7575
+ handler: ({ state: e, chain: t, range: o, match: i }) => {
7576
+ const n = _(e);
7577
+ if (!n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || n.blockNoteType === "numberedListItem")
7578
+ return;
7579
+ const r = parseInt(i[1]);
7580
+ t().command(
7582
7581
  S(
7583
7582
  this.options.editor,
7584
- i.bnBlock.beforePos,
7583
+ n.bnBlock.beforePos,
7585
7584
  {
7586
7585
  type: "numberedListItem",
7587
- props: {}
7586
+ props: r === 1 && {} || {
7587
+ start: r
7588
+ }
7588
7589
  }
7589
7590
  )
7590
7591
  ).deleteRange({ from: o.from, to: o.to });
@@ -7594,9 +7595,9 @@ const mn = {
7594
7595
  },
7595
7596
  addKeyboardShortcuts() {
7596
7597
  return {
7597
- Enter: () => Ge(this.options.editor),
7598
+ Enter: () => $e(this.options.editor),
7598
7599
  "Mod-Shift-7": () => {
7599
- const e = y(this.editor.state);
7600
+ const e = _(this.editor.state);
7600
7601
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7601
7602
  S(this.options.editor, e.bnBlock.beforePos, {
7602
7603
  type: "numberedListItem",
@@ -7607,7 +7608,7 @@ const mn = {
7607
7608
  };
7608
7609
  },
7609
7610
  addProseMirrorPlugins() {
7610
- return [Cn()];
7611
+ return [En()];
7611
7612
  },
7612
7613
  parseHTML() {
7613
7614
  return [
@@ -7623,7 +7624,15 @@ const mn = {
7623
7624
  if (typeof e == "string")
7624
7625
  return !1;
7625
7626
  const t = e.parentElement;
7626
- return t === null ? !1 : t.tagName === "OL" || t.tagName === "DIV" && t.parentElement.tagName === "OL" ? {} : !1;
7627
+ if (t === null)
7628
+ return !1;
7629
+ if (t.tagName === "OL" || t.tagName === "DIV" && t.parentElement.tagName === "OL") {
7630
+ const o = parseInt(t.getAttribute("start") || "1") || 1;
7631
+ return e.previousSibling || o === 1 ? {} : {
7632
+ start: o
7633
+ };
7634
+ }
7635
+ return !1;
7627
7636
  },
7628
7637
  node: "numberedListItem"
7629
7638
  },
@@ -7659,9 +7668,9 @@ const mn = {
7659
7668
  }
7660
7669
  }), Bn = W(
7661
7670
  Sn,
7662
- En
7671
+ Gt
7663
7672
  ), Tn = {
7664
- ...v
7673
+ ...x
7665
7674
  }, Mn = $({
7666
7675
  name: "paragraph",
7667
7676
  content: "inline*",
@@ -7669,7 +7678,7 @@ const mn = {
7669
7678
  addKeyboardShortcuts() {
7670
7679
  return {
7671
7680
  "Mod-Alt-0": () => {
7672
- const e = y(this.editor.state);
7681
+ const e = _(this.editor.state);
7673
7682
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
7674
7683
  S(this.options.editor, e.bnBlock.beforePos, {
7675
7684
  type: "paragraph",
@@ -7709,7 +7718,7 @@ const mn = {
7709
7718
  Mn,
7710
7719
  Tn
7711
7720
  ), In = {
7712
- textColor: v.textColor
7721
+ textColor: x.textColor
7713
7722
  }, Pn = $({
7714
7723
  name: "table",
7715
7724
  content: "tableRow+",
@@ -7741,7 +7750,7 @@ const mn = {
7741
7750
  addNodeView() {
7742
7751
  return ({ node: e, HTMLAttributes: t }) => {
7743
7752
  var i;
7744
- class o extends Lo {
7753
+ class o extends Ao {
7745
7754
  constructor(r, a, s) {
7746
7755
  super(r, a), this.node = r, this.cellMinWidth = a, this.blockContentHTMLAttributes = s;
7747
7756
  const l = document.createElement("div");
@@ -7753,10 +7762,10 @@ const mn = {
7753
7762
  s
7754
7763
  ))
7755
7764
  h !== "class" && l.setAttribute(h, m);
7756
- const c = this.dom, d = document.createElement("div");
7757
- d.className = "tableWrapper-inner", d.appendChild(c.firstChild), c.appendChild(d), l.appendChild(c);
7765
+ const d = this.dom, c = document.createElement("div");
7766
+ c.className = "tableWrapper-inner", c.appendChild(d.firstChild), d.appendChild(c), l.appendChild(d);
7758
7767
  const u = document.createElement("div");
7759
- u.className = "table-widgets-container", u.style.position = "relative", c.appendChild(u), this.dom = l;
7768
+ u.className = "table-widgets-container", u.style.position = "relative", d.appendChild(u), this.dom = l;
7760
7769
  }
7761
7770
  ignoreMutation(r) {
7762
7771
  return !r.target.closest(".tableWrapper-inner") || super.ignoreMutation(r);
@@ -7801,41 +7810,41 @@ const mn = {
7801
7810
  Pn,
7802
7811
  In,
7803
7812
  [
7804
- Qi,
7813
+ on,
7805
7814
  An,
7806
- Uo.extend({
7815
+ Vo.extend({
7807
7816
  content: "tableContent"
7808
7817
  }),
7809
- Ho.extend({
7818
+ Ro.extend({
7810
7819
  content: "tableContent"
7811
7820
  }),
7812
- Oo
7821
+ zo
7813
7822
  ]
7814
- ), zt = {
7823
+ ), $t = {
7815
7824
  paragraph: Ln,
7816
- heading: gn,
7817
- codeBlock: Ui,
7818
- bulletListItem: _n,
7825
+ heading: kn,
7826
+ codeBlock: Vi,
7827
+ bulletListItem: wn,
7819
7828
  numberedListItem: Bn,
7820
- checkListItem: vn,
7829
+ checkListItem: xn,
7821
7830
  table: Nn,
7822
- file: Gi,
7823
- image: Ji,
7824
- video: sn,
7825
- audio: Hi
7826
- }, jn = Pt(zt), Ft = {
7827
- bold: K(Io, "boolean"),
7828
- italic: K(Ao, "boolean"),
7829
- underline: K(jo, "boolean"),
7830
- strike: K(No, "boolean"),
7831
- code: K(Po, "boolean"),
7832
- textColor: un,
7833
- backgroundColor: dn
7834
- }, ts = Dt(Ft), Gt = {
7831
+ file: Ki,
7832
+ image: en,
7833
+ video: cn,
7834
+ audio: Ri
7835
+ }, jn = Pt($t), Wt = {
7836
+ bold: K(No, "boolean"),
7837
+ italic: K(Do, "boolean"),
7838
+ underline: K(Uo, "boolean"),
7839
+ strike: K(Ho, "boolean"),
7840
+ code: K(jo, "boolean"),
7841
+ textColor: mn,
7842
+ backgroundColor: pn
7843
+ }, os = Dt(Wt), Kt = {
7835
7844
  text: { config: "text", implementation: {} },
7836
7845
  link: { config: "link", implementation: {} }
7837
7846
  }, Dn = Nt(
7838
- Gt
7847
+ Kt
7839
7848
  );
7840
7849
  function L(e, t) {
7841
7850
  return e in t.schema.blockSchema && t.schema.blockSchema[e] === jn[e];
@@ -7846,19 +7855,19 @@ function Hn(e, t) {
7846
7855
  function Un(e, t, o) {
7847
7856
  return t.type === e && t.type in o.schema.blockSchema && L(t.type, o);
7848
7857
  }
7849
- function os(e, t) {
7858
+ function is(e, t) {
7850
7859
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
7851
7860
  }
7852
- function is(e, t) {
7861
+ function ns(e, t) {
7853
7862
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
7854
7863
  }
7855
- function ns(e, t) {
7864
+ function rs(e, t) {
7856
7865
  return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
7857
7866
  }
7858
7867
  function On(e, t, o) {
7859
- return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === v[e];
7868
+ return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === x[e];
7860
7869
  }
7861
- function rs(e, t, o) {
7870
+ function as(e, t, o) {
7862
7871
  return On(e, t.type, o);
7863
7872
  }
7864
7873
  function Rn(e, t) {
@@ -7952,7 +7961,7 @@ function Gn(e, t, o, i = "before") {
7952
7961
  }
7953
7962
  function $n(e) {
7954
7963
  const t = e._tiptapEditor.state, o = t.selection, i = z(t.doc, o.anchor);
7955
- if (o instanceof Re)
7964
+ if (o instanceof Ve)
7956
7965
  return {
7957
7966
  type: "cell",
7958
7967
  anchorBlockId: i.node.attrs.id,
@@ -7987,7 +7996,7 @@ function Wn(e, t) {
7987
7996
  );
7988
7997
  let i;
7989
7998
  if (t.type === "cell")
7990
- i = Re.create(
7999
+ i = Ve.create(
7991
8000
  e._tiptapEditor.state.doc,
7992
8001
  o + t.anchorCellOffset,
7993
8002
  o + t.headCellOffset
@@ -8014,63 +8023,63 @@ function Wn(e, t) {
8014
8023
  }
8015
8024
  e.dispatch(e._tiptapEditor.state.tr.setSelection(i));
8016
8025
  }
8017
- function He(e) {
8018
- return e.map((t) => t.type === "columnList" ? t.children.map((o) => He(o.children)).flat() : {
8026
+ function Ue(e) {
8027
+ return e.map((t) => t.type === "columnList" ? t.children.map((o) => Ue(o.children)).flat() : {
8019
8028
  ...t,
8020
- children: He(t.children)
8029
+ children: Ue(t.children)
8021
8030
  }).flat();
8022
8031
  }
8023
- function $t(e, t, o) {
8032
+ function qt(e, t, o) {
8024
8033
  var r;
8025
8034
  const i = ((r = e.getSelection()) == null ? void 0 : r.blocks) || [
8026
8035
  e.getTextCursorPosition().block
8027
8036
  ], n = $n(e);
8028
- e.removeBlocks(i), e.insertBlocks(He(i), t, o), Wn(e, n);
8037
+ e.removeBlocks(i), e.insertBlocks(Ue(i), t, o), Wn(e, n);
8029
8038
  }
8030
- function Wt(e) {
8039
+ function Xt(e) {
8031
8040
  return !e || e.type !== "columnList";
8032
8041
  }
8033
- function Kt(e, t, o) {
8042
+ function Zt(e, t, o) {
8034
8043
  let i, n;
8035
8044
  if (t ? t.children.length > 0 ? (i = t.children[t.children.length - 1], n = "after") : (i = t, n = "before") : o && (i = o, n = "before"), !i || !n)
8036
8045
  return;
8037
8046
  const r = e.getParentBlock(i);
8038
- return Wt(r) ? { referenceBlock: i, placement: n } : Kt(
8047
+ return Xt(r) ? { referenceBlock: i, placement: n } : Zt(
8039
8048
  e,
8040
8049
  n === "after" ? i : e.getPrevBlock(i),
8041
8050
  r
8042
8051
  );
8043
8052
  }
8044
- function qt(e, t, o) {
8053
+ function Jt(e, t, o) {
8045
8054
  let i, n;
8046
8055
  if (t ? t.children.length > 0 ? (i = t.children[0], n = "before") : (i = t, n = "after") : o && (i = o, n = "after"), !i || !n)
8047
8056
  return;
8048
8057
  const r = e.getParentBlock(i);
8049
- return Wt(r) ? { referenceBlock: i, placement: n } : qt(
8058
+ return Xt(r) ? { referenceBlock: i, placement: n } : Jt(
8050
8059
  e,
8051
8060
  n === "before" ? i : e.getNextBlock(i),
8052
8061
  r
8053
8062
  );
8054
8063
  }
8055
8064
  function Kn(e) {
8056
- const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[0]) || e.getTextCursorPosition().block, i = Kt(
8065
+ const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[0]) || e.getTextCursorPosition().block, i = Zt(
8057
8066
  e,
8058
8067
  e.getPrevBlock(o),
8059
8068
  e.getParentBlock(o)
8060
8069
  );
8061
- i && $t(
8070
+ i && qt(
8062
8071
  e,
8063
8072
  i.referenceBlock,
8064
8073
  i.placement
8065
8074
  );
8066
8075
  }
8067
8076
  function qn(e) {
8068
- const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[(t == null ? void 0 : t.blocks.length) - 1]) || e.getTextCursorPosition().block, i = qt(
8077
+ const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[(t == null ? void 0 : t.blocks.length) - 1]) || e.getTextCursorPosition().block, i = Jt(
8069
8078
  e,
8070
8079
  e.getNextBlock(o),
8071
8080
  e.getParentBlock(o)
8072
8081
  );
8073
- i && $t(
8082
+ i && qt(
8074
8083
  e,
8075
8084
  i.referenceBlock,
8076
8085
  i.placement
@@ -8080,7 +8089,7 @@ function Xn(e, t) {
8080
8089
  return function({ state: o, dispatch: i }) {
8081
8090
  const { $from: n, $to: r } = o.selection, a = n.blockRange(
8082
8091
  r,
8083
- (d) => d.childCount > 0 && (d.type.name === "blockGroup" || d.type.name === "column")
8092
+ (c) => c.childCount > 0 && (c.type.name === "blockGroup" || c.type.name === "column")
8084
8093
  // change necessary to not look at first item child type
8085
8094
  );
8086
8095
  if (!a)
@@ -8088,22 +8097,22 @@ function Xn(e, t) {
8088
8097
  const s = a.startIndex;
8089
8098
  if (s === 0)
8090
8099
  return !1;
8091
- const c = a.parent.child(s - 1);
8092
- if (c.type !== e)
8100
+ const d = a.parent.child(s - 1);
8101
+ if (d.type !== e)
8093
8102
  return !1;
8094
8103
  if (i) {
8095
- const d = c.lastChild && c.lastChild.type === t, u = j.from(d ? e.create() : null), h = new de(
8104
+ const c = d.lastChild && d.lastChild.type === t, u = j.from(c ? e.create() : null), h = new ee(
8096
8105
  j.from(
8097
8106
  e.create(null, j.from(t.create(null, u)))
8098
8107
  // change necessary to create "groupType" instead of parent.type
8099
8108
  ),
8100
- d ? 3 : 1,
8109
+ c ? 3 : 1,
8101
8110
  0
8102
8111
  ), m = a.start, f = a.end;
8103
8112
  i(
8104
8113
  o.tr.step(
8105
- new Ae(
8106
- m - (d ? 3 : 1),
8114
+ new Ne(
8115
+ m - (c ? 3 : 1),
8107
8116
  f,
8108
8117
  m,
8109
8118
  f,
@@ -8117,7 +8126,7 @@ function Xn(e, t) {
8117
8126
  return !0;
8118
8127
  };
8119
8128
  }
8120
- function Xt(e) {
8129
+ function Yt(e) {
8121
8130
  return e._tiptapEditor.commands.command(
8122
8131
  Xn(
8123
8132
  e._tiptapEditor.schema.nodes.blockContainer,
@@ -8129,18 +8138,18 @@ function Zn(e) {
8129
8138
  e._tiptapEditor.commands.liftListItem("blockContainer");
8130
8139
  }
8131
8140
  function Jn(e) {
8132
- const { bnBlock: t } = y(
8141
+ const { bnBlock: t } = _(
8133
8142
  e._tiptapEditor.state
8134
8143
  );
8135
8144
  return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore !== null;
8136
8145
  }
8137
8146
  function Yn(e) {
8138
- const { bnBlock: t } = y(
8147
+ const { bnBlock: t } = _(
8139
8148
  e._tiptapEditor.state
8140
8149
  );
8141
8150
  return e._tiptapEditor.state.doc.resolve(t.beforePos).depth > 1;
8142
8151
  }
8143
- function Zt(e, t, o) {
8152
+ function Qt(e, t, o) {
8144
8153
  const i = e._tiptapEditor;
8145
8154
  let n = i.state.tr;
8146
8155
  const r = [];
@@ -8153,7 +8162,7 @@ function Zt(e, t, o) {
8153
8162
  (u) => typeof u == "string" ? u : u.id
8154
8163
  )
8155
8164
  ), s = [], l = typeof t[0] == "string" ? t[0] : t[0].id;
8156
- let c = 0;
8165
+ let d = 0;
8157
8166
  if (i.state.doc.descendants((u, h) => {
8158
8167
  if (a.size === 0)
8159
8168
  return !1;
@@ -8171,12 +8180,12 @@ function Zt(e, t, o) {
8171
8180
  const b = n.doc.nodeSize;
8172
8181
  n = n.insert(h, r);
8173
8182
  const k = n.doc.nodeSize;
8174
- c += b - k;
8183
+ d += b - k;
8175
8184
  }
8176
- const m = n.doc.nodeSize, f = n.doc.resolve(h - c);
8177
- f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? n = n.delete(f.before(), f.after()) : n = n.delete(h - c, h - c + u.nodeSize);
8185
+ const m = n.doc.nodeSize, f = n.doc.resolve(h - d);
8186
+ f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? n = n.delete(f.before(), f.after()) : n = n.delete(h - d, h - d + u.nodeSize);
8178
8187
  const g = n.doc.nodeSize;
8179
- return c += m - g, !1;
8188
+ return d += m - g, !1;
8180
8189
  }), a.size > 0) {
8181
8190
  const u = [...a].join(`
8182
8191
  `);
@@ -8185,9 +8194,9 @@ function Zt(e, t, o) {
8185
8194
  );
8186
8195
  }
8187
8196
  e.dispatch(n);
8188
- const d = [];
8197
+ const c = [];
8189
8198
  for (const u of r)
8190
- d.push(
8199
+ c.push(
8191
8200
  w(
8192
8201
  u,
8193
8202
  e.schema.blockSchema,
@@ -8196,27 +8205,27 @@ function Zt(e, t, o) {
8196
8205
  e.blockCache
8197
8206
  )
8198
8207
  );
8199
- return { insertedBlocks: d, removedBlocks: s };
8208
+ return { insertedBlocks: c, removedBlocks: s };
8200
8209
  }
8201
8210
  function Qn(e, t, o) {
8202
- return Zt(e, t, o);
8211
+ return Qt(e, t, o);
8203
8212
  }
8204
8213
  function er(e, t) {
8205
- return Zt(e, t, []).removedBlocks;
8214
+ return Qt(e, t, []).removedBlocks;
8206
8215
  }
8207
8216
  function tr(e, t, o, i = { updateSelection: !0 }) {
8208
8217
  const n = o._tiptapEditor.state.tr;
8209
- let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, c = "";
8210
- if (t.forEach((d) => {
8211
- d.check(), s && d.isText && d.marks.length === 0 ? c += d.text : s = !1, l = l ? d.isBlock : !1;
8218
+ let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
8219
+ if (t.forEach((c) => {
8220
+ c.check(), s && c.isText && c.marks.length === 0 ? d += c.text : s = !1, l = l ? c.isBlock : !1;
8212
8221
  }), r === a && l) {
8213
- const { parent: d } = n.doc.resolve(r);
8214
- d.isTextblock && !d.type.spec.code && !d.childCount && (r -= 1, a += 1);
8222
+ const { parent: c } = n.doc.resolve(r);
8223
+ c.isTextblock && !c.type.spec.code && !c.childCount && (r -= 1, a += 1);
8215
8224
  }
8216
- return s ? n.insertText(c, r, a) : n.replaceWith(r, a, t), i.updateSelection && ko(n, n.steps.length - 1, -1), o.dispatch(n), !0;
8225
+ return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && wo(n, n.steps.length - 1, -1), o.dispatch(n), !0;
8217
8226
  }
8218
8227
  function or(e) {
8219
- const { bnBlock: t } = y(e._tiptapEditor.state), o = e._tiptapEditor.state.doc.resolve(t.beforePos), i = o.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
8228
+ const { bnBlock: t } = _(e._tiptapEditor.state), o = e._tiptapEditor.state.doc.resolve(t.beforePos), i = o.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
8220
8229
  t.afterPos
8221
8230
  ).nodeAfter;
8222
8231
  let r;
@@ -8251,7 +8260,7 @@ function or(e) {
8251
8260
  )
8252
8261
  };
8253
8262
  }
8254
- function Jt(e, t, o = "start") {
8263
+ function eo(e, t, o = "start") {
8255
8264
  const i = typeof t == "string" ? t : t.id, n = P(i, e._tiptapEditor.state.doc);
8256
8265
  if (!n)
8257
8266
  throw new Error(`Block with ID ${i} not found`);
@@ -8278,7 +8287,7 @@ function Jt(e, t, o = "start") {
8278
8287
  throw new D(a);
8279
8288
  } else {
8280
8289
  const s = o === "start" ? r.childContainer.node.firstChild : r.childContainer.node.lastChild;
8281
- Jt(e, s.attrs.id, o);
8290
+ eo(e, s.attrs.id, o);
8282
8291
  }
8283
8292
  }
8284
8293
  function ir(e) {
@@ -8289,8 +8298,8 @@ function ir(e) {
8289
8298
  z(t.doc, t.selection.from).posBeforeNode
8290
8299
  ), i = t.doc.resolve(
8291
8300
  z(t.doc, t.selection.to).posBeforeNode
8292
- ), n = (c, d) => {
8293
- const u = o.posAtIndex(c, d), h = t.doc.resolve(u).nodeAfter;
8301
+ ), n = (d, c) => {
8302
+ const u = o.posAtIndex(d, c), h = t.doc.resolve(u).nodeAfter;
8294
8303
  if (!h)
8295
8304
  throw new Error(
8296
8305
  `Error getting selection - node not found at position ${u}`
@@ -8313,16 +8322,16 @@ function ir(e) {
8313
8322
  e.blockCache
8314
8323
  )
8315
8324
  );
8316
- for (let c = o.depth; c > a; c--)
8317
- if (o.node(c).type.isInGroup("childContainer")) {
8318
- const u = o.index(c) + 1, h = o.node(c).childCount;
8325
+ for (let d = o.depth; d > a; d--)
8326
+ if (o.node(d).type.isInGroup("childContainer")) {
8327
+ const u = o.index(d) + 1, h = o.node(d).childCount;
8319
8328
  for (let m = u; m < h; m++)
8320
- r.push(n(m, c));
8329
+ r.push(n(m, d));
8321
8330
  }
8322
8331
  } else
8323
8332
  r.push(n(s, a));
8324
- for (let c = s + 1; c <= l; c++)
8325
- r.push(n(c, a));
8333
+ for (let d = s + 1; d <= l; d++)
8334
+ r.push(n(d, a));
8326
8335
  if (r.length === 0)
8327
8336
  throw new Error(
8328
8337
  `Error getting selection - selection doesn't span any blocks (${t.selection})`
@@ -8343,30 +8352,30 @@ function nr(e, t, o) {
8343
8352
  const s = P(n, r);
8344
8353
  if (!s)
8345
8354
  throw new Error(`Block with ID ${n} not found`);
8346
- const l = F(a), c = F(s), d = e.schema.blockSchema[l.blockNoteType], u = e.schema.blockSchema[c.blockNoteType];
8347
- if (!l.isBlockContainer || d.content === "none")
8355
+ const l = F(a), d = F(s), c = e.schema.blockSchema[l.blockNoteType], u = e.schema.blockSchema[d.blockNoteType];
8356
+ if (!l.isBlockContainer || c.content === "none")
8348
8357
  throw new Error(
8349
8358
  `Attempting to set selection anchor in block without content (id ${i})`
8350
8359
  );
8351
- if (!c.isBlockContainer || u.content === "none")
8360
+ if (!d.isBlockContainer || u.content === "none")
8352
8361
  throw new Error(
8353
8362
  `Attempting to set selection anchor in block without content (id ${n})`
8354
8363
  );
8355
8364
  let h, m;
8356
- if (d.content === "table") {
8357
- const f = et.get(l.blockContent.node);
8365
+ if (c.content === "table") {
8366
+ const f = tt.get(l.blockContent.node);
8358
8367
  h = l.blockContent.beforePos + f.positionAt(0, 0, l.blockContent.node) + 1 + 2;
8359
8368
  } else
8360
8369
  h = l.blockContent.beforePos + 1;
8361
8370
  if (u.content === "table") {
8362
- const f = et.get(c.blockContent.node), g = c.blockContent.beforePos + f.positionAt(
8371
+ const f = tt.get(d.blockContent.node), g = d.blockContent.beforePos + f.positionAt(
8363
8372
  f.height - 1,
8364
8373
  f.width - 1,
8365
- c.blockContent.node
8374
+ d.blockContent.node
8366
8375
  ) + 1, b = r.resolve(g).nodeAfter.nodeSize;
8367
8376
  m = g + b - 2;
8368
8377
  } else
8369
- m = c.blockContent.afterPos - 1;
8378
+ m = d.blockContent.afterPos - 1;
8370
8379
  e._tiptapEditor.dispatch(
8371
8380
  e._tiptapEditor.state.tr.setSelection(
8372
8381
  O.create(e._tiptapEditor.state.doc, h, m)
@@ -8374,7 +8383,7 @@ function nr(e, t, o) {
8374
8383
  );
8375
8384
  }
8376
8385
  let J;
8377
- async function $e() {
8386
+ async function We() {
8378
8387
  if (J)
8379
8388
  return J;
8380
8389
  const e = await Promise.all([
@@ -8440,7 +8449,7 @@ function ar() {
8440
8449
  };
8441
8450
  return t;
8442
8451
  }
8443
- function We(e) {
8452
+ function Ke(e) {
8444
8453
  const t = J;
8445
8454
  if (!t)
8446
8455
  throw new Error(
@@ -8451,9 +8460,9 @@ function We(e) {
8451
8460
  }).processSync(e).value;
8452
8461
  }
8453
8462
  async function sr(e, t, o, i) {
8454
- await $e();
8455
- const r = ve(t, o).exportBlocks(e, i);
8456
- return We(r);
8463
+ await We();
8464
+ const r = xe(t, o).exportBlocks(e, i);
8465
+ return Ke(r);
8457
8466
  }
8458
8467
  function lr(e) {
8459
8468
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
@@ -8486,24 +8495,24 @@ function ur(e) {
8486
8495
  n.append(i.nextElementSibling);
8487
8496
  });
8488
8497
  }
8489
- let ct = null;
8498
+ let ut = null;
8490
8499
  function pr() {
8491
- return ct || (ct = document.implementation.createHTMLDocument("title"));
8500
+ return ut || (ut = document.implementation.createHTMLDocument("title"));
8492
8501
  }
8493
- function Yt(e) {
8502
+ function to(e) {
8494
8503
  if (typeof e == "string") {
8495
8504
  const t = pr().createElement("div");
8496
8505
  t.innerHTML = e, e = t;
8497
8506
  }
8498
8507
  return cr(e), ur(e), e;
8499
8508
  }
8500
- async function Qt(e, t, o, i, n) {
8501
- const r = Yt(e), s = uo.fromSchema(n).parse(r, {
8509
+ async function oo(e, t, o, i, n) {
8510
+ const r = to(e), s = mo.fromSchema(n).parse(r, {
8502
8511
  topNode: n.nodes.blockGroup.create()
8503
8512
  }), l = [];
8504
- for (let c = 0; c < s.childCount; c++)
8513
+ for (let d = 0; d < s.childCount; d++)
8505
8514
  l.push(
8506
- w(s.child(c), t, o, i)
8515
+ w(s.child(d), t, o, i)
8507
8516
  );
8508
8517
  return l;
8509
8518
  }
@@ -8524,13 +8533,13 @@ function hr(e, t) {
8524
8533
  }, e.patch(t, n), n;
8525
8534
  }
8526
8535
  async function mr(e, t, o, i, n) {
8527
- const r = await $e(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
8536
+ const r = await We(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
8528
8537
  handlers: {
8529
8538
  ...r.remarkRehype.defaultHandlers,
8530
8539
  code: hr
8531
8540
  }
8532
8541
  }).use(r.rehypeStringify.default).processSync(e);
8533
- return Qt(
8542
+ return oo(
8534
8543
  a.value,
8535
8544
  t,
8536
8545
  o,
@@ -8538,7 +8547,7 @@ async function mr(e, t, o, i, n) {
8538
8547
  n
8539
8548
  );
8540
8549
  }
8541
- const Ke = [
8550
+ const qe = [
8542
8551
  "vscode-editor-data",
8543
8552
  "blocknote/html",
8544
8553
  "text/html",
@@ -8558,7 +8567,7 @@ function gr(e, t) {
8558
8567
  throw new Error(`The string ${t} is not a valid MIME type.`);
8559
8568
  return o[1] === "*" || i[1] === "*" ? o[0] === i[0] : (o[0] === "*" || i[0] === "*" || o[0] === i[0]) && o[1] === i[1];
8560
8569
  }
8561
- async function eo(e, t) {
8570
+ async function io(e, t) {
8562
8571
  var a;
8563
8572
  if (!t.uploadFile) {
8564
8573
  console.warn(
@@ -8570,7 +8579,7 @@ async function eo(e, t) {
8570
8579
  if (o === null)
8571
8580
  return;
8572
8581
  let i = null;
8573
- for (const s of Ke)
8582
+ for (const s of qe)
8574
8583
  if (o.types.includes(s)) {
8575
8584
  i = s;
8576
8585
  break;
@@ -8586,29 +8595,29 @@ async function eo(e, t) {
8586
8595
  );
8587
8596
  for (let s = 0; s < n.length; s++) {
8588
8597
  let l = "file";
8589
- for (const d of r)
8590
- for (const u of d.fileBlockAccept || []) {
8598
+ for (const c of r)
8599
+ for (const u of c.fileBlockAccept || []) {
8591
8600
  const h = u.startsWith("."), m = n[s].getAsFile();
8592
8601
  if (m && (!h && m.type && gr(n[s].type, u) || h && fr(
8593
8602
  "." + m.name.split(".").pop(),
8594
8603
  u
8595
8604
  ))) {
8596
- l = d.type;
8605
+ l = c.type;
8597
8606
  break;
8598
8607
  }
8599
8608
  }
8600
- const c = n[s].getAsFile();
8601
- if (c) {
8602
- const d = {
8609
+ const d = n[s].getAsFile();
8610
+ if (d) {
8611
+ const c = {
8603
8612
  type: l,
8604
8613
  props: {
8605
- name: c.name
8614
+ name: d.name
8606
8615
  }
8607
8616
  };
8608
8617
  let u;
8609
8618
  if (e.type === "paste")
8610
8619
  u = t.insertBlocks(
8611
- [d],
8620
+ [c],
8612
8621
  t.getTextCursorPosition().block,
8613
8622
  "after"
8614
8623
  )[0].id;
@@ -8624,13 +8633,13 @@ async function eo(e, t) {
8624
8633
  g.pos
8625
8634
  ), k = F(b);
8626
8635
  u = t.insertBlocks(
8627
- [d],
8636
+ [c],
8628
8637
  k.bnBlock.node.attrs.id,
8629
8638
  "after"
8630
8639
  )[0].id;
8631
8640
  } else
8632
8641
  return;
8633
- const h = await t.uploadFile(c, u), m = typeof h == "string" ? {
8642
+ const h = await t.uploadFile(d, u), m = typeof h == "string" ? {
8634
8643
  props: {
8635
8644
  url: h
8636
8645
  }
@@ -8650,12 +8659,12 @@ const br = (e) => I.create({
8650
8659
  if (!e.isEditable)
8651
8660
  return;
8652
8661
  let i = null;
8653
- for (const n of Ke)
8662
+ for (const n of qe)
8654
8663
  if (o.dataTransfer.types.includes(n)) {
8655
8664
  i = n;
8656
8665
  break;
8657
8666
  }
8658
- return i === null ? !0 : i === "Files" ? (eo(o, e), !0) : !1;
8667
+ return i === null ? !0 : i === "Files" ? (io(o, e), !0) : !1;
8659
8668
  }
8660
8669
  }
8661
8670
  }
@@ -8692,7 +8701,7 @@ const _r = (e) => I.create({
8692
8701
  if (o.preventDefault(), !e.isEditable)
8693
8702
  return;
8694
8703
  let i;
8695
- for (const r of Ke)
8704
+ for (const r of qe)
8696
8705
  if (o.clipboardData.types.includes(r)) {
8697
8706
  i = r;
8698
8707
  break;
@@ -8702,9 +8711,9 @@ const _r = (e) => I.create({
8702
8711
  if (i === "vscode-editor-data")
8703
8712
  return kr(o, t), !0;
8704
8713
  if (i === "Files")
8705
- return eo(o, e), !0;
8714
+ return io(o, e), !0;
8706
8715
  let n = o.clipboardData.getData(i);
8707
- return i === "blocknote/html" ? (t.pasteHTML(n), !0) : i === "text/html" ? (n = Yt(n.trim()).innerHTML, t.pasteHTML(n), !0) : (t.pasteText(n), !0);
8716
+ return i === "blocknote/html" ? (t.pasteHTML(n), !0) : i === "text/html" ? (n = to(n.trim()).innerHTML, t.pasteHTML(n), !0) : (t.pasteText(n), !0);
8708
8717
  }
8709
8718
  }
8710
8719
  }
@@ -8712,7 +8721,7 @@ const _r = (e) => I.create({
8712
8721
  ];
8713
8722
  }
8714
8723
  });
8715
- function to(e, t) {
8724
+ function no(e, t) {
8716
8725
  const o = [];
8717
8726
  return e.descendants((i) => {
8718
8727
  var n, r;
@@ -8738,21 +8747,21 @@ function to(e, t) {
8738
8747
  function yr(e, t, o) {
8739
8748
  var s;
8740
8749
  let i = !1;
8741
- const n = e.state.selection instanceof Re;
8750
+ const n = e.state.selection instanceof Ve;
8742
8751
  if (!n) {
8743
8752
  const l = e.state.doc.slice(
8744
8753
  e.state.selection.from,
8745
8754
  e.state.selection.to,
8746
8755
  !1
8747
- ).content, c = [];
8748
- for (let d = 0; d < l.childCount; d++)
8749
- c.push(l.child(d));
8750
- i = c.find(
8751
- (d) => d.type.isInGroup("bnBlock") || d.type.name === "blockGroup" || d.type.spec.group === "blockContent"
8756
+ ).content, d = [];
8757
+ for (let c = 0; c < l.childCount; c++)
8758
+ d.push(l.child(c));
8759
+ i = d.find(
8760
+ (c) => c.type.isInGroup("bnBlock") || c.type.name === "blockGroup" || c.type.spec.group === "blockContent"
8752
8761
  ) === void 0, i && (t = l);
8753
8762
  }
8754
8763
  let r;
8755
- const a = ve(
8764
+ const a = xe(
8756
8765
  e.state.schema,
8757
8766
  o
8758
8767
  );
@@ -8768,37 +8777,37 @@ function yr(e, t, o) {
8768
8777
  {}
8769
8778
  )}</table>`;
8770
8779
  } else if (i) {
8771
- const l = Ce(
8780
+ const l = Ee(
8772
8781
  t,
8773
8782
  o.schema.inlineContentSchema,
8774
8783
  o.schema.styleSchema
8775
8784
  );
8776
8785
  r = a.exportInlineContent(l, {});
8777
8786
  } else {
8778
- const l = to(t, o.schema);
8787
+ const l = no(t, o.schema);
8779
8788
  r = a.exportBlocks(l, {});
8780
8789
  }
8781
8790
  return r;
8782
8791
  }
8783
- function oo(e, t) {
8792
+ function ro(e, t) {
8784
8793
  "node" in e.state.selection && e.state.selection.node.type.spec.group === "blockContent" && t.dispatch(
8785
8794
  t._tiptapEditor.state.tr.setSelection(
8786
8795
  new ce(e.state.doc.resolve(e.state.selection.from - 1))
8787
8796
  )
8788
8797
  );
8789
- const o = yt.__serializeForClipboard(
8798
+ const o = wt.__serializeForClipboard(
8790
8799
  e,
8791
8800
  e.state.selection.content()
8792
8801
  ).dom.innerHTML, i = e.state.selection.content().content, n = yr(
8793
8802
  e,
8794
8803
  i,
8795
8804
  t
8796
- ), r = We(n);
8805
+ ), r = Ke(n);
8797
8806
  return { clipboardHTML: o, externalHTML: n, markdown: r };
8798
8807
  }
8799
- const ut = (e, t, o) => {
8808
+ const pt = (e, t, o) => {
8800
8809
  o.preventDefault(), o.clipboardData.clearData();
8801
- const { clipboardHTML: i, externalHTML: n, markdown: r } = oo(
8810
+ const { clipboardHTML: i, externalHTML: n, markdown: r } = ro(
8802
8811
  t,
8803
8812
  e
8804
8813
  );
@@ -8811,10 +8820,10 @@ const ut = (e, t, o) => {
8811
8820
  props: {
8812
8821
  handleDOMEvents: {
8813
8822
  copy(t, o) {
8814
- return ut(e, t, o), !0;
8823
+ return pt(e, t, o), !0;
8815
8824
  },
8816
8825
  cut(t, o) {
8817
- return ut(e, t, o), t.editable && t.dispatch(t.state.tr.deleteSelection()), !0;
8826
+ return pt(e, t, o), t.editable && t.dispatch(t.state.tr.deleteSelection()), !0;
8818
8827
  },
8819
8828
  // This is for the use-case in which only a block without content
8820
8829
  // is selected, e.g. an image block, and dragged (not using the
@@ -8829,7 +8838,7 @@ const ut = (e, t, o) => {
8829
8838
  )
8830
8839
  )
8831
8840
  ), o.preventDefault(), o.dataTransfer.clearData();
8832
- const { clipboardHTML: i, externalHTML: n, markdown: r } = oo(t, e);
8841
+ const { clipboardHTML: i, externalHTML: n, markdown: r } = ro(t, e);
8833
8842
  return o.dataTransfer.setData("blocknote/html", i), o.dataTransfer.setData("text/html", n), o.dataTransfer.setData("text/plain", r), !0;
8834
8843
  }
8835
8844
  }
@@ -8845,9 +8854,9 @@ const ut = (e, t, o) => {
8845
8854
  types: ["blockContainer"],
8846
8855
  attributes: {
8847
8856
  backgroundColor: {
8848
- default: v.backgroundColor.default,
8849
- parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : v.backgroundColor.default,
8850
- renderHTML: (e) => e.backgroundColor === v.backgroundColor.default ? {} : {
8857
+ default: x.backgroundColor.default,
8858
+ parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : x.backgroundColor.default,
8859
+ renderHTML: (e) => e.backgroundColor === x.backgroundColor.default ? {} : {
8851
8860
  "data-background-color": e.backgroundColor
8852
8861
  }
8853
8862
  }
@@ -8856,7 +8865,7 @@ const ut = (e, t, o) => {
8856
8865
  ];
8857
8866
  }
8858
8867
  });
8859
- class ie {
8868
+ class ne {
8860
8869
  constructor() {
8861
8870
  // eslint-disable-next-line @typescript-eslint/ban-types
8862
8871
  p(this, "callbacks", {});
@@ -8932,8 +8941,8 @@ class xr {
8932
8941
  this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
8933
8942
  }
8934
8943
  }
8935
- const Te = new N("FilePanelPlugin");
8936
- class Cr extends ie {
8944
+ const Me = new N("FilePanelPlugin");
8945
+ class Cr extends ne {
8937
8946
  constructor(o) {
8938
8947
  super();
8939
8948
  p(this, "view");
@@ -8943,10 +8952,10 @@ class Cr extends ie {
8943
8952
  return (o = this.view) == null ? void 0 : o.closeMenu();
8944
8953
  });
8945
8954
  this.plugin = new B({
8946
- key: Te,
8955
+ key: Me,
8947
8956
  view: (i) => (this.view = new xr(
8948
8957
  o,
8949
- Te,
8958
+ Me,
8950
8959
  i,
8951
8960
  (n) => {
8952
8961
  this.emit("update", n);
@@ -8965,7 +8974,7 @@ class Cr extends ie {
8965
8974
  apply: (i) => {
8966
8975
  var r;
8967
8976
  return {
8968
- block: (r = i.getMeta(Te)) == null ? void 0 : r.block
8977
+ block: (r = i.getMeta(Me)) == null ? void 0 : r.block
8969
8978
  };
8970
8979
  }
8971
8980
  }
@@ -8986,8 +8995,8 @@ class Er {
8986
8995
  p(this, "preventHide", !1);
8987
8996
  p(this, "preventShow", !1);
8988
8997
  p(this, "shouldShow", ({ state: t, from: o, to: i, view: n }) => {
8989
- const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length && kt(t.selection);
8990
- return a.$from.parent.type.spec.code || Ze(a) && a.node.type.spec.code ? !1 : !(!n.hasFocus() || s || l);
8998
+ const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length && _t(t.selection);
8999
+ return a.$from.parent.type.spec.code || Je(a) && a.node.type.spec.code ? !1 : !(!n.hasFocus() || s || l);
8991
9000
  });
8992
9001
  p(this, "blurHandler", (t) => {
8993
9002
  var i;
@@ -9034,20 +9043,20 @@ class Er {
9034
9043
  const { state: i, composing: n } = t, { selection: r } = i, a = o && o.selection.from === i.selection.from && o.selection.to === i.selection.to;
9035
9044
  if (n || a)
9036
9045
  return;
9037
- const { ranges: s } = r, l = Math.min(...s.map((m) => m.$from.pos)), c = Math.max(...s.map((m) => m.$to.pos)), d = (u = this.shouldShow) == null ? void 0 : u.call(this, {
9046
+ const { ranges: s } = r, l = Math.min(...s.map((m) => m.$from.pos)), d = Math.max(...s.map((m) => m.$to.pos)), c = (u = this.shouldShow) == null ? void 0 : u.call(this, {
9038
9047
  view: t,
9039
9048
  state: i,
9040
9049
  from: l,
9041
- to: c
9050
+ to: d
9042
9051
  });
9043
- if (!this.preventShow && (d || this.preventHide)) {
9052
+ if (!this.preventShow && (c || this.preventHide)) {
9044
9053
  this.state = {
9045
9054
  show: !0,
9046
9055
  referencePos: this.getSelectionBoundingBox()
9047
9056
  }, this.emitUpdate();
9048
9057
  return;
9049
9058
  }
9050
- if ((h = this.state) != null && h.show && !this.preventHide && (!d || this.preventShow || !this.editor.isEditable)) {
9059
+ if ((h = this.state) != null && h.show && !this.preventHide && (!c || this.preventShow || !this.editor.isEditable)) {
9051
9060
  this.state.show = !1, this.emitUpdate();
9052
9061
  return;
9053
9062
  }
@@ -9057,18 +9066,18 @@ class Er {
9057
9066
  }
9058
9067
  getSelectionBoundingBox() {
9059
9068
  const { state: t } = this.pmView, { selection: o } = t, { ranges: i } = o, n = Math.min(...i.map((a) => a.$from.pos)), r = Math.max(...i.map((a) => a.$to.pos));
9060
- if (Ze(o)) {
9069
+ if (Je(o)) {
9061
9070
  const a = this.pmView.nodeDOM(n);
9062
9071
  if (a)
9063
9072
  return a.getBoundingClientRect();
9064
9073
  }
9065
- return Pe(this.pmView, n, r);
9074
+ return Ae(this.pmView, n, r);
9066
9075
  }
9067
9076
  }
9068
9077
  const Sr = new N(
9069
9078
  "FormattingToolbarPlugin"
9070
9079
  );
9071
- class Br extends ie {
9080
+ class Br extends ne {
9072
9081
  constructor(o) {
9073
9082
  super();
9074
9083
  p(this, "view");
@@ -9092,7 +9101,7 @@ class Br extends ie {
9092
9101
  return this.on("update", o);
9093
9102
  }
9094
9103
  }
9095
- const pt = (e, t) => {
9104
+ const ht = (e, t) => {
9096
9105
  const o = e.resolve(t);
9097
9106
  if (o.depth <= 1)
9098
9107
  return;
@@ -9103,7 +9112,7 @@ const pt = (e, t) => {
9103
9112
  return pe(
9104
9113
  e.resolve(i)
9105
9114
  );
9106
- }, Ue = (e, t) => {
9115
+ }, Oe = (e, t) => {
9107
9116
  const o = e.resolve(t), i = o.index();
9108
9117
  if (i === 0)
9109
9118
  return;
@@ -9111,7 +9120,7 @@ const pt = (e, t) => {
9111
9120
  return pe(
9112
9121
  e.resolve(n)
9113
9122
  );
9114
- }, io = (e, t) => {
9123
+ }, ao = (e, t) => {
9115
9124
  for (; t.childContainer; ) {
9116
9125
  const o = t.childContainer.node, i = e.resolve(t.childContainer.beforePos + 1).posAtIndex(o.childCount - 1);
9117
9126
  t = pe(e.resolve(i));
@@ -9146,17 +9155,17 @@ const pt = (e, t) => {
9146
9155
  );
9147
9156
  }
9148
9157
  return !0;
9149
- }, ht = (e) => ({
9158
+ }, mt = (e) => ({
9150
9159
  state: t,
9151
9160
  dispatch: o
9152
9161
  }) => {
9153
- const i = t.doc.resolve(e), n = pe(i), r = Ue(
9162
+ const i = t.doc.resolve(e), n = pe(i), r = Oe(
9154
9163
  t.doc,
9155
9164
  n.bnBlock.beforePos
9156
9165
  );
9157
9166
  if (!r)
9158
9167
  return !1;
9159
- const a = io(
9168
+ const a = ao(
9160
9169
  t.doc,
9161
9170
  r
9162
9171
  );
@@ -9174,7 +9183,7 @@ const pt = (e, t) => {
9174
9183
  () => n.undoInputRule(),
9175
9184
  // Reverts block content type to a paragraph if the selection is at the start of the block.
9176
9185
  () => n.command(({ state: r }) => {
9177
- const a = y(r);
9186
+ const a = _(r);
9178
9187
  if (!a.isBlockContainer)
9179
9188
  return !1;
9180
9189
  const s = r.selection.from === a.blockContent.beforePos + 1, l = a.blockContent.node.type.name === "paragraph";
@@ -9191,7 +9200,7 @@ const pt = (e, t) => {
9191
9200
  }),
9192
9201
  // Removes a level of nesting if the block is indented if the selection is at the start of the block.
9193
9202
  () => n.command(({ state: r }) => {
9194
- const a = y(r);
9203
+ const a = _(r);
9195
9204
  if (!a.isBlockContainer)
9196
9205
  return !1;
9197
9206
  const { blockContent: s } = a;
@@ -9200,26 +9209,26 @@ const pt = (e, t) => {
9200
9209
  // Merges block with the previous one if it isn't indented, and the selection is at the start of the
9201
9210
  // block. The target block for merging must contain inline content.
9202
9211
  () => n.command(({ state: r }) => {
9203
- const a = y(r);
9212
+ const a = _(r);
9204
9213
  if (!a.isBlockContainer)
9205
9214
  return !1;
9206
- const { bnBlock: s, blockContent: l } = a, c = r.selection.from === l.beforePos + 1, d = r.selection.empty, u = s.beforePos;
9207
- return c && d ? i().command(ht(u)).scrollIntoView().run() : !1;
9215
+ const { bnBlock: s, blockContent: l } = a, d = r.selection.from === l.beforePos + 1, c = r.selection.empty, u = s.beforePos;
9216
+ return d && c ? i().command(mt(u)).scrollIntoView().run() : !1;
9208
9217
  }),
9209
9218
  () => n.command(({ state: r, dispatch: a }) => {
9210
- const s = y(r);
9211
- if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Ue(
9219
+ const s = _(r);
9220
+ if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Oe(
9212
9221
  r.doc,
9213
9222
  s.bnBlock.beforePos
9214
9223
  ))
9215
9224
  return !1;
9216
- const d = pt(
9225
+ const c = ht(
9217
9226
  r.doc,
9218
9227
  s.bnBlock.beforePos
9219
9228
  );
9220
- if ((d == null ? void 0 : d.blockNoteType) !== "column")
9229
+ if ((c == null ? void 0 : c.blockNoteType) !== "column")
9221
9230
  return !1;
9222
- const u = d, h = pt(
9231
+ const u = c, h = ht(
9223
9232
  r.doc,
9224
9233
  u.bnBlock.beforePos
9225
9234
  );
@@ -9235,7 +9244,7 @@ const pt = (e, t) => {
9235
9244
  if (f)
9236
9245
  if (g) {
9237
9246
  r.tr.step(
9238
- new Ae(
9247
+ new Ne(
9239
9248
  // replace entire column list
9240
9249
  h.bnBlock.beforePos,
9241
9250
  h.bnBlock.afterPos,
@@ -9252,7 +9261,7 @@ const pt = (e, t) => {
9252
9261
  r.tr.setSelection(O.between(k, k));
9253
9262
  } else {
9254
9263
  r.tr.step(
9255
- new Ae(
9264
+ new Ne(
9256
9265
  // replace entire column list
9257
9266
  h.bnBlock.beforePos,
9258
9267
  h.bnBlock.afterPos,
@@ -9309,30 +9318,30 @@ const pt = (e, t) => {
9309
9318
  // when the selection is empty and at the start of the block. Moves the
9310
9319
  // current block into the deleted block's place.
9311
9320
  () => n.command(({ state: r }) => {
9312
- const a = y(r);
9321
+ const a = _(r);
9313
9322
  if (!a.isBlockContainer)
9314
9323
  throw new Error("todo");
9315
- const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, c = Ue(
9324
+ const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d = Oe(
9316
9325
  r.doc,
9317
9326
  a.bnBlock.beforePos
9318
9327
  );
9319
- if (c && s && l) {
9320
- const d = io(
9328
+ if (d && s && l) {
9329
+ const c = ao(
9321
9330
  r.doc,
9322
- c
9331
+ d
9323
9332
  );
9324
- if (!d.isBlockContainer)
9333
+ if (!c.isBlockContainer)
9325
9334
  throw new Error("todo");
9326
- if (d.blockContent.node.type.spec.content === "" || d.blockContent.node.type.spec.content === "inline*" && d.blockContent.node.childCount === 0)
9335
+ if (c.blockContent.node.type.spec.content === "" || c.blockContent.node.type.spec.content === "inline*" && c.blockContent.node.childCount === 0)
9327
9336
  return i().cut(
9328
9337
  {
9329
9338
  from: a.bnBlock.beforePos,
9330
9339
  to: a.bnBlock.afterPos
9331
9340
  },
9332
- d.bnBlock.afterPos
9341
+ c.bnBlock.afterPos
9333
9342
  ).deleteRange({
9334
- from: d.bnBlock.beforePos,
9335
- to: d.bnBlock.afterPos
9343
+ from: c.bnBlock.beforePos,
9344
+ to: c.bnBlock.afterPos
9336
9345
  }).run();
9337
9346
  }
9338
9347
  return !1;
@@ -9345,19 +9354,19 @@ const pt = (e, t) => {
9345
9354
  // if one exists, the block has no children, and the selection is at the
9346
9355
  // end of the block.
9347
9356
  () => i.command(({ state: n }) => {
9348
- const r = y(n);
9357
+ const r = _(n);
9349
9358
  if (!r.isBlockContainer)
9350
9359
  return !1;
9351
9360
  const {
9352
9361
  bnBlock: a,
9353
9362
  blockContent: s,
9354
9363
  childContainer: l
9355
- } = r, { depth: c } = n.doc.resolve(a.beforePos), d = a.afterPos === n.doc.nodeSize - 3, u = n.selection.from === s.afterPos - 1, h = n.selection.empty;
9356
- if (!d && u && h && !(l !== void 0)) {
9357
- let f = c, g = a.afterPos + 1, b = n.doc.resolve(g).depth;
9364
+ } = r, { depth: d } = n.doc.resolve(a.beforePos), c = a.afterPos === n.doc.nodeSize - 3, u = n.selection.from === s.afterPos - 1, h = n.selection.empty;
9365
+ if (!c && u && h && !(l !== void 0)) {
9366
+ let f = d, g = a.afterPos + 1, b = n.doc.resolve(g).depth;
9358
9367
  for (; b < f; )
9359
9368
  f = b, g += 2, b = n.doc.resolve(g).depth;
9360
- return i.command(ht(g - 1));
9369
+ return i.command(mt(g - 1));
9361
9370
  }
9362
9371
  return !1;
9363
9372
  })
@@ -9366,20 +9375,20 @@ const pt = (e, t) => {
9366
9375
  // Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
9367
9376
  // of the block.
9368
9377
  () => i.command(({ state: n }) => {
9369
- const r = y(n);
9378
+ const r = _(n);
9370
9379
  if (!r.isBlockContainer)
9371
9380
  return !1;
9372
- const { bnBlock: a, blockContent: s } = r, { depth: l } = n.doc.resolve(a.beforePos), c = n.selection.$anchor.parentOffset === 0, d = n.selection.anchor === n.selection.head, u = s.node.childCount === 0, h = l > 1;
9373
- return c && d && u && h ? i.liftListItem("blockContainer") : !1;
9381
+ const { bnBlock: a, blockContent: s } = r, { depth: l } = n.doc.resolve(a.beforePos), d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = s.node.childCount === 0, h = l > 1;
9382
+ return d && c && u && h ? i.liftListItem("blockContainer") : !1;
9374
9383
  }),
9375
9384
  // Creates a new block and moves the selection to it if the current one is empty, while the selection is also
9376
9385
  // empty & at the start of the block.
9377
9386
  () => i.command(({ state: n, dispatch: r }) => {
9378
- const a = y(n);
9387
+ const a = _(n);
9379
9388
  if (!a.isBlockContainer)
9380
9389
  return !1;
9381
- const { bnBlock: s, blockContent: l } = a, c = n.selection.$anchor.parentOffset === 0, d = n.selection.anchor === n.selection.head, u = l.node.childCount === 0;
9382
- if (c && d && u) {
9390
+ const { bnBlock: s, blockContent: l } = a, d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = l.node.childCount === 0;
9391
+ if (d && c && u) {
9383
9392
  const h = s.afterPos, m = h + 2;
9384
9393
  if (r) {
9385
9394
  const f = n.schema.nodes.blockContainer.createAndFill();
@@ -9394,12 +9403,12 @@ const pt = (e, t) => {
9394
9403
  // Splits the current block, moving content inside that's after the cursor to a new text block below. Also
9395
9404
  // deletes the selection beforehand, if it's not empty.
9396
9405
  () => i.command(({ state: n, chain: r }) => {
9397
- const a = y(n);
9406
+ const a = _(n);
9398
9407
  if (!a.isBlockContainer)
9399
9408
  return !1;
9400
9409
  const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
9401
9410
  return s.node.childCount === 0 ? !1 : (r().deleteSelection().command(
9402
- Vt(
9411
+ zt(
9403
9412
  n.selection.from,
9404
9413
  l,
9405
9414
  l
@@ -9411,7 +9420,7 @@ const pt = (e, t) => {
9411
9420
  // editor since the browser will try to use tab for keyboard navigation.
9412
9421
  Tab: () => {
9413
9422
  var i, n, r;
9414
- return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 : Xt(this.options.editor);
9423
+ return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 : Yt(this.options.editor);
9415
9424
  },
9416
9425
  "Shift-Tab": () => {
9417
9426
  var i, n, r;
@@ -9440,7 +9449,7 @@ class Ir {
9440
9449
  const o = t.target, i = this.pmView.posAtDOM(o, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
9441
9450
  for (const a of r)
9442
9451
  if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
9443
- this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = Je(n, a.type, a.attrs) || void 0;
9452
+ this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = Ye(n, a.type, a.attrs) || void 0;
9444
9453
  break;
9445
9454
  }
9446
9455
  }
@@ -9456,7 +9465,7 @@ class Ir {
9456
9465
  });
9457
9466
  p(this, "scrollHandler", () => {
9458
9467
  var t;
9459
- this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = Pe(
9468
+ this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = Ae(
9460
9469
  this.pmView,
9461
9470
  this.linkMarkRange.from,
9462
9471
  this.linkMarkRange.to
@@ -9513,7 +9522,7 @@ class Ir {
9513
9522
  const s = this.pmView.state.selection.$from.marks();
9514
9523
  for (const l of s)
9515
9524
  if (l.type.name === this.pmView.state.schema.mark("link").type.name) {
9516
- this.keyboardHoveredLinkMark = l, this.keyboardHoveredLinkMarkRange = Je(
9525
+ this.keyboardHoveredLinkMark = l, this.keyboardHoveredLinkMarkRange = Ye(
9517
9526
  this.pmView.state.selection.$from,
9518
9527
  l.type,
9519
9528
  l.attrs
@@ -9524,7 +9533,7 @@ class Ir {
9524
9533
  if (this.mouseHoveredLinkMark && (this.linkMark = this.mouseHoveredLinkMark, this.linkMarkRange = this.mouseHoveredLinkMarkRange), this.keyboardHoveredLinkMark && (this.linkMark = this.keyboardHoveredLinkMark, this.linkMarkRange = this.keyboardHoveredLinkMarkRange), this.linkMark && this.editor.isEditable) {
9525
9534
  this.state = {
9526
9535
  show: !0,
9527
- referencePos: Pe(
9536
+ referencePos: Ae(
9528
9537
  this.pmView,
9529
9538
  this.linkMarkRange.from,
9530
9539
  this.linkMarkRange.to
@@ -9551,7 +9560,7 @@ class Ir {
9551
9560
  }
9552
9561
  }
9553
9562
  const Pr = new N("LinkToolbarPlugin");
9554
- class Ar extends ie {
9563
+ class Ar extends ne {
9555
9564
  constructor(o) {
9556
9565
  super();
9557
9566
  p(this, "view");
@@ -9658,26 +9667,26 @@ class Or {
9658
9667
  this.plugin = new B({
9659
9668
  key: Ur,
9660
9669
  view: () => {
9661
- var l, c;
9670
+ var l, d;
9662
9671
  const i = document.createElement("style"), n = t._tiptapEditor.options.injectNonce;
9663
- n && i.setAttribute("nonce", n), ((l = t.prosemirrorView) == null ? void 0 : l.root) instanceof ShadowRoot ? t.prosemirrorView.root.append(i) : (c = t.prosemirrorView) == null || c.root.head.appendChild(i);
9664
- const r = i.sheet, a = (d = "") => `.bn-block-content${d} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`, s = (d, u = !0) => {
9672
+ n && i.setAttribute("nonce", n), ((l = t.prosemirrorView) == null ? void 0 : l.root) instanceof ShadowRoot ? t.prosemirrorView.root.append(i) : (d = t.prosemirrorView) == null || d.root.head.appendChild(i);
9673
+ const r = i.sheet, a = (c = "") => `.bn-block-content${c} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`, s = (c, u = !0) => {
9665
9674
  const h = u ? "[data-is-empty-and-focused]" : "";
9666
- if (d === "default")
9675
+ if (c === "default")
9667
9676
  return a(h);
9668
- const m = `[data-content-type="${d}"]`;
9677
+ const m = `[data-content-type="${c}"]`;
9669
9678
  return a(h + m);
9670
9679
  };
9671
- for (const [d, u] of Object.entries(o)) {
9672
- const h = d === "default";
9680
+ for (const [c, u] of Object.entries(o)) {
9681
+ const h = c === "default";
9673
9682
  try {
9674
9683
  r.insertRule(
9675
9684
  `${s(
9676
- d,
9685
+ c,
9677
9686
  h
9678
9687
  )} { content: ${JSON.stringify(u)}; }`
9679
9688
  ), h || r.insertRule(
9680
- `${s(d, !0)} { content: ${JSON.stringify(
9689
+ `${s(c, !0)} { content: ${JSON.stringify(
9681
9690
  u
9682
9691
  )}; }`
9683
9692
  );
@@ -9690,8 +9699,8 @@ class Or {
9690
9699
  }
9691
9700
  return {
9692
9701
  destroy: () => {
9693
- var d, u;
9694
- ((d = t.prosemirrorView) == null ? void 0 : d.root) instanceof ShadowRoot ? t.prosemirrorView.root.removeChild(i) : (u = t.prosemirrorView) == null || u.root.head.removeChild(i);
9702
+ var c, u;
9703
+ ((c = t.prosemirrorView) == null ? void 0 : c.root) instanceof ShadowRoot ? t.prosemirrorView.root.removeChild(i) : (u = t.prosemirrorView) == null || u.root.head.removeChild(i);
9695
9704
  }
9696
9705
  };
9697
9706
  },
@@ -9704,16 +9713,16 @@ class Or {
9704
9713
  const a = r.$anchor, s = a.parent;
9705
9714
  if (s.content.size > 0)
9706
9715
  return null;
9707
- const l = a.before(), c = te.node(l, l + s.nodeSize, {
9716
+ const l = a.before(), d = oe.node(l, l + s.nodeSize, {
9708
9717
  "data-is-empty-and-focused": "true"
9709
9718
  });
9710
- return oe.create(n, [c]);
9719
+ return ie.create(n, [d]);
9711
9720
  }
9712
9721
  }
9713
9722
  });
9714
9723
  }
9715
9724
  }
9716
- const mt = new N("previous-blocks"), Rr = {
9725
+ const ft = new N("previous-blocks"), Rr = {
9717
9726
  // Numbered List Items
9718
9727
  index: "index",
9719
9728
  // Headings
@@ -9728,14 +9737,14 @@ class Vr {
9728
9737
  p(this, "plugin");
9729
9738
  let t;
9730
9739
  this.plugin = new B({
9731
- key: mt,
9740
+ key: ft,
9732
9741
  view(o) {
9733
9742
  return {
9734
9743
  update: async (i, n) => {
9735
9744
  var r;
9736
9745
  ((r = this.key) == null ? void 0 : r.getState(i.state).updatedBlocks.size) > 0 && (t = setTimeout(() => {
9737
9746
  i.dispatch(
9738
- i.state.tr.setMeta(mt, { clearUpdate: !0 })
9747
+ i.state.tr.setMeta(ft, { clearUpdate: !0 })
9739
9748
  );
9740
9749
  }, 0));
9741
9750
  },
@@ -9758,17 +9767,17 @@ class Vr {
9758
9767
  apply(o, i, n, r) {
9759
9768
  if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !o.docChanged || n.doc.eq(r.doc))
9760
9769
  return i;
9761
- const a = {}, s = Ye(n.doc, (d) => d.attrs.id), l = new Map(
9762
- s.map((d) => [d.node.attrs.id, d])
9763
- ), c = Ye(r.doc, (d) => d.attrs.id);
9764
- for (const d of c) {
9765
- const u = l.get(d.node.attrs.id), h = u == null ? void 0 : u.node.firstChild, m = d.node.firstChild;
9770
+ const a = {}, s = Qe(n.doc, (c) => c.attrs.id), l = new Map(
9771
+ s.map((c) => [c.node.attrs.id, c])
9772
+ ), d = Qe(r.doc, (c) => c.attrs.id);
9773
+ for (const c of d) {
9774
+ const u = l.get(c.node.attrs.id), h = u == null ? void 0 : u.node.firstChild, m = c.node.firstChild;
9766
9775
  if (u && h && m) {
9767
9776
  const f = {
9768
9777
  index: m.attrs.index,
9769
9778
  level: m.attrs.level,
9770
9779
  type: m.type.name,
9771
- depth: r.doc.resolve(d.pos).depth
9780
+ depth: r.doc.resolve(c.pos).depth
9772
9781
  };
9773
9782
  let g = {
9774
9783
  index: h.attrs.index,
@@ -9776,7 +9785,7 @@ class Vr {
9776
9785
  type: h.type.name,
9777
9786
  depth: n.doc.resolve(u.pos).depth
9778
9787
  };
9779
- a[d.node.attrs.id] = g, o.getMeta("numberedListIndexing") && (d.node.attrs.id in i.prevTransactionOldBlockAttrs && (g = i.prevTransactionOldBlockAttrs[d.node.attrs.id]), f.type === "numberedListItem" && (g.index = f.index)), i.currentTransactionOldBlockAttrs[d.node.attrs.id] = g, JSON.stringify(g) !== JSON.stringify(f) && (g["depth-change"] = g.depth - f.depth, i.updatedBlocks.add(d.node.attrs.id));
9788
+ a[c.node.attrs.id] = g, o.getMeta("numberedListIndexing") && (c.node.attrs.id in i.prevTransactionOldBlockAttrs && (g = i.prevTransactionOldBlockAttrs[c.node.attrs.id]), f.type === "numberedListItem" && (g.index = f.index)), i.currentTransactionOldBlockAttrs[c.node.attrs.id] = g, JSON.stringify(g) !== JSON.stringify(f) && (g["depth-change"] = g.depth - f.depth, i.updatedBlocks.add(c.node.attrs.id));
9780
9789
  }
9781
9790
  }
9782
9791
  return i.prevTransactionOldBlockAttrs = a, i;
@@ -9792,26 +9801,26 @@ class Vr {
9792
9801
  if (!r.attrs.id || !i.updatedBlocks.has(r.attrs.id))
9793
9802
  return;
9794
9803
  const s = i.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
9795
- for (const [d, u] of Object.entries(s))
9796
- l["data-prev-" + Rr[d]] = u || "none";
9797
- const c = te.node(a, a + r.nodeSize, {
9804
+ for (const [c, u] of Object.entries(s))
9805
+ l["data-prev-" + Rr[c]] = u || "none";
9806
+ const d = oe.node(a, a + r.nodeSize, {
9798
9807
  ...l
9799
9808
  });
9800
- n.push(c);
9801
- }), oe.create(o.doc, n);
9809
+ n.push(d);
9810
+ }), ie.create(o.doc, n);
9802
9811
  }
9803
9812
  }
9804
9813
  });
9805
9814
  }
9806
9815
  }
9807
- function no(e, t) {
9816
+ function so(e, t) {
9808
9817
  var o, i;
9809
9818
  for (; e && e.parentElement && e.parentElement !== t.dom && ((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) !== "blockContainer"; )
9810
9819
  e = e.parentElement;
9811
9820
  if (((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) === "blockContainer")
9812
9821
  return { node: e, id: e.getAttribute("data-id") };
9813
9822
  }
9814
- class Y extends Be {
9823
+ class Y extends Te {
9815
9824
  constructor(o, i) {
9816
9825
  super(o, i);
9817
9826
  p(this, "nodes");
@@ -9825,7 +9834,7 @@ class Y extends Be {
9825
9834
  return new Y(o.resolve(i), o.resolve(n));
9826
9835
  }
9827
9836
  content() {
9828
- return new de(j.from(this.nodes), 0, 0);
9837
+ return new ee(j.from(this.nodes), 0, 0);
9829
9838
  }
9830
9839
  eq(o) {
9831
9840
  if (!(o instanceof Y) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
@@ -9837,7 +9846,7 @@ class Y extends Be {
9837
9846
  }
9838
9847
  map(o, i) {
9839
9848
  const n = i.mapResult(this.from), r = i.mapResult(this.to);
9840
- return r.deleted ? Be.near(o.resolve(n.pos)) : n.deleted ? Be.near(o.resolve(r.pos)) : new Y(
9849
+ return r.deleted ? Te.near(o.resolve(n.pos)) : n.deleted ? Te.near(o.resolve(r.pos)) : new Y(
9841
9850
  o.resolve(n.pos),
9842
9851
  o.resolve(r.pos)
9843
9852
  );
@@ -9857,9 +9866,9 @@ function zr(e, t) {
9857
9866
  o = e.from, i = e.to;
9858
9867
  return { from: o, to: i };
9859
9868
  }
9860
- function ft(e, t, o = t) {
9869
+ function gt(e, t, o = t) {
9861
9870
  t === o && (o += e.state.doc.resolve(t + 1).node().nodeSize);
9862
- const i = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (d, u) => Array.prototype.indexOf.call(d.children, u), a = r(
9871
+ const i = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (c, u) => Array.prototype.indexOf.call(c.children, u), a = r(
9863
9872
  n,
9864
9873
  // Expects from position to be just before the first selected block.
9865
9874
  e.domAtPos(t + 1).node.parentElement
@@ -9868,15 +9877,15 @@ function ft(e, t, o = t) {
9868
9877
  // Expects to position to be just after the last selected block.
9869
9878
  e.domAtPos(o - 1).node.parentElement
9870
9879
  );
9871
- for (let d = n.childElementCount - 1; d >= 0; d--)
9872
- (d > s || d < a) && i.removeChild(i.children[d]);
9873
- ro(e.root), U = i;
9874
- const c = e.dom.className.split(" ").filter(
9875
- (d) => d !== "ProseMirror" && d !== "bn-root" && d !== "bn-editor"
9880
+ for (let c = n.childElementCount - 1; c >= 0; c--)
9881
+ (c > s || c < a) && i.removeChild(i.children[c]);
9882
+ lo(e.root), U = i;
9883
+ const d = e.dom.className.split(" ").filter(
9884
+ (c) => c !== "ProseMirror" && c !== "bn-root" && c !== "bn-editor"
9876
9885
  ).join(" ");
9877
- U.className = U.className + " bn-drag-preview " + c, e.root instanceof ShadowRoot ? e.root.appendChild(U) : e.root.body.appendChild(U);
9886
+ U.className = U.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(U) : e.root.body.appendChild(U);
9878
9887
  }
9879
- function ro(e) {
9888
+ function lo(e) {
9880
9889
  U !== void 0 && (e instanceof ShadowRoot ? e.removeChild(U) : e.body.removeChild(U), U = void 0);
9881
9890
  }
9882
9891
  function Fr(e, t, o) {
@@ -9890,25 +9899,25 @@ function Fr(e, t, o) {
9890
9899
  throw new Error(`Block with ID ${t.id} not found`);
9891
9900
  const r = n.posBeforeNode;
9892
9901
  if (r != null) {
9893
- const a = i.state.selection, s = i.state.doc, { from: l, to: c } = zr(a, s), d = l <= r && r < c, u = a.$anchor.node() !== a.$head.node() || a instanceof Y;
9894
- d && u ? (i.dispatch(
9895
- i.state.tr.setSelection(Y.create(s, l, c))
9896
- ), ft(i, l, c)) : (i.dispatch(
9902
+ const a = i.state.selection, s = i.state.doc, { from: l, to: d } = zr(a, s), c = l <= r && r < d, u = a.$anchor.node() !== a.$head.node() || a instanceof Y;
9903
+ c && u ? (i.dispatch(
9904
+ i.state.tr.setSelection(Y.create(s, l, d))
9905
+ ), gt(i, l, d)) : (i.dispatch(
9897
9906
  i.state.tr.setSelection(ce.create(i.state.doc, r))
9898
- ), ft(i, r));
9899
- const h = i.state.selection.content(), m = o.pmSchema, f = yt.__serializeForClipboard(
9907
+ ), gt(i, r));
9908
+ const h = i.state.selection.content(), m = o.pmSchema, f = wt.__serializeForClipboard(
9900
9909
  i,
9901
9910
  h
9902
- ).dom.innerHTML, g = ve(m, o), b = to(h.content, o.schema), k = g.exportBlocks(b, {}), C = We(k);
9911
+ ).dom.innerHTML, g = xe(m, o), b = no(h.content, o.schema), k = g.exportBlocks(b, {}), C = Ke(k);
9903
9912
  e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", k), e.dataTransfer.setData("text/plain", C), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(U, 0, 0), i.dragging = { slice: h, move: !0 };
9904
9913
  }
9905
9914
  }
9906
- const re = 0.1;
9907
- function Oe(e, t, o = !0) {
9915
+ const ae = 0.1;
9916
+ function Re(e, t, o = !0) {
9908
9917
  const i = e.root.elementsFromPoint(t.left, t.top);
9909
9918
  for (const n of i)
9910
9919
  if (e.dom.contains(n))
9911
- return o && n.closest("[data-node-type=columnList]") ? Oe(
9920
+ return o && n.closest("[data-node-type=columnList]") ? Re(
9912
9921
  e,
9913
9922
  {
9914
9923
  left: t.left + 50,
@@ -9916,7 +9925,7 @@ function Oe(e, t, o = !0) {
9916
9925
  top: t.top
9917
9926
  },
9918
9927
  !1
9919
- ) : no(n, e);
9928
+ ) : so(n, e);
9920
9929
  }
9921
9930
  function Gr(e, t) {
9922
9931
  if (!t.dom.firstChild)
@@ -9926,10 +9935,10 @@ function Gr(e, t) {
9926
9935
  top: e.y
9927
9936
  }, n = i.left < o.left, r = i.left > o.right;
9928
9937
  n && (i.left = o.left + 10), r && (i.left = o.right - 10);
9929
- let a = Oe(t, i);
9938
+ let a = Re(t, i);
9930
9939
  if (!r && a) {
9931
9940
  const s = a.node.getBoundingClientRect();
9932
- i.left = s.right - 10, a = Oe(t, i, !1);
9941
+ i.left = s.right - 10, a = Re(t, i, !1);
9933
9942
  }
9934
9943
  return a;
9935
9944
  }
@@ -10046,7 +10055,7 @@ class $r {
10046
10055
  ), this.pmView.root.addEventListener(
10047
10056
  "dragover",
10048
10057
  this.onDragOver
10049
- ), $e(), this.pmView.root.addEventListener(
10058
+ ), We(), this.pmView.root.addEventListener(
10050
10059
  "mousemove",
10051
10060
  this.onMouseMove,
10052
10061
  !0
@@ -10058,7 +10067,7 @@ class $r {
10058
10067
  }
10059
10068
  createSyntheticEvent(t) {
10060
10069
  const o = new Event(t.type, t), i = this.pmView.dom.firstChild.getBoundingClientRect();
10061
- return o.clientX = t.clientX, o.clientY = t.clientY, t.clientX < i.left && t.clientX > i.left - i.width * re ? o.clientX = i.left + i.width * re / 2 : t.clientX > i.right && t.clientX < i.right + i.width * re ? o.clientX = i.right - i.width * re / 2 : (t.clientX < i.left || t.clientX > i.right) && (o.clientX = i.left + re * i.width * 2), o.clientY = Math.min(
10070
+ return o.clientX = t.clientX, o.clientY = t.clientY, t.clientX < i.left && t.clientX > i.left - i.width * ae ? o.clientX = i.left + i.width * ae / 2 : t.clientX > i.right && t.clientX < i.right + i.width * ae ? o.clientX = i.right - i.width * ae / 2 : (t.clientX < i.left || t.clientX > i.right) && (o.clientX = i.left + ae * i.width * 2), o.clientY = Math.min(
10062
10071
  Math.max(t.clientY, i.top),
10063
10072
  i.top + i.height
10064
10073
  ), o.dataTransfer = t.dataTransfer, o.preventDefault = () => t.preventDefault(), o.synthetic = !0, o;
@@ -10095,7 +10104,7 @@ class $r {
10095
10104
  }
10096
10105
  }
10097
10106
  const Wr = new N("SideMenuPlugin");
10098
- class Kr extends ie {
10107
+ class Kr extends ne {
10099
10108
  constructor(o) {
10100
10109
  super();
10101
10110
  p(this, "view");
@@ -10110,7 +10119,7 @@ class Kr extends ie {
10110
10119
  * Handles drag & drop events for blocks.
10111
10120
  */
10112
10121
  p(this, "blockDragEnd", () => {
10113
- this.editor.prosemirrorView && ro(this.editor.prosemirrorView.root);
10122
+ this.editor.prosemirrorView && lo(this.editor.prosemirrorView.root);
10114
10123
  });
10115
10124
  /**
10116
10125
  * Freezes the side menu. When frozen, the side menu will stay
@@ -10139,7 +10148,7 @@ class Kr extends ie {
10139
10148
  return this.on("update", o);
10140
10149
  }
10141
10150
  }
10142
- const qr = _o((e) => e.type.name === "blockContainer");
10151
+ const qr = vo((e) => e.type.name === "blockContainer");
10143
10152
  class Xr {
10144
10153
  constructor(t, o) {
10145
10154
  p(this, "state");
@@ -10180,7 +10189,7 @@ class Xr {
10180
10189
  }, this.rootEl = (i = this.editor.prosemirrorView) == null ? void 0 : i.root, (n = this.rootEl) == null || n.addEventListener("scroll", this.handleScroll, !0);
10181
10190
  }
10182
10191
  update(t, o) {
10183
- var c;
10192
+ var d;
10184
10193
  const i = Q.getState(o), n = Q.getState(
10185
10194
  t.state
10186
10195
  ), r = i === void 0 && n !== void 0, a = i !== void 0 && n === void 0;
@@ -10190,7 +10199,7 @@ class Xr {
10190
10199
  this.state.show = !1, this.emitUpdate(this.pluginState.triggerCharacter);
10191
10200
  return;
10192
10201
  }
10193
- const l = (c = this.rootEl) == null ? void 0 : c.querySelector(
10202
+ const l = (d = this.rootEl) == null ? void 0 : d.querySelector(
10194
10203
  `[data-decoration-id="${this.pluginState.decorationId}"]`
10195
10204
  );
10196
10205
  this.editor.isEditable && l && (this.state = {
@@ -10205,7 +10214,7 @@ class Xr {
10205
10214
  }
10206
10215
  }
10207
10216
  const Q = new N("SuggestionMenuPlugin");
10208
- class Zr extends ie {
10217
+ class Zr extends ne {
10209
10218
  constructor(o) {
10210
10219
  super();
10211
10220
  p(this, "view");
@@ -10260,11 +10269,11 @@ class Zr extends ie {
10260
10269
  r.triggerCharacter !== void 0 && s.selection.from < r.queryStartPos
10261
10270
  )
10262
10271
  return;
10263
- const c = { ...r };
10264
- return c.query = s.doc.textBetween(
10272
+ const d = { ...r };
10273
+ return d.query = s.doc.textBetween(
10265
10274
  r.queryStartPos,
10266
10275
  s.selection.from
10267
- ), c;
10276
+ ), d;
10268
10277
  }
10269
10278
  },
10270
10279
  props: {
@@ -10284,8 +10293,8 @@ class Zr extends ie {
10284
10293
  if (!r.deleteTriggerCharacter) {
10285
10294
  const a = qr(n.selection);
10286
10295
  if (a)
10287
- return oe.create(n.doc, [
10288
- te.node(
10296
+ return ie.create(n.doc, [
10297
+ oe.node(
10289
10298
  a.pos,
10290
10299
  a.pos + a.node.nodeSize,
10291
10300
  {
@@ -10296,8 +10305,8 @@ class Zr extends ie {
10296
10305
  )
10297
10306
  ]);
10298
10307
  }
10299
- return oe.create(n.doc, [
10300
- te.inline(
10308
+ return ie.create(n.doc, [
10309
+ oe.inline(
10301
10310
  r.queryStartPos - r.triggerCharacter.length,
10302
10311
  r.queryStartPos,
10303
10312
  {
@@ -10319,17 +10328,17 @@ class Zr extends ie {
10319
10328
  return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
10320
10329
  }
10321
10330
  }
10322
- function as(e, t) {
10331
+ function ss(e, t) {
10323
10332
  e.suggestionMenus.addTriggerCharacter(t);
10324
10333
  }
10325
10334
  let T;
10326
- function gt(e) {
10335
+ function bt(e) {
10327
10336
  T || (T = document.createElement("div"), T.innerHTML = "_", T.style.opacity = "0", T.style.height = "1px", T.style.width = "1px", e instanceof Document ? e.body.appendChild(T) : e.appendChild(T));
10328
10337
  }
10329
10338
  function Jr(e) {
10330
10339
  T && (e instanceof Document ? e.body.removeChild(T) : e.removeChild(T), T = void 0);
10331
10340
  }
10332
- function fe(e) {
10341
+ function ge(e) {
10333
10342
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
10334
10343
  }
10335
10344
  function Yr(e) {
@@ -10374,12 +10383,12 @@ class ea {
10374
10383
  this.mouseState = "up", this.mouseMoveHandler(t);
10375
10384
  });
10376
10385
  p(this, "mouseMoveHandler", (t) => {
10377
- var c, d, u, h;
10386
+ var d, c, u, h;
10378
10387
  if (this.menuFrozen || this.mouseState === "selecting" || !(t.target instanceof Element) || !this.pmView.dom.contains(t.target))
10379
10388
  return;
10380
10389
  const o = Yr(t.target);
10381
- if ((o == null ? void 0 : o.type) === "cell" && this.mouseState === "down" && !((c = this.state) != null && c.draggingState)) {
10382
- this.mouseState = "selecting", (d = this.state) != null && d.show && (this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate());
10390
+ if ((o == null ? void 0 : o.type) === "cell" && this.mouseState === "down" && !((d = this.state) != null && d.draggingState)) {
10391
+ this.mouseState = "selecting", (c = this.state) != null && c.show && (this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate());
10383
10392
  return;
10384
10393
  }
10385
10394
  if (!o || !this.editor.isEditable) {
@@ -10388,7 +10397,7 @@ class ea {
10388
10397
  }
10389
10398
  if (!o.tbodyNode)
10390
10399
  return;
10391
- const i = o.tbodyNode.getBoundingClientRect(), n = no(o.domNode, this.pmView);
10400
+ const i = o.tbodyNode.getBoundingClientRect(), n = so(o.domNode, this.pmView);
10392
10401
  if (!n)
10393
10402
  return;
10394
10403
  this.tableElement = n.node;
@@ -10426,7 +10435,7 @@ class ea {
10426
10435
  referencePosCell: g ? void 0 : this.state.referencePosCell
10427
10436
  };
10428
10437
  } else {
10429
- const m = fe(o.domNode), f = fe(o.domNode.parentElement), g = o.domNode.getBoundingClientRect();
10438
+ const m = ge(o.domNode), f = ge(o.domNode.parentElement), g = o.domNode.getBoundingClientRect();
10430
10439
  if (this.state !== void 0 && this.state.show && this.tableId === n.id && this.state.rowIndex === f && this.state.colIndex === m)
10431
10440
  return;
10432
10441
  this.state = {
@@ -10470,11 +10479,11 @@ class ea {
10470
10479
  );
10471
10480
  const n = i[0];
10472
10481
  let r = !1;
10473
- const a = fe(n.parentElement), s = fe(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, d = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
10482
+ const a = ge(n.parentElement), s = ge(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, c = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
10474
10483
  (this.state.rowIndex !== a || this.state.colIndex !== s) && (this.state.rowIndex = a, this.state.colIndex = s, this.state.referencePosCell = n.getBoundingClientRect(), r = !0);
10475
10484
  const u = this.state.draggingState.draggedCellOrientation === "row" ? o.top : o.left;
10476
- this.state.draggingState.mousePos !== u && (this.state.draggingState.mousePos = u, r = !0), r && this.emitUpdate(), d && this.editor.dispatch(
10477
- this.pmView.state.tr.setMeta(ae, !0)
10485
+ this.state.draggingState.mousePos !== u && (this.state.draggingState.mousePos = u, r = !0), r && this.emitUpdate(), c && this.editor.dispatch(
10486
+ this.pmView.state.tr.setMeta(se, !0)
10478
10487
  );
10479
10488
  });
10480
10489
  p(this, "dropHandler", (t) => {
@@ -10545,8 +10554,8 @@ class ea {
10545
10554
  );
10546
10555
  }
10547
10556
  }
10548
- const ae = new N("TableHandlesPlugin");
10549
- class ta extends ie {
10557
+ const se = new N("TableHandlesPlugin");
10558
+ class ta extends ne {
10550
10559
  constructor(o) {
10551
10560
  super();
10552
10561
  p(this, "view");
@@ -10565,7 +10574,7 @@ class ta extends ie {
10565
10574
  originalIndex: this.view.state.colIndex,
10566
10575
  mousePos: o.clientX
10567
10576
  }, this.view.emitUpdate(), this.editor.dispatch(
10568
- this.editor._tiptapEditor.state.tr.setMeta(ae, {
10577
+ this.editor._tiptapEditor.state.tr.setMeta(se, {
10569
10578
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
10570
10579
  originalIndex: this.view.state.colIndex,
10571
10580
  newIndex: this.view.state.colIndex,
@@ -10573,7 +10582,7 @@ class ta extends ie {
10573
10582
  })
10574
10583
  ), !this.editor.prosemirrorView)
10575
10584
  throw new Error("Editor view not initialized.");
10576
- gt(this.editor.prosemirrorView.root), o.dataTransfer.setDragImage(T, 0, 0), o.dataTransfer.effectAllowed = "move";
10585
+ bt(this.editor.prosemirrorView.root), o.dataTransfer.setDragImage(T, 0, 0), o.dataTransfer.effectAllowed = "move";
10577
10586
  });
10578
10587
  /**
10579
10588
  * Callback that should be set on the `dragStart` event for whichever element
@@ -10589,7 +10598,7 @@ class ta extends ie {
10589
10598
  originalIndex: this.view.state.rowIndex,
10590
10599
  mousePos: o.clientY
10591
10600
  }, this.view.emitUpdate(), this.editor.dispatch(
10592
- this.editor._tiptapEditor.state.tr.setMeta(ae, {
10601
+ this.editor._tiptapEditor.state.tr.setMeta(se, {
10593
10602
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
10594
10603
  originalIndex: this.view.state.rowIndex,
10595
10604
  newIndex: this.view.state.rowIndex,
@@ -10597,7 +10606,7 @@ class ta extends ie {
10597
10606
  })
10598
10607
  ), !this.editor.prosemirrorView)
10599
10608
  throw new Error("Editor view not initialized.");
10600
- gt(this.editor.prosemirrorView.root), o.dataTransfer.setDragImage(T, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
10609
+ bt(this.editor.prosemirrorView.root), o.dataTransfer.setDragImage(T, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
10601
10610
  });
10602
10611
  /**
10603
10612
  * Callback that should be set on the `dragEnd` event for both the element
@@ -10609,7 +10618,7 @@ class ta extends ie {
10609
10618
  "Attempted to drag table row, but no table block was hovered prior."
10610
10619
  );
10611
10620
  if (this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
10612
- this.editor._tiptapEditor.state.tr.setMeta(ae, null)
10621
+ this.editor._tiptapEditor.state.tr.setMeta(se, null)
10613
10622
  ), !this.editor.prosemirrorView)
10614
10623
  throw new Error("Editor view not initialized.");
10615
10624
  Jr(this.editor.prosemirrorView.root);
@@ -10629,7 +10638,7 @@ class ta extends ie {
10629
10638
  this.view.menuFrozen = !1;
10630
10639
  });
10631
10640
  this.editor = o, this.plugin = new B({
10632
- key: ae,
10641
+ key: se,
10633
10642
  view: (i) => (this.view = new ea(o, i, (n) => {
10634
10643
  this.emit("update", n);
10635
10644
  }), this.view),
@@ -10644,19 +10653,19 @@ class ta extends ie {
10644
10653
  return;
10645
10654
  const r = [];
10646
10655
  if (n === this.view.state.draggingState.originalIndex)
10647
- return oe.create(i.doc, r);
10656
+ return ie.create(i.doc, r);
10648
10657
  const a = i.doc.resolve(this.view.tablePos + 1), s = a.node();
10649
10658
  if (this.view.state.draggingState.draggedCellOrientation === "row") {
10650
10659
  const l = i.doc.resolve(
10651
10660
  a.posAtIndex(n) + 1
10652
- ), c = l.node();
10653
- for (let d = 0; d < c.childCount; d++) {
10661
+ ), d = l.node();
10662
+ for (let c = 0; c < d.childCount; c++) {
10654
10663
  const u = i.doc.resolve(
10655
- l.posAtIndex(d) + 1
10664
+ l.posAtIndex(c) + 1
10656
10665
  ), h = u.node(), m = u.pos + (n > this.view.state.draggingState.originalIndex ? h.nodeSize - 2 : 0);
10657
10666
  r.push(
10658
10667
  // The widget is a small bar which spans the width of the cell.
10659
- te.widget(m, () => {
10668
+ oe.widget(m, () => {
10660
10669
  const f = document.createElement("div");
10661
10670
  return f.className = "bn-table-drop-cursor", f.style.left = "0", f.style.right = "0", n > this.view.state.draggingState.originalIndex ? f.style.bottom = "-2px" : f.style.top = "-3px", f.style.height = "4px", f;
10662
10671
  })
@@ -10664,20 +10673,20 @@ class ta extends ie {
10664
10673
  }
10665
10674
  } else
10666
10675
  for (let l = 0; l < s.childCount; l++) {
10667
- const c = i.doc.resolve(
10676
+ const d = i.doc.resolve(
10668
10677
  a.posAtIndex(l) + 1
10669
- ), d = i.doc.resolve(
10670
- c.posAtIndex(n) + 1
10671
- ), u = d.node(), h = d.pos + (n > this.view.state.draggingState.originalIndex ? u.nodeSize - 2 : 0);
10678
+ ), c = i.doc.resolve(
10679
+ d.posAtIndex(n) + 1
10680
+ ), u = c.node(), h = c.pos + (n > this.view.state.draggingState.originalIndex ? u.nodeSize - 2 : 0);
10672
10681
  r.push(
10673
10682
  // The widget is a small bar which spans the height of the cell.
10674
- te.widget(h, () => {
10683
+ oe.widget(h, () => {
10675
10684
  const m = document.createElement("div");
10676
10685
  return m.className = "bn-table-drop-cursor", m.style.top = "0", m.style.bottom = "0", n > this.view.state.draggingState.originalIndex ? m.style.right = "-2px" : m.style.left = "-3px", m.style.width = "4px", m;
10677
10686
  })
10678
10687
  );
10679
10688
  }
10680
- return oe.create(i.doc, r);
10689
+ return ie.create(i.doc, r);
10681
10690
  }
10682
10691
  }
10683
10692
  });
@@ -10720,9 +10729,9 @@ const oa = I.create({
10720
10729
  types: ["blockContainer"],
10721
10730
  attributes: {
10722
10731
  textColor: {
10723
- default: v.textColor.default,
10724
- parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : v.textColor.default,
10725
- renderHTML: (e) => e.textColor === v.textColor.default ? {} : {
10732
+ default: x.textColor.default,
10733
+ parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : x.textColor.default,
10734
+ renderHTML: (e) => e.textColor === x.textColor.default ? {} : {
10726
10735
  "data-text-color": e.textColor
10727
10736
  }
10728
10737
  }
@@ -10738,11 +10747,11 @@ const oa = I.create({
10738
10747
  new B({
10739
10748
  key: e,
10740
10749
  appendTransaction: (t, o, i) => {
10741
- const { doc: n, tr: r, schema: a } = i, s = e.getState(i), l = n.content.size - 2, c = a.nodes.blockContainer, d = a.nodes.paragraph;
10750
+ const { doc: n, tr: r, schema: a } = i, s = e.getState(i), l = n.content.size - 2, d = a.nodes.blockContainer, c = a.nodes.paragraph;
10742
10751
  if (s)
10743
10752
  return r.insert(
10744
10753
  l,
10745
- c.create(void 0, d.create())
10754
+ d.create(void 0, c.create())
10746
10755
  );
10747
10756
  },
10748
10757
  state: {
@@ -10865,25 +10874,25 @@ const oa = I.create({
10865
10874
  }, ca = (e) => {
10866
10875
  var o;
10867
10876
  const t = [
10868
- ne.ClipboardTextSerializer,
10869
- ne.Commands,
10870
- ne.Editable,
10871
- ne.FocusEvents,
10872
- ne.Tabindex,
10877
+ re.ClipboardTextSerializer,
10878
+ re.Commands,
10879
+ re.Editable,
10880
+ re.FocusEvents,
10881
+ re.Tabindex,
10873
10882
  // DevTools,
10874
- zo,
10883
+ $o,
10875
10884
  // DropCursor,
10876
10885
  ue.configure({
10877
10886
  // everything from bnBlock group (nodes that represent a BlockNote block should have an id)
10878
10887
  types: ["blockContainer", "columnList", "column"],
10879
10888
  setIdAttribute: e.setIdAttribute
10880
10889
  }),
10881
- Fo.extend({ priority: 10 }),
10890
+ Wo.extend({ priority: 10 }),
10882
10891
  // Comments,
10883
10892
  // basics:
10884
- Wo,
10893
+ Xo,
10885
10894
  // marks:
10886
- $o.extend({
10895
+ qo.extend({
10887
10896
  inclusive: !1
10888
10897
  }).configure({
10889
10898
  defaultProtocol: jr,
@@ -10941,7 +10950,7 @@ const oa = I.create({
10941
10950
  ];
10942
10951
  if (e.collaboration) {
10943
10952
  if (t.push(
10944
- Ro.configure({
10953
+ Fo.configure({
10945
10954
  fragment: e.collaboration.fragment
10946
10955
  })
10947
10956
  ), (o = e.collaboration.provider) != null && o.awareness) {
@@ -10954,7 +10963,7 @@ const oa = I.create({
10954
10963
  return r.insertBefore(s, null), r.insertBefore(a, null), r.insertBefore(l, null), r;
10955
10964
  };
10956
10965
  t.push(
10957
- Vo.configure({
10966
+ Go.configure({
10958
10967
  user: e.collaboration.user,
10959
10968
  render: e.collaboration.renderCursor || i,
10960
10969
  provider: e.collaboration.provider
@@ -10962,7 +10971,7 @@ const oa = I.create({
10962
10971
  );
10963
10972
  }
10964
10973
  } else
10965
- t.push(Go);
10974
+ t.push(Ko);
10966
10975
  return t;
10967
10976
  };
10968
10977
  function ua(e, t) {
@@ -10991,7 +11000,8 @@ function pa(e, t) {
10991
11000
  }
10992
11001
  function ha(e, t) {
10993
11002
  let o = j.from(e.content);
10994
- o = pa(o, t.state.schema);
11003
+ if (o = pa(o, t.state.schema), !ma(o, t))
11004
+ return new ee(o, e.openStart, e.openEnd);
10995
11005
  for (let i = 0; i < o.childCount; i++)
10996
11006
  if (o.child(i).type.spec.group === "blockContent") {
10997
11007
  const n = [o.child(i)];
@@ -11005,14 +11015,28 @@ function ha(e, t) {
11005
11015
  );
11006
11016
  o = o.replaceChild(i, r);
11007
11017
  }
11008
- return new de(o, e.openStart, e.openEnd);
11018
+ return new ee(o, e.openStart, e.openEnd);
11019
+ }
11020
+ function ma(e, t) {
11021
+ var r, a;
11022
+ const o = e.childCount === 1, i = ((r = e.firstChild) == null ? void 0 : r.type.spec.content) === "inline*", n = ((a = e.firstChild) == null ? void 0 : a.type.spec.content) === "tableRow+";
11023
+ if (o) {
11024
+ if (i)
11025
+ return !1;
11026
+ if (n) {
11027
+ const s = _(t.state);
11028
+ if (s.isBlockContainer)
11029
+ return !(s.blockContent.node.type.spec.content === "tableRow+");
11030
+ }
11031
+ }
11032
+ return !0;
11009
11033
  }
11010
- function Me(e) {
11034
+ function Le(e) {
11011
11035
  return e && Object.fromEntries(
11012
11036
  Object.entries(e).filter(([, t]) => t !== void 0)
11013
11037
  );
11014
11038
  }
11015
- class qe {
11039
+ class Xe {
11016
11040
  constructor(t) {
11017
11041
  p(this, "blockSpecs");
11018
11042
  p(this, "inlineContentSpecs");
@@ -11024,15 +11048,15 @@ class qe {
11024
11048
  p(this, "BlockNoteEditor", "only for types");
11025
11049
  p(this, "Block", "only for types");
11026
11050
  p(this, "PartialBlock", "only for types");
11027
- this.blockSpecs = Me(t == null ? void 0 : t.blockSpecs) || zt, this.inlineContentSpecs = Me(t == null ? void 0 : t.inlineContentSpecs) || Gt, this.styleSpecs = Me(t == null ? void 0 : t.styleSpecs) || Ft, this.blockSchema = Pt(this.blockSpecs), this.inlineContentSchema = Nt(
11051
+ this.blockSpecs = Le(t == null ? void 0 : t.blockSpecs) || $t, this.inlineContentSpecs = Le(t == null ? void 0 : t.inlineContentSpecs) || Kt, this.styleSpecs = Le(t == null ? void 0 : t.styleSpecs) || Wt, this.blockSchema = Pt(this.blockSpecs), this.inlineContentSchema = Nt(
11028
11052
  this.inlineContentSpecs
11029
11053
  ), this.styleSchema = Dt(this.styleSpecs);
11030
11054
  }
11031
11055
  static create(t) {
11032
- return new qe(t);
11056
+ return new Xe(t);
11033
11057
  }
11034
11058
  }
11035
- const _e = class _e extends yo {
11059
+ const ye = class ye extends xo {
11036
11060
  constructor(o, i) {
11037
11061
  super({ ...o, content: void 0 });
11038
11062
  p(this, "_state");
@@ -11051,15 +11075,15 @@ const _e = class _e extends yo {
11051
11075
  n.nodes.doc.createAndFill = (...l) => {
11052
11076
  if (r)
11053
11077
  return r;
11054
- const c = a.apply(n.nodes.doc, l), d = JSON.parse(JSON.stringify(c.toJSON()));
11055
- return d.content[0].content[0].attrs.id = "initialBlockId", r = po.fromJSON(n, d), r;
11078
+ const d = a.apply(n.nodes.doc, l), c = JSON.parse(JSON.stringify(d.toJSON()));
11079
+ return c.content[0].content[0].attrs.id = "initialBlockId", r = fo.fromJSON(n, c), r;
11056
11080
  };
11057
11081
  let s;
11058
11082
  try {
11059
11083
  const l = o == null ? void 0 : o.content.map(
11060
- (c) => X(c, this.schema, i).toJSON()
11084
+ (d) => X(d, this.schema, i).toJSON()
11061
11085
  );
11062
- s = wo(
11086
+ s = Co(
11063
11087
  {
11064
11088
  type: "doc",
11065
11089
  content: [
@@ -11080,7 +11104,7 @@ const _e = class _e extends yo {
11080
11104
  "Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(o.content)
11081
11105
  );
11082
11106
  }
11083
- this._state = xo.create({
11107
+ this._state = So.create({
11084
11108
  doc: s,
11085
11109
  schema: this.schema
11086
11110
  // selection: selection || undefined,
@@ -11099,7 +11123,7 @@ const _e = class _e extends yo {
11099
11123
  this._creating = !0, queueMicrotask(() => {
11100
11124
  if (!this._creating)
11101
11125
  return;
11102
- this.view = new Ko(
11126
+ this.view = new Zo(
11103
11127
  { mount: this.options.element },
11104
11128
  // use mount option so that we reuse the existing element instead of creating a new one
11105
11129
  {
@@ -11116,26 +11140,26 @@ const _e = class _e extends yo {
11116
11140
  });
11117
11141
  }
11118
11142
  };
11119
- p(_e, "create", (o, i) => {
11143
+ p(ye, "create", (o, i) => {
11120
11144
  var r, a;
11121
11145
  const n = (r = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : r.setTimeout;
11122
11146
  typeof ((a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : a.setTimeout) < "u" && (globalThis.window.setTimeout = () => 0);
11123
11147
  try {
11124
- return new _e(o, i);
11148
+ return new ye(o, i);
11125
11149
  } finally {
11126
11150
  n && (globalThis.window.setTimeout = n);
11127
11151
  }
11128
11152
  });
11129
- let ke = _e;
11130
- ke.prototype.createView = function() {
11153
+ let _e = ye;
11154
+ _e.prototype.createView = function() {
11131
11155
  this.options.onPaste = this.options.onDrop = void 0;
11132
11156
  };
11133
- const ma = {
11157
+ const fa = {
11134
11158
  enableInputRules: !0,
11135
11159
  enablePasteRules: !0,
11136
11160
  enableCoreExtensions: !1
11137
11161
  };
11138
- class ao {
11162
+ class co {
11139
11163
  constructor(t) {
11140
11164
  p(this, "_pmSchema");
11141
11165
  /**
@@ -11201,7 +11225,7 @@ class ao {
11201
11225
  p(this, "mount", (t) => {
11202
11226
  this._tiptapEditor.mount(t);
11203
11227
  });
11204
- var s, l, c, d, u, h, m;
11228
+ var s, l, d, c, u, h, m;
11205
11229
  this.options = t;
11206
11230
  const o = t;
11207
11231
  if (o.onEditorContentChange)
@@ -11220,10 +11244,10 @@ class ao {
11220
11244
  throw new Error(
11221
11245
  "editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
11222
11246
  );
11223
- this.dictionary = t.dictionary || wt;
11247
+ this.dictionary = t.dictionary || vt;
11224
11248
  const i = {
11225
11249
  defaultStyles: !0,
11226
- schema: t.schema || qe.create(),
11250
+ schema: t.schema || Xe.create(),
11227
11251
  _headless: !1,
11228
11252
  ...t,
11229
11253
  placeholders: {
@@ -11243,7 +11267,7 @@ class ao {
11243
11267
  setIdAttribute: i.setIdAttribute,
11244
11268
  animations: i.animations ?? !0,
11245
11269
  tableHandles: L("table", this),
11246
- dropCursor: this.options.dropCursor ?? qo,
11270
+ dropCursor: this.options.dropCursor ?? Jo,
11247
11271
  placeholders: i.placeholders,
11248
11272
  tabBehavior: i.tabBehavior
11249
11273
  }), (((s = i._tiptapOptions) == null ? void 0 : s.extensions) || []).forEach((f) => {
@@ -11285,7 +11309,7 @@ class ao {
11285
11309
  );
11286
11310
  const r = [
11287
11311
  ...Object.entries(this.extensions).map(([f, g]) => {
11288
- if (g instanceof I || g instanceof q || g instanceof ye)
11312
+ if (g instanceof I || g instanceof q || g instanceof we)
11289
11313
  return g;
11290
11314
  if (!g.plugin)
11291
11315
  throw new Error(
@@ -11297,7 +11321,7 @@ class ao {
11297
11321
  });
11298
11322
  })
11299
11323
  ], a = {
11300
- ...ma,
11324
+ ...fa,
11301
11325
  ...i._tiptapOptions,
11302
11326
  content: n,
11303
11327
  extensions: r,
@@ -11308,7 +11332,7 @@ class ao {
11308
11332
  // editable, so you can't focus it. We want to revert this as we have
11309
11333
  // UI behaviour that relies on it.
11310
11334
  tabIndex: "0",
11311
- ...(d = (c = i._tiptapOptions) == null ? void 0 : c.editorProps) == null ? void 0 : d.attributes,
11335
+ ...(c = (d = i._tiptapOptions) == null ? void 0 : d.editorProps) == null ? void 0 : c.attributes,
11312
11336
  ...(u = i.domAttributes) == null ? void 0 : u.editor,
11313
11337
  class: G(
11314
11338
  "bn-editor",
@@ -11319,7 +11343,7 @@ class ao {
11319
11343
  transformPasted: ha
11320
11344
  }
11321
11345
  };
11322
- this.headless ? this._pmSchema = vo(a.extensions) : (this._tiptapEditor = ke.create(
11346
+ this.headless ? this._pmSchema = Eo(a.extensions) : (this._tiptapEditor = _e.create(
11323
11347
  a,
11324
11348
  this.schema.styleSchema
11325
11349
  ), this._pmSchema = this._tiptapEditor.schema);
@@ -11328,7 +11352,7 @@ class ao {
11328
11352
  return this._pmSchema;
11329
11353
  }
11330
11354
  static create(t = {}) {
11331
- return new ao(t);
11355
+ return new co(t);
11332
11356
  }
11333
11357
  dispatch(t) {
11334
11358
  this._tiptapEditor.dispatch(t);
@@ -11473,7 +11497,7 @@ class ao {
11473
11497
  * @param placement Whether the text cursor should be placed at the start or end of the block.
11474
11498
  */
11475
11499
  setTextCursorPosition(t, o = "start") {
11476
- Jt(this, t, o);
11500
+ eo(this, t, o);
11477
11501
  }
11478
11502
  /**
11479
11503
  * Gets a snapshot of the current selection.
@@ -11527,7 +11551,7 @@ class ao {
11527
11551
  * @param update A partial block which defines how the existing block should be changed.
11528
11552
  */
11529
11553
  updateBlock(t, o) {
11530
- return hn(this, t, o);
11554
+ return gn(this, t, o);
11531
11555
  }
11532
11556
  /**
11533
11557
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
@@ -11663,7 +11687,7 @@ class ao {
11663
11687
  * Nests the block containing the text cursor into the block above it.
11664
11688
  */
11665
11689
  nestBlock() {
11666
- Xt(this);
11690
+ Yt(this);
11667
11691
  }
11668
11692
  /**
11669
11693
  * Checks if the block containing the text cursor is nested.
@@ -11701,7 +11725,7 @@ class ao {
11701
11725
  * @returns The blocks, serialized as an HTML string.
11702
11726
  */
11703
11727
  async blocksToHTMLLossy(t = this.document) {
11704
- return ve(this.pmSchema, this).exportBlocks(t, {});
11728
+ return xe(this.pmSchema, this).exportBlocks(t, {});
11705
11729
  }
11706
11730
  /**
11707
11731
  * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
@@ -11713,7 +11737,7 @@ class ao {
11713
11737
  * @returns The blocks, serialized as an HTML string.
11714
11738
  */
11715
11739
  async blocksToFullHTML(t) {
11716
- return gi(this.pmSchema, this).serializeBlocks(t, {});
11740
+ return _i(this.pmSchema, this).serializeBlocks(t, {});
11717
11741
  }
11718
11742
  /**
11719
11743
  * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
@@ -11723,7 +11747,7 @@ class ao {
11723
11747
  * @returns The blocks parsed from the HTML string.
11724
11748
  */
11725
11749
  async tryParseHTMLToBlocks(t) {
11726
- return Qt(
11750
+ return oo(
11727
11751
  t,
11728
11752
  this.schema.blockSchema,
11729
11753
  this.schema.inlineContentSchema,
@@ -11813,7 +11837,7 @@ class ao {
11813
11837
  );
11814
11838
  }
11815
11839
  }
11816
- const ss = {
11840
+ const ls = {
11817
11841
  gray: {
11818
11842
  text: "#9b9a97",
11819
11843
  background: "#ebeced"
@@ -11850,7 +11874,7 @@ const ss = {
11850
11874
  text: "#ad1a72",
11851
11875
  background: "#f4dfeb"
11852
11876
  }
11853
- }, ls = {
11877
+ }, ds = {
11854
11878
  gray: {
11855
11879
  text: "#bebdb8",
11856
11880
  background: "#9b9a97"
@@ -11888,7 +11912,7 @@ const ss = {
11888
11912
  background: "#ad1a72"
11889
11913
  }
11890
11914
  };
11891
- class ds {
11915
+ class cs {
11892
11916
  constructor(t, o, i) {
11893
11917
  this.mappings = o, this.options = i;
11894
11918
  }
@@ -11920,29 +11944,29 @@ class ds {
11920
11944
  );
11921
11945
  }
11922
11946
  }
11923
- function cs(e) {
11947
+ function us(e) {
11924
11948
  return {
11925
11949
  createBlockMapping: (t) => t,
11926
11950
  createInlineContentMapping: (t) => t,
11927
11951
  createStyleMapping: (t) => t
11928
11952
  };
11929
11953
  }
11930
- let ge, Le;
11931
- async function us(e, t) {
11954
+ let be, Ie;
11955
+ async function ps(e, t) {
11932
11956
  if (!Hn("text", e))
11933
11957
  return [];
11934
- if (!ge) {
11935
- ge = import("@emoji-mart/data"), Le = await import("emoji-mart");
11936
- const n = (await ge).default;
11937
- await Le.init({ data: n });
11958
+ if (!be) {
11959
+ be = import("@emoji-mart/data"), Ie = await import("emoji-mart");
11960
+ const n = (await be).default;
11961
+ await Ie.init({ data: n });
11938
11962
  }
11939
- const o = (await ge).default;
11940
- return (t.trim() === "" ? Object.values(o.emojis) : await Le.SearchIndex.search(t)).map((n) => ({
11963
+ const o = (await be).default;
11964
+ return (t.trim() === "" ? Object.values(o.emojis) : await Ie.SearchIndex.search(t)).map((n) => ({
11941
11965
  id: n.skins[0].native,
11942
11966
  onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
11943
11967
  }));
11944
11968
  }
11945
- function fa(e) {
11969
+ function ga(e) {
11946
11970
  let t = e.getTextCursorPosition().block, o = e.schema.blockSchema[t.type].content;
11947
11971
  for (; o === "none"; )
11948
11972
  t = e.getTextCursorPosition().nextBlock, o = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
@@ -11952,9 +11976,9 @@ function M(e, t) {
11952
11976
  if (o.content === void 0)
11953
11977
  throw new Error("Slash Menu open in a block that doesn't contain content.");
11954
11978
  let i;
11955
- return Array.isArray(o.content) && (o.content.length === 1 && le(o.content[0]) && o.content[0].type === "text" && o.content[0].text === "/" || o.content.length === 0) ? (i = e.updateBlock(o, t), e.setTextCursorPosition(i)) : (i = e.insertBlocks([t], o, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), fa(e), i;
11979
+ return Array.isArray(o.content) && (o.content.length === 1 && de(o.content[0]) && o.content[0].type === "text" && o.content[0].text === "/" || o.content.length === 0) ? (i = e.updateBlock(o, t), e.setTextCursorPosition(i)) : (i = e.insertBlocks([t], o, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), ga(e), i;
11956
11980
  }
11957
- function ps(e) {
11981
+ function hs(e) {
11958
11982
  const t = [];
11959
11983
  return L("heading", e) && t.push(
11960
11984
  {
@@ -12118,14 +12142,14 @@ function ps(e) {
12118
12142
  ...e.dictionary.slash_menu.emoji
12119
12143
  }), t;
12120
12144
  }
12121
- function hs(e, t) {
12145
+ function ms(e, t) {
12122
12146
  return e.filter(
12123
12147
  ({ title: o, aliases: i }) => o.toLowerCase().includes(t.toLowerCase()) || i && i.filter(
12124
12148
  (n) => n.toLowerCase().includes(t.toLowerCase())
12125
12149
  ).length !== 0
12126
12150
  );
12127
12151
  }
12128
- function ms(e, ...t) {
12152
+ function fs(e, ...t) {
12129
12153
  const o = [...e];
12130
12154
  for (const i of t)
12131
12155
  for (const n of i) {
@@ -12136,7 +12160,7 @@ function ms(e, ...t) {
12136
12160
  }
12137
12161
  return o;
12138
12162
  }
12139
- function Ie(e = "") {
12163
+ function Pe(e = "") {
12140
12164
  return typeof e == "string" ? [
12141
12165
  {
12142
12166
  type: "text",
@@ -12145,31 +12169,31 @@ function Ie(e = "") {
12145
12169
  }
12146
12170
  ] : e;
12147
12171
  }
12148
- function se(e) {
12149
- return typeof e == "string" ? Ie(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? Ie(t) : vt(t) ? {
12172
+ function le(e) {
12173
+ return typeof e == "string" ? Pe(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? Pe(t) : xt(t) ? {
12150
12174
  ...t,
12151
- content: Ie(t.content)
12152
- } : le(t) ? t : {
12175
+ content: Pe(t.content)
12176
+ } : de(t) ? t : {
12153
12177
  props: {},
12154
12178
  ...t,
12155
- content: se(t.content)
12179
+ content: le(t.content)
12156
12180
  }) : (e == null ? void 0 : e.type) === "tableContent" ? {
12157
12181
  type: "tableContent",
12158
12182
  columnWidths: e.columnWidths,
12159
12183
  rows: e.rows.map((t) => ({
12160
12184
  ...t,
12161
12185
  cells: t.cells.map(
12162
- (o) => se(o)
12186
+ (o) => le(o)
12163
12187
  )
12164
12188
  }))
12165
12189
  } : e;
12166
12190
  }
12167
- function fs(e, t) {
12191
+ function gs(e, t) {
12168
12192
  return t.map(
12169
- (o) => so(e.blockSchema, o)
12193
+ (o) => uo(e.blockSchema, o)
12170
12194
  );
12171
12195
  }
12172
- function so(e, t) {
12196
+ function uo(e, t) {
12173
12197
  var n;
12174
12198
  const o = e[t.type].content, i = {
12175
12199
  id: "",
@@ -12181,11 +12205,11 @@ function so(e, t) {
12181
12205
  };
12182
12206
  if (Object.entries(e[t.type].propSchema).forEach(
12183
12207
  ([r, a]) => {
12184
- i.props[r] === void 0 && (i.props[r] = a.default);
12208
+ i.props[r] === void 0 && a.default !== void 0 && (i.props[r] = a.default);
12185
12209
  }
12186
12210
  ), o === "inline") {
12187
12211
  const r = i.content;
12188
- i.content = se(r);
12212
+ i.content = le(r);
12189
12213
  } else if (o === "table") {
12190
12214
  const r = i.content;
12191
12215
  i.content = {
@@ -12193,45 +12217,45 @@ function so(e, t) {
12193
12217
  columnWidths: (r == null ? void 0 : r.columnWidths) || ((n = r == null ? void 0 : r.rows[0]) == null ? void 0 : n.cells.map(() => {
12194
12218
  })) || [],
12195
12219
  rows: (r == null ? void 0 : r.rows.map((a) => ({
12196
- cells: a.cells.map((s) => se(s))
12220
+ cells: a.cells.map((s) => le(s))
12197
12221
  }))) || []
12198
12222
  };
12199
12223
  }
12200
12224
  return {
12201
12225
  ...i,
12202
- content: se(i.content),
12203
- children: i.children.map((r) => so(e, r))
12226
+ content: le(i.content),
12227
+ children: i.children.map((r) => uo(e, r))
12204
12228
  };
12205
12229
  }
12206
- function ga(e) {
12207
- e.id || (e.id = ue.options.generateID()), e.children && ba(e.children);
12208
- }
12209
12230
  function ba(e) {
12231
+ e.id || (e.id = ue.options.generateID()), e.children && ka(e.children);
12232
+ }
12233
+ function ka(e) {
12210
12234
  for (const t of e)
12211
- ga(t);
12235
+ ba(t);
12212
12236
  }
12213
12237
  export {
12214
- Hi as AudioBlock,
12215
- ao as BlockNoteEditor,
12216
- qe as BlockNoteSchema,
12217
- ls as COLORS_DARK_MODE_DEFAULT,
12218
- ss as COLORS_DEFAULT,
12219
- Ui as CodeBlock,
12238
+ Ri as AudioBlock,
12239
+ co as BlockNoteEditor,
12240
+ Xe as BlockNoteSchema,
12241
+ ds as COLORS_DARK_MODE_DEFAULT,
12242
+ ls as COLORS_DEFAULT,
12243
+ Vi as CodeBlock,
12220
12244
  jr as DEFAULT_LINK_PROTOCOL,
12221
- es as EMPTY_CELL_HEIGHT,
12245
+ ts as EMPTY_CELL_HEIGHT,
12222
12246
  Rt as EMPTY_CELL_WIDTH,
12223
- ds as Exporter,
12224
- Ii as FILE_AUDIO_ICON_SVG,
12225
- Mi as FILE_ICON_SVG,
12226
- $i as FILE_IMAGE_ICON_SVG,
12227
- en as FILE_VIDEO_ICON_SVG,
12228
- Gi as FileBlock,
12247
+ cs as Exporter,
12248
+ Ni as FILE_AUDIO_ICON_SVG,
12249
+ Pi as FILE_ICON_SVG,
12250
+ qi as FILE_IMAGE_ICON_SVG,
12251
+ nn as FILE_VIDEO_ICON_SVG,
12252
+ Ki as FileBlock,
12229
12253
  Cr as FilePanelProsemirrorPlugin,
12230
12254
  xr as FilePanelView,
12231
12255
  Br as FormattingToolbarProsemirrorPlugin,
12232
12256
  Er as FormattingToolbarView,
12233
- Qt as HTMLToBlocks,
12234
- Ji as ImageBlock,
12257
+ oo as HTMLToBlocks,
12258
+ en as ImageBlock,
12235
12259
  Ar as LinkToolbarProsemirrorPlugin,
12236
12260
  Kr as SideMenuProsemirrorPlugin,
12237
12261
  $r as SideMenuView,
@@ -12241,128 +12265,128 @@ export {
12241
12265
  ue as UniqueID,
12242
12266
  D as UnreachableCaseError,
12243
12267
  Nr as VALID_LINK_PROTOCOLS,
12244
- sn as VideoBlock,
12245
- ga as addIdsToBlock,
12246
- ba as addIdsToBlocks,
12247
- nt as addInlineContentAttributes,
12248
- wi as addInlineContentKeyboardShortcuts,
12249
- Si as addStyleAttributes,
12250
- _i as applyNonSelectableBlockFix,
12251
- Ka as assertEmpty,
12252
- Ai as audioBlockConfig,
12253
- ji as audioParse,
12254
- Pi as audioPropSchema,
12255
- Ni as audioRender,
12256
- Di as audioToExternalHTML,
12268
+ cn as VideoBlock,
12269
+ ba as addIdsToBlock,
12270
+ ka as addIdsToBlocks,
12271
+ rt as addInlineContentAttributes,
12272
+ Ci as addInlineContentKeyboardShortcuts,
12273
+ Mi as addStyleAttributes,
12274
+ vi as applyNonSelectableBlockFix,
12275
+ qa as assertEmpty,
12276
+ Di as audioBlockConfig,
12277
+ Ui as audioParse,
12278
+ ji as audioPropSchema,
12279
+ Hi as audioRender,
12280
+ Oi as audioToExternalHTML,
12257
12281
  X as blockToNode,
12258
12282
  sr as blocksToMarkdown,
12259
- be as camelToDataKebab,
12260
- rs as checkBlockHasDefaultProp,
12283
+ ke as camelToDataKebab,
12284
+ as as checkBlockHasDefaultProp,
12261
12285
  Un as checkBlockIsDefaultType,
12262
- os as checkBlockIsFileBlock,
12263
- ns as checkBlockIsFileBlockWithPlaceholder,
12264
- is as checkBlockIsFileBlockWithPreview,
12286
+ is as checkBlockIsFileBlock,
12287
+ rs as checkBlockIsFileBlockWithPlaceholder,
12288
+ ns as checkBlockIsFileBlockWithPreview,
12265
12289
  On as checkBlockTypeHasDefaultProp,
12266
12290
  L as checkDefaultBlockTypeInSchema,
12267
12291
  Hn as checkDefaultInlineContentTypeInSchema,
12268
- We as cleanHTMLToMarkdown,
12269
- ms as combineByGroup,
12270
- Ce as contentNodeToInlineContent,
12292
+ Ke as cleanHTMLToMarkdown,
12293
+ fs as combineByGroup,
12294
+ Ee as contentNodeToInlineContent,
12271
12295
  At as contentNodeToTableContent,
12272
- Ti as createAddFileButton,
12273
- xe as createBlockSpec,
12296
+ Ii as createAddFileButton,
12297
+ Ce as createBlockSpec,
12274
12298
  W as createBlockSpecFromStronglyTypedTiptapNode,
12275
12299
  R as createDefaultBlockDOMOutputSpec,
12276
- ve as createExternalHTMLExporter,
12277
- Fe as createFigureWithCaption,
12278
- ze as createFileBlockWrapper,
12279
- Li as createFileNameWithIcon,
12280
- Za as createInlineContentSpec,
12281
- xi as createInlineContentSpecFromTipTapNode,
12300
+ xe as createExternalHTMLExporter,
12301
+ Ge as createFigureWithCaption,
12302
+ Fe as createFileBlockWrapper,
12303
+ Ai as createFileNameWithIcon,
12304
+ Ja as createInlineContentSpec,
12305
+ Si as createInlineContentSpecFromTipTapNode,
12282
12306
  It as createInternalBlockSpec,
12283
- gi as createInternalHTMLSerializer,
12284
- vi as createInternalInlineContentSpec,
12307
+ _i as createInternalHTMLSerializer,
12308
+ Ei as createInternalInlineContentSpec,
12285
12309
  jt as createInternalStyleSpec,
12286
- Se as createLinkWithCaption,
12310
+ Be as createLinkWithCaption,
12287
12311
  Ot as createResizableFileBlockWrapper,
12288
12312
  $ as createStronglyTypedTiptapNode,
12289
- Ja as createStyleSpec,
12313
+ Ya as createStyleSpec,
12290
12314
  K as createStyleSpecFromTipTapMark,
12291
- as as createSuggestionMenu,
12292
- Ya as customizeCodeBlock,
12315
+ ss as createSuggestionMenu,
12316
+ Qa as customizeCodeBlock,
12293
12317
  jn as defaultBlockSchema,
12294
- zt as defaultBlockSpecs,
12295
- it as defaultBlockToHTML,
12296
- De as defaultCodeBlockPropSchema,
12318
+ $t as defaultBlockSpecs,
12319
+ nt as defaultBlockToHTML,
12320
+ He as defaultCodeBlockPropSchema,
12297
12321
  Dn as defaultInlineContentSchema,
12298
- Gt as defaultInlineContentSpecs,
12299
- v as defaultProps,
12300
- ts as defaultStyleSchema,
12301
- Ft as defaultStyleSpecs,
12322
+ Kt as defaultInlineContentSpecs,
12323
+ x as defaultProps,
12324
+ os as defaultStyleSchema,
12325
+ Wt as defaultStyleSpecs,
12302
12326
  J as esmDependencies,
12303
- Ri as fileBlockConfig,
12304
- zi as fileParse,
12305
- Oi as filePropSchema,
12306
- Vi as fileRender,
12307
- Fi as fileToExternalHTML,
12308
- Xa as filenameFromURL,
12309
- hs as filterSuggestionItems,
12327
+ Fi as fileBlockConfig,
12328
+ $i as fileParse,
12329
+ zi as filePropSchema,
12330
+ Gi as fileRender,
12331
+ Wi as fileToExternalHTML,
12332
+ Za as filenameFromURL,
12333
+ ms as filterSuggestionItems,
12310
12334
  V as formatKeyboardShortcut,
12311
12335
  Sr as formattingToolbarPluginKey,
12312
- ki as getBlockFromPos,
12336
+ wi as getBlockFromPos,
12313
12337
  F as getBlockInfo,
12314
12338
  pe as getBlockInfoFromResolvedPos,
12315
- y as getBlockInfoFromSelection,
12316
- Ve as getBlockInfoWithManualOffset,
12339
+ _ as getBlockInfoFromSelection,
12340
+ ze as getBlockInfoWithManualOffset,
12317
12341
  da as getBlockNoteExtensions,
12318
12342
  Pt as getBlockSchemaFromSpecs,
12319
- us as getDefaultEmojiPickerItems,
12320
- ps as getDefaultSlashMenuItems,
12321
- Ci as getInlineContentParseRules,
12343
+ ps as getDefaultEmojiPickerItems,
12344
+ hs as getDefaultSlashMenuItems,
12345
+ Bi as getInlineContentParseRules,
12322
12346
  Nt as getInlineContentSchemaFromSpecs,
12323
12347
  z as getNearestBlockPos,
12324
12348
  P as getNodeById,
12325
- yi as getParseRules,
12326
- Bi as getStyleParseRules,
12349
+ xi as getParseRules,
12350
+ Li as getStyleParseRules,
12327
12351
  Dt as getStyleSchemaFromSpecs,
12328
- Ki as imageBlockConfig,
12329
- Xi as imageParse,
12330
- Wi as imagePropSchema,
12331
- qi as imageRender,
12332
- Zi as imageToExternalHTML,
12333
- Mt as inheritedProps,
12334
- $e as initializeESMDependencies,
12352
+ Zi as imageBlockConfig,
12353
+ Yi as imageParse,
12354
+ Xi as imagePropSchema,
12355
+ Ji as imageRender,
12356
+ Qi as imageToExternalHTML,
12357
+ Lt as inheritedProps,
12358
+ We as initializeESMDependencies,
12335
12359
  H as inlineContentToNodes,
12336
12360
  M as insertOrUpdateBlock,
12337
- bi as isAppleOS,
12338
- tt as isLinkInlineContent,
12339
- vt as isPartialLinkInlineContent,
12340
- qa as isSafari,
12341
- le as isStyledTextInlineContent,
12361
+ yi as isAppleOS,
12362
+ ot as isLinkInlineContent,
12363
+ xt as isPartialLinkInlineContent,
12364
+ Xa as isSafari,
12365
+ de as isStyledTextInlineContent,
12342
12366
  Pr as linkToolbarPluginKey,
12343
- Wa as locales,
12344
- cs as mappingFactory,
12367
+ Ka as locales,
12368
+ us as mappingFactory,
12345
12369
  mr as markdownToBlocks,
12346
12370
  G as mergeCSSClasses,
12347
12371
  w as nodeToBlock,
12348
- je as nodeToCustomInlineContent,
12349
- at as parseEmbedElement,
12350
- Ee as parseFigureElement,
12351
- so as partialBlockToBlockForTesting,
12352
- fs as partialBlocksToBlocksForTesting,
12353
- Lt as propsToAttributes,
12372
+ De as nodeToCustomInlineContent,
12373
+ st as parseEmbedElement,
12374
+ Se as parseFigureElement,
12375
+ uo as partialBlockToBlockForTesting,
12376
+ gs as partialBlocksToBlocksForTesting,
12377
+ he as propsToAttributes,
12354
12378
  Wr as sideMenuPluginKey,
12355
- Ei as stylePropsToAttributes,
12356
- we as tableContentToNodes,
12357
- ae as tableHandlesPluginKey,
12358
- hn as updateBlock,
12379
+ Ti as stylePropsToAttributes,
12380
+ ve as tableContentToNodes,
12381
+ se as tableHandlesPluginKey,
12382
+ gn as updateBlock,
12359
12383
  S as updateBlockCommand,
12360
- Qa as uploadToTmpFilesDotOrg_DEV_ONLY,
12361
- on as videoBlockConfig,
12362
- rn as videoParse,
12363
- tn as videoPropSchema,
12364
- nn as videoRender,
12365
- an as videoToExternalHTML,
12366
- me as wrapInBlockStructure
12384
+ es as uploadToTmpFilesDotOrg_DEV_ONLY,
12385
+ an as videoBlockConfig,
12386
+ ln as videoParse,
12387
+ rn as videoPropSchema,
12388
+ sn as videoRender,
12389
+ dn as videoToExternalHTML,
12390
+ fe as wrapInBlockStructure
12367
12391
  };
12368
12392
  //# sourceMappingURL=blocknote.js.map