@blocknote/core 0.55.0 → 0.57.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 (678) hide show
  1. package/NOTICE.txt +101 -0
  2. package/dist/BlockNoteExtension-U58cXw1g.js +64 -0
  3. package/dist/ThreadStore-CSEwCO0O.js +8 -0
  4. package/dist/{UserStore-C4TzkGEn.js → UserStore-BFv6NXA-.js} +3 -7
  5. package/dist/ar-DPJDxCQI.js +3 -0
  6. package/dist/blocknote.js +8 -6
  7. package/dist/blocks-BUX9dXi9.js +2063 -0
  8. package/dist/blocks.js +3 -2
  9. package/dist/comments.js +18 -19
  10. package/dist/de-CakHBokE.js +3 -0
  11. package/dist/emoji-data.js +102 -0
  12. package/dist/en-BGdzE27X.js +3 -0
  13. package/dist/{en-BAn9gxr-.js → en-Ne9rlj9Y.js} +42 -5
  14. package/dist/es-VeBX6MEG.js +3 -0
  15. package/dist/extensions-CEgexSyF.js +3091 -0
  16. package/dist/extensions.js +4 -4
  17. package/dist/fa-Dt7EYtKf.js +3 -0
  18. package/dist/fr-DUhhjxrJ.js +3 -0
  19. package/dist/getDefaultSlashMenuItems-DfDOr807.js +1939 -0
  20. package/dist/he-BShJg1dK.js +3 -0
  21. package/dist/hr-BXtyqmwg.js +3 -0
  22. package/dist/is-2Fb-0w_j.js +3 -0
  23. package/dist/it-CiZtVb3Y.js +3 -0
  24. package/dist/ja-CsxD3kEL.js +3 -0
  25. package/dist/ko-It6g03Cy.js +3 -0
  26. package/dist/locales.js +1418 -32
  27. package/dist/markGroups-BszXCkX8.js +18 -0
  28. package/dist/nb-CLao87La.js +3 -0
  29. package/dist/nl-JQSo8dht.js +3 -0
  30. package/dist/pl-DEMBgHEP.js +3 -0
  31. package/dist/pt-CBCdYAax.js +3 -0
  32. package/dist/ru-BQk_9Q-L.js +3 -0
  33. package/dist/sk-kgB2DtDL.js +3 -0
  34. package/dist/src-DksfoQmN.js +3574 -0
  35. package/dist/style.css +1 -1
  36. package/dist/tr-DkcSXX8f.js +3 -0
  37. package/dist/uk-Bib-e6bV.js +3 -0
  38. package/dist/uz-B2jaKhJb.js +3 -0
  39. package/dist/vi-V_GFRxE8.js +3 -0
  40. package/dist/y.js +1284 -559
  41. package/dist/yjs.js +211 -171
  42. package/dist/zh-hant-2ZrAkFnC.js +3 -0
  43. package/dist/zh-jglyCmjs.js +3 -0
  44. package/package.json +51 -27
  45. package/src/fonts/inter.css +111 -0
  46. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +2 -1
  47. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +24 -24
  48. package/types/src/api/blockManipulation/commands/nestBlock/nestBlock.d.ts +3 -2
  49. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +1 -1
  50. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +2 -2
  51. package/types/src/api/blockManipulation/layoutBlocks/fixLayoutBlock.d.ts +34 -0
  52. package/types/src/api/blockManipulation/layoutBlocks/layoutBlocks.fixture.d.ts +465 -0
  53. package/types/src/api/blockManipulation/setupTestEnv.d.ts +15 -69
  54. package/types/src/api/blockManipulation/tables/tables.d.ts +9 -4
  55. package/types/src/api/clipboard/fromClipboard/normalizeOfficeHTML.d.ts +5 -0
  56. package/types/src/api/combineTransactionSteps.d.ts +12 -0
  57. package/types/src/api/exporters/markdown/wrapWithDelimiter.d.ts +6 -0
  58. package/types/src/api/getBlockInfoFromPos.d.ts +218 -44
  59. package/types/src/api/{getChangedRange.d.ts → getChangedRangeWithAttrs.d.ts} +1 -1
  60. package/types/src/api/getChangedRanges.d.ts +23 -0
  61. package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +0 -3
  62. package/types/src/api/parsers/markdown/autolink.d.ts +5 -0
  63. package/types/src/blocks/Code/helpers/extensions/CodeKeyboardShortcutsExtension.d.ts +4 -0
  64. package/types/src/blocks/ToggleWrapper/createToggleFrame.d.ts +29 -0
  65. package/types/src/blocks/defaultBlockTypeItems.d.ts +37 -0
  66. package/types/src/blocks/defaultBlocks.d.ts +10 -0
  67. package/types/src/blocks/index.d.ts +2 -1
  68. package/types/src/editor/BlockNoteEditor.d.ts +38 -9
  69. package/types/src/editor/managers/BlockManager.d.ts +4 -3
  70. package/types/src/editor/managers/ExtensionManager/index.d.ts +19 -7
  71. package/types/src/editor/managers/StateManager.d.ts +1 -1
  72. package/types/src/editor/managers/StyleManager.d.ts +2 -1
  73. package/types/src/editor/transformPasted.d.ts +1 -1
  74. package/types/src/emoji-data/frimousse/ar.d.ts +2 -0
  75. package/types/src/emoji-data/frimousse/common.d.ts +3 -0
  76. package/types/src/emoji-data/frimousse/de.d.ts +2 -0
  77. package/types/src/emoji-data/frimousse/en.d.ts +2 -0
  78. package/types/src/emoji-data/frimousse/es.d.ts +2 -0
  79. package/types/src/emoji-data/frimousse/fa.d.ts +2 -0
  80. package/types/src/emoji-data/frimousse/fr.d.ts +2 -0
  81. package/types/src/emoji-data/frimousse/he.d.ts +2 -0
  82. package/types/src/emoji-data/frimousse/hr.d.ts +2 -0
  83. package/types/src/emoji-data/frimousse/is.d.ts +2 -0
  84. package/types/src/emoji-data/frimousse/it.d.ts +2 -0
  85. package/types/src/emoji-data/frimousse/ja.d.ts +2 -0
  86. package/types/src/emoji-data/frimousse/ko.d.ts +2 -0
  87. package/types/src/emoji-data/frimousse/loadFrimousseData.d.ts +2 -0
  88. package/types/src/emoji-data/frimousse/nb.d.ts +2 -0
  89. package/types/src/emoji-data/frimousse/nl.d.ts +2 -0
  90. package/types/src/emoji-data/frimousse/pl.d.ts +2 -0
  91. package/types/src/emoji-data/frimousse/pt.d.ts +2 -0
  92. package/types/src/emoji-data/frimousse/ru.d.ts +2 -0
  93. package/types/src/emoji-data/frimousse/sk.d.ts +2 -0
  94. package/types/src/emoji-data/frimousse/tr.d.ts +2 -0
  95. package/types/src/emoji-data/frimousse/types.d.ts +21 -0
  96. package/types/src/emoji-data/frimousse/uk.d.ts +2 -0
  97. package/types/src/emoji-data/frimousse/uz.d.ts +2 -0
  98. package/types/src/emoji-data/frimousse/vi.d.ts +2 -0
  99. package/types/src/emoji-data/frimousse/zh-hant.d.ts +2 -0
  100. package/types/src/emoji-data/frimousse/zh.d.ts +2 -0
  101. package/types/src/emoji-data/index.d.ts +3 -0
  102. package/types/src/emoji-data/searchEmojis.d.ts +5 -0
  103. package/types/src/exporter/Exporter.d.ts +11 -4
  104. package/types/src/exporter/mapping.d.ts +13 -1
  105. package/types/src/extensions/DropCursor/DropCursor.d.ts +1 -1
  106. package/types/src/extensions/DropCursor/dropIntoChildren.d.ts +38 -0
  107. package/types/src/extensions/Loading/Loading.d.ts +11 -0
  108. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.d.ts +1 -1
  109. package/types/src/extensions/ReadOnly/ReadOnly.d.ts +21 -0
  110. package/types/src/extensions/SideMenu/MultipleNodeSelection.d.ts +13 -4
  111. package/types/src/extensions/SideMenu/SideMenu.d.ts +51 -89
  112. package/types/src/extensions/SideMenu/blockDropHandling.d.ts +11 -0
  113. package/types/src/extensions/SideMenu/blockGeometry.d.ts +22 -0
  114. package/types/src/extensions/SideMenu/dragging.d.ts +0 -4
  115. package/types/src/extensions/SideMenu/sideMenuHover.d.ts +58 -0
  116. package/types/src/extensions/Versioning/Versioning.d.ts +36 -311
  117. package/types/src/extensions/Versioning/createVersioning.d.ts +32 -0
  118. package/types/src/extensions/Versioning/formatVersionDate.d.ts +7 -0
  119. package/types/src/extensions/Versioning/inMemoryVersioning.d.ts +65 -36
  120. package/types/src/extensions/Versioning/index.d.ts +4 -0
  121. package/types/src/extensions/Versioning/scrollToFirstChange.d.ts +18 -0
  122. package/types/src/extensions/Versioning/types.d.ts +245 -0
  123. package/types/src/extensions/Versioning/versioningState.d.ts +49 -0
  124. package/types/src/extensions/blockDOM.d.ts +37 -0
  125. package/types/src/extensions/index.d.ts +3 -2
  126. package/types/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.d.ts +1 -0
  127. package/types/src/i18n/dictionary.d.ts +4 -1
  128. package/types/src/i18n/locales/en.d.ts +38 -0
  129. package/types/src/i18n/locales/fa.d.ts +38 -0
  130. package/types/src/i18n/locales/index.d.ts +1 -0
  131. package/types/src/i18n/locales/sk.d.ts +38 -0
  132. package/types/src/i18n/locales/tr.d.ts +378 -0
  133. package/types/src/index.d.ts +5 -3
  134. package/types/src/pm-nodes/BlockContainer.d.ts +6 -0
  135. package/types/src/schema/blocks/children.d.ts +39 -0
  136. package/types/src/schema/blocks/createSpec.d.ts +13 -0
  137. package/types/src/schema/blocks/frame.d.ts +109 -0
  138. package/types/src/schema/blocks/internal.d.ts +6 -0
  139. package/types/src/schema/blocks/keyboard.d.ts +111 -0
  140. package/types/src/schema/blocks/layoutBlockAttributes.d.ts +9 -0
  141. package/types/src/schema/blocks/meta.d.ts +14 -0
  142. package/types/src/schema/blocks/types.d.ts +228 -15
  143. package/types/src/schema/blocks/validateChildren.d.ts +5 -0
  144. package/types/src/schema/dataAttributes.d.ts +19 -0
  145. package/types/src/schema/index.d.ts +3 -0
  146. package/types/src/schema/inlineContent/createSpec.d.ts +2 -1
  147. package/types/src/schema/inlineContent/internal.d.ts +1 -1
  148. package/types/src/schema/inlineContent/types.d.ts +2 -4
  149. package/types/src/schema/markGroups.d.ts +8 -0
  150. package/types/src/schema/styles/createSpec.d.ts +2 -1
  151. package/types/src/schema/styles/internal.d.ts +4 -1
  152. package/types/src/schema/styles/types.d.ts +2 -0
  153. package/types/src/user/userColors.d.ts +24 -3
  154. package/types/src/y/comments/RESTYjsThreadStore.d.ts +1 -1
  155. package/types/src/y/comments/YjsThreadStore.d.ts +1 -1
  156. package/types/src/y/comments/YjsThreadStoreBase.d.ts +2 -2
  157. package/types/src/y/comments/yjsHelpers.d.ts +5 -5
  158. package/types/src/y/extensions/AttributionExtension.d.ts +19 -21
  159. package/types/src/y/extensions/DiffVersioningExtension.d.ts +9 -4
  160. package/types/src/y/extensions/ForkYDoc.d.ts +3 -1
  161. package/types/src/y/extensions/Versioning.d.ts +4 -15
  162. package/types/src/y/extensions/YAttributionMarks.d.ts +13 -2
  163. package/types/src/y/extensions/YCursorPlugin.d.ts +1 -0
  164. package/types/src/y/extensions/YSync.d.ts +4 -18
  165. package/types/src/y/extensions/blockMatchNodes.d.ts +0 -22
  166. package/types/src/y/extensions/index.d.ts +27 -44
  167. package/types/src/y/extensions/persistentBlockGroups.d.ts +189 -0
  168. package/types/src/y/extensions/snapshotCodec.d.ts +13 -0
  169. package/types/src/y/extensions/snapshotPreview.d.ts +21 -0
  170. package/types/src/y/index.d.ts +1 -0
  171. package/types/src/y/utils.d.ts +39 -19
  172. package/types/src/y/versioning/index.d.ts +1 -1
  173. package/types/src/y/versioning/yhub.d.ts +71 -86
  174. package/types/src/y/versioning/yhubClient.d.ts +67 -0
  175. package/types/src/yjs/extensions/ForkYDoc.d.ts +2 -0
  176. package/types/src/yjs/extensions/Versioning.d.ts +37 -22
  177. package/types/src/yjs/extensions/YUndo.d.ts +3 -2
  178. package/types/src/yjs/extensions/index.d.ts +3 -2
  179. package/types/src/yjs/index.d.ts +1 -0
  180. package/dist/BlockNoteExtension-BJCLnwrE.cjs +0 -2
  181. package/dist/BlockNoteExtension-BJCLnwrE.cjs.map +0 -1
  182. package/dist/BlockNoteExtension-CbvDA0F7.js +0 -80
  183. package/dist/BlockNoteExtension-CbvDA0F7.js.map +0 -1
  184. package/dist/ThreadStore-Bx-gSEh1.cjs +0 -2
  185. package/dist/ThreadStore-Bx-gSEh1.cjs.map +0 -1
  186. package/dist/ThreadStore-et9wB5Xt.js +0 -11
  187. package/dist/ThreadStore-et9wB5Xt.js.map +0 -1
  188. package/dist/UserStore-C4TzkGEn.js.map +0 -1
  189. package/dist/UserStore-mj3fXW4D.cjs +0 -2
  190. package/dist/UserStore-mj3fXW4D.cjs.map +0 -1
  191. package/dist/blocknote.cjs +0 -1
  192. package/dist/blocks-DLgTreVu.cjs +0 -12
  193. package/dist/blocks-DLgTreVu.cjs.map +0 -1
  194. package/dist/blocks-DaEUT0O1.js +0 -3527
  195. package/dist/blocks-DaEUT0O1.js.map +0 -1
  196. package/dist/blocks.cjs +0 -1
  197. package/dist/comments.cjs +0 -2
  198. package/dist/comments.cjs.map +0 -1
  199. package/dist/comments.js.map +0 -1
  200. package/dist/en-BAn9gxr-.js.map +0 -1
  201. package/dist/en-CHnrV5l8.cjs +0 -2
  202. package/dist/en-CHnrV5l8.cjs.map +0 -1
  203. package/dist/extensions-B1JQURVF.js +0 -2138
  204. package/dist/extensions-B1JQURVF.js.map +0 -1
  205. package/dist/extensions-CZkqKzJO.cjs +0 -58
  206. package/dist/extensions-CZkqKzJO.cjs.map +0 -1
  207. package/dist/extensions.cjs +0 -1
  208. package/dist/locales.cjs +0 -2
  209. package/dist/locales.cjs.map +0 -1
  210. package/dist/locales.js.map +0 -1
  211. package/dist/src-D5w0XAHX.js +0 -3379
  212. package/dist/src-D5w0XAHX.js.map +0 -1
  213. package/dist/src-th5uZEvx.cjs +0 -23
  214. package/dist/src-th5uZEvx.cjs.map +0 -1
  215. package/dist/webpack-stats.json +0 -1
  216. package/dist/y.cjs +0 -2
  217. package/dist/y.cjs.map +0 -1
  218. package/dist/y.js.map +0 -1
  219. package/dist/yjs.cjs +0 -2
  220. package/dist/yjs.cjs.map +0 -1
  221. package/dist/yjs.js.map +0 -1
  222. package/src/api/README.md +0 -8
  223. package/src/api/__snapshots__/blocks-deleted-nested-deep.json +0 -26
  224. package/src/api/__snapshots__/blocks-deleted-nested.json +0 -68
  225. package/src/api/__snapshots__/blocks-deleted.json +0 -26
  226. package/src/api/__snapshots__/blocks-indented-changed.json +0 -129
  227. package/src/api/__snapshots__/blocks-inserted-nested.json +0 -62
  228. package/src/api/__snapshots__/blocks-inserted.json +0 -20
  229. package/src/api/__snapshots__/blocks-moved-deeper-into-nesting.json +0 -164
  230. package/src/api/__snapshots__/blocks-moved-down-twice-in-same-parent.json +0 -44
  231. package/src/api/__snapshots__/blocks-moved-insert-changes-sibling-order.json +0 -26
  232. package/src/api/__snapshots__/blocks-moved-multiple-in-same-transaction.json +0 -188
  233. package/src/api/__snapshots__/blocks-moved-nested-sibling-reorder.json +0 -180
  234. package/src/api/__snapshots__/blocks-moved-to-different-parent.json +0 -78
  235. package/src/api/__snapshots__/blocks-moved-to-root-level.json +0 -78
  236. package/src/api/__snapshots__/blocks-moved-up-down-in-same-parent.json +0 -44
  237. package/src/api/__snapshots__/blocks-moved-up-down-in-same-transaction.json +0 -44
  238. package/src/api/__snapshots__/blocks-outdented-changed.json +0 -129
  239. package/src/api/__snapshots__/blocks-updated-content-inserted.json +0 -42
  240. package/src/api/__snapshots__/blocks-updated-multiple-insert.json +0 -50
  241. package/src/api/__snapshots__/blocks-updated-multiple.json +0 -82
  242. package/src/api/__snapshots__/blocks-updated-nested-deep.json +0 -42
  243. package/src/api/__snapshots__/blocks-updated-nested-multiple.json +0 -118
  244. package/src/api/__snapshots__/blocks-updated-nested.json +0 -78
  245. package/src/api/__snapshots__/blocks-updated-single.json +0 -42
  246. package/src/api/__snapshots__/blocks-updated.json +0 -42
  247. package/src/api/blockManipulation/__snapshots__/transactions.test.ts.snap +0 -34
  248. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -4570
  249. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +0 -176
  250. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +0 -56
  251. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -2761
  252. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +0 -147
  253. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +0 -199
  254. package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +0 -13625
  255. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +0 -375
  256. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +0 -409
  257. package/src/api/blockManipulation/commands/nestBlock/__snapshots__/nestBlock.test.ts.snap +0 -952
  258. package/src/api/blockManipulation/commands/nestBlock/nestBlock.test.ts +0 -661
  259. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +0 -208
  260. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -5710
  261. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +0 -235
  262. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +0 -135
  263. package/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts +0 -173
  264. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -3507
  265. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +0 -151
  266. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +0 -58
  267. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -15085
  268. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +0 -978
  269. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +0 -685
  270. package/src/api/blockManipulation/getBlock/getBlock.ts +0 -111
  271. package/src/api/blockManipulation/insertContentAt.ts +0 -83
  272. package/src/api/blockManipulation/selections/selection.ts +0 -267
  273. package/src/api/blockManipulation/selections/textCursorPosition.ts +0 -118
  274. package/src/api/blockManipulation/setupTestEnv.ts +0 -191
  275. package/src/api/blockManipulation/tables/tables.test.ts +0 -2127
  276. package/src/api/blockManipulation/tables/tables.ts +0 -887
  277. package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +0 -8
  278. package/src/api/clipboard/fromClipboard/fileDropExtension.ts +0 -55
  279. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +0 -209
  280. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +0 -38
  281. package/src/api/clipboard/fromClipboard/pasteExtension.ts +0 -157
  282. package/src/api/clipboard/toClipboard/copyExtension.ts +0 -299
  283. package/src/api/exporters/html/externalHTMLExporter.ts +0 -76
  284. package/src/api/exporters/html/internalHTMLSerializer.ts +0 -182
  285. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +0 -435
  286. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +0 -253
  287. package/src/api/exporters/markdown/htmlToMarkdown.ts +0 -884
  288. package/src/api/exporters/markdown/markdownExporter.ts +0 -41
  289. package/src/api/getBlockInfoFromPos.test.ts +0 -256
  290. package/src/api/getBlockInfoFromPos.ts +0 -291
  291. package/src/api/getBlocksChangedByTransaction.test.ts +0 -783
  292. package/src/api/getBlocksChangedByTransaction.ts +0 -458
  293. package/src/api/getChangedRange.ts +0 -54
  294. package/src/api/nodeConversions/blockToNode.test.ts +0 -113
  295. package/src/api/nodeConversions/blockToNode.ts +0 -399
  296. package/src/api/nodeConversions/fragmentToBlocks.ts +0 -63
  297. package/src/api/nodeConversions/nodeToBlock.ts +0 -665
  298. package/src/api/nodeUtil.ts +0 -46
  299. package/src/api/parsers/html/parseHTML.ts +0 -80
  300. package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +0 -144
  301. package/src/api/parsers/html/util/nestedLists.test.ts +0 -165
  302. package/src/api/parsers/html/util/nestedLists.ts +0 -123
  303. package/src/api/parsers/html/util/normalizeWhitespace.ts +0 -87
  304. package/src/api/parsers/markdown/detectMarkdown.test.ts +0 -211
  305. package/src/api/parsers/markdown/detectMarkdown.ts +0 -61
  306. package/src/api/parsers/markdown/markdownToHtml.ts +0 -1340
  307. package/src/api/parsers/markdown/parseMarkdown.ts +0 -24
  308. package/src/api/pmUtil.ts +0 -79
  309. package/src/api/positionMapping.test.ts +0 -209
  310. package/src/api/positionMapping.ts +0 -42
  311. package/src/blocks/Audio/block.ts +0 -171
  312. package/src/blocks/Audio/parseAudioElement.ts +0 -5
  313. package/src/blocks/BlockNoteSchema.ts +0 -59
  314. package/src/blocks/Code/CodeBlockOptions.ts +0 -83
  315. package/src/blocks/Code/block.test.ts +0 -265
  316. package/src/blocks/Code/block.ts +0 -56
  317. package/src/blocks/Code/helpers/extensions/CodeKeyboardShortcutsExtension.ts +0 -120
  318. package/src/blocks/Code/helpers/parse/parsePreCode.ts +0 -45
  319. package/src/blocks/Code/helpers/render/createCodeBlock.ts +0 -98
  320. package/src/blocks/Code/helpers/toExternalHTML/createPreCode.ts +0 -14
  321. package/src/blocks/Divider/block.ts +0 -49
  322. package/src/blocks/File/block.ts +0 -95
  323. package/src/blocks/File/helpers/parse/parseEmbedElement.ts +0 -5
  324. package/src/blocks/File/helpers/parse/parseFigureElement.ts +0 -16
  325. package/src/blocks/File/helpers/render/createAddFileButton.ts +0 -69
  326. package/src/blocks/File/helpers/render/createFileBlockWrapper.ts +0 -88
  327. package/src/blocks/File/helpers/render/createFileNameWithIcon.ts +0 -37
  328. package/src/blocks/File/helpers/render/createResizableFileBlockWrapper.ts +0 -271
  329. package/src/blocks/File/helpers/toExternalHTML/createFigureWithCaption.ts +0 -13
  330. package/src/blocks/File/helpers/toExternalHTML/createLinkWithCaption.ts +0 -15
  331. package/src/blocks/Heading/block.ts +0 -188
  332. package/src/blocks/Image/block.ts +0 -193
  333. package/src/blocks/Image/parseImageElement.ts +0 -7
  334. package/src/blocks/ListItem/BulletListItem/block.ts +0 -127
  335. package/src/blocks/ListItem/CheckListItem/block.test.ts +0 -61
  336. package/src/blocks/ListItem/CheckListItem/block.ts +0 -182
  337. package/src/blocks/ListItem/ListItemKeyboardShortcuts.ts +0 -63
  338. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts +0 -352
  339. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +0 -242
  340. package/src/blocks/ListItem/NumberedListItem/block.ts +0 -141
  341. package/src/blocks/ListItem/ToggleListItem/block.ts +0 -128
  342. package/src/blocks/ListItem/getListItemContent.ts +0 -115
  343. package/src/blocks/PageBreak/block.ts +0 -72
  344. package/src/blocks/PageBreak/getPageBreakSlashMenuItems.ts +0 -47
  345. package/src/blocks/Paragraph/block.ts +0 -80
  346. package/src/blocks/Quote/block.ts +0 -99
  347. package/src/blocks/README.md +0 -3
  348. package/src/blocks/Table/TableExtension.test.ts +0 -231
  349. package/src/blocks/Table/TableExtension.ts +0 -115
  350. package/src/blocks/Table/block.ts +0 -500
  351. package/src/blocks/ToggleWrapper/createToggleWrapper.ts +0 -197
  352. package/src/blocks/Video/block.ts +0 -142
  353. package/src/blocks/Video/parseVideoElement.ts +0 -7
  354. package/src/blocks/defaultBlockHelpers.ts +0 -113
  355. package/src/blocks/defaultBlockTypeGuards.ts +0 -167
  356. package/src/blocks/defaultBlocks.ts +0 -208
  357. package/src/blocks/defaultProps.ts +0 -165
  358. package/src/blocks/getDetailsContent.ts +0 -77
  359. package/src/blocks/index.ts +0 -29
  360. package/src/blocks/utils/listItemEnterHandler.ts +0 -43
  361. package/src/comments/CommentEditorSubmitExtension.test.ts +0 -141
  362. package/src/comments/CommentEditorSubmitExtension.ts +0 -56
  363. package/src/comments/extension.ts +0 -396
  364. package/src/comments/index.ts +0 -8
  365. package/src/comments/mark.ts +0 -64
  366. package/src/comments/threadstore/DefaultThreadStoreAuth.ts +0 -106
  367. package/src/comments/threadstore/ThreadStore.ts +0 -130
  368. package/src/comments/threadstore/ThreadStoreAuth.ts +0 -13
  369. package/src/comments/threadstore/TipTapThreadStore.ts +0 -292
  370. package/src/comments/threadstore/tiptap/types.ts +0 -131
  371. package/src/comments/types.ts +0 -121
  372. package/src/editor/Block.css +0 -1366
  373. package/src/editor/BlockNoteEditor.test.ts +0 -278
  374. package/src/editor/BlockNoteEditor.ts +0 -1497
  375. package/src/editor/BlockNoteExtension.test.ts +0 -103
  376. package/src/editor/BlockNoteExtension.ts +0 -246
  377. package/src/editor/README.md +0 -3
  378. package/src/editor/cursorPositionTypes.ts +0 -17
  379. package/src/editor/defaultColors.ts +0 -77
  380. package/src/editor/editor.css +0 -197
  381. package/src/editor/managers/BlockManager.ts +0 -255
  382. package/src/editor/managers/EventManager.browser.test.ts +0 -334
  383. package/src/editor/managers/EventManager.ts +0 -260
  384. package/src/editor/managers/ExportManager.ts +0 -137
  385. package/src/editor/managers/ExtensionManager/ExtensionManager.test.ts +0 -336
  386. package/src/editor/managers/ExtensionManager/extensions.ts +0 -191
  387. package/src/editor/managers/ExtensionManager/index.ts +0 -697
  388. package/src/editor/managers/ExtensionManager/symbol.ts +0 -5
  389. package/src/editor/managers/SelectionManager.ts +0 -120
  390. package/src/editor/managers/StateManager.ts +0 -251
  391. package/src/editor/managers/StyleManager.browser.test.ts +0 -122
  392. package/src/editor/managers/StyleManager.test.ts +0 -98
  393. package/src/editor/managers/StyleManager.ts +0 -278
  394. package/src/editor/managers/index.ts +0 -8
  395. package/src/editor/performance.test.ts +0 -192
  396. package/src/editor/selectionTypes.ts +0 -14
  397. package/src/editor/transformPasted.test.ts +0 -295
  398. package/src/editor/transformPasted.ts +0 -293
  399. package/src/exporter/ExportImage.ts +0 -50
  400. package/src/exporter/Exporter.test.ts +0 -186
  401. package/src/exporter/Exporter.ts +0 -155
  402. package/src/exporter/index.ts +0 -3
  403. package/src/exporter/mapping.ts +0 -79
  404. package/src/extensions/BlockChange/BlockChange.ts +0 -67
  405. package/src/extensions/DropCursor/DropCursor.ts +0 -263
  406. package/src/extensions/DropCursor/utils.ts +0 -195
  407. package/src/extensions/FilePanel/FilePanel.ts +0 -41
  408. package/src/extensions/FormattingToolbar/FormattingToolbar.ts +0 -151
  409. package/src/extensions/History/History.ts +0 -11
  410. package/src/extensions/InlineContentBoundaryEdit/InlineContentBoundaryEdit.ts +0 -109
  411. package/src/extensions/LinkToolbar/LinkToolbar.ts +0 -76
  412. package/src/extensions/LinkToolbar/protocols.ts +0 -13
  413. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.ts +0 -75
  414. package/src/extensions/Placeholder/Placeholder.ts +0 -149
  415. package/src/extensions/PositionMapping/PositionMapping.ts +0 -68
  416. package/src/extensions/PreviousBlockType/PreviousBlockType.test.ts +0 -120
  417. package/src/extensions/PreviousBlockType/PreviousBlockType.ts +0 -197
  418. package/src/extensions/README.md +0 -3
  419. package/src/extensions/ShowSelection/ShowSelection.ts +0 -61
  420. package/src/extensions/SideMenu/MultipleNodeSelection.ts +0 -89
  421. package/src/extensions/SideMenu/SideMenu.ts +0 -833
  422. package/src/extensions/SideMenu/dragging.ts +0 -213
  423. package/src/extensions/SourceBlockWithPreview/SourceBlockWithPreview.ts +0 -192
  424. package/src/extensions/SourceInlineContentWithPreview/SourceInlineContentWithPreview.ts +0 -142
  425. package/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.ts +0 -4
  426. package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +0 -11
  427. package/src/extensions/SuggestionMenu/SuggestionMenu.test.ts +0 -309
  428. package/src/extensions/SuggestionMenu/SuggestionMenu.ts +0 -427
  429. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +0 -76
  430. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +0 -399
  431. package/src/extensions/SyntaxHighlighting/SyntaxHighlighting.test.ts +0 -120
  432. package/src/extensions/SyntaxHighlighting/SyntaxHighlighting.ts +0 -89
  433. package/src/extensions/SyntaxHighlighting/inlineHighlight.test.ts +0 -135
  434. package/src/extensions/SyntaxHighlighting/shiki.ts +0 -116
  435. package/src/extensions/TableHandles/TableHandles.browser.test.ts +0 -307
  436. package/src/extensions/TableHandles/TableHandles.ts +0 -1265
  437. package/src/extensions/TrailingNode/TrailingNode.ts +0 -233
  438. package/src/extensions/Versioning/Versioning.test.ts +0 -435
  439. package/src/extensions/Versioning/Versioning.ts +0 -628
  440. package/src/extensions/Versioning/inMemoryVersioning.test.ts +0 -469
  441. package/src/extensions/Versioning/inMemoryVersioning.ts +0 -273
  442. package/src/extensions/Versioning/index.ts +0 -2
  443. package/src/extensions/getDraggableBlockFromElement.ts +0 -19
  444. package/src/extensions/index.ts +0 -25
  445. package/src/extensions/tiptap-extensions/BackgroundColor/BackgroundColorExtension.ts +0 -17
  446. package/src/extensions/tiptap-extensions/HardBreak/HardBreak.ts +0 -35
  447. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.ts +0 -204
  448. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +0 -1002
  449. package/src/extensions/tiptap-extensions/Link/helpers/autolink.ts +0 -179
  450. package/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts +0 -82
  451. package/src/extensions/tiptap-extensions/Link/helpers/linkDetector.ts +0 -412
  452. package/src/extensions/tiptap-extensions/Link/helpers/pasteHandler.ts +0 -53
  453. package/src/extensions/tiptap-extensions/Link/helpers/tlds.ts +0 -7
  454. package/src/extensions/tiptap-extensions/Link/helpers/whitespace.ts +0 -13
  455. package/src/extensions/tiptap-extensions/Link/index.ts +0 -2
  456. package/src/extensions/tiptap-extensions/Link/link.test.ts +0 -945
  457. package/src/extensions/tiptap-extensions/Link/link.ts +0 -238
  458. package/src/extensions/tiptap-extensions/TextAlignment/TextAlignmentExtension.ts +0 -33
  459. package/src/extensions/tiptap-extensions/TextColor/TextColorExtension.ts +0 -17
  460. package/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.ts +0 -187
  461. package/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts +0 -336
  462. package/src/extensions/tiptap-extensions/index.ts +0 -7
  463. package/src/extensions-shared/UiElementPosition.ts +0 -4
  464. package/src/i18n/dictionary.ts +0 -17
  465. package/src/i18n/index.ts +0 -2
  466. package/src/i18n/locales/ar.ts +0 -411
  467. package/src/i18n/locales/de.ts +0 -445
  468. package/src/i18n/locales/en.ts +0 -426
  469. package/src/i18n/locales/es.ts +0 -424
  470. package/src/i18n/locales/fa.ts +0 -395
  471. package/src/i18n/locales/fr.ts +0 -472
  472. package/src/i18n/locales/he.ts +0 -426
  473. package/src/i18n/locales/hr.ts +0 -440
  474. package/src/i18n/locales/index.ts +0 -23
  475. package/src/i18n/locales/is.ts +0 -440
  476. package/src/i18n/locales/it.ts +0 -448
  477. package/src/i18n/locales/ja.ts +0 -466
  478. package/src/i18n/locales/ko.ts +0 -439
  479. package/src/i18n/locales/nl.ts +0 -427
  480. package/src/i18n/locales/no.ts +0 -444
  481. package/src/i18n/locales/pl.ts +0 -417
  482. package/src/i18n/locales/pt.ts +0 -419
  483. package/src/i18n/locales/ru.ts +0 -470
  484. package/src/i18n/locales/sk.ts +0 -424
  485. package/src/i18n/locales/uk.ts +0 -450
  486. package/src/i18n/locales/uz.ts +0 -460
  487. package/src/i18n/locales/vi.ts +0 -425
  488. package/src/i18n/locales/zh-tw.ts +0 -467
  489. package/src/i18n/locales/zh.ts +0 -467
  490. package/src/index.ts +0 -56
  491. package/src/locales.ts +0 -1
  492. package/src/pm-nodes/BlockContainer.ts +0 -91
  493. package/src/pm-nodes/BlockGroup.ts +0 -57
  494. package/src/pm-nodes/Doc.ts +0 -11
  495. package/src/pm-nodes/README.md +0 -141
  496. package/src/pm-nodes/index.ts +0 -3
  497. package/src/pm-nodes/suggestionMarks.ts +0 -43
  498. package/src/schema/README.md +0 -3
  499. package/src/schema/blocks/createSpec.test.ts +0 -123
  500. package/src/schema/blocks/createSpec.ts +0 -506
  501. package/src/schema/blocks/extendBlockSpec.test.ts +0 -188
  502. package/src/schema/blocks/internal.test.ts +0 -86
  503. package/src/schema/blocks/internal.ts +0 -255
  504. package/src/schema/blocks/types.ts +0 -702
  505. package/src/schema/contentTypePropagation.test.ts +0 -182
  506. package/src/schema/index.ts +0 -12
  507. package/src/schema/inlineContent/createSpec.test.ts +0 -161
  508. package/src/schema/inlineContent/createSpec.ts +0 -409
  509. package/src/schema/inlineContent/internal.ts +0 -136
  510. package/src/schema/inlineContent/types.ts +0 -204
  511. package/src/schema/markGroups.ts +0 -50
  512. package/src/schema/nodeViewMutations.test.ts +0 -146
  513. package/src/schema/nodeViewMutations.ts +0 -49
  514. package/src/schema/propTypes.ts +0 -61
  515. package/src/schema/schema.test.ts +0 -110
  516. package/src/schema/schema.ts +0 -236
  517. package/src/schema/styles/createSpec.ts +0 -140
  518. package/src/schema/styles/internal.ts +0 -155
  519. package/src/schema/styles/types.ts +0 -57
  520. package/src/style.css +0 -2
  521. package/src/user/UserStore.ts +0 -199
  522. package/src/user/createUserStore.test.ts +0 -126
  523. package/src/user/index.ts +0 -2
  524. package/src/user/userColors.ts +0 -72
  525. package/src/util/EventEmitter.ts +0 -59
  526. package/src/util/README.md +0 -3
  527. package/src/util/Store.test.ts +0 -132
  528. package/src/util/Store.ts +0 -135
  529. package/src/util/browser.ts +0 -54
  530. package/src/util/combineByGroup.ts +0 -25
  531. package/src/util/expandToWords.ts +0 -38
  532. package/src/util/string.ts +0 -36
  533. package/src/util/table.ts +0 -110
  534. package/src/util/topo-sort.test.ts +0 -125
  535. package/src/util/topo-sort.ts +0 -206
  536. package/src/util/typescript.ts +0 -17
  537. package/src/vite-env.d.ts +0 -7
  538. package/src/y/README.md +0 -5
  539. package/src/y/comments/RESTYjsThreadStore.ts +0 -138
  540. package/src/y/comments/YjsThreadStore.test.ts +0 -295
  541. package/src/y/comments/YjsThreadStore.ts +0 -358
  542. package/src/y/comments/YjsThreadStoreBase.ts +0 -50
  543. package/src/y/comments/index.ts +0 -3
  544. package/src/y/comments/yjsHelpers.ts +0 -125
  545. package/src/y/extensions/AttributionExtension.test.ts +0 -95
  546. package/src/y/extensions/AttributionExtension.ts +0 -378
  547. package/src/y/extensions/DiffVersioningExtension.test.ts +0 -193
  548. package/src/y/extensions/DiffVersioningExtension.ts +0 -228
  549. package/src/y/extensions/ForkYDoc.test.ts +0 -253
  550. package/src/y/extensions/ForkYDoc.ts +0 -108
  551. package/src/y/extensions/RelativePositionMapping.test.ts +0 -418
  552. package/src/y/extensions/RelativePositionMapping.ts +0 -49
  553. package/src/y/extensions/Suggestions.ts +0 -174
  554. package/src/y/extensions/Versioning.test.ts +0 -408
  555. package/src/y/extensions/Versioning.ts +0 -115
  556. package/src/y/extensions/YAttributionMarks.ts +0 -320
  557. package/src/y/extensions/YCursorPlugin.ts +0 -189
  558. package/src/y/extensions/YSync.ts +0 -125
  559. package/src/y/extensions/blockMatchNodes.ts +0 -182
  560. package/src/y/extensions/index.ts +0 -156
  561. package/src/y/index.ts +0 -4
  562. package/src/y/utils.test.ts +0 -1042
  563. package/src/y/utils.ts +0 -242
  564. package/src/y/versioning/__test__/fixtures/activity-all-after.bin +0 -0
  565. package/src/y/versioning/__test__/fixtures/activity-all-after.json +0 -50
  566. package/src/y/versioning/__test__/fixtures/activity-all.bin +0 -0
  567. package/src/y/versioning/__test__/fixtures/activity-all.json +0 -20
  568. package/src/y/versioning/__test__/fixtures/activity-filtered-after.bin +0 -0
  569. package/src/y/versioning/__test__/fixtures/activity-filtered-after.json +0 -32
  570. package/src/y/versioning/__test__/fixtures/activity-filtered-before.json +0 -1
  571. package/src/y/versioning/__test__/fixtures/changeset.bin +0 -0
  572. package/src/y/versioning/__test__/fixtures/patch-response.json +0 -4
  573. package/src/y/versioning/__test__/yhub.test.ts +0 -785
  574. package/src/y/versioning/index.ts +0 -1
  575. package/src/y/versioning/yhub.ts +0 -637
  576. package/src/yjs/README.md +0 -5
  577. package/src/yjs/comments/RESTYjsThreadStore.test.ts +0 -85
  578. package/src/yjs/comments/RESTYjsThreadStore.ts +0 -172
  579. package/src/yjs/comments/YjsThreadStore.test.ts +0 -295
  580. package/src/yjs/comments/YjsThreadStore.ts +0 -345
  581. package/src/yjs/comments/YjsThreadStoreBase.ts +0 -50
  582. package/src/yjs/comments/index.ts +0 -3
  583. package/src/yjs/comments/yjsHelpers.ts +0 -127
  584. package/src/yjs/extensions/FixUpSchema.test.ts +0 -421
  585. package/src/yjs/extensions/FixUpSchema.ts +0 -88
  586. package/src/yjs/extensions/ForkYDoc.test.ts +0 -253
  587. package/src/yjs/extensions/ForkYDoc.ts +0 -159
  588. package/src/yjs/extensions/RelativePositionMapping.test.ts +0 -418
  589. package/src/yjs/extensions/RelativePositionMapping.ts +0 -77
  590. package/src/yjs/extensions/Versioning.test.ts +0 -561
  591. package/src/yjs/extensions/Versioning.ts +0 -83
  592. package/src/yjs/extensions/YCursorPlugin.ts +0 -201
  593. package/src/yjs/extensions/YSync.ts +0 -16
  594. package/src/yjs/extensions/YUndo.ts +0 -12
  595. package/src/yjs/extensions/__snapshots__/fork-yjs-snap-editor-forked.json +0 -19
  596. package/src/yjs/extensions/__snapshots__/fork-yjs-snap-editor.json +0 -19
  597. package/src/yjs/extensions/__snapshots__/fork-yjs-snap-forked.html +0 -1
  598. package/src/yjs/extensions/__snapshots__/fork-yjs-snap.html +0 -1
  599. package/src/yjs/extensions/index.ts +0 -89
  600. package/src/yjs/extensions/schemaMigration/SchemaMigration.ts +0 -59
  601. package/src/yjs/extensions/schemaMigration/migrationRules/index.ts +0 -4
  602. package/src/yjs/extensions/schemaMigration/migrationRules/migrationRule.ts +0 -4
  603. package/src/yjs/extensions/schemaMigration/migrationRules/moveColorAttributes.test.ts +0 -130
  604. package/src/yjs/extensions/schemaMigration/migrationRules/moveColorAttributes.ts +0 -91
  605. package/src/yjs/index.ts +0 -3
  606. package/src/yjs/utils.test.ts +0 -1013
  607. package/src/yjs/utils.ts +0 -186
  608. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.d.ts +0 -1
  609. package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.d.ts +0 -1
  610. package/types/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.d.ts +0 -1
  611. package/types/src/api/blockManipulation/commands/nestBlock/nestBlock.test.d.ts +0 -1
  612. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.d.ts +0 -1
  613. package/types/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.d.ts +0 -32
  614. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.test.d.ts +0 -1
  615. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.test.d.ts +0 -1
  616. package/types/src/api/blockManipulation/tables/tables.test.d.ts +0 -1
  617. package/types/src/api/getBlockInfoFromPos.test.d.ts +0 -1
  618. package/types/src/api/getBlocksChangedByTransaction.test.d.ts +0 -1
  619. package/types/src/api/nodeConversions/blockToNode.test.d.ts +0 -1
  620. package/types/src/api/parsers/html/util/nestedLists.test.d.ts +0 -1
  621. package/types/src/api/parsers/markdown/detectMarkdown.test.d.ts +0 -1
  622. package/types/src/api/positionMapping.test.d.ts +0 -1
  623. package/types/src/blocks/Code/block.test.d.ts +0 -1
  624. package/types/src/blocks/ListItem/CheckListItem/block.test.d.ts +0 -1
  625. package/types/src/blocks/ListItem/ListItemKeyboardShortcuts.d.ts +0 -2
  626. package/types/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.d.ts +0 -1
  627. package/types/src/blocks/Table/TableExtension.test.d.ts +0 -1
  628. package/types/src/blocks/ToggleWrapper/createToggleWrapper.d.ts +0 -15
  629. package/types/src/blocks/utils/listItemEnterHandler.d.ts +0 -2
  630. package/types/src/comments/CommentEditorSubmitExtension.test.d.ts +0 -1
  631. package/types/src/editor/BlockNoteEditor.test.d.ts +0 -1
  632. package/types/src/editor/BlockNoteExtension.test.d.ts +0 -1
  633. package/types/src/editor/managers/EventManager.browser.test.d.ts +0 -1
  634. package/types/src/editor/managers/ExtensionManager/ExtensionManager.test.d.ts +0 -1
  635. package/types/src/editor/managers/StyleManager.browser.test.d.ts +0 -1
  636. package/types/src/editor/managers/StyleManager.test.d.ts +0 -1
  637. package/types/src/editor/performance.test.d.ts +0 -1
  638. package/types/src/editor/transformPasted.test.d.ts +0 -1
  639. package/types/src/exporter/Exporter.test.d.ts +0 -1
  640. package/types/src/extensions/PreviousBlockType/PreviousBlockType.test.d.ts +0 -1
  641. package/types/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.d.ts +0 -4
  642. package/types/src/extensions/SuggestionMenu/SuggestionMenu.test.d.ts +0 -1
  643. package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +0 -4
  644. package/types/src/extensions/SyntaxHighlighting/SyntaxHighlighting.test.d.ts +0 -1
  645. package/types/src/extensions/SyntaxHighlighting/inlineHighlight.test.d.ts +0 -1
  646. package/types/src/extensions/TableHandles/TableHandles.browser.test.d.ts +0 -1
  647. package/types/src/extensions/Versioning/Versioning.test.d.ts +0 -1
  648. package/types/src/extensions/Versioning/inMemoryVersioning.test.d.ts +0 -1
  649. package/types/src/extensions/getDraggableBlockFromElement.d.ts +0 -5
  650. package/types/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.d.ts +0 -1
  651. package/types/src/extensions/tiptap-extensions/Link/link.test.d.ts +0 -1
  652. package/types/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.d.ts +0 -4
  653. package/types/src/schema/blocks/createSpec.test.d.ts +0 -1
  654. package/types/src/schema/blocks/extendBlockSpec.test.d.ts +0 -1
  655. package/types/src/schema/blocks/internal.test.d.ts +0 -1
  656. package/types/src/schema/contentTypePropagation.test.d.ts +0 -1
  657. package/types/src/schema/inlineContent/createSpec.test.d.ts +0 -1
  658. package/types/src/schema/nodeViewMutations.test.d.ts +0 -1
  659. package/types/src/schema/schema.test.d.ts +0 -1
  660. package/types/src/user/createUserStore.test.d.ts +0 -1
  661. package/types/src/util/Store.test.d.ts +0 -1
  662. package/types/src/util/topo-sort.test.d.ts +0 -1
  663. package/types/src/y/comments/YjsThreadStore.test.d.ts +0 -1
  664. package/types/src/y/extensions/AttributionExtension.test.d.ts +0 -1
  665. package/types/src/y/extensions/DiffVersioningExtension.test.d.ts +0 -1
  666. package/types/src/y/extensions/ForkYDoc.test.d.ts +0 -1
  667. package/types/src/y/extensions/RelativePositionMapping.test.d.ts +0 -1
  668. package/types/src/y/extensions/Versioning.test.d.ts +0 -1
  669. package/types/src/y/utils.test.d.ts +0 -1
  670. package/types/src/y/versioning/__test__/yhub.test.d.ts +0 -1
  671. package/types/src/yjs/comments/RESTYjsThreadStore.test.d.ts +0 -1
  672. package/types/src/yjs/comments/YjsThreadStore.test.d.ts +0 -1
  673. package/types/src/yjs/extensions/FixUpSchema.test.d.ts +0 -1
  674. package/types/src/yjs/extensions/ForkYDoc.test.d.ts +0 -1
  675. package/types/src/yjs/extensions/RelativePositionMapping.test.d.ts +0 -1
  676. package/types/src/yjs/extensions/Versioning.test.d.ts +0 -1
  677. package/types/src/yjs/extensions/schemaMigration/migrationRules/moveColorAttributes.test.d.ts +0 -1
  678. package/types/src/yjs/utils.test.d.ts +0 -1
@@ -1,3379 +0,0 @@
1
- import { At as e, Cn as t, Ct as n, En as r, Ft as i, It as a, Lt as o, Mt as s, Nt as c, O as l, On as u, Pn as d, Sn as f, Tn as p, Tt as m, Un as h, W as g, Wn as _, Yt as ee, an as te, bn as ne, bt as re, er as ie, f as ae, gn as oe, in as se, ir as v, jn as y, jt as ce, m as le, nr as ue, or as de, rn as fe, rr as b, sr as x, t as pe, tr as S, wn as C, xn as me } from "./blocks-DaEUT0O1.js";
2
- import { o as he, r as ge, t as _e } from "./BlockNoteExtension-CbvDA0F7.js";
3
- import { A as ve, C as ye, F as be, M as xe, N as Se, O as Ce, P as we, S as Te, T as Ee, b as De, c as Oe, g as ke, h as Ae, k as je, m as Me, s as Ne, w as Pe, x as Fe, y as Ie } from "./extensions-B1JQURVF.js";
4
- import { r as Le } from "./UserStore-C4TzkGEn.js";
5
- import { t as Re } from "./en-BAn9gxr-.js";
6
- import { DOMParser as ze, DOMSerializer as Be, Fragment as w, NodeRange as Ve, Slice as T } from "prosemirror-model";
7
- import { ReplaceAroundStep as E, ReplaceStep as He, canJoin as Ue, liftTarget as We } from "prosemirror-transform";
8
- import { Editor as Ge, Extension as D, Mark as Ke, Node as O, combineTransactionSteps as qe, createDocument as Je, extensions as k, findChildrenInRange as Ye, findParentNodeClosestToPos as Xe, getAttributes as Ze, getChangedRanges as Qe, getMarkRange as $e, getMarksBetween as et, getSchema as tt, isNodeSelection as nt, markPasteRule as rt, mergeAttributes as A, posToDOMRect as it, selectionToInsertionEnd as at } from "@tiptap/core";
9
- import { NodeSelection as j, Plugin as M, TextSelection as N } from "prosemirror-state";
10
- import { DOMParser as ot, Fragment as P, Slice as F } from "@tiptap/pm/model";
11
- import { CellSelection as I, TableMap as st } from "prosemirror-tables";
12
- import { Plugin as ct, PluginKey as lt } from "@tiptap/pm/state";
13
- import { digestString as ut } from "lib0/hash/fnv1a";
14
- import { InputRule as dt, inputRules as ft } from "@handlewithcare/prosemirror-inputrules";
15
- import { keydownHandler as pt } from "@tiptap/pm/keymap";
16
- import { Text as mt } from "@tiptap/extension-text";
17
- import { Gapcursor as ht } from "@tiptap/extensions/gap-cursor";
18
- //#region src/schema/blocks/types.ts
19
- function gt(e) {
20
- return typeof e == "string" ? e : e.map((e) => typeof e == "string" ? e : e.text).join("");
21
- }
22
- //#endregion
23
- //#region src/schema/inlineContent/createSpec.ts
24
- function _t(e) {
25
- return e.matches("[data-editable]") ? e : e.querySelector("[data-editable]") || e;
26
- }
27
- function vt(e, t) {
28
- return ot.fromSchema(t).parse(e, {
29
- topNode: t.nodes.paragraph.create(),
30
- preserveWhitespace: !0
31
- }).content;
32
- }
33
- function yt(e, t) {
34
- let n = [];
35
- return e.forEach((e) => {
36
- if (e.isText) n.push(e);
37
- else {
38
- let r = e.type === t.linebreakReplacement ? "\n" : e.textContent;
39
- r && n.push(t.text(r, e.marks));
40
- }
41
- }), P.fromArray(n);
42
- }
43
- function bt(e, t, n) {
44
- let r = e.content === "plain" || n && e.content === "styled" ? (t) => (r, i) => {
45
- let a = n?.({
46
- el: r,
47
- schema: i
48
- });
49
- if (a !== void 0) return e.content === "plain" ? yt(a, i) : a;
50
- let o = vt(t(r), i);
51
- return e.content === "plain" ? yt(o, i) : o;
52
- } : void 0, i = [{
53
- tag: `[data-inline-content-type="${e.type}"]`,
54
- contentElement: (e) => _t(e),
55
- getContent: r ? (e, t) => r(_t)(e, t) : void 0
56
- }];
57
- return t && i.push({
58
- tag: "*",
59
- getAttrs(e) {
60
- if (typeof e == "string") return !1;
61
- let n = t?.(e);
62
- return n !== void 0 && n;
63
- },
64
- preserveWhitespace: r ? !0 : void 0,
65
- getContent: r ? (e, t) => r((e) => e)(e, t) : void 0
66
- }), i;
67
- }
68
- function xt(e, t) {
69
- let n = O.create({
70
- name: e.type,
71
- inline: !0,
72
- group: "inline",
73
- draggable: t.meta?.draggable,
74
- selectable: e.content !== "none",
75
- atom: e.content === "none",
76
- code: t.meta?.code,
77
- content: e.content === "styled" ? "inline*" : e.content === "plain" ? "text*" : "",
78
- marks() {
79
- return e.content === "plain" ? he(this.editor) : void 0;
80
- },
81
- addAttributes() {
82
- return oe(e.propSchema);
83
- },
84
- addKeyboardShortcuts() {
85
- return se(e);
86
- },
87
- parseHTML() {
88
- return bt(e, t.parse, t.parseContent);
89
- },
90
- renderHTML({ node: n }) {
91
- let r = this.options.editor, i = t.render.call({
92
- renderType: "dom",
93
- props: void 0
94
- }, p(n, r.schema.inlineContentSchema, r.schema.styleSchema), () => {}, r, n, () => void 0);
95
- return fe(i, e.type, n.attrs, e.propSchema);
96
- },
97
- addNodeView() {
98
- return (n) => {
99
- let { node: r, getPos: i } = n, o = this.options.editor, s = t.render.call({
100
- renderType: "nodeView",
101
- props: n
102
- }, p(r, o.schema.inlineContentSchema, o.schema.styleSchema), (e) => {
103
- let t = a([e], o.pmSchema), n = i();
104
- n && o.transact((e) => e.replaceWith(n, n + r.nodeSize, t));
105
- }, o, r, i), c = fe(s, e.type, r.attrs, e.propSchema);
106
- return d(c), c;
107
- };
108
- }
109
- });
110
- return te(n, e.propSchema, {
111
- ...t,
112
- toExternalHTML: t.toExternalHTML,
113
- render(n, r, i) {
114
- let o = a([n], i.pmSchema)[0], s = t.render(n, r, i, o, () => void 0);
115
- return fe(s, e.type, n.props, e.propSchema);
116
- }
117
- });
118
- }
119
- //#endregion
120
- //#region src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts
121
- function L(e, t, n, r = "before") {
122
- let a = typeof n == "string" ? n : n.id, o = y(e), s = t.map((e) => {
123
- let t = i(e, o);
124
- return t.check(), t;
125
- }), l = c(a, e.doc);
126
- if (!l) throw Error(`Block with ID ${a} not found`);
127
- let u = l.posBeforeNode;
128
- return r === "after" && (u += l.node.nodeSize), e.step(new He(u, u, new T(w.from(s), 0, 0))), s.map((t) => C(t, e.doc));
129
- }
130
- //#endregion
131
- //#region src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts
132
- function R(e) {
133
- if (!e || e.type.name !== "column") throw Error("Invalid columnPos: does not point to column node.");
134
- let t = e.firstChild;
135
- if (!t) throw Error("Invalid column: does not have child node.");
136
- let n = t.firstChild;
137
- if (!n) throw Error("Invalid blockContainer: does not have child node.");
138
- return e.childCount === 1 && t.childCount === 1 && n.type.name === "paragraph" && n.content.content.length === 0;
139
- }
140
- function St(e, t) {
141
- let n = e.doc.resolve(t), r = n.nodeAfter;
142
- if (!r || r.type.name !== "columnList") throw Error("Invalid columnListPos: does not point to columnList node.");
143
- for (let t = r.childCount - 1; t >= 0; t--) {
144
- let r = e.doc.resolve(n.pos + 1).posAtIndex(t), i = e.doc.resolve(r).nodeAfter;
145
- if (!i || i.type.name !== "column") throw Error("Invalid columnPos: does not point to column node.");
146
- R(i) && e.delete(r, r + i.nodeSize);
147
- }
148
- }
149
- function z(e, t) {
150
- St(e, t);
151
- let n = e.doc.resolve(t).nodeAfter;
152
- if (!n || n.type.name !== "columnList") throw Error("Invalid columnListPos: does not point to columnList node.");
153
- if (n.childCount > 2) return;
154
- if (n.childCount < 2) throw Error("Invalid columnList: contains fewer than two children.");
155
- let r = t + 1, i = e.doc.resolve(r).nodeAfter, a = t + n.nodeSize - 1, o = e.doc.resolve(a).nodeBefore;
156
- if (!i || !o) throw Error("Invalid columnList: does not contain children.");
157
- let s = R(i), c = R(o);
158
- if (s && c) {
159
- e.delete(t, t + n.nodeSize);
160
- return;
161
- }
162
- if (s) {
163
- e.step(new E(t, t + n.nodeSize, a - o.nodeSize + 1, a - 1, T.empty, 0, !1));
164
- return;
165
- }
166
- if (c) {
167
- e.step(new E(t, t + n.nodeSize, r + 1, r + i.nodeSize - 1, T.empty, 0, !1));
168
- return;
169
- }
170
- }
171
- //#endregion
172
- //#region src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts
173
- function B(e, t, n, r = {}) {
174
- let a = y(e), o = n.map((e) => {
175
- let t = i(e, a);
176
- return t.check(), t;
177
- }), s = new Set(t.map((e) => typeof e == "string" ? e : e.id)), c = [], l = /* @__PURE__ */ new Set(), u = typeof t[0] == "string" ? t[0] : t[0].id, d = 0;
178
- if (e.doc.descendants((t, r) => {
179
- if (s.size === 0) return !1;
180
- if (!t.type.isInGroup("bnBlock")) return !0;
181
- let i = x(t, e.doc);
182
- if (!s.has(i)) return !0;
183
- if (c.push(C(t, e.doc)), s.delete(i), n.length > 0 && i === u) {
184
- let t = e.doc.nodeSize;
185
- e.insert(r, o);
186
- let n = e.doc.nodeSize;
187
- d += t - n;
188
- }
189
- let a = e.doc.nodeSize, f = e.doc.resolve(r - d);
190
- f.node().type.name === "column" ? l.add(f.before(-1)) : f.node().type.name === "columnList" && l.add(f.before()), f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? e.delete(f.before(), f.after()) : e.delete(r - d, r - d + t.nodeSize);
191
- let p = e.doc.nodeSize;
192
- return d += a - p, !1;
193
- }), s.size > 0) {
194
- let e = [...s].join("\n");
195
- throw Error("Blocks with the following IDs could not be found in the editor: " + e);
196
- }
197
- return r.fixColumns !== !1 && l.forEach((t) => z(e, t)), {
198
- insertedBlocks: o.map((t) => C(t, e.doc)),
199
- removedBlocks: c
200
- };
201
- }
202
- //#endregion
203
- //#region src/api/exporters/html/util/serializeBlocksInternalHTML.ts
204
- function Ct(e, t, n, r, i) {
205
- let s;
206
- if (!t) throw Error("blockContent is required");
207
- if (typeof t == "string") s = a([t], e.pmSchema, r);
208
- else if (Array.isArray(t)) s = a(t, e.pmSchema, r);
209
- else if (t.type === "tableContent") s = o(t, e.pmSchema);
210
- else throw new _(t.type);
211
- let c = (i?.document ?? document).createDocumentFragment();
212
- for (let t of s) if (t.type.name !== "text" && e.schema.inlineContentSchema[t.type.name]) {
213
- let r = e.schema.inlineContentSpecs[t.type.name].implementation;
214
- if (r) {
215
- let a = p(t, e.schema.inlineContentSchema, e.schema.styleSchema), o = r.render.call({
216
- renderType: "dom",
217
- props: void 0
218
- }, a, () => {}, e);
219
- if (o) {
220
- if (c.appendChild(o.dom), o.contentDOM) {
221
- let e = n.serializeFragment(t.content, i);
222
- o.contentDOM.dataset.editable = "", o.contentDOM.appendChild(e);
223
- }
224
- continue;
225
- }
226
- }
227
- } else if (t.type.name === "text") {
228
- let n = document.createTextNode(t.textContent);
229
- for (let r of t.marks.toReversed()) if (r.type.name in e.schema.styleSpecs) {
230
- let t = e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue, e);
231
- t.contentDOM.appendChild(n), n = t.dom;
232
- } else {
233
- let e = r.type.spec.toDOM(r, !0), t = Be.renderSpec(document, e);
234
- t.contentDOM.appendChild(n), n = t.dom;
235
- }
236
- c.appendChild(n);
237
- } else {
238
- let e = n.serializeFragment(w.from([t]), i);
239
- c.appendChild(e);
240
- }
241
- return c;
242
- }
243
- function wt(e, t, n, r) {
244
- let i = e.pmSchema.nodes.blockContainer, a = t.props || {};
245
- for (let [n, r] of Object.entries(e.schema.blockSchema[t.type].propSchema)) !(n in a) && r.default !== void 0 && (a[n] = r.default);
246
- let o = t.children || [], s = e.blockImplementations[t.type].implementation.render.call({
247
- renderType: "dom",
248
- props: void 0
249
- }, {
250
- ...t,
251
- props: a,
252
- children: o
253
- }, e);
254
- if (s.contentDOM && t.content) {
255
- let i = Ct(e, t.content, n, t.type, r);
256
- s.contentDOM.appendChild(i);
257
- }
258
- if (e.pmSchema.nodes[t.type].isInGroup("bnBlock")) {
259
- if (t.children && t.children.length > 0) {
260
- let i = Tt(e, t.children, n, r);
261
- s.contentDOM?.append(i);
262
- }
263
- return s.dom;
264
- }
265
- let c = i.spec?.toDOM?.(i.create({
266
- id: t.id,
267
- ...a
268
- }));
269
- return c.contentDOM?.appendChild(s.dom), t.children && t.children.length > 0 && c.contentDOM?.appendChild(Et(e, t.children, n, r)), c.dom;
270
- }
271
- function Tt(e, t, n, r) {
272
- let i = (r?.document ?? document).createDocumentFragment();
273
- for (let a of t) {
274
- let t = wt(e, a, n, r);
275
- i.appendChild(t);
276
- }
277
- return i;
278
- }
279
- var Et = (e, t, n, r) => {
280
- let i = e.pmSchema.nodes.blockGroup, a = i.spec.toDOM(i.create({})), o = Tt(e, t, n, r);
281
- return a.contentDOM?.appendChild(o), a.dom;
282
- }, Dt = (e) => (e.querySelectorAll("[data-content-type=\"numberedListItem\"]").forEach((e) => {
283
- let t = e.closest(".bn-block-outer")?.previousElementSibling?.querySelector("[data-content-type=\"numberedListItem\"]");
284
- if (!t) e.setAttribute("data-index", e.getAttribute("data-start") || "1");
285
- else {
286
- let n = t.getAttribute("data-index");
287
- e.setAttribute("data-index", (parseInt(n || "0") + 1).toString());
288
- }
289
- }), e), Ot = (e) => (e.querySelectorAll("[data-content-type=\"checkListItem\"] input").forEach((e) => {
290
- e.disabled = !0;
291
- }), e), kt = (e) => (e.querySelectorAll(".bn-toggle-wrapper[data-show-children=\"false\"]").forEach((e) => {
292
- e.setAttribute("data-show-children", "true");
293
- }), e), At = (e) => (e.querySelectorAll("[data-content-type=\"table\"] table").forEach((e) => {
294
- e.setAttribute("style", "--default-cell-min-width: 120px;"), e.setAttribute("data-show-children", "true");
295
- }), e), jt = (e) => (e.querySelectorAll("[data-content-type=\"table\"] table").forEach((e) => {
296
- let t = document.createElement("div");
297
- t.className = "tableWrapper";
298
- let n = document.createElement("div");
299
- n.className = "tableWrapper-inner", t.appendChild(n), e.parentElement?.appendChild(t), t.appendChild(e);
300
- }), e), Mt = (e) => (e.querySelectorAll(".bn-inline-content:empty").forEach((e) => {
301
- let t = document.createElement("span");
302
- t.className = "ProseMirror-trailingBreak", t.setAttribute("style", "display: inline-block;"), e.appendChild(t);
303
- }), e), Nt = (e, t) => {
304
- let n = Be.fromSchema(e), r = [
305
- Dt,
306
- Ot,
307
- kt,
308
- At,
309
- jt,
310
- Mt
311
- ];
312
- return { serializeBlocks: (e, i) => {
313
- let a = Et(t, e, n, i);
314
- for (let e of r) a = e(a);
315
- return a.outerHTML;
316
- } };
317
- }, Pt = (e) => {
318
- let t = 0;
319
- for (let n = 0; n < e.length; n++) t = Math.imul(31, t) + e.charCodeAt(n);
320
- return Math.abs(t);
321
- }, V = [
322
- {
323
- light: "#fff0c2",
324
- dark: "#8a6d1a"
325
- },
326
- {
327
- light: "#fcc9c3",
328
- dark: "#8a2e24"
329
- },
330
- {
331
- light: "#d4e8eb",
332
- dark: "#4a7178"
333
- },
334
- {
335
- light: "#c2eeff",
336
- dark: "#1a6e8a"
337
- },
338
- {
339
- light: "#bef3ff",
340
- dark: "#0a7a8a"
341
- }
342
- ], Ft = (e) => V[Pt(e) % V.length], It = (e, t) => {
343
- if (!t || t.length === 0) return V[0];
344
- let n = t[0], r = e.getUser(n);
345
- return r?.color && r.colorLight ? {
346
- light: r.colorLight,
347
- dark: r.color
348
- } : Ft(n);
349
- }, Lt = (e) => ut(e).toString(16).padStart(8, "0"), Rt = (e) => {
350
- let t = Lt(e);
351
- return {
352
- light: `--user-color-${t}-light`,
353
- dark: `--user-color-${t}-dark`
354
- };
355
- }, H = class {
356
- callbacks = {};
357
- on(e, t) {
358
- return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(t), () => this.off(e, t);
359
- }
360
- emit(e, ...t) {
361
- let n = this.callbacks[e];
362
- n && n.forEach((e) => e.apply(this, t));
363
- }
364
- off(e, t) {
365
- let n = this.callbacks[e];
366
- n && (t ? this.callbacks[e] = n.filter((e) => e !== t) : delete this.callbacks[e]);
367
- }
368
- removeAllListeners() {
369
- this.callbacks = {};
370
- }
371
- };
372
- //#endregion
373
- //#region src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts
374
- function zt(e) {
375
- return e.transact((e) => {
376
- let t = ue(e, e.selection.anchor), n = x(t.bnBlock.node, e.doc);
377
- if (e.selection instanceof I) return {
378
- type: "cell",
379
- anchorBlockId: n,
380
- anchorCellOffset: e.selection.$anchorCell.pos - t.bnBlock.beforePos,
381
- headCellOffset: e.selection.$headCell.pos - t.bnBlock.beforePos
382
- };
383
- if (e.selection instanceof j) return {
384
- type: "node",
385
- anchorBlockId: n
386
- };
387
- {
388
- let r = ue(e, e.selection.head);
389
- return {
390
- type: "text",
391
- anchorBlockId: n,
392
- headBlockId: x(r.bnBlock.node, e.doc),
393
- anchorOffset: e.selection.anchor - t.bnBlock.beforePos,
394
- headOffset: e.selection.head - r.bnBlock.beforePos
395
- };
396
- }
397
- });
398
- }
399
- function Bt(e, t) {
400
- let n = c(t.anchorBlockId, e.doc)?.posBeforeNode;
401
- if (n === void 0) throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);
402
- let r;
403
- if (t.type === "cell") r = I.create(e.doc, n + t.anchorCellOffset, n + t.headCellOffset);
404
- else if (t.type === "node") r = j.create(e.doc, n + 1);
405
- else {
406
- let i = c(t.headBlockId, e.doc)?.posBeforeNode;
407
- if (i === void 0) throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);
408
- r = N.create(e.doc, n + t.anchorOffset, i + t.headOffset);
409
- }
410
- e.setSelection(r);
411
- }
412
- function Vt(e) {
413
- return e.flatMap((e) => e.type === "column" ? e.children : [e]);
414
- }
415
- function U(e, t, n, r) {
416
- e.transact((e) => {
417
- B(e, t, [], { fixColumns: !1 }), L(e, Vt(t), n, r);
418
- });
419
- }
420
- function Ht(e, t, n) {
421
- e.transact((r) => {
422
- let i = e.getSelection()?.blocks || [e.getTextCursorPosition().block], a = zt(e);
423
- U(e, i, t, n), Bt(r, a);
424
- });
425
- }
426
- function Ut(e) {
427
- return !e || e.type !== "columnList";
428
- }
429
- function Wt(e, t, n) {
430
- let r, i;
431
- if (t ? t.children.length > 0 ? (r = t.children[t.children.length - 1], i = "after") : (r = t, i = "before") : n && (r = n, i = "before"), !r || !i) return;
432
- let a = e.getParentBlock(r);
433
- return Ut(a) ? {
434
- referenceBlock: r,
435
- placement: i
436
- } : Wt(e, i === "after" ? r : e.getPrevBlock(r), a);
437
- }
438
- function Gt(e, t, n) {
439
- let r, i;
440
- if (t ? t.children.length > 0 ? (r = t.children[0], i = "before") : (r = t, i = "after") : n && (r = n, i = "after"), !r || !i) return;
441
- let a = e.getParentBlock(r);
442
- return Ut(a) ? {
443
- referenceBlock: r,
444
- placement: i
445
- } : Gt(e, i === "before" ? r : e.getNextBlock(r), a);
446
- }
447
- function Kt(e, t) {
448
- e.transact(() => {
449
- let n;
450
- if (t) {
451
- if (n = e.getBlock(t), !n) return;
452
- } else n = e.getSelection()?.blocks[0] || e.getTextCursorPosition().block;
453
- let r = Wt(e, e.getPrevBlock(n), e.getParentBlock(n));
454
- r && (t ? U(e, [n], r.referenceBlock, r.placement) : Ht(e, r.referenceBlock, r.placement));
455
- });
456
- }
457
- function qt(e, t) {
458
- e.transact(() => {
459
- let n;
460
- if (t) {
461
- if (n = e.getBlock(t), !n) return;
462
- } else {
463
- let t = e.getSelection();
464
- n = t?.blocks[t?.blocks.length - 1] || e.getTextCursorPosition().block;
465
- }
466
- let r = Gt(e, e.getNextBlock(n), e.getParentBlock(n));
467
- r && (t ? U(e, [n], r.referenceBlock, r.placement) : Ht(e, r.referenceBlock, r.placement));
468
- });
469
- }
470
- //#endregion
471
- //#region src/api/blockManipulation/commands/nestBlock/nestBlock.ts
472
- function Jt(e, t, n) {
473
- let { $from: r, $to: i } = e.selection, a = r.blockRange(i, (e) => e.childCount > 0 && (e.type.name === "blockGroup" || e.type.name === "column"));
474
- if (!a) return !1;
475
- let o = a.startIndex;
476
- if (o === 0) return !1;
477
- let s = a.parent.child(o - 1);
478
- if (s.type !== t) return !1;
479
- let c = s.lastChild && s.lastChild.type === n, l = w.from(c ? t.create() : null), u = new T(w.from(t.create(null, w.from(n.create(null, l)))), c ? 3 : 1, 0), d = a.start, f = a.end;
480
- return e.step(new E(d - (c ? 3 : 1), f, d, f, u, 1, !0)).scrollIntoView(), !0;
481
- }
482
- function Yt(e) {
483
- return e.transact((t) => Jt(t, e.pmSchema.nodes.blockContainer, e.pmSchema.nodes.blockGroup));
484
- }
485
- function Xt(e, t, n, r) {
486
- let i = r.end, a = r.$to.end(r.depth);
487
- if (i < a) {
488
- let o = r.parent.child(r.endIndex - 1), s = o.lastChild && o.lastChild.type === n;
489
- e.step(new E(i - (s ? 2 : 1), a, i, a, new T(w.from(t.create(null, n.create())), s ? 2 : 1, 0), +!s, !0)), r = new Ve(e.doc.resolve(r.$from.pos), e.doc.resolve(a), r.depth);
490
- }
491
- let o = We(r);
492
- if (o == null) return !1;
493
- e.lift(r, o);
494
- let s = e.doc.resolve(e.mapping.map(i, -1) - 1);
495
- return Ue(e.doc, s.pos) && s.nodeBefore.type === s.nodeAfter.type && e.join(s.pos), e.scrollIntoView(), !0;
496
- }
497
- function W(e, t, n) {
498
- let { $from: r, $to: i } = e.selection, a = r.blockRange(i, (e) => e.childCount > 0 && (e.type.name === "blockGroup" || e.type.name === "column"));
499
- return a ? r.node(a.depth - 1).type === t && Xt(e, t, n, a) : !1;
500
- }
501
- function Zt(e) {
502
- return e.transact((t) => W(t, e.pmSchema.nodes.blockContainer, e.pmSchema.nodes.blockGroup));
503
- }
504
- function Qt(e) {
505
- return e.transact((e) => {
506
- let { bnBlock: t } = v(e);
507
- return e.doc.resolve(t.beforePos).nodeBefore !== null;
508
- });
509
- }
510
- function $t(e) {
511
- return e.transact((e) => {
512
- let { bnBlock: t } = v(e);
513
- return e.doc.resolve(t.beforePos).depth > 1;
514
- });
515
- }
516
- //#endregion
517
- //#region src/api/blockManipulation/getBlock/getBlock.ts
518
- function en(e, t) {
519
- let n = typeof t == "string" ? t : t.id, r = c(n, e);
520
- if (r) return C(r.node, e);
521
- }
522
- function tn(e, t) {
523
- let n = typeof t == "string" ? t : t.id, r = c(n, e);
524
- if (!r) return;
525
- let i = e.resolve(r.posBeforeNode).nodeBefore;
526
- if (i) return C(i, e);
527
- }
528
- function nn(e, t) {
529
- let n = typeof t == "string" ? t : t.id, r = c(n, e);
530
- if (!r) return;
531
- let i = e.resolve(r.posBeforeNode + r.node.nodeSize).nodeAfter;
532
- if (i) return C(i, e);
533
- }
534
- function rn(e, t) {
535
- let n = typeof t == "string" ? t : t.id, r = c(n, e);
536
- if (!r) return;
537
- let i = e.resolve(r.posBeforeNode), a = i.node(), o = i.node(-1), s = o.type.name === "doc" ? void 0 : a.type.name === "blockGroup" ? o : a;
538
- if (s) return C(s, e);
539
- }
540
- //#endregion
541
- //#region src/editor/managers/BlockManager.ts
542
- var an = class {
543
- editor;
544
- constructor(e) {
545
- this.editor = e;
546
- }
547
- get document() {
548
- return this.editor.transact((e) => t(e.doc));
549
- }
550
- getBlock(e) {
551
- return this.editor.transact((t) => en(t.doc, e));
552
- }
553
- getPrevBlock(e) {
554
- return this.editor.transact((t) => tn(t.doc, e));
555
- }
556
- getNextBlock(e) {
557
- return this.editor.transact((t) => nn(t.doc, e));
558
- }
559
- getParentBlock(e) {
560
- return this.editor.transact((t) => rn(t.doc, e));
561
- }
562
- forEachBlock(e, t = !1) {
563
- let n = this.document.slice();
564
- t && n.reverse();
565
- function r(n) {
566
- for (let i of n) if (e(i) === !1 || !r(t ? i.children.slice().reverse() : i.children)) return !1;
567
- return !0;
568
- }
569
- r(n);
570
- }
571
- insertBlocks(e, t, n = "before") {
572
- return this.editor.transact((r) => L(r, e, t, n));
573
- }
574
- updateBlock(t, n) {
575
- return this.editor.transact((r) => e(r, t, n));
576
- }
577
- removeBlocks(e) {
578
- return this.editor.transact((t) => B(t, e, []).removedBlocks);
579
- }
580
- replaceBlocks(e, t) {
581
- return this.editor.transact((n) => B(n, e, t));
582
- }
583
- canNestBlock() {
584
- return Qt(this.editor);
585
- }
586
- nestBlock() {
587
- Yt(this.editor);
588
- }
589
- canUnnestBlock() {
590
- return $t(this.editor);
591
- }
592
- unnestBlock() {
593
- Zt(this.editor);
594
- }
595
- moveBlocksUp(e) {
596
- return Kt(this.editor, e);
597
- }
598
- moveBlocksDown(e) {
599
- return qt(this.editor, e);
600
- }
601
- }, on = class extends H {
602
- editor;
603
- constructor(e) {
604
- super(), this.editor = e, e.on("create", () => {
605
- e._tiptapEditor.on("update", ({ transaction: t, appendedTransactions: n }) => {
606
- this.emit("onChange", {
607
- editor: e,
608
- transaction: t,
609
- appendedTransactions: n
610
- });
611
- }), e._tiptapEditor.on("selectionUpdate", ({ transaction: t }) => {
612
- this.emit("onSelectionChange", {
613
- editor: e,
614
- transaction: t
615
- });
616
- }), e._tiptapEditor.on("focus", ({ event: t }) => {
617
- this.emit("onFocusChange", {
618
- editor: e,
619
- focused: !0,
620
- event: t
621
- });
622
- }), e._tiptapEditor.on("blur", ({ event: t }) => {
623
- this.emit("onFocusChange", {
624
- editor: e,
625
- focused: !1,
626
- event: t
627
- });
628
- }), e._tiptapEditor.on("mount", () => {
629
- this.emit("onMount", { editor: e });
630
- }), e._tiptapEditor.on("unmount", () => {
631
- this.emit("onUnmount", { editor: e });
632
- });
633
- let t;
634
- this.onMount(() => {
635
- t = this.attachUIFocusTracker();
636
- }), this.onUnmount(() => {
637
- t && t();
638
- });
639
- });
640
- }
641
- attachUIFocusTracker() {
642
- if (typeof document > "u") return () => {};
643
- let e = this.editor.isFocused({ includeEditorUI: !0 }), t, n = (t) => {
644
- let n = this.editor.isFocused({ includeEditorUI: !0 });
645
- n !== e && (e = n, this.emit("onFocusChangeWithinUI", {
646
- editor: this.editor,
647
- focused: n,
648
- event: t
649
- }));
650
- }, r = (e) => n(e), i = (e) => {
651
- clearTimeout(t), t = setTimeout(() => n(e));
652
- };
653
- return document.addEventListener("focusin", r, !0), document.addEventListener("focusout", i, !0), () => {
654
- clearTimeout(t), document.removeEventListener("focusin", r, !0), document.removeEventListener("focusout", i, !0);
655
- };
656
- }
657
- onChange(e, t = !0) {
658
- return this.on("onChange", ({ transaction: n, appendedTransactions: r }) => {
659
- !t && sn(n) || e(this.editor, { getChanges() {
660
- return we(n, r);
661
- } });
662
- });
663
- }
664
- onSelectionChange(e, t = !1) {
665
- return this.on("onSelectionChange", ({ transaction: n }) => {
666
- !t && sn(n) || e(this.editor);
667
- });
668
- }
669
- onFocusChange(e, t) {
670
- return this.on(t?.includeEditorUI ? "onFocusChangeWithinUI" : "onFocusChange", ({ focused: t, event: n }) => e(this.editor, {
671
- focused: t,
672
- event: n
673
- }));
674
- }
675
- onMount(e) {
676
- return this.on("onMount", e);
677
- }
678
- onUnmount(e) {
679
- return this.on("onUnmount", e);
680
- }
681
- };
682
- function sn(e) {
683
- return !!e.getMeta("y-sync$");
684
- }
685
- //#endregion
686
- //#region src/api/parsers/html/util/nestedLists.ts
687
- function cn(e) {
688
- return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
689
- }
690
- function ln(e) {
691
- return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
692
- }
693
- function un(e) {
694
- e.querySelectorAll("li > ul, li > ol").forEach((e) => {
695
- let t = cn(e), n = e.parentElement, r = Array.from(n.childNodes).slice(t + 1);
696
- e.remove(), r.forEach((e) => {
697
- e.remove();
698
- }), n.insertAdjacentElement("afterend", e), r.reverse().forEach((t) => {
699
- if (ln(t)) return;
700
- let n = document.createElement("li");
701
- n.append(t), e.insertAdjacentElement("afterend", n);
702
- }), n.childNodes.length === 0 && n.remove();
703
- });
704
- }
705
- function dn(e) {
706
- e.querySelectorAll("li + ul, li + ol").forEach((e) => {
707
- let t = e.previousElementSibling, n = document.createElement("div");
708
- t.insertAdjacentElement("afterend", n), n.append(t);
709
- let r = document.createElement("div");
710
- for (r.setAttribute("data-node-type", "blockGroup"), n.append(r); n.nextElementSibling?.nodeName === "UL" || n.nextElementSibling?.nodeName === "OL";) r.append(n.nextElementSibling);
711
- });
712
- }
713
- var fn = null;
714
- function pn() {
715
- return fn ||= document.implementation.createHTMLDocument("title");
716
- }
717
- function mn(e) {
718
- if (typeof e == "string") {
719
- let t = pn().createElement("div");
720
- t.innerHTML = e, e = t;
721
- }
722
- return un(e), dn(e), e;
723
- }
724
- //#endregion
725
- //#region src/api/parsers/html/util/normalizeWhitespace.ts
726
- function hn(e) {
727
- let t = e.ownerDocument.createTreeWalker(e, 128), n;
728
- for (; n = t.nextNode();) if (/^\s*notionvc:/.test(n.nodeValue || "")) return !0;
729
- return !1;
730
- }
731
- function gn(e) {
732
- let t = /* @__PURE__ */ new Set(["PRE", "CODE"]), n = e.ownerDocument.createTreeWalker(e, 4, { acceptNode(n) {
733
- let r = n.parentElement;
734
- for (; r && r !== e;) {
735
- if (t.has(r.tagName)) return 2;
736
- r = r.parentElement;
737
- }
738
- return 1;
739
- } }), r = [], i;
740
- for (; i = n.nextNode();) r.push(i);
741
- for (let e of r) e.nodeValue && /[\r\n]/.test(e.nodeValue) && (e.nodeValue = e.nodeValue.replace(/[ \t\r\n\f]+/g, " "));
742
- }
743
- function _n(e) {
744
- hn(e) || gn(e);
745
- }
746
- //#endregion
747
- //#region src/api/parsers/html/parseHTML.ts
748
- function vn(e) {
749
- let t = [];
750
- for (let n of e) if (n.type === "text") {
751
- let e = n.text.split("").join("");
752
- e.length > 0 && t.push({
753
- ...n,
754
- text: e
755
- });
756
- } else Array.isArray(n.content) ? t.push({
757
- ...n,
758
- content: vn(n.content)
759
- }) : t.push(n);
760
- return t;
761
- }
762
- function yn(e) {
763
- for (let t of e) Array.isArray(t.content) && (t.content = vn(t.content)), t.children.length > 0 && yn(t.children);
764
- }
765
- function G(e, t) {
766
- let n = mn(e);
767
- _n(n);
768
- let r = ze.fromSchema(t).parse(n, { topNode: t.nodes.blockGroup.create() }), i = [];
769
- for (let e = 0; e < r.childCount; e++) i.push(C(r.child(e), r));
770
- return yn(i), i;
771
- }
772
- //#endregion
773
- //#region src/api/parsers/markdown/markdownToHtml.ts
774
- function K(e) {
775
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
776
- }
777
- function bn(e) {
778
- return e ? /\w/.test(e) : !1;
779
- }
780
- function q(e, t, n) {
781
- let r = t > 0 ? e[t - 1] : void 0, i = t + n < e.length ? e[t + n] : void 0;
782
- return bn(r) && bn(i);
783
- }
784
- function xn(e, t) {
785
- if (e[t] !== "\\" || t + 1 >= e.length) return null;
786
- let n = e[t + 1];
787
- return n === "\n" ? {
788
- html: "<br>\n",
789
- end: t + 2
790
- } : "\\`*_{}[]()#+-.!~|>".includes(n) ? {
791
- html: K(n),
792
- end: t + 2
793
- } : null;
794
- }
795
- function Sn(e, t) {
796
- return e[t] === "`" ? Rn(e, t) : null;
797
- }
798
- function Cn(e, t) {
799
- return e[t] !== "!" || e[t + 1] !== "[" ? null : zn(e, t);
800
- }
801
- function wn(e, t) {
802
- return e[t] === "[" ? Bn(e, t) : null;
803
- }
804
- function Tn(e, t) {
805
- return e[t] !== "~" || e[t + 1] !== "~" ? null : Y(e, t, "~~", "<del>", "</del>");
806
- }
807
- function En(e, t) {
808
- return e[t] === "*" && e[t + 1] === "*" && e[t + 2] === "*" || e[t] === "_" && e[t + 1] === "_" && e[t + 2] === "_" && !q(e, t, 3) ? Y(e, t, e.substring(t, t + 3), "<strong><em>", "</em></strong>") : null;
809
- }
810
- function Dn(e, t) {
811
- return e[t] === "*" && e[t + 1] === "*" || e[t] === "_" && e[t + 1] === "_" && !q(e, t, 2) ? Y(e, t, e.substring(t, t + 2), "<strong>", "</strong>") : null;
812
- }
813
- function On(e, t) {
814
- return e[t] === "*" || e[t] === "_" && !q(e, t, 1) ? Y(e, t, e[t], "<em>", "</em>") : null;
815
- }
816
- function kn(e, t) {
817
- return e[t] === "\n" ? {
818
- html: "<br>\n",
819
- end: t + 1
820
- } : null;
821
- }
822
- var An = /^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/, jn = /^<!--[\s\S]*?-->/, Mn = /^<!\[CDATA\[[\s\S]*?\]\]>/, Nn = /^<\?[\s\S]*?\?>/, Pn = /^<![A-Za-z][\s\S]*?>/;
823
- function Fn(e, t) {
824
- if (e[t] !== "<") return null;
825
- let n = e.substring(t);
826
- for (let e of [
827
- jn,
828
- Mn,
829
- Nn,
830
- Pn,
831
- An
832
- ]) {
833
- let r = n.match(e);
834
- if (r) return {
835
- html: r[0],
836
- end: t + r[0].length
837
- };
838
- }
839
- return null;
840
- }
841
- var In = /* @__PURE__ */ new Set("\\`![~*_\n<"), Ln = [
842
- xn,
843
- Sn,
844
- Cn,
845
- wn,
846
- Tn,
847
- En,
848
- Dn,
849
- On,
850
- Fn,
851
- kn
852
- ];
853
- function J(e) {
854
- let t = "", n = 0;
855
- for (; n < e.length;) {
856
- if (e[n] === "\n" && n >= 2 && e[n - 1] === " " && e[n - 2] === " ") {
857
- t = t.replace(/ +$/, ""), t += "<br>\n", n++;
858
- continue;
859
- }
860
- let r = !1;
861
- if (In.has(e[n])) for (let i of Ln) {
862
- let a = i(e, n);
863
- if (a) {
864
- t += a.html, n = a.end, r = !0;
865
- break;
866
- }
867
- }
868
- if (!r) {
869
- let r = n;
870
- for (n++; n < e.length && !In.has(e[n]);) n++;
871
- t += K(e.substring(r, n));
872
- }
873
- }
874
- return t;
875
- }
876
- function Rn(e, t) {
877
- let n = 0, r = t;
878
- for (; r < e.length && e[r] === "`";) n++, r++;
879
- let i = r;
880
- for (; i < e.length;) if (e[i] === "`") {
881
- let t = 0, a = i;
882
- for (; i < e.length && e[i] === "`";) t++, i++;
883
- if (t === n) {
884
- let t = e.substring(r, a);
885
- return t = t.replace(/\n/g, " "), t.length >= 2 && t[0] === " " && t[t.length - 1] === " " && /[^ ]/.test(t) && (t = t.substring(1, t.length - 1)), {
886
- html: `<code>${K(t)}</code>`,
887
- end: i
888
- };
889
- }
890
- } else i++;
891
- return null;
892
- }
893
- function zn(e, t) {
894
- let n = Vn(e, t + 1);
895
- if (n === -1) return null;
896
- let r = t + 2;
897
- if (e[n + 1] !== "(") return null;
898
- let i = n + 2, a = Hn(e, i - 1);
899
- if (a === -1) return null;
900
- let o = e.substring(r, n), { url: s, title: c } = Un(e.substring(i, a));
901
- if (ne(s)) {
902
- let e = o || c;
903
- return {
904
- html: `<video src="${K(s)}"${e ? ` data-name="${K(e)}"` : ""} data-url="${K(s)}" controls></video>`,
905
- end: a + 1
906
- };
907
- }
908
- let l = c === void 0 ? "" : ` title="${K(c)}"`;
909
- return {
910
- html: `<img src="${K(s)}" alt="${K(o)}"${l}>`,
911
- end: a + 1
912
- };
913
- }
914
- function Bn(e, t) {
915
- let n = t + 1, r = Vn(e, t);
916
- if (r === -1 || e[r + 1] !== "(") return null;
917
- let i = r + 2, a = Hn(e, r + 1);
918
- if (a === -1) return null;
919
- let o = e.substring(n, r), { url: s, title: c } = Un(e.substring(i, a)), l = c === void 0 ? "" : ` title="${K(c)}"`;
920
- return {
921
- html: `<a href="${K(s)}"${l}>${J(o)}</a>`,
922
- end: a + 1
923
- };
924
- }
925
- function Vn(e, t) {
926
- let n = 0;
927
- for (let r = t; r < e.length; r++) {
928
- if (e[r] === "\\" && r + 1 < e.length) {
929
- r++;
930
- continue;
931
- }
932
- if (e[r] === "[" && n++, e[r] === "]" && (n--, n === 0)) return r;
933
- }
934
- return -1;
935
- }
936
- function Hn(e, t) {
937
- let n = 0;
938
- for (let r = t; r < e.length; r++) {
939
- if (e[r] === "\\" && r + 1 < e.length) {
940
- r++;
941
- continue;
942
- }
943
- if (e[r] === "(" && n++, e[r] === ")" && (n--, n === 0)) return r;
944
- }
945
- return -1;
946
- }
947
- function Un(e) {
948
- e = e.trim();
949
- let t, n;
950
- if (e.startsWith("<")) {
951
- let r = e.indexOf(">");
952
- r === -1 ? (t = e.substring(1), n = "") : (t = e.substring(1, r), n = e.substring(r + 1).trim());
953
- } else {
954
- let r = e.length;
955
- for (let t = 0; t < e.length; t++) {
956
- if (e[t] === "\\" && t + 1 < e.length) {
957
- t++;
958
- continue;
959
- }
960
- if (e[t] === " " || e[t] === " " || e[t] === "\n") {
961
- r = t;
962
- break;
963
- }
964
- }
965
- t = e.substring(0, r), n = e.substring(r).trim();
966
- }
967
- let r;
968
- if (n.length > 0) {
969
- let e = n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);
970
- e && (r = e[1] ?? e[2] ?? e[3]);
971
- }
972
- return {
973
- url: t,
974
- title: r
975
- };
976
- }
977
- function Y(e, t, n, r, i) {
978
- let a = n.length, o = t + a;
979
- if (o >= e.length || e[o] === " " || e[o] === " ") return null;
980
- let s = o;
981
- for (; s < e.length;) {
982
- if (e[s] === "\\" && s + 1 < e.length) {
983
- s += 2;
984
- continue;
985
- }
986
- if (e.substring(s, s + a) === n) {
987
- if (e[s - 1] === " " || e[s - 1] === " ") {
988
- s++;
989
- continue;
990
- }
991
- if (a === 1 && (s > 0 && e[s - 1] === n[0] && !(s >= 2 && e[s - 2] === "\\") || s + a < e.length && e[s + a] === n[0])) {
992
- s++;
993
- continue;
994
- }
995
- let t = e.substring(o, s);
996
- if (t.length === 0) {
997
- s++;
998
- continue;
999
- }
1000
- return {
1001
- html: r + J(t) + i,
1002
- end: s + a
1003
- };
1004
- }
1005
- s++;
1006
- }
1007
- return null;
1008
- }
1009
- var Wn = /* @__PURE__ */ new Set(/* @__PURE__ */ "address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul".split("."));
1010
- function Gn(e) {
1011
- if (/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e)) return !0;
1012
- let t = e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);
1013
- return t ? Wn.has(t[1].toLowerCase()) : !1;
1014
- }
1015
- function Kn(e) {
1016
- let t = e.split("\n"), n = [], r = 0, i = !0;
1017
- for (; r < t.length;) {
1018
- let e = t[r];
1019
- if (e.trim() === "") {
1020
- i = !0, r++;
1021
- continue;
1022
- }
1023
- let a = e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);
1024
- if (a) {
1025
- let e = a[1], o = e[0], s = e.length, c = a[2].trim(), l = [];
1026
- for (r++; r < t.length;) {
1027
- if (t[r].match(RegExp(`^ {0,3}${o}{${s},}\\s*$`))) {
1028
- r++;
1029
- break;
1030
- }
1031
- l.push(t[r]), r++;
1032
- }
1033
- n.push({
1034
- type: "codeBlock",
1035
- language: c || "",
1036
- code: l.join("\n")
1037
- }), i = !1;
1038
- continue;
1039
- }
1040
- let o = e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);
1041
- if (o) {
1042
- n.push({
1043
- type: "heading",
1044
- level: o[1].length,
1045
- content: o[2]
1046
- }), i = !1, r++;
1047
- continue;
1048
- }
1049
- if (/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)) {
1050
- let t = n[n.length - 1];
1051
- if (!i && e.trim().match(/^-+$/) && t && t.type === "paragraph") {
1052
- let e = t;
1053
- n[n.length - 1] = {
1054
- type: "heading",
1055
- level: 2,
1056
- content: e.content
1057
- }, i = !1, r++;
1058
- continue;
1059
- }
1060
- n.push({ type: "hr" }), i = !1, r++;
1061
- continue;
1062
- }
1063
- if (r + 1 < t.length) {
1064
- let a = t[r + 1];
1065
- if (/^={1,}\s*$/.test(a) && e.trim().length > 0) {
1066
- n.push({
1067
- type: "heading",
1068
- level: 1,
1069
- content: e.trim()
1070
- }), i = !1, r += 2;
1071
- continue;
1072
- }
1073
- }
1074
- let s = qn(t, r);
1075
- if (s) {
1076
- n.push(s.token), r = s.nextLine, i = !1;
1077
- continue;
1078
- }
1079
- if (/^\s{0,3}>/.test(e)) {
1080
- let e = [];
1081
- for (; r < t.length && /^\s{0,3}>/.test(t[r]);) e.push(t[r].replace(/^\s{0,3}>\s?/, "")), r++;
1082
- for (; r < t.length;) {
1083
- let n = t[r];
1084
- if (n.trim() === "" || /^\s{0,3}>/.test(n) || /^(#{1,6})\s/.test(n) || /^(`{3,}|~{3,})/.test(n) || /^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n) || /^\s*([-*+]|\d+[.)])\s+/.test(n) || /^\s*\|(.+\|)+\s*$/.test(n)) break;
1085
- e.push(n), r++;
1086
- }
1087
- n.push({
1088
- type: "blockquote",
1089
- content: e.join("\n")
1090
- }), i = !1;
1091
- continue;
1092
- }
1093
- let c = e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);
1094
- if (c) {
1095
- let e = c[1].length, a = c[2], o = c[3], s = c[4], l = c[5], u, d, f;
1096
- s ? (u = "task", f = s.trim() !== "[ ]") : /^\d+[.)]$/.test(a) ? (u = "ordered", d = parseInt(a, 10)) : u = "bullet";
1097
- let p = e + a.length + o.length + (s ? s.length : 0), m = e + 1, h = (e) => {
1098
- if (e.trim() === "") return !0;
1099
- let t = e.match(/^\s*/)[0].length;
1100
- return !!(t >= p || t >= m && e.match(/^\s*([-*+]|\d+[.)])\s+/));
1101
- };
1102
- r++;
1103
- let g = [];
1104
- for (; r < t.length;) {
1105
- let e = t[r];
1106
- if (e.trim() === "") {
1107
- let e = r + 1;
1108
- for (; e < t.length && t[e].trim() === "";) e++;
1109
- if (e < t.length && h(t[e])) {
1110
- g.push(""), r++;
1111
- continue;
1112
- }
1113
- break;
1114
- }
1115
- if (!h(e)) break;
1116
- e.match(/^\s*/)[0].length >= p ? g.push(e.substring(p)) : g.push(e.substring(m)), r++;
1117
- }
1118
- let _ = g.join("\n").replace(/^\n+|\n+$/g, "");
1119
- n.push({
1120
- type: "listItem",
1121
- listType: u,
1122
- indent: e,
1123
- content: l.trim(),
1124
- start: d,
1125
- checked: f,
1126
- childContent: _ || void 0
1127
- }), i = !1;
1128
- continue;
1129
- }
1130
- if (Gn(e)) {
1131
- let e = [];
1132
- for (; r < t.length && t[r].trim() !== "";) e.push(t[r]), r++;
1133
- n.push({
1134
- type: "rawHtml",
1135
- content: e.join("\n")
1136
- }), i = !1;
1137
- continue;
1138
- }
1139
- let l = [e];
1140
- for (r++; r < t.length;) {
1141
- let e = t[r];
1142
- if (e.trim() === "" || /^(#{1,6})\s/.test(e) || /^(`{3,}|~{3,})/.test(e) || /^\s{0,3}>/.test(e) || /^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e) || /^\s*([-*+]|\d+[.)])\s+/.test(e) || /^\s*\|(.+\|)+\s*$/.test(e) || Gn(e) || r + 1 < t.length && /^[=-]+\s*$/.test(t[r + 1]) && e.trim().length > 0) break;
1143
- l.push(e), r++;
1144
- }
1145
- n.push({
1146
- type: "paragraph",
1147
- content: l.map((e) => e.replace(/^ {1,3}/, "")).join("\n").replace(/[ \t]+$/, "")
1148
- }), i = !1;
1149
- }
1150
- return n;
1151
- }
1152
- function qn(e, t) {
1153
- if (t + 1 >= e.length) return null;
1154
- let n = e[t], r = e[t + 1];
1155
- if (!r.includes("|") || !/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r) || !n.includes("|")) return null;
1156
- let i = Jn(n), a = Yn(r), o = [], s = t + 2;
1157
- for (; s < e.length;) {
1158
- let t = e[s];
1159
- if (!t.includes("|")) break;
1160
- o.push(Jn(t)), s++;
1161
- }
1162
- return {
1163
- token: {
1164
- type: "table",
1165
- headers: i,
1166
- rows: o,
1167
- alignments: a
1168
- },
1169
- nextLine: s
1170
- };
1171
- }
1172
- function Jn(e) {
1173
- let t = e.trim(), n = t.startsWith("|") ? t.substring(1) : t, r = n.endsWith("|") ? n.substring(0, n.length - 1) : n, i = [], a = "";
1174
- for (let e = 0; e < r.length; e++) r[e] === "\\" && e + 1 < r.length && r[e + 1] === "|" ? (a += "|", e++) : r[e] === "|" ? (i.push(a.trim()), a = "") : a += r[e];
1175
- return i.push(a.trim()), i;
1176
- }
1177
- function Yn(e) {
1178
- return Jn(e).map((e) => {
1179
- let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
1180
- return n && r ? "center" : r ? "right" : n ? "left" : null;
1181
- });
1182
- }
1183
- function Xn(e) {
1184
- let t = "", n = 0;
1185
- for (; n < e.length;) {
1186
- let r = e[n];
1187
- switch (r.type) {
1188
- case "heading": {
1189
- let e = r;
1190
- t += `<h${e.level}>${J(e.content)}</h${e.level}>`, n++;
1191
- break;
1192
- }
1193
- case "paragraph":
1194
- t += `<p>${J(r.content)}</p>`, n++;
1195
- break;
1196
- case "codeBlock": {
1197
- let e = r, i = e.language ? ` data-language="${K(e.language)}"` : "";
1198
- t += `<pre><code${i}>${K(e.code)}</code></pre>`, n++;
1199
- break;
1200
- }
1201
- case "blockquote": {
1202
- let e = Xn(Kn(r.content));
1203
- t += `<blockquote>${e}</blockquote>`, n++;
1204
- break;
1205
- }
1206
- case "hr":
1207
- t += "<hr>", n++;
1208
- break;
1209
- case "listItem": {
1210
- let r = Zn(e, n);
1211
- t += r.html, n = r.nextIndex;
1212
- break;
1213
- }
1214
- case "table":
1215
- t += $n(r), n++;
1216
- break;
1217
- case "rawHtml":
1218
- t += r.content, n++;
1219
- break;
1220
- default: n++;
1221
- }
1222
- }
1223
- return t;
1224
- }
1225
- function Zn(e, t) {
1226
- let n = "", r = t, i = null;
1227
- for (; r < e.length && e[r].type === "listItem";) {
1228
- let t = e[r], a = Qn(t.listType);
1229
- if (i !== null && i !== a && (n += `</${i === "ordered" ? "ol" : "ul"}>`, i = null), i === null) {
1230
- if (a === "ordered") {
1231
- let e = t.start !== void 0 && t.start !== 1 ? ` start="${t.start}"` : "";
1232
- n += `<ol${e}>`;
1233
- } else n += "<ul>";
1234
- i = a;
1235
- }
1236
- if (t.listType === "task") {
1237
- let e = t.checked ? " checked" : "";
1238
- n += `<li><input type="checkbox" disabled${e}><p>${J(t.content)}</p>`;
1239
- } else n += `<li><p>${J(t.content)}</p>`;
1240
- if (t.childContent) {
1241
- let e = Kn(t.childContent);
1242
- n += Xn(e);
1243
- }
1244
- n += "</li>", r++;
1245
- }
1246
- return i !== null && (n += `</${i === "ordered" ? "ol" : "ul"}>`), {
1247
- html: n,
1248
- nextIndex: r
1249
- };
1250
- }
1251
- function Qn(e) {
1252
- return e === "ordered" ? "ordered" : "bullet";
1253
- }
1254
- function $n(e) {
1255
- let t = "<table>", n = e.headers.every((e) => e.trim() === ""), r = e.headers.length;
1256
- if (!n) {
1257
- t += "<thead><tr>";
1258
- for (let n = 0; n < r; n++) {
1259
- let r = e.alignments[n], i = r ? ` align="${r}"` : "";
1260
- t += `<th${i}>${J(e.headers[n])}</th>`;
1261
- }
1262
- t += "</tr></thead>";
1263
- }
1264
- if (e.rows.length > 0) {
1265
- t += "<tbody>";
1266
- for (let n of e.rows) {
1267
- t += "<tr>";
1268
- for (let i = 0; i < r; i++) {
1269
- let r = i < n.length ? n[i] : "", a = e.alignments[i], o = a ? ` align="${a}"` : "";
1270
- t += `<td${o}>${J(r)}</td>`;
1271
- }
1272
- t += "</tr>";
1273
- }
1274
- t += "</tbody>";
1275
- }
1276
- return t += "</table>", t;
1277
- }
1278
- function er(e) {
1279
- return Xn(Kn(e));
1280
- }
1281
- //#endregion
1282
- //#region src/api/parsers/markdown/parseMarkdown.ts
1283
- function tr(e) {
1284
- return er(e);
1285
- }
1286
- function nr(e, t) {
1287
- return G(tr(e), t);
1288
- }
1289
- //#endregion
1290
- //#region src/editor/managers/ExportManager.ts
1291
- var rr = class {
1292
- editor;
1293
- constructor(e) {
1294
- this.editor = e;
1295
- }
1296
- blocksToHTMLLossy(e = this.editor.document) {
1297
- return be(this.editor.pmSchema, this.editor).exportBlocks(e, {});
1298
- }
1299
- blocksToFullHTML(e = this.editor.document) {
1300
- return Nt(this.editor.pmSchema, this.editor).serializeBlocks(e, {});
1301
- }
1302
- tryParseHTMLToBlocks(e) {
1303
- return G(e, this.editor.pmSchema);
1304
- }
1305
- blocksToMarkdownLossy(e = this.editor.document) {
1306
- return De(e, this.editor.pmSchema, this.editor, {});
1307
- }
1308
- tryParseMarkdownToBlocks(e) {
1309
- return nr(e, this.editor.pmSchema);
1310
- }
1311
- pasteHTML(e, t = !1) {
1312
- let n = e;
1313
- if (!t) {
1314
- let t = this.tryParseHTMLToBlocks(e);
1315
- n = this.blocksToFullHTML(t);
1316
- }
1317
- n && this.editor.prosemirrorView?.pasteHTML(n);
1318
- }
1319
- pasteText(e) {
1320
- return this.editor.prosemirrorView?.pasteText(e);
1321
- }
1322
- pasteMarkdown(e) {
1323
- let t = tr(e);
1324
- return this.pasteHTML(t);
1325
- }
1326
- };
1327
- //#endregion
1328
- //#region src/api/blockManipulation/selections/textCursorPosition.ts
1329
- function ir(e) {
1330
- let { bnBlock: t } = v(e), n = e.doc.resolve(t.beforePos), r = n.nodeBefore, i = e.doc.resolve(t.afterPos).nodeAfter, a;
1331
- return n.depth > 1 && (a = n.node(), a.type.isInGroup("bnBlock") || (a = n.node(n.depth - 1))), {
1332
- block: C(t.node, e.doc),
1333
- prevBlock: r === null ? void 0 : C(r, e.doc),
1334
- nextBlock: i === null ? void 0 : C(i, e.doc),
1335
- parentBlock: a === void 0 ? void 0 : C(a, e.doc)
1336
- };
1337
- }
1338
- function ar(e, t, n = "start") {
1339
- let r = typeof t == "string" ? t : t.id, i = y(e.doc), a = u(i), o = c(r, e.doc);
1340
- if (!o) throw Error(`Block with ID ${r} not found`);
1341
- let s = S(o), l = a.blockSchema[s.blockNoteType].content;
1342
- if (s.isBlockContainer) {
1343
- let t = s.blockContent;
1344
- if (l === "none") {
1345
- e.setSelection(j.create(e.doc, t.beforePos));
1346
- return;
1347
- }
1348
- if (l === "inline" || l === "plain") n === "start" ? e.setSelection(N.create(e.doc, t.beforePos + 1)) : e.setSelection(N.create(e.doc, t.afterPos - 1));
1349
- else if (l === "table") n === "start" ? e.setSelection(N.create(e.doc, t.beforePos + 4)) : e.setSelection(N.create(e.doc, t.afterPos - 4));
1350
- else throw new _(l);
1351
- } else {
1352
- let t = n === "start" ? s.childContainer.node.firstChild : s.childContainer.node.lastChild;
1353
- ar(e, x(t, e.doc), n);
1354
- }
1355
- }
1356
- //#endregion
1357
- //#region src/api/clipboard/fromClipboard/acceptedMIMETypes.ts
1358
- var or = [
1359
- "vscode-editor-data",
1360
- "blocknote/html",
1361
- "text/markdown",
1362
- "text/html",
1363
- "text/plain",
1364
- "Files"
1365
- ];
1366
- //#endregion
1367
- //#region src/api/clipboard/fromClipboard/handleFileInsertion.ts
1368
- function sr(e, t) {
1369
- if (!e.startsWith(".") || !t.startsWith(".")) throw Error("The strings provided are not valid file extensions.");
1370
- return e === t;
1371
- }
1372
- function cr(e, t) {
1373
- let n = e.split("/"), r = t.split("/");
1374
- if (n.length !== 2) throw Error(`The string ${e} is not a valid MIME type.`);
1375
- if (r.length !== 2) throw Error(`The string ${t} is not a valid MIME type.`);
1376
- return n[1] === "*" || r[1] === "*" ? n[0] === r[0] : (n[0] === "*" || r[0] === "*" || n[0] === r[0]) && n[1] === r[1];
1377
- }
1378
- function lr(e, t, n, r = "after") {
1379
- let i;
1380
- return i = Array.isArray(t.content) && t.content.length === 0 ? e.updateBlock(t, n).id : e.insertBlocks([n], t, r)[0].id, i;
1381
- }
1382
- async function ur(e, t) {
1383
- if (!t.uploadFile) {
1384
- console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");
1385
- return;
1386
- }
1387
- let n = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
1388
- if (n === null) return;
1389
- let r = null;
1390
- for (let e of or) if (n.types.includes(e)) {
1391
- r = e;
1392
- break;
1393
- }
1394
- if (r !== "Files") return;
1395
- let i = n.items;
1396
- if (i) {
1397
- e.preventDefault();
1398
- for (let n = 0; n < i.length; n++) {
1399
- let r = "file";
1400
- for (let e of Object.values(t.schema.blockSpecs)) for (let t of e.implementation.meta?.fileBlockAccept || []) {
1401
- let a = t.startsWith("."), o = i[n].getAsFile();
1402
- if (o && (!a && o.type && cr(i[n].type, t) || a && sr("." + o.name.split(".").pop(), t))) {
1403
- r = e.config.type;
1404
- break;
1405
- }
1406
- }
1407
- let a = i[n].getAsFile();
1408
- if (a) {
1409
- let n = {
1410
- type: r,
1411
- props: { name: a.name }
1412
- }, i;
1413
- if (e.type === "paste") {
1414
- let e = t.getTextCursorPosition().block;
1415
- i = lr(t, e, n);
1416
- } else if (e.type === "drop") {
1417
- let r = {
1418
- left: e.clientX,
1419
- top: e.clientY
1420
- }, a = t.prosemirrorView.posAtCoords(r);
1421
- if (!a) return;
1422
- i = t.transact((e) => {
1423
- let i = ue(e, a.pos), o = x(i.bnBlock.node, e.doc), s = (t.domElement?.querySelector(`[data-id="${o}"]`))?.getBoundingClientRect(), c = t.getBlock(o);
1424
- if (c) return lr(t, c, n, s && (s.top + s.bottom) / 2 > r.top ? "before" : "after");
1425
- });
1426
- } else return;
1427
- if (!i) return;
1428
- let o = await t.uploadFile(a, i), s = typeof o == "string" ? { props: { url: o } } : { ...o };
1429
- t.updateBlock(i, s);
1430
- }
1431
- }
1432
- }
1433
- }
1434
- //#endregion
1435
- //#region src/api/clipboard/fromClipboard/fileDropExtension.ts
1436
- var dr = (e) => D.create({
1437
- name: "dropFile",
1438
- addProseMirrorPlugins() {
1439
- return [new M({ props: { handleDOMEvents: { drop(t, n) {
1440
- if (!e.isEditable) return;
1441
- let r = null;
1442
- for (let e of or) if (n.dataTransfer.types.includes(e)) {
1443
- r = e;
1444
- break;
1445
- }
1446
- return r === null || r === "Files" && (ur(n, e), !0);
1447
- } } } })];
1448
- }
1449
- }), fr = /(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/, pr = /(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/, mr = /\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/, hr = /(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/, gr = /(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/, _r = /(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/, vr = /\n{2} {0,3}-{2,48}\n{2}/, yr = /(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/, br = /(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/, xr = /(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/, Sr = /^\s*\|(.+\|)+\s*$/m, Cr = /^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m, wr = /^\s*\|(.+\|)+\s*$/m, Tr = (e) => fr.test(e) || pr.test(e) || mr.test(e) || hr.test(e) || gr.test(e) || _r.test(e) || vr.test(e) || yr.test(e) || br.test(e) || xr.test(e) || Sr.test(e) || Cr.test(e) || wr.test(e);
1450
- //#endregion
1451
- //#region src/api/clipboard/fromClipboard/handleVSCodePaste.ts
1452
- function Er(e, t) {
1453
- let { schema: n } = t.state;
1454
- if (!e.clipboardData) return !1;
1455
- let r = e.clipboardData.getData("text/plain");
1456
- if (!r || !n.nodes.codeBlock) return !1;
1457
- let i = e.clipboardData.getData("vscode-editor-data"), a = (i ? JSON.parse(i) : void 0)?.mode;
1458
- return a ? (t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g, "\n")}</code></pre>`), !0) : !1;
1459
- }
1460
- //#endregion
1461
- //#region src/api/clipboard/fromClipboard/pasteExtension.ts
1462
- function Dr({ event: e, editor: t, prioritizeMarkdownOverHTML: n, plainTextAsMarkdown: r }) {
1463
- if (t.transact((e) => e.selection.$from.parent.type.spec.code && e.selection.$to.parent.type.spec.code)) {
1464
- let n = e.clipboardData?.getData("text/plain");
1465
- if (n) return t.pasteText(n), !0;
1466
- }
1467
- let i;
1468
- for (let t of or) if (e.clipboardData.types.includes(t)) {
1469
- i = t;
1470
- break;
1471
- }
1472
- if (!i) return !0;
1473
- if (i === "vscode-editor-data") {
1474
- if (Er(e, t.prosemirrorView)) return !0;
1475
- i = "text/plain";
1476
- }
1477
- if (i === "Files") return ur(e, t), !0;
1478
- let a = e.clipboardData.getData(i);
1479
- if (i === "blocknote/html") return t.pasteHTML(a, !0), !0;
1480
- if (i === "text/markdown") return t.pasteMarkdown(a), !0;
1481
- if (n) {
1482
- let n = e.clipboardData.getData("text/plain");
1483
- if (Tr(n)) return t.pasteMarkdown(n), !0;
1484
- }
1485
- return i === "text/html" ? (t.pasteHTML(a), !0) : r ? (t.pasteMarkdown(a), !0) : (t.pasteText(a), !0);
1486
- }
1487
- var Or = (e, t) => D.create({
1488
- name: "pasteFromClipboard",
1489
- addProseMirrorPlugins() {
1490
- return [new M({ props: { handleDOMEvents: { paste(n, r) {
1491
- if (r.preventDefault(), e.isEditable) return t({
1492
- event: r,
1493
- editor: e,
1494
- defaultPasteHandler: ({ prioritizeMarkdownOverHTML: t = !0, plainTextAsMarkdown: n = !0 } = {}) => Dr({
1495
- event: r,
1496
- editor: e,
1497
- prioritizeMarkdownOverHTML: t,
1498
- plainTextAsMarkdown: n
1499
- })
1500
- });
1501
- } } } })];
1502
- }
1503
- });
1504
- //#endregion
1505
- //#region src/api/clipboard/toClipboard/copyExtension.ts
1506
- function kr(e, t, n) {
1507
- let r = !1, i = e.state.selection instanceof I;
1508
- if (!i) {
1509
- let n = e.state.doc.slice(e.state.selection.from, e.state.selection.to, !1).content, i = [];
1510
- for (let e = 0; e < n.childCount; e++) i.push(n.child(e));
1511
- r = i.find((e) => e.type.isInGroup("bnBlock") || e.type.name === "blockGroup" || e.type.spec.group === "blockContent") === void 0, r && (t = n);
1512
- }
1513
- let a, o = be(e.state.schema, n);
1514
- if (i) {
1515
- t.firstChild?.type.name === "table" && (t = t.firstChild.content);
1516
- let e = f(t, n.schema.inlineContentSchema, n.schema.styleSchema);
1517
- a = `<table>${o.exportInlineContent(e, {})}</table>`;
1518
- } else if (r) {
1519
- let e = me(t, n.schema.inlineContentSchema, n.schema.styleSchema);
1520
- a = o.exportInlineContent(e, {});
1521
- } else {
1522
- let e = Ie(t);
1523
- a = o.exportBlocks(e, {});
1524
- }
1525
- return a;
1526
- }
1527
- function Ar(e, t) {
1528
- "node" in e.state.selection && e.state.selection.node.type.spec.group === "blockContent" && t.transact((t) => t.setSelection(new j(t.doc.resolve(e.state.selection.from - 1))));
1529
- let n = e.serializeForClipboard(e.state.selection.content()).dom.innerHTML, r = e.state.selection.content().content, i = kr(e, r, t), { $from: a, $to: o } = e.state.selection, s = a.parent.type.name, c = t.blockImplementations[s];
1530
- return {
1531
- clipboardHTML: n,
1532
- externalHTML: i,
1533
- markdown: a.sameParent(o) && c?.implementation.meta?.code === !0 ? e.state.doc.textBetween(a.pos, o.pos) : Fe(i)
1534
- };
1535
- }
1536
- var jr = (e) => {
1537
- if (e.state.selection.empty) return !0;
1538
- let t = window.getSelection();
1539
- if (t && !t.isCollapsed) {
1540
- let e = t.focusNode;
1541
- for (; e;) {
1542
- if (e instanceof HTMLElement && e.getAttribute("contenteditable") === "false") return !0;
1543
- e = e.parentElement;
1544
- }
1545
- }
1546
- return !1;
1547
- }, Mr = (e, t, n) => {
1548
- n.preventDefault(), n.clipboardData.clearData();
1549
- let { clipboardHTML: r, externalHTML: i, markdown: a } = Ar(t, e);
1550
- n.clipboardData.setData("blocknote/html", r), n.clipboardData.setData("text/html", i), n.clipboardData.setData("text/plain", a);
1551
- }, Nr = (e) => D.create({
1552
- name: "copyToClipboard",
1553
- addProseMirrorPlugins() {
1554
- return [new M({ props: { handleDOMEvents: {
1555
- copy(t, n) {
1556
- return jr(t) || Mr(e, t, n), !0;
1557
- },
1558
- cut(t, n) {
1559
- return jr(t) ? !0 : (Mr(e, t, n), t.editable && t.dispatch(t.state.tr.deleteSelection()), !0);
1560
- },
1561
- dragstart(t, n) {
1562
- if (!("node" in t.state.selection) || t.state.selection.node.type.spec.group !== "blockContent") return;
1563
- e.transact((e) => e.setSelection(new j(e.doc.resolve(t.state.selection.from - 1)))), n.preventDefault(), n.dataTransfer.clearData();
1564
- let { clipboardHTML: r, externalHTML: i, markdown: a } = Ar(t, e);
1565
- return n.dataTransfer.setData("blocknote/html", r), n.dataTransfer.setData("text/html", i), n.dataTransfer.setData("text/plain", a), !0;
1566
- }
1567
- } } })];
1568
- }
1569
- }), Pr = D.create({
1570
- name: "blockBackgroundColor",
1571
- addGlobalAttributes() {
1572
- return [{
1573
- types: ["tableCell", "tableHeader"],
1574
- attributes: { backgroundColor: n() }
1575
- }];
1576
- }
1577
- }), Fr = O.create({
1578
- name: "hardBreak",
1579
- inline: !0,
1580
- group: "inline",
1581
- selectable: !1,
1582
- linebreakReplacement: !0,
1583
- priority: 10,
1584
- parseHTML() {
1585
- return [{ tag: "br" }];
1586
- },
1587
- renderHTML({ HTMLAttributes: e }) {
1588
- return ["br", A(this.options.HTMLAttributes, e)];
1589
- },
1590
- renderText() {
1591
- return "\n";
1592
- }
1593
- }), Ir = (e, t) => {
1594
- let n = e.resolve(t), r = n.depth - 1;
1595
- if (r < 1) return;
1596
- let i = n.before(r), a = e.resolve(i).nodeAfter;
1597
- if (a) return a.type.spec.group?.includes("bnBlock") ? b(e.resolve(i)) : Ir(e, i);
1598
- }, X = (e, t) => {
1599
- let n = e.resolve(t), r = n.index();
1600
- if (r === 0) return;
1601
- let i = n.posAtIndex(r - 1);
1602
- return b(e.resolve(i));
1603
- }, Z = (e, t) => {
1604
- let n = e.resolve(t), r = n.index();
1605
- if (r === n.node().childCount - 1) return;
1606
- let i = n.posAtIndex(r + 1);
1607
- return b(e.resolve(i));
1608
- }, Lr = (e, t) => {
1609
- for (; t.childContainer;) {
1610
- let n = t.childContainer.node, r = e.resolve(t.childContainer.beforePos + 1).posAtIndex(n.childCount - 1);
1611
- t = b(e.resolve(r));
1612
- }
1613
- return t;
1614
- }, Rr = (e, t) => e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*" && e.blockContent.node.childCount > 0 && t.isBlockContainer && t.blockContent.node.type.spec.content === "inline*", zr = (e, t, n, r) => {
1615
- if (!r.isBlockContainer) throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but next block is not a block container`);
1616
- if (r.childContainer) {
1617
- let n = e.doc.resolve(r.childContainer.beforePos + 1), i = e.doc.resolve(r.childContainer.afterPos - 1), a = n.blockRange(i);
1618
- if (t) {
1619
- let t = e.doc.resolve(r.bnBlock.beforePos);
1620
- e.tr.lift(a, t.depth);
1621
- }
1622
- }
1623
- if (t) {
1624
- if (!n.isBlockContainer) throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but previous block is not a block container`);
1625
- t(e.tr.delete(n.blockContent.afterPos - 1, r.blockContent.beforePos + 1));
1626
- }
1627
- return !0;
1628
- }, Br = (e) => ({ state: t, dispatch: n }) => {
1629
- let r = t.doc.resolve(e), i = b(r), a = X(t.doc, i.bnBlock.beforePos);
1630
- if (!a) return !1;
1631
- let o = Lr(t.doc, a);
1632
- return Rr(o, i) ? zr(t, n, o, i) : !1;
1633
- }, Vr = D.create({
1634
- priority: 50,
1635
- addKeyboardShortcuts() {
1636
- let e = () => this.editor.commands.first(({ chain: e, commands: t }) => [
1637
- () => t.deleteSelection(),
1638
- () => t.undoInputRule(),
1639
- () => t.command(({ state: e }) => {
1640
- let n = v(e);
1641
- if (!n.isBlockContainer) return !1;
1642
- let r = e.selection.from === n.blockContent.beforePos + 1, i = n.blockContent.node.type.name === "paragraph";
1643
- return r && !i ? t.command(ce(n.bnBlock.beforePos, {
1644
- type: "paragraph",
1645
- props: {}
1646
- })) : !1;
1647
- }),
1648
- () => t.command(({ state: e, tr: t }) => {
1649
- let n = v(e);
1650
- if (!n.isBlockContainer) return !1;
1651
- let { blockContent: r } = n;
1652
- return e.selection.from === r.beforePos + 1 && W(t, t.doc.type.schema.nodes.blockContainer, t.doc.type.schema.nodes.blockGroup);
1653
- }),
1654
- () => t.command(({ state: t }) => {
1655
- let n = v(t);
1656
- if (!n.isBlockContainer) return !1;
1657
- let { bnBlock: r, blockContent: i } = n, a = X(t.doc, n.bnBlock.beforePos);
1658
- if (!a || !a.isBlockContainer || a.blockContent.node.type.spec.content !== "inline*") return !1;
1659
- let o = t.selection.from === i.beforePos + 1, s = t.selection.empty, c = r.beforePos;
1660
- return o && s ? e().command(Br(c)).scrollIntoView().run() : !1;
1661
- }),
1662
- () => t.command(({ state: e, tr: t, dispatch: n }) => {
1663
- let r = v(e);
1664
- if (!r.isBlockContainer || e.selection.from !== r.blockContent.beforePos + 1) return !1;
1665
- let i = X(e.doc, r.bnBlock.beforePos);
1666
- if (!i || i.isBlockContainer) return !1;
1667
- if (n) {
1668
- let e = i.bnBlock.afterPos - 1, n = t.doc.resolve(e - 1);
1669
- return t.delete(r.bnBlock.beforePos, r.bnBlock.afterPos), t.insert(n.pos, r.bnBlock.node), t.setSelection(N.near(t.doc.resolve(n.pos + 1))), !0;
1670
- }
1671
- return !1;
1672
- }),
1673
- () => t.command(({ state: e, tr: t, dispatch: n }) => {
1674
- let r = v(e);
1675
- if (!r.isBlockContainer || t.selection.from !== r.blockContent.beforePos + 1) return !1;
1676
- let i = t.doc.resolve(r.bnBlock.beforePos);
1677
- if (i.nodeBefore || i.node().type.name !== "column") return !1;
1678
- let a = t.doc.resolve(r.bnBlock.beforePos), o = t.doc.resolve(a.before()), s = o.before();
1679
- return n && (t.delete(r.bnBlock.beforePos, r.bnBlock.afterPos), z(t, s), o.pos === s + 1 ? (t.insert(s, r.bnBlock.node), t.setSelection(N.near(t.doc.resolve(s)))) : (t.insert(o.pos - 1, r.bnBlock.node), t.setSelection(N.near(t.doc.resolve(o.pos))))), !0;
1680
- }),
1681
- () => t.command(({ state: t }) => {
1682
- let n = v(t);
1683
- if (!n.isBlockContainer) return !1;
1684
- if (n.blockContent.node.childCount === 0 && n.blockContent.node.type.spec.content === "inline*") {
1685
- let r = X(t.doc, n.bnBlock.beforePos);
1686
- if (!r) return !1;
1687
- let i = Lr(t.doc, r);
1688
- if (!i.isBlockContainer || !i || !i.isBlockContainer) return !1;
1689
- let a = e();
1690
- if (n.childContainer && a.insertContentAt(n.bnBlock.afterPos, n.childContainer?.node.content), i.blockContent.node.type.spec.content === "tableRow+") {
1691
- let e = n.bnBlock.beforePos - 1 - 1 - 1 - 1 - 1;
1692
- a = a.setTextSelection(e);
1693
- } else if (i.blockContent.node.type.spec.content === "") a = a.setNodeSelection(i.blockContent.beforePos);
1694
- else {
1695
- let e = i.blockContent.afterPos - 1;
1696
- a = a.setTextSelection(e);
1697
- }
1698
- return a.deleteRange({
1699
- from: n.bnBlock.beforePos,
1700
- to: n.bnBlock.afterPos
1701
- }).scrollIntoView().run();
1702
- }
1703
- return !1;
1704
- }),
1705
- () => t.command(({ state: t }) => {
1706
- let n = v(t);
1707
- if (!n.isBlockContainer) return !1;
1708
- let r = t.selection.from === n.blockContent.beforePos + 1, i = t.selection.empty, a = X(t.doc, n.bnBlock.beforePos);
1709
- if (a && r && i) {
1710
- let r = Lr(t.doc, a);
1711
- if (!r.isBlockContainer) return !1;
1712
- if (r.blockContent.node.type.spec.content === "" || r.blockContent.node.type.spec.content === "inline*" && r.blockContent.node.childCount === 0) return e().cut({
1713
- from: n.bnBlock.beforePos,
1714
- to: n.bnBlock.afterPos
1715
- }, r.bnBlock.afterPos).deleteRange({
1716
- from: r.bnBlock.beforePos,
1717
- to: r.bnBlock.afterPos
1718
- }).run();
1719
- }
1720
- return !1;
1721
- })
1722
- ]), t = () => this.editor.commands.first(({ chain: e, commands: t }) => [
1723
- () => t.deleteSelection(),
1724
- () => t.command(({ state: t }) => {
1725
- let n = v(t);
1726
- if (!n.isBlockContainer || !n.childContainer) return !1;
1727
- let { blockContent: r, childContainer: i } = n, a = t.selection.from === r.afterPos - 1, o = t.selection.empty, s = b(t.doc.resolve(i.beforePos + 1));
1728
- if (!s.isBlockContainer) return !1;
1729
- if (a && o) {
1730
- let n = s.blockContent.node, a = n.type.spec.content === "inline*", o = r.node.type.spec.content === "inline*";
1731
- return e().insertContentAt(s.bnBlock.afterPos, s.childContainer?.node.content || w.empty).deleteRange(i.node.childCount === 1 ? {
1732
- from: i.beforePos,
1733
- to: i.afterPos
1734
- } : {
1735
- from: s.bnBlock.beforePos,
1736
- to: s.bnBlock.afterPos
1737
- }).insertContentAt(t.selection.from, a && o ? n.content : null).setTextSelection(t.selection.from).scrollIntoView().run();
1738
- }
1739
- return !1;
1740
- }),
1741
- () => t.command(({ state: t }) => {
1742
- let n = v(t);
1743
- if (!n.isBlockContainer) return !1;
1744
- let { bnBlock: r, blockContent: i } = n, a = Z(t.doc, n.bnBlock.beforePos);
1745
- if (!a || !a.isBlockContainer) return !1;
1746
- let o = t.selection.from === i.afterPos - 1, s = t.selection.empty, c = r.afterPos;
1747
- return o && s ? e().command(Br(c)).scrollIntoView().run() : !1;
1748
- }),
1749
- () => t.command(({ state: e, tr: t, dispatch: n }) => {
1750
- let r = v(e);
1751
- if (!r.isBlockContainer || e.selection.from !== r.blockContent.afterPos - 1) return !1;
1752
- let i = Z(e.doc, r.bnBlock.beforePos);
1753
- if (!i || i.isBlockContainer) return !1;
1754
- if (n) {
1755
- let e = i.bnBlock.beforePos + 1, n = t.doc.resolve(e + 1);
1756
- return t.delete(n.pos, n.pos + n.nodeAfter.nodeSize), z(t, i.bnBlock.beforePos), t.insert(r.bnBlock.afterPos, n.nodeAfter), t.setSelection(N.near(t.doc.resolve(n.pos))), !0;
1757
- }
1758
- return !1;
1759
- }),
1760
- () => t.command(({ state: e, tr: t, dispatch: n }) => {
1761
- let r = v(e);
1762
- if (!r.isBlockContainer || t.selection.from !== r.blockContent.afterPos - 1) return !1;
1763
- let i = t.doc.resolve(r.bnBlock.afterPos);
1764
- if (i.nodeAfter || i.node().type.name !== "column") return !1;
1765
- let a = t.doc.resolve(r.bnBlock.afterPos), o = t.doc.resolve(a.after()), s = o.after();
1766
- if (n) {
1767
- let e = o.pos === s - 1 ? s : o.pos + 1, n = b(t.doc.resolve(e));
1768
- t.delete(n.bnBlock.beforePos, n.bnBlock.afterPos), z(t, s - o.node().nodeSize), t.insert(a.pos, n.bnBlock.node), t.setSelection(N.near(t.doc.resolve(e)));
1769
- }
1770
- return !0;
1771
- }),
1772
- () => t.command(({ state: t }) => {
1773
- let n = v(t);
1774
- if (!n.isBlockContainer) return !1;
1775
- let { blockContent: r } = n, i = t.selection.from === r.afterPos - 1, a = t.selection.empty;
1776
- if (i && a) {
1777
- let i = (e, t) => {
1778
- let n = Z(e, t);
1779
- if (n) return n;
1780
- let r = Ir(e, t);
1781
- if (r) return i(e, r.bnBlock.beforePos);
1782
- }, a = i(t.doc, n.bnBlock.beforePos);
1783
- if (!a || !a.isBlockContainer) return !1;
1784
- let o = a.blockContent.node, s = o.type.spec.content === "inline*", c = r.node.type.spec.content === "inline*";
1785
- return e().insertContentAt(a.bnBlock.afterPos, a.childContainer?.node.content || w.empty).deleteRange({
1786
- from: a.bnBlock.beforePos,
1787
- to: a.bnBlock.afterPos
1788
- }).insertContentAt(t.selection.from, s && c ? o.content : null).setTextSelection(t.selection.from).scrollIntoView().run();
1789
- }
1790
- return !1;
1791
- }),
1792
- () => t.command(({ state: t }) => {
1793
- let n = v(t);
1794
- if (!n.isBlockContainer) return !1;
1795
- if (n.blockContent.node.childCount === 0 && n.blockContent.node.type.spec.content === "inline*") {
1796
- let r = Z(t.doc, n.bnBlock.beforePos);
1797
- if (!r || !r.isBlockContainer) return !1;
1798
- let i = e();
1799
- if (r.blockContent.node.type.spec.content === "tableRow+") {
1800
- let e = n.bnBlock.afterPos + 1 + 1 + 1 + 1 + 1;
1801
- i = i.setTextSelection(e);
1802
- } else i = r.blockContent.node.type.spec.content === "" ? i.setNodeSelection(r.blockContent.beforePos) : i.setTextSelection(r.blockContent.beforePos + 1);
1803
- return i.deleteRange({
1804
- from: n.bnBlock.beforePos,
1805
- to: n.bnBlock.afterPos
1806
- }).scrollIntoView().run();
1807
- }
1808
- return !1;
1809
- }),
1810
- () => t.command(({ state: t }) => {
1811
- let n = v(t);
1812
- if (!n.isBlockContainer) return !1;
1813
- let r = t.selection.from === n.blockContent.afterPos - 1, i = t.selection.empty, a = Z(t.doc, n.bnBlock.beforePos);
1814
- if (!a || !a.isBlockContainer) return !1;
1815
- if (a && r && i && (a.blockContent.node.type.spec.content === "" || a.blockContent.node.type.spec.content === "inline*" && a.blockContent.node.childCount === 0)) {
1816
- let t = a.bnBlock.node.lastChild.content;
1817
- return e().deleteRange({
1818
- from: a.bnBlock.beforePos,
1819
- to: a.bnBlock.afterPos
1820
- }).insertContentAt(n.bnBlock.afterPos, a.bnBlock.node.childCount === 2 ? t : null).run();
1821
- }
1822
- return !1;
1823
- })
1824
- ]), n = (e = !1) => this.editor.commands.first(({ commands: t, tr: n }) => [
1825
- () => t.command(({ state: e, tr: t }) => {
1826
- let n = v(e);
1827
- if (!n.isBlockContainer) return !1;
1828
- let { bnBlock: r, blockContent: i } = n, { depth: a } = e.doc.resolve(r.beforePos), o = e.selection.$anchor.parentOffset === 0, s = e.selection.anchor === e.selection.head, c = i.node.childCount === 0;
1829
- return o && s && c && a > 1 ? W(t, t.doc.type.schema.nodes.blockContainer, t.doc.type.schema.nodes.blockGroup) : !1;
1830
- }),
1831
- () => t.command(({ state: t }) => {
1832
- let r = v(t), i = this.options.editor.schema.blockSpecs[r.blockNoteType], a = i?.implementation?.meta?.hardBreakShortcut ?? "shift+enter";
1833
- if (a === "none") return !1;
1834
- if (a === "shift+enter" && e || a === "enter") {
1835
- if (i?.config?.content === "plain") return n.insertText("\n", n.selection.head), !0;
1836
- let e = n.storedMarks || n.selection.$head.marks().filter((e) => this.editor.extensionManager.splittableMarks.includes(e.type.name));
1837
- return n.insert(n.selection.head, n.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e), !0;
1838
- }
1839
- return !1;
1840
- }),
1841
- () => t.command(({ state: e, dispatch: t, tr: n }) => {
1842
- let r = v(e);
1843
- if (!r.isBlockContainer) return !1;
1844
- let { bnBlock: i, blockContent: a } = r, o = e.selection.$anchor.parentOffset === 0, s = e.selection.anchor === e.selection.head, c = a.node.childCount === 0;
1845
- if (o && s && c) {
1846
- let a = i.afterPos, o = a + 2;
1847
- if (t) {
1848
- let t = e.schema.nodes.blockContainer.createAndFill(void 0, [e.schema.nodes.paragraph.createAndFill() || void 0, r.childContainer?.node].filter((e) => e !== void 0));
1849
- n.insert(a, t).setSelection(new N(n.doc.resolve(o))).scrollIntoView(), r.childContainer && n.delete(r.childContainer.beforePos, r.childContainer.afterPos);
1850
- }
1851
- return !0;
1852
- }
1853
- return !1;
1854
- }),
1855
- () => t.command(({ state: e, chain: t }) => {
1856
- let n = v(e);
1857
- if (!n.isBlockContainer) return !1;
1858
- let { blockContent: r } = n, i = e.selection.$anchor.parentOffset === 0;
1859
- return r.node.childCount !== 0 && (t().deleteSelection().command(g(e.selection.from, i, i)).scrollIntoView().run(), !0);
1860
- })
1861
- ]);
1862
- return {
1863
- Backspace: e,
1864
- Delete: t,
1865
- Enter: () => n(),
1866
- "Shift-Enter": () => n(!0),
1867
- Tab: () => this.options.tabBehavior !== "prefer-indent" && (this.options.editor.getExtension(le)?.store.state || this.options.editor.getExtension(re)?.store.state !== void 0) ? !1 : Yt(this.options.editor),
1868
- "Shift-Tab": () => this.options.tabBehavior !== "prefer-indent" && (this.options.editor.getExtension(le)?.store.state || this.options.editor.getExtension(re)?.store.state !== void 0) ? !1 : Zt(this.options.editor),
1869
- "Shift-Mod-ArrowUp": () => (this.options.editor.moveBlocksUp(), !0),
1870
- "Shift-Mod-ArrowDown": () => (this.options.editor.moveBlocksDown(), !0),
1871
- "Mod-z": () => this.options.editor.undo(),
1872
- "Mod-y": () => this.options.editor.redo(),
1873
- "Shift-Mod-z": () => this.options.editor.redo()
1874
- };
1875
- }
1876
- }), Hr = D.create({
1877
- name: "textAlignment",
1878
- addGlobalAttributes() {
1879
- return [{
1880
- types: ["tableCell", "tableHeader"],
1881
- attributes: { textAlignment: {
1882
- default: "left",
1883
- parseHTML: (e) => e.getAttribute("data-text-alignment"),
1884
- renderHTML: (e) => e.textAlignment === "left" ? {} : { "data-text-alignment": e.textAlignment }
1885
- } }
1886
- }];
1887
- }
1888
- }), Ur = D.create({
1889
- name: "blockTextColor",
1890
- addGlobalAttributes() {
1891
- return [{
1892
- types: [
1893
- "table",
1894
- "tableCell",
1895
- "tableHeader"
1896
- ],
1897
- attributes: { textColor: m() }
1898
- }];
1899
- }
1900
- }), Wr = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
1901
- //#endregion
1902
- //#region src/extensions/tiptap-extensions/Link/helpers/linkDetector.ts
1903
- function Gr(e) {
1904
- let t = [], n = [], r = 0;
1905
- for (; r < e.length;) {
1906
- let i = 0;
1907
- for (; r + i < e.length && e.charCodeAt(r + i) >= 48 && e.charCodeAt(r + i) <= 57;) i++;
1908
- if (i > 0) {
1909
- t.push(n.join(""));
1910
- let a = parseInt(e.substring(r, r + i), 10);
1911
- for (; a-- > 0;) n.pop();
1912
- r += i;
1913
- } else n.push(e[r]), r++;
1914
- }
1915
- return t;
1916
- }
1917
- var Kr = new Set(Gr(Wr)), qr = /* @__PURE__ */ new Set(["localhost"]), Jr = /[.,;:!?"']+$/, Yr = /(?:https?|ftp|ftps):\/\/[^\s]+/g, Xr = /mailto:[^\s]+/g, Zr = /[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g, Qr = /(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;
1918
- function $r(e) {
1919
- let t = e, n = !0;
1920
- for (; n;) {
1921
- n = !1;
1922
- let e = t;
1923
- t = t.replace(Jr, ""), t !== e && (n = !0);
1924
- for (let [e, r] of [["(", ")"], ["[", "]"]]) for (; t.endsWith(r);) {
1925
- let i = ei(t, e);
1926
- if (ei(t, r) > i) t = t.slice(0, -1), n = !0;
1927
- else break;
1928
- }
1929
- }
1930
- return t;
1931
- }
1932
- function ei(e, t) {
1933
- let n = 0;
1934
- for (let r = 0; r < e.length; r++) e[r] === t && n++;
1935
- return n;
1936
- }
1937
- function ti(e) {
1938
- let t = e.split(".");
1939
- return t[t.length - 1].toLowerCase();
1940
- }
1941
- function ni(e) {
1942
- let t = ti(e);
1943
- return Kr.has(t);
1944
- }
1945
- function ri(e, t, n) {
1946
- return t === "email" ? "mailto:" + e : /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e) || /^mailto:/i.test(e) ? e : n + "://" + e;
1947
- }
1948
- function ii(e, t) {
1949
- if (!e) return [];
1950
- let n = t?.defaultProtocol || "http", r = [];
1951
- for (let t of e.matchAll(Yr)) r.push({
1952
- type: "url",
1953
- value: t[0],
1954
- start: t.index,
1955
- end: t.index + t[0].length
1956
- });
1957
- for (let t of e.matchAll(Xr)) r.push({
1958
- type: "url",
1959
- value: t[0],
1960
- start: t.index,
1961
- end: t.index + t[0].length
1962
- });
1963
- for (let t of e.matchAll(Zr)) r.push({
1964
- type: "email",
1965
- value: t[0],
1966
- start: t.index,
1967
- end: t.index + t[0].length
1968
- });
1969
- for (let t of e.matchAll(Qr)) r.push({
1970
- type: "url",
1971
- value: t[0],
1972
- start: t.index,
1973
- end: t.index + t[0].length
1974
- });
1975
- r.sort((e, t) => e.start - t.start || t.end - e.end);
1976
- let i = [], a = -1;
1977
- for (let e of r) e.start >= a && (i.push(e), a = e.end);
1978
- let o = [];
1979
- for (let e of i) {
1980
- let t = $r(e.value);
1981
- if (!t) continue;
1982
- let r = e.start, i = r + t.length;
1983
- if (e.type === "url" && !/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)) {
1984
- let e = new URL("http://" + t).hostname;
1985
- if (!ni(e)) continue;
1986
- }
1987
- if (e.type === "email") {
1988
- let e = t.split("@")[1];
1989
- if (!ni(e)) continue;
1990
- }
1991
- let a = ri(t, e.type, n);
1992
- o.push({
1993
- type: e.type,
1994
- value: t,
1995
- isLink: !0,
1996
- href: a,
1997
- start: r,
1998
- end: i
1999
- });
2000
- }
2001
- return o;
2002
- }
2003
- function ai(e, t = "http") {
2004
- if (!e) return [$(e, 0, 0)];
2005
- for (let [n, r] of [
2006
- ["(", ")"],
2007
- ["[", "]"],
2008
- ["{", "}"]
2009
- ]) if (e.startsWith(n) && e.endsWith(r) && e.length > 2) {
2010
- let i = e.slice(1, -1);
2011
- if (Q(i)) return [
2012
- $(n, 0, 1),
2013
- oi(i, 1, 1 + i.length, t),
2014
- $(r, 1 + i.length, e.length)
2015
- ];
2016
- }
2017
- if (e.endsWith(".") && e.length > 1) {
2018
- let n = e.slice(0, -1);
2019
- if (Q(n)) return [oi(n, 0, n.length, t), $(".", n.length, e.length)];
2020
- }
2021
- return Q(e) ? [oi(e, 0, e.length, t)] : [$(e, 0, e.length)];
2022
- }
2023
- function Q(e) {
2024
- if (/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e) || /^mailto:[^\s]+$/.test(e) || qr.has(e.toLowerCase())) return !0;
2025
- let t = e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);
2026
- if (t) {
2027
- let e = t[1].toLowerCase();
2028
- if (Kr.has(e)) return !0;
2029
- }
2030
- return !1;
2031
- }
2032
- function oi(e, t, n, r) {
2033
- let i = e.includes("@") && !e.includes("://") && !e.startsWith("mailto:") ? "email" : "url";
2034
- return {
2035
- type: i,
2036
- value: e,
2037
- isLink: !0,
2038
- href: ri(e, i, r),
2039
- start: t,
2040
- end: n
2041
- };
2042
- }
2043
- function $(e, t, n) {
2044
- return {
2045
- type: "text",
2046
- value: e,
2047
- isLink: !1,
2048
- href: e,
2049
- start: t,
2050
- end: n
2051
- };
2052
- }
2053
- //#endregion
2054
- //#region src/extensions/tiptap-extensions/Link/helpers/whitespace.ts
2055
- var si = "[\0- \xA0 ᠎ -\u2029  ]", ci = new RegExp(si), li = RegExp(`${si}$`), ui = new RegExp(si, "g");
2056
- //#endregion
2057
- //#region src/extensions/tiptap-extensions/Link/helpers/autolink.ts
2058
- function di(e) {
2059
- return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
2060
- }
2061
- function fi(e) {
2062
- return new ct({
2063
- key: new lt("autolink"),
2064
- appendTransaction: (t, n, r) => {
2065
- let i = t.some((e) => e.docChanged) && !n.doc.eq(r.doc), a = t.some((e) => e.getMeta("preventAutolink"));
2066
- if (!i || a) return;
2067
- let { tr: o } = r, s = qe(n.doc, [...t]);
2068
- if (Qe(s).forEach(({ newRange: t }) => {
2069
- let n = Ye(r.doc, t, (e) => e.isTextblock), i, a;
2070
- if (n.length > 1) i = n[0], a = r.doc.textBetween(i.pos, i.pos + i.node.nodeSize, void 0, " ");
2071
- else if (n.length) {
2072
- let e = r.doc.textBetween(t.from, t.to, " ", " ");
2073
- if (!li.test(e)) return;
2074
- i = n[0], a = r.doc.textBetween(i.pos, t.to, void 0, " ");
2075
- }
2076
- if (i && a) {
2077
- let t = a.split(ci).filter(Boolean);
2078
- if (t.length <= 0) return;
2079
- let n = t[t.length - 1], s = i.pos + a.lastIndexOf(n);
2080
- if (!n) return;
2081
- let c = ai(n, e.defaultProtocol);
2082
- if (!di(c)) return;
2083
- c.filter((e) => e.isLink).map((e) => ({
2084
- ...e,
2085
- from: s + e.start + 1,
2086
- to: s + e.end + 1
2087
- })).filter((e) => !r.schema.marks.code || !r.doc.rangeHasMark(e.from, e.to, r.schema.marks.code)).filter((t) => e.validate(t.value)).filter((t) => e.shouldAutoLink(t.value)).forEach((t) => {
2088
- et(t.from, t.to, r.doc).some((t) => t.mark.type === e.type) || o.addMark(t.from, t.to, e.type.create({ href: t.href }));
2089
- });
2090
- }
2091
- }), o.steps.length) return o;
2092
- }
2093
- });
2094
- }
2095
- //#endregion
2096
- //#region src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts
2097
- function pi(e) {
2098
- return new ct({
2099
- key: new lt("handleClickLink"),
2100
- props: { handleClick: (t, n, r) => {
2101
- if (r.button !== 0 || !t.editable) return !1;
2102
- let i = null;
2103
- if (r.target instanceof HTMLAnchorElement && r.target.getAttribute("data-inline-content-type") === "link") i = r.target;
2104
- else {
2105
- let t = r.target;
2106
- if (!t) return !1;
2107
- let n = e.tiptapEditor.view.dom;
2108
- i = t.closest("a[data-inline-content-type=\"link\"]"), i && !n.contains(i) && (i = null);
2109
- }
2110
- if (!i) return !1;
2111
- if (e.onClick) {
2112
- if (!e.editor) throw Error("BlockNoteEditor not found in Link click handler");
2113
- return e.onClick(r, e.editor) ?? !0;
2114
- }
2115
- let a = Ze(t.state, e.type.name), o = i.href ?? a.href, s = i.target ?? a.target;
2116
- return o ? (window.open(o, s), !0) : !1;
2117
- } }
2118
- });
2119
- }
2120
- //#endregion
2121
- //#region src/extensions/tiptap-extensions/Link/helpers/pasteHandler.ts
2122
- function mi(e) {
2123
- return new ct({
2124
- key: new lt("handlePasteLink"),
2125
- props: { handlePaste: (t, n, r) => {
2126
- let { shouldAutoLink: i, isValidLink: a } = e, { state: o } = t, { selection: s } = o, { empty: c } = s;
2127
- if (c) return !1;
2128
- let l = "";
2129
- r.content.forEach((e) => {
2130
- l += e.textContent;
2131
- });
2132
- let u = ii(l, { defaultProtocol: e.defaultProtocol }).find((e) => e.isLink && e.value === l);
2133
- return !l || !u || !a(u.value) || i !== void 0 && !i(u.value) ? !1 : e.editor.commands.setMark(e.type, { href: u.href });
2134
- } }
2135
- });
2136
- }
2137
- //#endregion
2138
- //#region src/extensions/tiptap-extensions/Link/link.ts
2139
- var hi = "https", gi = /^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;
2140
- function _i(e) {
2141
- if (!e) return !0;
2142
- let t = e.replace(ui, "");
2143
- return gi.test(t);
2144
- }
2145
- function vi(e) {
2146
- let t = /^[a-z][a-z0-9+.-]*:\/\//i.test(e), n = /^[a-z][a-z0-9+.-]*:/i.test(e);
2147
- if (t || n && !e.includes("@")) return !0;
2148
- let r = (e.includes("@") ? e.split("@").pop() : e).split(/[/?#:]/)[0];
2149
- return !(/^\d{1,3}(\.\d{1,3}){3}$/.test(r) || !/\./.test(r));
2150
- }
2151
- var yi = Ke.create({
2152
- name: "link",
2153
- keepOnSplit: !1,
2154
- exitable: !0,
2155
- inclusive: !1,
2156
- addOptions() {
2157
- return {
2158
- HTMLAttributes: {
2159
- target: "_blank",
2160
- rel: "noopener noreferrer nofollow",
2161
- className: "bn-inline-content-section",
2162
- "data-inline-content-type": "link"
2163
- },
2164
- editor: void 0,
2165
- onClick: void 0,
2166
- isValidLink: _i
2167
- };
2168
- },
2169
- addAttributes() {
2170
- return { href: {
2171
- default: null,
2172
- parseHTML(e) {
2173
- return e.getAttribute("href");
2174
- }
2175
- } };
2176
- },
2177
- parseHTML() {
2178
- let e = this.options.isValidLink;
2179
- return [{
2180
- tag: "a[href]",
2181
- getAttrs: (t) => {
2182
- let n = t.getAttribute("href");
2183
- return !n || !e(n) ? !1 : null;
2184
- }
2185
- }];
2186
- },
2187
- renderHTML({ HTMLAttributes: e }) {
2188
- return this.options.isValidLink(e.href) ? [
2189
- "a",
2190
- A(e, this.options.HTMLAttributes),
2191
- 0
2192
- ] : [
2193
- "a",
2194
- A({
2195
- ...e,
2196
- href: ""
2197
- }, this.options.HTMLAttributes),
2198
- 0
2199
- ];
2200
- },
2201
- addPasteRules() {
2202
- let e = this.options.isValidLink;
2203
- return [rt({
2204
- find: (t) => {
2205
- let n = [];
2206
- if (t) {
2207
- let r = ii(t, { defaultProtocol: hi }).filter((t) => t.isLink && e(t.value));
2208
- for (let e of r) vi(e.value) && n.push({
2209
- text: e.value,
2210
- data: { href: e.href },
2211
- index: e.start
2212
- });
2213
- }
2214
- return n;
2215
- },
2216
- type: this.type,
2217
- getAttributes: (e) => ({ href: e.data?.href })
2218
- })];
2219
- },
2220
- addProseMirrorPlugins() {
2221
- let e = [];
2222
- return e.push(fi({
2223
- type: this.type,
2224
- defaultProtocol: hi,
2225
- validate: this.options.isValidLink,
2226
- shouldAutoLink: vi
2227
- })), e.push(pi({
2228
- type: this.type,
2229
- tiptapEditor: this.editor,
2230
- editor: this.options.editor,
2231
- onClick: this.options.onClick
2232
- })), e.push(mi({
2233
- editor: this.editor,
2234
- defaultProtocol: hi,
2235
- type: this.type,
2236
- shouldAutoLink: vi,
2237
- isValidLink: this.options.isValidLink
2238
- })), e;
2239
- }
2240
- }), bi = _e(({ editor: e, options: t }) => ({
2241
- key: "link",
2242
- tiptapExtensions: [yi.configure({
2243
- HTMLAttributes: t.HTMLAttributes ?? {},
2244
- editor: e,
2245
- onClick: t.onClick,
2246
- ...t.isValidLink ? { isValidLink: t.isValidLink } : {}
2247
- })]
2248
- })), xi = {
2249
- blockColor: "data-block-color",
2250
- blockStyle: "data-block-style",
2251
- id: "data-id",
2252
- depth: "data-depth",
2253
- depthChange: "data-depth-change"
2254
- }, Si = O.create({
2255
- name: "blockContainer",
2256
- group: "blockGroupChild bnBlock",
2257
- content: "blockContent blockGroup?",
2258
- priority: 50,
2259
- defining: !0,
2260
- marks() {
2261
- return l(this.editor);
2262
- },
2263
- parseHTML() {
2264
- return [{
2265
- tag: "div[data-node-type=" + this.name + "]",
2266
- getAttrs: (e) => {
2267
- if (typeof e == "string") return !1;
2268
- let t = {};
2269
- for (let [n, r] of Object.entries(xi)) e.getAttribute(r) && (t[n] = e.getAttribute(r));
2270
- return t;
2271
- }
2272
- }, {
2273
- tag: "div[data-node-type=\"blockOuter\"]",
2274
- skip: !0
2275
- }];
2276
- },
2277
- renderHTML({ HTMLAttributes: e }) {
2278
- let t = document.createElement("div");
2279
- t.className = "bn-block-outer", t.setAttribute("data-node-type", "blockOuter");
2280
- for (let [n, r] of Object.entries(e)) n !== "class" && t.setAttribute(n, r);
2281
- let n = {
2282
- ...this.options.domAttributes?.block || {},
2283
- ...e
2284
- }, r = document.createElement("div");
2285
- r.className = h("bn-block", n.class), r.setAttribute("data-node-type", this.name);
2286
- for (let [e, t] of Object.entries(n)) e !== "class" && r.setAttribute(e, t);
2287
- return t.appendChild(r), {
2288
- dom: t,
2289
- contentDOM: r
2290
- };
2291
- }
2292
- }), Ci = O.create({
2293
- name: "blockGroup",
2294
- group: "childContainer",
2295
- content: "blockGroupChild+",
2296
- marks() {
2297
- return l(this.editor);
2298
- },
2299
- parseHTML() {
2300
- return [{
2301
- tag: "div",
2302
- getAttrs: (e) => typeof e != "string" && e.getAttribute("data-node-type") === "blockGroup" && null
2303
- }];
2304
- },
2305
- renderHTML({ HTMLAttributes: e }) {
2306
- let t = {
2307
- ...this.options.domAttributes?.blockGroup || {},
2308
- ...e
2309
- }, n = document.createElement("div");
2310
- n.className = h("bn-block-group", t.class), n.setAttribute("data-node-type", "blockGroup");
2311
- for (let [e, r] of Object.entries(t)) e !== "class" && n.setAttribute(e, r);
2312
- return {
2313
- dom: n,
2314
- contentDOM: n
2315
- };
2316
- }
2317
- }), wi = O.create({
2318
- name: "doc",
2319
- topNode: !0,
2320
- content: "blockGroup",
2321
- marks() {
2322
- return l(this.editor);
2323
- }
2324
- });
2325
- //#endregion
2326
- //#region src/editor/managers/ExtensionManager/extensions.ts
2327
- function Ti(e, t) {
2328
- return [
2329
- k.ClipboardTextSerializer,
2330
- k.Commands,
2331
- k.Editable,
2332
- k.FocusEvents,
2333
- k.Tabindex,
2334
- ht,
2335
- ie.configure({
2336
- types: [
2337
- "blockContainer",
2338
- "columnList",
2339
- "column"
2340
- ],
2341
- setIdAttribute: t.setIdAttribute,
2342
- isWithinEditor: e.isWithinEditor
2343
- }),
2344
- Fr,
2345
- mt,
2346
- ...Object.values(e.schema.styleSpecs).map((t) => t.implementation.mark.configure({ editor: e })),
2347
- Ur,
2348
- Pr,
2349
- Hr,
2350
- D.create({
2351
- name: "OverrideEscape",
2352
- addKeyboardShortcuts: () => ({ Escape: () => !e.getExtension(ae)?.shown() && (e.blur(), !0) })
2353
- }),
2354
- wi,
2355
- Si.configure({
2356
- editor: e,
2357
- domAttributes: t.domAttributes
2358
- }),
2359
- Vr.configure({
2360
- editor: e,
2361
- tabBehavior: t.tabBehavior
2362
- }),
2363
- Ci.configure({ domAttributes: t.domAttributes }),
2364
- ...Object.values(e.schema.inlineContentSpecs).filter((e) => e.config !== "link" && e.config !== "text").map((t) => t.implementation.node.configure({ editor: e })),
2365
- ...Object.values(e.schema.blockSpecs).flatMap((n) => [..."node" in n.implementation ? [n.implementation.node.configure({
2366
- editor: e,
2367
- domAttributes: t.domAttributes
2368
- })] : []]),
2369
- Nr(e),
2370
- Or(e, t.pasteHandler || ((e) => e.defaultPasteHandler())),
2371
- dr(e)
2372
- ];
2373
- }
2374
- function Ei(e, t) {
2375
- let n = [
2376
- Se(),
2377
- xe(t),
2378
- re(t),
2379
- le(t),
2380
- bi({
2381
- HTMLAttributes: t.links?.HTMLAttributes ?? {},
2382
- onClick: t.links?.onClick,
2383
- ...t.links?.isValidLink ? { isValidLink: t.links.isValidLink } : {}
2384
- }),
2385
- Ce(t),
2386
- Ee(),
2387
- Pe(t),
2388
- Le(t),
2389
- ke(t),
2390
- Ae(),
2391
- Me(),
2392
- ae(t),
2393
- ve(),
2394
- je(),
2395
- ye(),
2396
- ...t.trailingBlock === !1 ? [] : [Ne()]
2397
- ];
2398
- return "table" in e.schema.blockSpecs && n.push(Oe(t)), t.animations !== !1 && n.push(Te()), n;
2399
- }
2400
- //#endregion
2401
- //#region src/editor/managers/ExtensionManager/index.ts
2402
- var Di = class {
2403
- editor;
2404
- options;
2405
- disabledExtensions = /* @__PURE__ */ new Set();
2406
- extensions = [];
2407
- abortMap = /* @__PURE__ */ new Map();
2408
- extensionFactories = /* @__PURE__ */ new Map();
2409
- extensionPlugins = /* @__PURE__ */ new Map();
2410
- blockNoteExtensionDependents = /* @__PURE__ */ new Map();
2411
- constructor(e, t) {
2412
- this.editor = e, this.options = t, e.onMount(() => {
2413
- for (let t of this.extensions) if (t.mount) {
2414
- let n = new window.AbortController(), r = t.mount({
2415
- dom: e.prosemirrorView.dom,
2416
- root: e.prosemirrorView.root,
2417
- signal: n.signal
2418
- });
2419
- r && n.signal.addEventListener("abort", () => {
2420
- r();
2421
- }), this.abortMap.set(t, n);
2422
- }
2423
- }), e.onUnmount(() => {
2424
- for (let [e, t] of this.abortMap.entries()) this.abortMap.delete(e), t.abort();
2425
- }), this.disabledExtensions = new Set(t.disableExtensions || []);
2426
- for (let e of Ei(this.editor, this.options)) this.addExtension(e);
2427
- for (let e of this.options.extensions ?? []) this.addExtension(e);
2428
- for (let e of Object.values(this.editor.schema.blockSpecs)) for (let t of e.extensions ?? []) this.addExtension(t);
2429
- }
2430
- registerExtension(e) {
2431
- this.replaceExtension(void 0, e);
2432
- }
2433
- addExtension(e, t) {
2434
- let n;
2435
- if (n = typeof e == "function" ? e({ editor: this.editor }) : e, !(!n || this.disabledExtensions.has(n.key))) {
2436
- if (t) {
2437
- let e = this.blockNoteExtensionDependents.get(n.key);
2438
- e || (e = /* @__PURE__ */ new Set(), this.blockNoteExtensionDependents.set(n.key, e)), e.add(t);
2439
- }
2440
- if (!this.extensions.some((e) => e.key === n.key)) {
2441
- if (typeof e == "function") {
2442
- let e = n[ge];
2443
- typeof e == "function" && this.extensionFactories.set(e, n);
2444
- }
2445
- if (this.extensions.push(n), n.blockNoteExtensions) for (let e of n.blockNoteExtensions) this.addExtension(e, n.key);
2446
- return n;
2447
- }
2448
- }
2449
- }
2450
- resolveExtensions(e) {
2451
- let t = [];
2452
- if (typeof e == "function") {
2453
- let n = this.extensionFactories.get(e);
2454
- n && t.push(n);
2455
- } else if (Array.isArray(e)) for (let n of e) t.push(...this.resolveExtensions(n));
2456
- else if (typeof e == "object" && "key" in e) t.push(e);
2457
- else if (typeof e == "string") {
2458
- let n = this.extensions.find((t) => t.key === e);
2459
- n && t.push(n);
2460
- }
2461
- return t;
2462
- }
2463
- unregisterExtension(e) {
2464
- this.replaceExtension(e, []);
2465
- }
2466
- replaceExtension(e, t) {
2467
- let n = this.resolveExtensions(e);
2468
- e && !n.length && console.warn("No extensions found to unregister", e);
2469
- let r = !1, i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
2470
- for (let t of n) this.extensions = this.extensions.filter((e) => e !== t), this.extensionFactories.forEach((e, n) => {
2471
- e === t && this.extensionFactories.delete(n);
2472
- }), this.abortMap.get(t)?.abort(), this.abortMap.delete(t), this.extensionPlugins.get(t)?.forEach((e) => {
2473
- i.add(e);
2474
- let t = e.spec?.key, n = typeof t == "object" && t ? t.key : t;
2475
- typeof n == "string" && a.add(n);
2476
- }), this.extensionPlugins.delete(t), t.tiptapExtensions && !r && (r = !0, console.warn(`Extension ${t.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`, e));
2477
- let o = [].concat(t).filter(Boolean).map((e) => this.addExtension(e)).filter(Boolean), s = [];
2478
- for (let e of o) e?.tiptapExtensions && console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`, e), e?.inputRules?.length && console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`, e), this.getProsemirrorPluginsFromExtension(e).plugins.forEach((e) => {
2479
- s.push(e);
2480
- });
2481
- !i.size && !a.size && !s.length || this.updatePlugins((e) => [...e.filter((e) => {
2482
- if (i.has(e)) return !1;
2483
- if (a.size) {
2484
- let t = e.spec?.key, n = typeof t == "object" && t ? t.key : t;
2485
- if (typeof n == "string" && a.has(n)) return !1;
2486
- }
2487
- return !0;
2488
- }), ...s]);
2489
- }
2490
- updatePlugins(e) {
2491
- let t = this.editor.prosemirrorState, n = t.reconfigure({ plugins: e(t.plugins.slice()) });
2492
- this.editor.prosemirrorView.updateState(n);
2493
- }
2494
- getTiptapExtensions() {
2495
- let e = Ti(this.editor, this.options).filter((e) => !this.disabledExtensions.has(e.name)), t = ee(this.extensions.map((e) => {
2496
- let t = this.blockNoteExtensionDependents.get(e.key);
2497
- return t?.size ? {
2498
- key: e.key,
2499
- runsBefore: [...e.runsBefore ?? [], ...t]
2500
- } : e;
2501
- })), n = /* @__PURE__ */ new Map();
2502
- for (let r of this.extensions) {
2503
- r.tiptapExtensions && e.push(...r.tiptapExtensions);
2504
- let i = t(r.key), { plugins: a, inputRules: o } = this.getProsemirrorPluginsFromExtension(r);
2505
- a.length && e.push(D.create({
2506
- name: r.key,
2507
- priority: i,
2508
- addProseMirrorPlugins: () => a
2509
- })), o.length && (n.has(i) || n.set(i, []), n.get(i).push(...o));
2510
- }
2511
- e.push(D.create({
2512
- name: "blocknote-input-rules",
2513
- addProseMirrorPlugins() {
2514
- let e = [];
2515
- Array.from(n.keys()).sort((e, t) => e - t).reverse().forEach((t) => {
2516
- e.push(...n.get(t));
2517
- });
2518
- let t = ft({ rules: e });
2519
- return [t, new M({ props: { handleKeyDown(e, n) {
2520
- if (n.key !== "Enter" || n.shiftKey || n.ctrlKey || n.metaKey || n.altKey) return !1;
2521
- let { $cursor: r } = e.state.selection;
2522
- return r ? !!t.props.handleTextInput?.call(t, e, r.pos, r.pos, "\n", () => e.state.tr.insertText("\n", r.pos, r.pos)) : !1;
2523
- } } })];
2524
- }
2525
- }));
2526
- for (let t of this.options._tiptapOptions?.extensions ?? []) e.push(t);
2527
- return e;
2528
- }
2529
- getProsemirrorPluginsFromExtension(e) {
2530
- let t = [...e.prosemirrorPlugins ?? []], n = [];
2531
- if (!e.prosemirrorPlugins?.length && !Object.keys(e.keyboardShortcuts || {}).length && !e.inputRules?.length) return {
2532
- plugins: t,
2533
- inputRules: n
2534
- };
2535
- if (this.extensionPlugins.set(e, t), e.inputRules?.length && n.push(...e.inputRules.map((e) => new dt(e.find, (t, n, r, i) => {
2536
- let a = e.replace({
2537
- match: n,
2538
- range: {
2539
- from: r,
2540
- to: i
2541
- },
2542
- editor: this.editor
2543
- });
2544
- if (a) {
2545
- let e = t.tr, n = v(e);
2546
- return !n.isBlockContainer || this.editor.schema.blockSchema[n.blockNoteType]?.content !== "inline" ? null : (e.deleteRange(r, i), s(e, n.bnBlock.beforePos, a), ar(e, x(n.bnBlock.node, e.doc), "start"), e);
2547
- }
2548
- return null;
2549
- }, { undoable: !0 }))), Object.keys(e.keyboardShortcuts || {}).length) {
2550
- let n, r = pt(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e, t]) => [e, () => {
2551
- if (!n) throw Error("Keyboard shortcut called outside handleKeyDown");
2552
- return t({
2553
- editor: this.editor,
2554
- event: n
2555
- });
2556
- }])));
2557
- t.push(new M({ props: { handleKeyDown: (e, t) => {
2558
- let i = n;
2559
- n = t;
2560
- try {
2561
- return r(e, t);
2562
- } finally {
2563
- n = i;
2564
- }
2565
- } } }));
2566
- }
2567
- return {
2568
- plugins: t,
2569
- inputRules: n
2570
- };
2571
- }
2572
- getExtensions() {
2573
- return new Map(this.extensions.map((e) => [e.key, e]));
2574
- }
2575
- getExtension(e) {
2576
- if (typeof e == "string") return this.extensions.find((t) => t.key === e) || void 0;
2577
- if (typeof e == "function") return this.extensionFactories.get(e) || void 0;
2578
- throw Error(`Invalid extension type: ${typeof e}`);
2579
- }
2580
- hasExtension(e) {
2581
- return typeof e == "string" ? this.extensions.some((t) => t.key === e) : typeof e == "object" && "key" in e ? this.extensions.some((t) => t.key === e.key) : typeof e == "function" && this.extensionFactories.has(e);
2582
- }
2583
- };
2584
- //#endregion
2585
- //#region src/util/expandToWords.ts
2586
- function Oi(e, t) {
2587
- let { $from: n, $to: r } = t;
2588
- if (n.pos > n.start() && n.pos < e.content.size) {
2589
- let t = e.textBetween(n.pos, n.pos + 1);
2590
- if (/^[\w\p{P}]$/u.test(t)) {
2591
- let t = e.textBetween(n.start(), n.pos).match(/[\w\p{P}]+$/u);
2592
- t && (n = e.resolve(n.pos - t[0].length));
2593
- }
2594
- }
2595
- if (r.pos < r.end() && r.pos > 0) {
2596
- let t = e.textBetween(r.pos - 1, r.pos);
2597
- if (/^[\w\p{P}]$/u.test(t)) {
2598
- let t = e.textBetween(r.pos, r.end()).match(/^[\w\p{P}]+/u);
2599
- t && (r = e.resolve(r.pos + t[0].length));
2600
- }
2601
- }
2602
- return {
2603
- $from: n,
2604
- $to: r,
2605
- from: n.pos,
2606
- to: r.pos
2607
- };
2608
- }
2609
- //#endregion
2610
- //#region src/api/blockManipulation/selections/selection.ts
2611
- function ki(e) {
2612
- if (e.selection.empty || "node" in e.selection) return;
2613
- let t = e.doc.resolve(de(e.doc, e.selection.from).posBeforeNode), n = e.doc.resolve(de(e.doc, e.selection.to).posBeforeNode), r = (n, r) => {
2614
- let i = t.posAtIndex(n, r), a = e.doc.resolve(i).nodeAfter;
2615
- if (!a) throw Error(`Error getting selection - node not found at position ${i}`);
2616
- return C(a, e.doc);
2617
- }, i = [], a = t.sharedDepth(n.pos), o = t.index(a), s = n.index(a);
2618
- if (t.depth > a) {
2619
- i.push(C(t.nodeAfter, e.doc));
2620
- for (let e = t.depth; e > a; e--) if (t.node(e).type.isInGroup("childContainer")) {
2621
- let n = t.index(e) + 1, a = t.node(e).childCount;
2622
- for (let t = n; t < a; t++) i.push(r(t, e));
2623
- }
2624
- } else i.push(r(o, a));
2625
- for (let e = o + 1; e <= s; e++) i.push(r(e, a));
2626
- if (i.length === 0) throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);
2627
- return { blocks: i };
2628
- }
2629
- function Ai(e, t, n) {
2630
- let r = typeof t == "string" ? t : t.id, i = typeof n == "string" ? n : n.id, a = y(e), o = u(a);
2631
- if (r === i) throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);
2632
- let s = c(r, e.doc);
2633
- if (!s) throw Error(`Block with ID ${r} not found`);
2634
- let l = c(i, e.doc);
2635
- if (!l) throw Error(`Block with ID ${i} not found`);
2636
- let d = S(s), f = S(l), p = o.blockSchema[d.blockNoteType], m = o.blockSchema[f.blockNoteType];
2637
- if (!d.isBlockContainer || p.content === "none") throw Error(`Attempting to set selection anchor in block without content (id ${r})`);
2638
- if (!f.isBlockContainer || m.content === "none") throw Error(`Attempting to set selection anchor in block without content (id ${i})`);
2639
- let h, g;
2640
- if (p.content === "table") {
2641
- let e = st.get(d.blockContent.node);
2642
- h = d.blockContent.beforePos + e.positionAt(0, 0, d.blockContent.node) + 1 + 2;
2643
- } else h = d.blockContent.beforePos + 1;
2644
- if (m.content === "table") {
2645
- let t = st.get(f.blockContent.node), n = f.blockContent.beforePos + t.positionAt(t.height - 1, t.width - 1, f.blockContent.node) + 1;
2646
- g = n + e.doc.resolve(n).nodeAfter.nodeSize - 2;
2647
- } else g = f.blockContent.afterPos - 1;
2648
- e.setSelection(N.create(e.doc, h, g));
2649
- }
2650
- function ji(e, t = !1) {
2651
- let n = t ? Oi(e.doc, e.selection) : e.selection, i = n.$from, a = n.$to;
2652
- for (; a.parentOffset >= a.parent.nodeSize - 2 && a.depth > 0;) a = e.doc.resolve(a.pos + 1);
2653
- for (; a.parentOffset === 0 && a.depth > 0;) a = e.doc.resolve(a.pos - 1);
2654
- for (; i.parentOffset === 0 && i.depth > 0;) i = e.doc.resolve(i.pos - 1);
2655
- for (; i.parentOffset >= i.parent.nodeSize - 2 && i.depth > 0;) i = e.doc.resolve(i.pos + 1);
2656
- let o = r(e.doc.slice(i.pos, a.pos, !0));
2657
- return {
2658
- _meta: {
2659
- startPos: i.pos,
2660
- endPos: a.pos
2661
- },
2662
- ...o
2663
- };
2664
- }
2665
- //#endregion
2666
- //#region src/editor/managers/SelectionManager.ts
2667
- var Mi = class {
2668
- editor;
2669
- constructor(e) {
2670
- this.editor = e;
2671
- }
2672
- getSelection() {
2673
- return this.editor.transact((e) => ki(e));
2674
- }
2675
- getSelectionCutBlocks(e = !1) {
2676
- return this.editor.transact((t) => ji(t, e));
2677
- }
2678
- setSelection(e, t) {
2679
- return this.editor.transact((n) => Ai(n, e, t));
2680
- }
2681
- getTextCursorPosition() {
2682
- return this.editor.transact((e) => ir(e));
2683
- }
2684
- setTextCursorPosition(e, t = "start") {
2685
- return this.editor.transact((n) => ar(n, e, t));
2686
- }
2687
- getSelectionBoundingBox() {
2688
- if (!this.editor.prosemirrorView) return;
2689
- let { selection: e } = this.editor.prosemirrorState, { ranges: t } = e, n = Math.min(...t.map((e) => e.$from.pos)), r = Math.max(...t.map((e) => e.$to.pos));
2690
- if (nt(e)) {
2691
- let e = this.editor.prosemirrorView.nodeDOM(n);
2692
- if (e) return e.getBoundingClientRect();
2693
- }
2694
- return it(this.editor.prosemirrorView, n, r).toJSON();
2695
- }
2696
- }, Ni = class {
2697
- editor;
2698
- constructor(e) {
2699
- this.editor = e;
2700
- }
2701
- activeTransaction = null;
2702
- can(e) {
2703
- try {
2704
- return this.isInCan = !0, e();
2705
- } finally {
2706
- this.isInCan = !1;
2707
- }
2708
- }
2709
- isInCan = !1;
2710
- exec(e) {
2711
- if (this.activeTransaction) throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");
2712
- if (this.isInCan) return this.canExec(e);
2713
- let t = this.prosemirrorState, n = this.prosemirrorView;
2714
- return e(t, (e) => this.prosemirrorView.dispatch(e), n);
2715
- }
2716
- canExec(e) {
2717
- if (this.activeTransaction) throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");
2718
- let t = this.prosemirrorState, n = this.prosemirrorView;
2719
- return e(t, void 0, n);
2720
- }
2721
- transact(e) {
2722
- if (this.activeTransaction) return e(this.activeTransaction);
2723
- try {
2724
- this.activeTransaction = this.editor._tiptapEditor.state.tr;
2725
- let t = e(this.activeTransaction), n = this.activeTransaction;
2726
- return this.activeTransaction = null, n && (n.docChanged || n.selectionSet || n.scrolledIntoView || n.storedMarksSet || !n.isGeneric) && this.prosemirrorView.dispatch(n), t;
2727
- } finally {
2728
- this.activeTransaction = null;
2729
- }
2730
- }
2731
- get prosemirrorState() {
2732
- if (this.activeTransaction) throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");
2733
- return this.editor._tiptapEditor.state;
2734
- }
2735
- get prosemirrorView() {
2736
- return this.editor._tiptapEditor.view;
2737
- }
2738
- isFocused() {
2739
- return this.prosemirrorView?.hasFocus() || !1;
2740
- }
2741
- focus() {
2742
- this.prosemirrorView?.focus();
2743
- }
2744
- get isEditable() {
2745
- if (!this.editor._tiptapEditor) {
2746
- if (!this.editor.headless) throw Error("no editor, but also not headless?");
2747
- return !1;
2748
- }
2749
- return this.editor._tiptapEditor.isEditable === void 0 || this.editor._tiptapEditor.isEditable;
2750
- }
2751
- set isEditable(e) {
2752
- if (!this.editor._tiptapEditor) {
2753
- if (!this.editor.headless) throw Error("no editor, but also not headless?");
2754
- return;
2755
- }
2756
- this.editor._tiptapEditor.options.editable !== e && this.editor._tiptapEditor.setEditable(e);
2757
- }
2758
- undo() {
2759
- let e = this.editor.getExtension("yUndo");
2760
- if (e) return this.exec(e.undoCommand);
2761
- let t = this.editor.getExtension("history");
2762
- if (t) return this.exec(t.undoCommand);
2763
- throw Error("No undo plugin found");
2764
- }
2765
- redo() {
2766
- let e = this.editor.getExtension("yUndo");
2767
- if (e) return this.exec(e.redoCommand);
2768
- let t = this.editor.getExtension("history");
2769
- if (t) return this.exec(t.redoCommand);
2770
- throw Error("No redo plugin found");
2771
- }
2772
- };
2773
- //#endregion
2774
- //#region src/api/blockManipulation/insertContentAt.ts
2775
- function Pi(e, t, n, r = { updateSelection: !0 }) {
2776
- let { from: i, to: a } = typeof t == "number" ? {
2777
- from: t,
2778
- to: t
2779
- } : {
2780
- from: t.from,
2781
- to: t.to
2782
- }, o = !0, s = !0, c = "";
2783
- if (n.forEach((e) => {
2784
- e.check(), o && e.isText && e.marks.length === 0 ? c += e.text : o = !1, s = s ? e.isBlock : !1;
2785
- }), i === a && s) {
2786
- let { parent: t } = e.doc.resolve(i);
2787
- t.isTextblock && !t.type.spec.code && !t.childCount && (--i, a += 1);
2788
- }
2789
- return o ? e.insertText(c, i, a) : e.replaceWith(i, a, n), r.updateSelection && at(e, e.steps.length - 1, -1), !0;
2790
- }
2791
- //#endregion
2792
- //#region src/editor/managers/StyleManager.ts
2793
- var Fi = class {
2794
- editor;
2795
- constructor(e) {
2796
- this.editor = e;
2797
- }
2798
- insertInlineContent(e, { updateSelection: t = !1 } = {}) {
2799
- let n = a(e, this.editor.pmSchema);
2800
- this.editor.transact((e) => {
2801
- Pi(e, {
2802
- from: e.selection.from,
2803
- to: e.selection.to
2804
- }, n, { updateSelection: t });
2805
- });
2806
- }
2807
- getActiveStyles() {
2808
- return this.editor.transact((e) => {
2809
- let t = {}, n = e.selection.empty && e.storedMarks || e.selection.$to.marks();
2810
- for (let e of n) {
2811
- let n = this.editor.schema.styleSchema[e.type.name];
2812
- if (!n) {
2813
- e.type.name !== "link" && !e.type.spec.blocknoteIgnore && console.warn("mark not found in styleschema", e.type.name);
2814
- continue;
2815
- }
2816
- n.propSchema === "boolean" ? t[n.type] = !0 : t[n.type] = e.attrs.stringValue;
2817
- }
2818
- return t;
2819
- });
2820
- }
2821
- addStyles(e) {
2822
- for (let [t, n] of Object.entries(e)) {
2823
- let e = this.editor.schema.styleSchema[t];
2824
- if (!e) throw Error(`style ${t} not found in styleSchema`);
2825
- if (e.propSchema === "boolean") this.editor._tiptapEditor.commands.setMark(t);
2826
- else if (e.propSchema === "string") this.editor._tiptapEditor.commands.setMark(t, { stringValue: n });
2827
- else throw new _(e.propSchema);
2828
- }
2829
- }
2830
- removeStyles(e) {
2831
- for (let t of Object.keys(e)) this.editor._tiptapEditor.commands.unsetMark(t);
2832
- }
2833
- toggleStyles(e) {
2834
- for (let [t, n] of Object.entries(e)) {
2835
- let e = this.editor.schema.styleSchema[t];
2836
- if (!e) throw Error(`style ${t} not found in styleSchema`);
2837
- if (e.propSchema === "boolean") this.editor._tiptapEditor.commands.toggleMark(t);
2838
- else if (e.propSchema === "string") this.editor._tiptapEditor.commands.toggleMark(t, { stringValue: n });
2839
- else throw new _(e.propSchema);
2840
- }
2841
- }
2842
- getSelectedText() {
2843
- return this.editor.transact((e) => e.doc.textBetween(e.selection.from, e.selection.to));
2844
- }
2845
- getLinkMarkAtPos(e) {
2846
- return this.editor.transact((t) => {
2847
- let n = this.editor.pmSchema.marks.link, r = $e(t.doc.resolve(e), n);
2848
- if (!r) return;
2849
- let i = t.doc.nodeAt(r.from)?.marks.find((e) => e.type === n);
2850
- if (i) return {
2851
- href: i.attrs.href,
2852
- from: r.from,
2853
- to: r.to,
2854
- text: t.doc.textBetween(r.from, r.to)
2855
- };
2856
- });
2857
- }
2858
- getSelectedLinkUrl() {
2859
- return this.editor.transact((e) => (e.doc.nodeAt(e.selection.from)?.marks.find((e) => e.type.name === "link"))?.attrs.href);
2860
- }
2861
- createLink(e, t) {
2862
- e !== "" && this.editor.transact((n) => {
2863
- let { from: r, to: i } = n.selection, a = this.editor.pmSchema.mark("link", { href: e });
2864
- t ? n.insertText(t, r, i).addMark(r, r + t.length, a) : n.addMark(r, i, a);
2865
- });
2866
- }
2867
- editLink(e, t, n = this.editor.transact((e) => e.selection.anchor)) {
2868
- this.editor.transact((r) => {
2869
- let { from: i, to: a } = this.getLinkMarkAtPos(n) || {
2870
- from: r.selection.from,
2871
- to: r.selection.to
2872
- }, o = this.editor.pmSchema.mark("link", { href: e });
2873
- t !== r.doc.textBetween(i, a) && r.insertText(t, i, a), r.addMark(i, i + t.length, o);
2874
- }), this.editor.prosemirrorView.focus();
2875
- }
2876
- deleteLink(e = this.editor.transact((e) => e.selection.anchor)) {
2877
- this.editor.transact((t) => {
2878
- let { from: n, to: r } = this.getLinkMarkAtPos(e) || {
2879
- from: t.selection.from,
2880
- to: t.selection.to
2881
- };
2882
- t.removeMark(n, r, this.editor.pmSchema.marks.link).setMeta("preventAutolink", !0);
2883
- }), this.editor.prosemirrorView.focus();
2884
- }
2885
- };
2886
- //#endregion
2887
- //#region src/editor/transformPasted.ts
2888
- function Ii(e) {
2889
- return Xe(e.state.selection.$from, (e) => e.type.name === "tableCell" || e.type.name === "tableHeader") !== void 0;
2890
- }
2891
- function Li(e, t) {
2892
- let n = t.nodes.hardBreak, r = P.empty;
2893
- return e.forEach((e) => {
2894
- e.isTextblock && e.childCount > 0 ? (r = r.append(e.content), r = r.addToEnd(n.create())) : e.isText ? r = r.addToEnd(e) : e.isBlock && e.childCount > 0 && (r = r.append(Li(e.content, t)), r = r.addToEnd(n.create()));
2895
- }), r.lastChild?.type === n && (r = r.cut(0, r.size - 1)), r;
2896
- }
2897
- function Ri(e, t) {
2898
- let n = [];
2899
- return e.forEach((e, r, i) => {
2900
- i !== t && n.push(e);
2901
- }), P.from(n);
2902
- }
2903
- function zi(e, t) {
2904
- let n = [];
2905
- for (let r = 0; r < e.childCount; r++) if (e.child(r).type.name === "tableRow") {
2906
- if (n.length > 0 && n[n.length - 1].type.name === "table") {
2907
- let t = n[n.length - 1], i = t.copy(t.content.addToEnd(e.child(r)));
2908
- n[n.length - 1] = i;
2909
- } else {
2910
- let i = t.nodes.table.createChecked(void 0, e.child(r));
2911
- n.push(i);
2912
- }
2913
- } else n.push(e.child(r));
2914
- return e = P.from(n), e;
2915
- }
2916
- function Bi(e, t) {
2917
- let n = P.from(e.content);
2918
- n = zi(n, t.state.schema);
2919
- let r = Vi(n, t, e);
2920
- if (r) return r;
2921
- if (Ii(t)) {
2922
- let e = !1;
2923
- if (n.descendants((t) => {
2924
- t.type.isInGroup("tableContent") && (e = !0);
2925
- }), !e && !t.state.schema.nodes.tableParagraph.validContent(n)) return new F(Li(n, t.state.schema), 0, 0);
2926
- }
2927
- if (!Hi(n, t)) return new F(n, e.openStart, e.openEnd);
2928
- for (let e = 0; e < n.childCount; e++) if (n.child(e).type.spec.group === "blockContent") {
2929
- let r = [n.child(e)];
2930
- if (e + 1 < n.childCount && n.child(e + 1).type.name === "blockGroup") {
2931
- let t = n.child(e + 1).child(0).child(0);
2932
- (t.type.name === "bulletListItem" || t.type.name === "numberedListItem" || t.type.name === "checkListItem") && (r.push(n.child(e + 1)), n = Ri(n, e + 1));
2933
- }
2934
- let i = t.state.schema.nodes.blockContainer.createChecked(void 0, r);
2935
- n = n.replaceChild(e, i);
2936
- }
2937
- return new F(n, e.openStart, e.openEnd);
2938
- }
2939
- function Vi(e, t, n) {
2940
- if (Ii(t) || t.dragging) return null;
2941
- let r = v(t.state), i = r.isBlockContainer ? r.blockContent.node : null;
2942
- if (!i || i.type.name === "paragraph" || i.type.spec.content !== "inline*" || i.childCount > 0) return null;
2943
- let a = e.firstChild, o = a?.firstChild, s = o?.firstChild;
2944
- if (a?.type.name !== "blockGroup" || o?.type.name !== "blockContainer" || s?.type.name !== "paragraph") return null;
2945
- let c = i.type.create(i.attrs, s.content), l = o.copy(o.content.replaceChild(0, c)), u = a.copy(a.content.replaceChild(0, l));
2946
- return new F(e.replaceChild(0, u), n.openStart, n.openEnd);
2947
- }
2948
- function Hi(e, t) {
2949
- let n = e.childCount === 1, r = e.firstChild?.type.spec.content === "inline*", i = e.firstChild?.type.spec.content === "tableRow+";
2950
- if (n) {
2951
- if (r) return !1;
2952
- if (i) {
2953
- let e = v(t.state);
2954
- if (e.isBlockContainer) return e.blockContent.node.type.spec.content !== "tableRow+";
2955
- }
2956
- }
2957
- return !0;
2958
- }
2959
- //#endregion
2960
- //#region src/editor/BlockNoteEditor.ts
2961
- var Ui = {
2962
- enableInputRules: !0,
2963
- enablePasteRules: !0,
2964
- enableCoreExtensions: !1
2965
- }, Wi = class e extends H {
2966
- options;
2967
- pmSchema;
2968
- _tiptapEditor;
2969
- elementRenderer = null;
2970
- blockCache = /* @__PURE__ */ new WeakMap();
2971
- dictionary;
2972
- schema;
2973
- blockImplementations;
2974
- inlineContentImplementations;
2975
- styleImplementations;
2976
- uploadFile;
2977
- onUploadStartCallbacks = [];
2978
- onUploadEndCallbacks = [];
2979
- resolveFileUrl;
2980
- settings;
2981
- static create(t) {
2982
- return new e(t ?? {});
2983
- }
2984
- constructor(e) {
2985
- super(), this.options = e, this.dictionary = e.dictionary || Re, this.settings = { tables: {
2986
- splitCells: e?.tables?.splitCells ?? !1,
2987
- cellBackgroundColor: e?.tables?.cellBackgroundColor ?? !1,
2988
- cellTextColor: e?.tables?.cellTextColor ?? !1,
2989
- headers: e?.tables?.headers ?? !1
2990
- } };
2991
- let t = {
2992
- defaultStyles: !0,
2993
- schema: e.schema || pe.create(),
2994
- ...e,
2995
- placeholders: {
2996
- ...this.dictionary.placeholders,
2997
- ...e.placeholders
2998
- }
2999
- };
3000
- if (this.schema = t.schema, this.blockImplementations = t.schema.blockSpecs, this.inlineContentImplementations = t.schema.inlineContentSpecs, this.styleImplementations = t.schema.styleSpecs, t.uploadFile) {
3001
- let e = t.uploadFile;
3002
- this.uploadFile = async (t, n) => {
3003
- this.onUploadStartCallbacks.forEach((e) => e.apply(this, [n]));
3004
- try {
3005
- return await e(t, n);
3006
- } finally {
3007
- this.onUploadEndCallbacks.forEach((e) => e.apply(this, [n]));
3008
- }
3009
- };
3010
- }
3011
- this.resolveFileUrl = t.resolveFileUrl, this._eventManager = new on(this), this._extensionManager = new Di(this, t);
3012
- let n = this._extensionManager.getTiptapExtensions(), r = {
3013
- ...Ui,
3014
- ...t._tiptapOptions,
3015
- element: null,
3016
- autofocus: t.autofocus ?? !1,
3017
- extensions: n,
3018
- editorProps: {
3019
- scrollMargin: {
3020
- top: 72,
3021
- bottom: 72,
3022
- left: 0,
3023
- right: 0
3024
- },
3025
- ...t._tiptapOptions?.editorProps,
3026
- attributes: {
3027
- tabIndex: "0",
3028
- ...t._tiptapOptions?.editorProps?.attributes,
3029
- ...t.domAttributes?.editor,
3030
- class: h("bn-editor", t.defaultStyles ? "bn-default-styles" : "", t.domAttributes?.editor?.class || "")
3031
- },
3032
- transformPasted: Bi
3033
- }
3034
- };
3035
- try {
3036
- let e = t.initialContent || [{
3037
- type: "paragraph",
3038
- id: ie.options.generateID()
3039
- }];
3040
- if (!Array.isArray(e) || e.length === 0) throw Error("initialContent must be a non-empty array of blocks, received: " + JSON.stringify(e));
3041
- let n = tt(r.extensions);
3042
- n.cached.blockNoteEditor = this;
3043
- let a = e.map((e) => i(e, n, this.schema.styleSchema).toJSON()), o = Je({
3044
- type: "doc",
3045
- content: [{
3046
- type: "blockGroup",
3047
- content: a
3048
- }]
3049
- }, n, r.parseOptions);
3050
- this._tiptapEditor = new Ge({
3051
- ...r,
3052
- content: o.toJSON()
3053
- }), this.pmSchema = this._tiptapEditor.schema;
3054
- } catch (e) {
3055
- throw Error("Error creating document from blocks passed as `initialContent`", { cause: e });
3056
- }
3057
- this.pmSchema.cached.blockNoteEditor = this, this._tiptapEditor.on("mount", () => {
3058
- this.headless = !1;
3059
- }), this._tiptapEditor.on("unmount", () => {
3060
- this.headless = !0;
3061
- }), this._blockManager = new an(this), this._exportManager = new rr(this), this._selectionManager = new Mi(this), this._stateManager = new Ni(this), this._styleManager = new Fi(this), this.emit("create");
3062
- }
3063
- _blockManager;
3064
- _eventManager;
3065
- _exportManager;
3066
- _extensionManager;
3067
- _selectionManager;
3068
- _stateManager;
3069
- _styleManager;
3070
- get extensions() {
3071
- return this._extensionManager.getExtensions();
3072
- }
3073
- exec(e) {
3074
- return this._stateManager.exec(e);
3075
- }
3076
- canExec(e) {
3077
- return this._stateManager.canExec(e);
3078
- }
3079
- transact(e) {
3080
- return this._stateManager.transact(e);
3081
- }
3082
- unregisterExtension = (...e) => this._extensionManager.unregisterExtension(...e);
3083
- registerExtension = (...e) => this._extensionManager.registerExtension(...e);
3084
- replaceExtension = (...e) => this._extensionManager.replaceExtension(...e);
3085
- getExtension = ((e) => this._extensionManager.getExtension(e));
3086
- mount = (e) => {
3087
- this._tiptapEditor.mount({ mount: e });
3088
- };
3089
- unmount = () => {
3090
- this._tiptapEditor.unmount();
3091
- };
3092
- get prosemirrorState() {
3093
- return this._stateManager.prosemirrorState;
3094
- }
3095
- get prosemirrorView() {
3096
- return this._stateManager.prosemirrorView;
3097
- }
3098
- get domElement() {
3099
- if (!this.headless) return this.prosemirrorView?.dom;
3100
- }
3101
- _portalElements = /* @__PURE__ */ new Map();
3102
- registerPortalElement = (e) => {
3103
- this._portalElements.set(e, (this._portalElements.get(e) ?? 0) + 1);
3104
- };
3105
- unregisterPortalElement = (e) => {
3106
- let t = this._portalElements.get(e);
3107
- t !== void 0 && (t <= 1 ? this._portalElements.delete(e) : this._portalElements.set(e, t - 1));
3108
- };
3109
- isWithinEditor = (e) => {
3110
- if (this.domElement?.parentElement?.contains(e)) return !0;
3111
- for (let t of this._portalElements.keys()) if (t.contains(e)) return !0;
3112
- return !1;
3113
- };
3114
- isFocused(e) {
3115
- if (this.headless) return !1;
3116
- let t = this.prosemirrorView?.hasFocus() || !1;
3117
- if (!e?.includeEditorUI) return t;
3118
- let n = typeof document < "u" ? document.activeElement : null;
3119
- return t || !!n && this.isWithinEditor(n);
3120
- }
3121
- headless = !0;
3122
- focus() {
3123
- this.headless || this.prosemirrorView.focus();
3124
- }
3125
- blur() {
3126
- this.headless || this.domElement?.blur();
3127
- }
3128
- onUploadStart(e) {
3129
- return this.onUploadStartCallbacks.push(e), () => {
3130
- let t = this.onUploadStartCallbacks.indexOf(e);
3131
- t > -1 && this.onUploadStartCallbacks.splice(t, 1);
3132
- };
3133
- }
3134
- onUploadEnd(e) {
3135
- return this.onUploadEndCallbacks.push(e), () => {
3136
- let t = this.onUploadEndCallbacks.indexOf(e);
3137
- t > -1 && this.onUploadEndCallbacks.splice(t, 1);
3138
- };
3139
- }
3140
- get topLevelBlocks() {
3141
- return this.document;
3142
- }
3143
- get document() {
3144
- return this._blockManager.document;
3145
- }
3146
- getBlock(e) {
3147
- return this._blockManager.getBlock(e);
3148
- }
3149
- getPrevBlock(e) {
3150
- return this._blockManager.getPrevBlock(e);
3151
- }
3152
- getNextBlock(e) {
3153
- return this._blockManager.getNextBlock(e);
3154
- }
3155
- getParentBlock(e) {
3156
- return this._blockManager.getParentBlock(e);
3157
- }
3158
- forEachBlock(e, t = !1) {
3159
- this._blockManager.forEachBlock(e, t);
3160
- }
3161
- onEditorContentChange(e) {
3162
- this._tiptapEditor.on("update", e);
3163
- }
3164
- onEditorSelectionChange(e) {
3165
- this._tiptapEditor.on("selectionUpdate", e);
3166
- }
3167
- onBeforeChange(e) {
3168
- return this._extensionManager.getExtension(Se).subscribe(e);
3169
- }
3170
- getTextCursorPosition() {
3171
- return this._selectionManager.getTextCursorPosition();
3172
- }
3173
- setTextCursorPosition(e, t = "start") {
3174
- return this._selectionManager.setTextCursorPosition(e, t);
3175
- }
3176
- getSelection() {
3177
- return this._selectionManager.getSelection();
3178
- }
3179
- getSelectionCutBlocks(e = !1) {
3180
- return this._selectionManager.getSelectionCutBlocks(e);
3181
- }
3182
- setSelection(e, t) {
3183
- return this._selectionManager.setSelection(e, t);
3184
- }
3185
- get isEditable() {
3186
- return this._stateManager.isEditable;
3187
- }
3188
- set isEditable(e) {
3189
- this._stateManager.isEditable = e;
3190
- }
3191
- insertBlocks(e, t, n = "before") {
3192
- return this._blockManager.insertBlocks(e, t, n);
3193
- }
3194
- updateBlock(e, t) {
3195
- return this._blockManager.updateBlock(e, t);
3196
- }
3197
- removeBlocks(e) {
3198
- return this._blockManager.removeBlocks(e);
3199
- }
3200
- replaceBlocks(e, t) {
3201
- return this._blockManager.replaceBlocks(e, t);
3202
- }
3203
- undo() {
3204
- return this._stateManager.undo();
3205
- }
3206
- redo() {
3207
- return this._stateManager.redo();
3208
- }
3209
- insertInlineContent(e, { updateSelection: t = !1 } = {}) {
3210
- this._styleManager.insertInlineContent(e, { updateSelection: t });
3211
- }
3212
- getActiveStyles() {
3213
- return this._styleManager.getActiveStyles();
3214
- }
3215
- addStyles(e) {
3216
- this._styleManager.addStyles(e);
3217
- }
3218
- removeStyles(e) {
3219
- this._styleManager.removeStyles(e);
3220
- }
3221
- toggleStyles(e) {
3222
- this._styleManager.toggleStyles(e);
3223
- }
3224
- getSelectedText() {
3225
- return this._styleManager.getSelectedText();
3226
- }
3227
- getSelectedLinkUrl() {
3228
- return this._styleManager.getSelectedLinkUrl();
3229
- }
3230
- createLink(e, t) {
3231
- this._styleManager.createLink(e, t);
3232
- }
3233
- getLinkMarkAtPos(e) {
3234
- return this._styleManager.getLinkMarkAtPos(e);
3235
- }
3236
- editLink(e, t, n) {
3237
- this._styleManager.editLink(e, t, n);
3238
- }
3239
- deleteLink(e) {
3240
- this._styleManager.deleteLink(e);
3241
- }
3242
- canNestBlock() {
3243
- return this._blockManager.canNestBlock();
3244
- }
3245
- nestBlock() {
3246
- this._blockManager.nestBlock();
3247
- }
3248
- canUnnestBlock() {
3249
- return this._blockManager.canUnnestBlock();
3250
- }
3251
- unnestBlock() {
3252
- this._blockManager.unnestBlock();
3253
- }
3254
- moveBlocksUp(e) {
3255
- return this._blockManager.moveBlocksUp(e);
3256
- }
3257
- moveBlocksDown(e) {
3258
- return this._blockManager.moveBlocksDown(e);
3259
- }
3260
- blocksToHTMLLossy(e = this.document) {
3261
- return this._exportManager.blocksToHTMLLossy(e);
3262
- }
3263
- blocksToFullHTML(e = this.document) {
3264
- return this._exportManager.blocksToFullHTML(e);
3265
- }
3266
- tryParseHTMLToBlocks(e) {
3267
- return this._exportManager.tryParseHTMLToBlocks(e);
3268
- }
3269
- blocksToMarkdownLossy(e = this.document) {
3270
- return this._exportManager.blocksToMarkdownLossy(e);
3271
- }
3272
- tryParseMarkdownToBlocks(e) {
3273
- return this._exportManager.tryParseMarkdownToBlocks(e);
3274
- }
3275
- onChange(e, t) {
3276
- return this._eventManager.onChange(e, t);
3277
- }
3278
- onSelectionChange(e, t) {
3279
- return this._eventManager.onSelectionChange(e, t);
3280
- }
3281
- onFocusChange(e, t) {
3282
- return this._eventManager.onFocusChange(e, t);
3283
- }
3284
- onMount(e) {
3285
- return this._eventManager.onMount(e);
3286
- }
3287
- onUnmount(e) {
3288
- return this._eventManager.onUnmount(e);
3289
- }
3290
- getSelectionBoundingBox() {
3291
- return this._selectionManager.getSelectionBoundingBox();
3292
- }
3293
- get isEmpty() {
3294
- let e = this.document;
3295
- return e.length === 0 || e.length === 1 && e[0].type === "paragraph" && e[0].content.length === 0;
3296
- }
3297
- pasteHTML(e, t = !1) {
3298
- this._exportManager.pasteHTML(e, t);
3299
- }
3300
- pasteText(e) {
3301
- return this._exportManager.pasteText(e);
3302
- }
3303
- pasteMarkdown(e) {
3304
- return this._exportManager.pasteMarkdown(e);
3305
- }
3306
- }, Gi = class {
3307
- mappings;
3308
- options;
3309
- constructor(e, t, n) {
3310
- this.mappings = t, this.options = n;
3311
- }
3312
- get dictionary() {
3313
- return this.options.dictionary?.exporter ?? Re.exporter;
3314
- }
3315
- async resolveFile(e) {
3316
- if (!this.options?.resolveFileUrl) return this.fetchBlob(e);
3317
- let t = await this.options.resolveFileUrl(e);
3318
- return t instanceof Blob ? t : this.fetchBlob(t);
3319
- }
3320
- async fetchBlob(e) {
3321
- let t = await fetch(e);
3322
- if (!t.ok) throw Error(`Failed to fetch file "${e}": ${t.status} ${t.statusText}`);
3323
- return t.blob();
3324
- }
3325
- mapStyles(e) {
3326
- return Object.entries(e).map(([e, t]) => {
3327
- let n = this.mappings.styleMapping[e];
3328
- if (!n) throw Error(`Exporter is missing a style mapping for style "${e}". If this style comes from a separate package, spread that package's exporter mappings into your styleMapping.`);
3329
- return n(t, this);
3330
- });
3331
- }
3332
- mapInlineContent(e) {
3333
- let t = this.mappings.inlineContentMapping[e.type];
3334
- if (!t) throw Error(`Exporter is missing an inline content mapping for inline content type "${e.type}". If this inline content comes from a separate package, spread that package's exporter mappings into your inlineContentMapping.`);
3335
- return t(e, this);
3336
- }
3337
- transformInlineContent(e) {
3338
- return e.map((e) => this.mapInlineContent(e));
3339
- }
3340
- async mapBlock(e, t, n, r) {
3341
- let i = this.mappings.blockMapping[e.type];
3342
- if (!i) throw Error(`Exporter is missing a block mapping for block type "${e.type}". If this block comes from a separate package, spread that package's exporter mappings into your blockMapping.`);
3343
- return i(e, this, t, n, r);
3344
- }
3345
- };
3346
- //#endregion
3347
- //#region src/exporter/ExportImage.ts
3348
- function Ki(e) {
3349
- if ("toBase64" in e && typeof e.toBase64 == "function") return e.toBase64();
3350
- let t = "";
3351
- for (let n of e) t += String.fromCharCode(n);
3352
- return btoa(t);
3353
- }
3354
- function qi(e) {
3355
- return `data:${e.mimeType};base64,${Ki(e.data)}`;
3356
- }
3357
- //#endregion
3358
- //#region src/exporter/mapping.ts
3359
- function Ji(e) {
3360
- return {
3361
- createBlockMapping: (e) => e,
3362
- createInlineContentMapping: (e) => e,
3363
- createStyleMapping: (e) => e
3364
- };
3365
- }
3366
- //#endregion
3367
- //#region src/util/combineByGroup.ts
3368
- function Yi(e, ...t) {
3369
- let n = [...e];
3370
- for (let e of t) for (let t of e) {
3371
- let e = n.findLastIndex((e) => e.group === t.group);
3372
- e === -1 ? n.push(t) : n.splice(e + 1, 0, t);
3373
- }
3374
- return n;
3375
- }
3376
- //#endregion
3377
- export { gt as A, B as C, L as D, St as E, xt as O, Nt as S, R as T, It as _, Gi as a, V as b, Ar as c, G as d, en as f, H as g, tn as h, qi as i, bt as k, nr as l, rn as m, Ji as n, Wi as o, nn as p, Ki as r, Oi as s, Yi as t, tr as u, Lt as v, z as w, Rt as x, Ft as y };
3378
-
3379
- //# sourceMappingURL=src-D5w0XAHX.js.map