@blocknote/core 0.51.4 → 0.52.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 (396) hide show
  1. package/dist/BlockNoteExtension-B_IEJHS8.js +38 -0
  2. package/dist/BlockNoteExtension-B_IEJHS8.js.map +1 -0
  3. package/dist/BlockNoteExtension-M0znTzxP.cjs +2 -0
  4. package/dist/BlockNoteExtension-M0znTzxP.cjs.map +1 -0
  5. package/dist/ThreadStore-Bx-gSEh1.cjs +2 -0
  6. package/dist/ThreadStore-Bx-gSEh1.cjs.map +1 -0
  7. package/dist/ThreadStore-et9wB5Xt.js +11 -0
  8. package/dist/ThreadStore-et9wB5Xt.js.map +1 -0
  9. package/dist/UserStore-DCG6lsla.cjs +2 -0
  10. package/dist/UserStore-DCG6lsla.cjs.map +1 -0
  11. package/dist/UserStore-QbbPFj0z.js +73 -0
  12. package/dist/UserStore-QbbPFj0z.js.map +1 -0
  13. package/dist/blocknote.cjs +1 -1
  14. package/dist/blocknote.js +6 -7
  15. package/dist/blocks-BqHv0xhc.cjs +12 -0
  16. package/dist/blocks-BqHv0xhc.cjs.map +1 -0
  17. package/dist/{blocks-DGsP5WKr.js → blocks-CiuUGa1E.js} +1093 -994
  18. package/dist/blocks-CiuUGa1E.js.map +1 -0
  19. package/dist/blocks.cjs +1 -1
  20. package/dist/blocks.js +2 -2
  21. package/dist/comments.cjs +1 -1
  22. package/dist/comments.cjs.map +1 -1
  23. package/dist/comments.js +75 -340
  24. package/dist/comments.js.map +1 -1
  25. package/dist/{en-Cj5r8sW_.cjs → en-C5Z4Ag9_.cjs} +2 -2
  26. package/dist/en-C5Z4Ag9_.cjs.map +1 -0
  27. package/dist/{en-B9hMApn4.js → en-CGKXfWma.js} +9 -1
  28. package/dist/en-CGKXfWma.js.map +1 -0
  29. package/dist/{extensions-Co4y7P63.js → extensions-CrUGDOks.js} +655 -583
  30. package/dist/extensions-CrUGDOks.js.map +1 -0
  31. package/dist/extensions-Ghr9QqqR.cjs +52 -0
  32. package/dist/extensions-Ghr9QqqR.cjs.map +1 -0
  33. package/dist/extensions.cjs +1 -1
  34. package/dist/extensions.js +4 -4
  35. package/dist/locales.cjs +1 -1
  36. package/dist/locales.cjs.map +1 -1
  37. package/dist/locales.js +177 -1
  38. package/dist/locales.js.map +1 -1
  39. package/dist/{src-Bcud0PIg.js → src-DTF83Cl9.js} +1243 -1297
  40. package/dist/src-DTF83Cl9.js.map +1 -0
  41. package/dist/src-OfbaVbMw.cjs +21 -0
  42. package/dist/src-OfbaVbMw.cjs.map +1 -0
  43. package/dist/style.css +1 -1
  44. package/dist/webpack-stats.json +1 -1
  45. package/dist/y.cjs +2 -0
  46. package/dist/y.cjs.map +1 -0
  47. package/dist/y.js +989 -0
  48. package/dist/y.js.map +1 -0
  49. package/dist/yjs.cjs +1 -1
  50. package/dist/yjs.cjs.map +1 -1
  51. package/dist/yjs.js +535 -14
  52. package/dist/yjs.js.map +1 -1
  53. package/package.json +46 -19
  54. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +1 -1
  55. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +1 -1
  56. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +3 -3
  57. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +25 -20
  58. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +39 -29
  59. package/src/api/blockManipulation/commands/nestBlock/nestBlock.test.ts +2 -2
  60. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +4 -8
  61. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +1 -1
  62. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +21 -9
  63. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +6 -5
  64. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +362 -4
  65. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +240 -30
  66. package/src/api/blockManipulation/getBlock/getBlock.ts +4 -9
  67. package/src/api/blockManipulation/selections/selection.ts +3 -6
  68. package/src/api/blockManipulation/selections/textCursorPosition.ts +10 -10
  69. package/src/api/blockManipulation/setupTestEnv.ts +1 -1
  70. package/src/api/blockManipulation/tables/tables.test.ts +1 -1
  71. package/src/api/clipboard/fromClipboard/fileDropExtension.ts +1 -1
  72. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +8 -4
  73. package/src/api/clipboard/fromClipboard/pasteExtension.ts +1 -1
  74. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +2 -1
  75. package/src/api/exporters/markdown/htmlToMarkdown.ts +79 -43
  76. package/src/api/getBlockInfoFromPos.test.ts +256 -0
  77. package/src/api/getBlockInfoFromPos.ts +53 -15
  78. package/src/api/getBlocksChangedByTransaction.test.ts +2 -1
  79. package/src/api/getBlocksChangedByTransaction.ts +6 -6
  80. package/src/api/nodeConversions/blockToNode.test.ts +113 -0
  81. package/src/api/nodeConversions/blockToNode.ts +15 -3
  82. package/src/api/nodeConversions/fragmentToBlocks.ts +2 -4
  83. package/src/api/nodeConversions/nodeToBlock.ts +28 -58
  84. package/src/api/nodeUtil.ts +6 -2
  85. package/src/api/parsers/html/parseHTML.ts +1 -1
  86. package/src/api/parsers/html/util/nestedLists.test.ts +1 -1
  87. package/src/api/parsers/markdown/detectMarkdown.test.ts +1 -1
  88. package/src/api/parsers/markdown/markdownToHtml.ts +228 -82
  89. package/src/api/pmUtil.ts +18 -1
  90. package/src/api/positionMapping.test.ts +20 -345
  91. package/src/api/positionMapping.ts +13 -83
  92. package/src/blocks/Audio/block.ts +1 -1
  93. package/src/blocks/Code/block.test.ts +14 -7
  94. package/src/blocks/Code/block.ts +2 -2
  95. package/src/blocks/Image/block.ts +1 -1
  96. package/src/blocks/ListItem/CheckListItem/block.test.ts +1 -1
  97. package/src/blocks/ListItem/ListItemKeyboardShortcuts.ts +2 -2
  98. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts +4 -11
  99. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +47 -50
  100. package/src/blocks/Table/TableExtension.test.ts +9 -6
  101. package/src/blocks/Table/TableExtension.ts +20 -6
  102. package/src/blocks/Table/block.ts +18 -5
  103. package/src/blocks/Video/block.ts +1 -1
  104. package/src/blocks/utils/listItemEnterHandler.ts +3 -2
  105. package/src/comments/extension.ts +30 -21
  106. package/src/comments/index.ts +0 -3
  107. package/src/comments/mark.ts +4 -0
  108. package/src/comments/threadstore/ThreadStore.ts +4 -8
  109. package/src/comments/types.ts +0 -8
  110. package/src/editor/Block.css +307 -3
  111. package/src/editor/BlockNoteEditor.test.ts +21 -18
  112. package/src/editor/BlockNoteEditor.ts +22 -57
  113. package/src/editor/BlockNoteExtension.test.ts +1 -1
  114. package/src/editor/managers/BlockManager.ts +1 -1
  115. package/src/editor/managers/ExtensionManager/ExtensionManager.test.ts +249 -0
  116. package/src/editor/managers/ExtensionManager/extensions.ts +7 -18
  117. package/src/editor/managers/ExtensionManager/index.ts +168 -68
  118. package/src/editor/managers/StateManager.ts +4 -3
  119. package/src/editor/performance.test.ts +14 -1
  120. package/src/editor/transformPasted.test.ts +1 -1
  121. package/src/extensions/Placeholder/Placeholder.ts +1 -0
  122. package/src/extensions/PositionMapping/PositionMapping.ts +68 -0
  123. package/src/extensions/PreviousBlockType/PreviousBlockType.test.ts +14 -1
  124. package/src/extensions/PreviousBlockType/PreviousBlockType.ts +14 -11
  125. package/src/extensions/SideMenu/SideMenu.ts +9 -2
  126. package/src/extensions/SuggestionMenu/SuggestionMenu.test.ts +1 -1
  127. package/src/extensions/TableHandles/TableHandles.ts +18 -20
  128. package/src/extensions/TrailingNode/TrailingNode.ts +33 -1
  129. package/src/extensions/Versioning/Versioning.test.ts +435 -0
  130. package/src/extensions/Versioning/Versioning.ts +628 -0
  131. package/src/extensions/Versioning/inMemoryVersioning.test.ts +469 -0
  132. package/src/extensions/Versioning/inMemoryVersioning.ts +263 -0
  133. package/src/extensions/Versioning/index.ts +2 -0
  134. package/src/extensions/index.ts +6 -9
  135. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.ts +155 -0
  136. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +6 -8
  137. package/src/extensions/tiptap-extensions/Link/helpers/autolink.ts +9 -9
  138. package/src/extensions/tiptap-extensions/Link/helpers/linkDetector.ts +8 -10
  139. package/src/extensions/tiptap-extensions/Link/helpers/whitespace.ts +2 -2
  140. package/src/extensions/tiptap-extensions/Link/link.test.ts +26 -22
  141. package/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.ts +187 -0
  142. package/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts +37 -24
  143. package/src/extensions/tiptap-extensions/index.ts +1 -25
  144. package/src/i18n/locales/ar.ts +9 -0
  145. package/src/i18n/locales/de.ts +9 -0
  146. package/src/i18n/locales/en.ts +10 -1
  147. package/src/i18n/locales/es.ts +9 -0
  148. package/src/i18n/locales/fa.ts +11 -1
  149. package/src/i18n/locales/fr.ts +9 -0
  150. package/src/i18n/locales/he.ts +10 -1
  151. package/src/i18n/locales/hr.ts +10 -0
  152. package/src/i18n/locales/is.ts +10 -0
  153. package/src/i18n/locales/it.ts +9 -0
  154. package/src/i18n/locales/ja.ts +9 -0
  155. package/src/i18n/locales/ko.ts +9 -0
  156. package/src/i18n/locales/nl.ts +10 -0
  157. package/src/i18n/locales/no.ts +10 -0
  158. package/src/i18n/locales/pl.ts +9 -0
  159. package/src/i18n/locales/pt.ts +10 -0
  160. package/src/i18n/locales/ru.ts +10 -0
  161. package/src/i18n/locales/sk.ts +10 -1
  162. package/src/i18n/locales/uk.ts +9 -0
  163. package/src/i18n/locales/uz.ts +9 -0
  164. package/src/i18n/locales/vi.ts +9 -0
  165. package/src/i18n/locales/zh-tw.ts +9 -0
  166. package/src/i18n/locales/zh.ts +9 -0
  167. package/src/index.ts +2 -0
  168. package/src/pm-nodes/BlockContainer.ts +4 -1
  169. package/src/pm-nodes/BlockGroup.ts +4 -1
  170. package/src/pm-nodes/Doc.ts +4 -1
  171. package/src/pm-nodes/suggestionMarks.ts +43 -0
  172. package/src/schema/blocks/createSpec.test.ts +123 -0
  173. package/src/schema/blocks/createSpec.ts +82 -24
  174. package/src/schema/blocks/extendBlockSpec.test.ts +188 -0
  175. package/src/schema/blocks/internal.ts +13 -43
  176. package/src/schema/blocks/types.ts +69 -22
  177. package/src/schema/contentTypePropagation.test.ts +182 -0
  178. package/src/schema/index.ts +1 -0
  179. package/src/schema/inlineContent/internal.ts +1 -1
  180. package/src/schema/inlineContent/types.ts +3 -3
  181. package/src/schema/markGroups.ts +50 -0
  182. package/src/user/UserStore.ts +199 -0
  183. package/src/user/createUserStore.test.ts +126 -0
  184. package/src/user/index.ts +2 -0
  185. package/src/user/userColors.ts +72 -0
  186. package/src/util/string.ts +1 -1
  187. package/src/util/topo-sort.test.ts +1 -1
  188. package/src/util/typescript.ts +2 -1
  189. package/src/vite-env.d.ts +1 -1
  190. package/src/y/README.md +5 -0
  191. package/src/{comments/threadstore/yjs → y/comments}/RESTYjsThreadStore.ts +8 -14
  192. package/src/y/comments/YjsThreadStore.test.ts +295 -0
  193. package/src/y/comments/YjsThreadStore.ts +358 -0
  194. package/src/y/comments/YjsThreadStoreBase.ts +50 -0
  195. package/src/y/comments/index.ts +3 -0
  196. package/src/y/comments/yjsHelpers.ts +125 -0
  197. package/src/y/extensions/AttributionExtension.test.ts +86 -0
  198. package/src/y/extensions/AttributionExtension.ts +378 -0
  199. package/src/y/extensions/DiffVersioningExtension.test.ts +193 -0
  200. package/src/y/extensions/DiffVersioningExtension.ts +228 -0
  201. package/src/y/extensions/ForkYDoc.test.ts +253 -0
  202. package/src/y/extensions/ForkYDoc.ts +108 -0
  203. package/src/y/extensions/RelativePositionMapping.test.ts +418 -0
  204. package/src/y/extensions/RelativePositionMapping.ts +49 -0
  205. package/src/y/extensions/Suggestions.ts +174 -0
  206. package/src/y/extensions/Versioning.test.ts +395 -0
  207. package/src/y/extensions/Versioning.ts +115 -0
  208. package/src/y/extensions/YAttributionMarks.ts +320 -0
  209. package/src/{extensions/Collaboration → y/extensions}/YCursorPlugin.ts +15 -7
  210. package/src/y/extensions/YSync.ts +125 -0
  211. package/src/y/extensions/blockMatchNodes.ts +182 -0
  212. package/src/y/extensions/index.ts +156 -0
  213. package/src/y/index.ts +4 -0
  214. package/src/y/utils.test.ts +1042 -0
  215. package/src/y/utils.ts +242 -0
  216. package/src/y/versioning/__test__/fixtures/activity-all-after.bin +0 -0
  217. package/src/y/versioning/__test__/fixtures/activity-all-after.json +50 -0
  218. package/src/y/versioning/__test__/fixtures/activity-all.bin +0 -0
  219. package/src/y/versioning/__test__/fixtures/activity-all.json +20 -0
  220. package/src/y/versioning/__test__/fixtures/activity-filtered-after.bin +0 -0
  221. package/src/y/versioning/__test__/fixtures/activity-filtered-after.json +32 -0
  222. package/src/y/versioning/__test__/fixtures/activity-filtered-before.json +1 -0
  223. package/src/y/versioning/__test__/fixtures/changeset.bin +0 -0
  224. package/src/y/versioning/__test__/fixtures/patch-response.json +4 -0
  225. package/src/y/versioning/__test__/yhub.test.ts +752 -0
  226. package/src/y/versioning/index.ts +1 -0
  227. package/src/y/versioning/yhub.ts +631 -0
  228. package/src/yjs/README.md +5 -0
  229. package/src/yjs/comments/RESTYjsThreadStore.ts +166 -0
  230. package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.test.ts +3 -3
  231. package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.ts +7 -3
  232. package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStoreBase.ts +3 -3
  233. package/src/yjs/comments/index.ts +3 -0
  234. package/src/{comments/threadstore/yjs → yjs/comments}/yjsHelpers.ts +5 -1
  235. package/src/yjs/extensions/FixUpSchema.test.ts +421 -0
  236. package/src/yjs/extensions/FixUpSchema.ts +88 -0
  237. package/src/yjs/extensions/ForkYDoc.test.ts +216 -0
  238. package/src/{extensions/Collaboration → yjs/extensions}/ForkYDoc.ts +38 -57
  239. package/src/yjs/extensions/RelativePositionMapping.test.ts +418 -0
  240. package/src/yjs/extensions/RelativePositionMapping.ts +71 -0
  241. package/src/yjs/extensions/Versioning.test.ts +549 -0
  242. package/src/yjs/extensions/Versioning.ts +83 -0
  243. package/src/yjs/extensions/YCursorPlugin.ts +201 -0
  244. package/src/{extensions/Collaboration → yjs/extensions}/YSync.ts +1 -1
  245. package/src/yjs/extensions/index.ts +89 -0
  246. package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.test.ts +1 -1
  247. package/src/yjs/index.ts +2 -0
  248. package/src/yjs/utils.test.ts +5 -15
  249. package/src/yjs/utils.ts +36 -0
  250. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +3 -1
  251. package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
  252. package/types/src/api/getBlockInfoFromPos.d.ts +5 -9
  253. package/types/src/api/nodeConversions/nodeToBlock.d.ts +4 -6
  254. package/types/src/api/pmUtil.d.ts +12 -1
  255. package/types/src/blocks/Audio/block.d.ts +2 -2
  256. package/types/src/blocks/Code/block.d.ts +2 -2
  257. package/types/src/blocks/File/block.d.ts +2 -2
  258. package/types/src/blocks/Heading/block.d.ts +21 -21
  259. package/types/src/blocks/Image/block.d.ts +3 -3
  260. package/types/src/blocks/ListItem/CheckListItem/block.d.ts +6 -6
  261. package/types/src/blocks/ListItem/NumberedListItem/block.d.ts +6 -6
  262. package/types/src/blocks/Video/block.d.ts +3 -3
  263. package/types/src/blocks/defaultBlocks.d.ts +17 -17
  264. package/types/src/comments/extension.d.ts +18 -5
  265. package/types/src/comments/index.d.ts +0 -3
  266. package/types/src/comments/threadstore/ThreadStore.d.ts +4 -8
  267. package/types/src/comments/types.d.ts +0 -8
  268. package/types/src/editor/BlockNoteEditor.d.ts +8 -9
  269. package/types/src/editor/managers/BlockManager.d.ts +1 -1
  270. package/types/src/editor/managers/ExtensionManager/extensions.d.ts +2 -2
  271. package/types/src/editor/managers/ExtensionManager/index.d.ts +13 -0
  272. package/types/src/editor/managers/SelectionManager.d.ts +1 -1
  273. package/types/src/extensions/PositionMapping/PositionMapping.d.ts +4 -0
  274. package/types/src/extensions/TableHandles/TableHandles.d.ts +6 -6
  275. package/types/src/extensions/Versioning/Versioning.d.ts +352 -0
  276. package/types/src/extensions/Versioning/Versioning.test.d.ts +1 -0
  277. package/types/src/extensions/Versioning/inMemoryVersioning.d.ts +37 -0
  278. package/types/src/extensions/Versioning/inMemoryVersioning.test.d.ts +1 -0
  279. package/types/src/extensions/Versioning/index.d.ts +2 -0
  280. package/types/src/extensions/index.d.ts +6 -9
  281. package/types/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.d.ts +1 -0
  282. package/types/src/extensions/tiptap-extensions/UniqueID/UniqueID.d.ts +6 -1
  283. package/types/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.d.ts +4 -0
  284. package/types/src/extensions/tiptap-extensions/index.d.ts +1 -5
  285. package/types/src/i18n/locales/en.d.ts +9 -1
  286. package/types/src/i18n/locales/fa.d.ts +9 -1
  287. package/types/src/i18n/locales/sk.d.ts +9 -1
  288. package/types/src/index.d.ts +2 -0
  289. package/types/src/pm-nodes/suggestionMarks.d.ts +26 -0
  290. package/types/src/schema/blocks/createSpec.d.ts +4 -4
  291. package/types/src/schema/blocks/createSpec.test.d.ts +1 -0
  292. package/types/src/schema/blocks/extendBlockSpec.test.d.ts +1 -0
  293. package/types/src/schema/blocks/internal.d.ts +5 -7
  294. package/types/src/schema/blocks/types.d.ts +22 -14
  295. package/types/src/schema/contentTypePropagation.test.d.ts +1 -0
  296. package/types/src/schema/index.d.ts +1 -0
  297. package/types/src/schema/inlineContent/types.d.ts +3 -3
  298. package/types/src/schema/markGroups.d.ts +33 -0
  299. package/types/src/user/UserStore.d.ts +105 -0
  300. package/types/src/user/createUserStore.test.d.ts +1 -0
  301. package/types/src/user/index.d.ts +2 -0
  302. package/types/src/user/userColors.d.ts +36 -0
  303. package/types/src/y/comments/RESTYjsThreadStore.d.ts +77 -0
  304. package/types/src/y/comments/YjsThreadStore.d.ts +79 -0
  305. package/types/src/y/comments/YjsThreadStore.test.d.ts +1 -0
  306. package/types/src/y/comments/YjsThreadStoreBase.d.ts +15 -0
  307. package/types/src/y/comments/index.d.ts +3 -0
  308. package/types/src/y/comments/yjsHelpers.d.ts +13 -0
  309. package/types/src/y/extensions/AttributionExtension.d.ts +74 -0
  310. package/types/src/y/extensions/AttributionExtension.test.d.ts +1 -0
  311. package/types/src/y/extensions/DiffVersioningExtension.d.ts +69 -0
  312. package/types/src/y/extensions/DiffVersioningExtension.test.d.ts +1 -0
  313. package/types/src/{extensions/Collaboration → y/extensions}/ForkYDoc.d.ts +4 -2
  314. package/types/src/y/extensions/ForkYDoc.test.d.ts +1 -0
  315. package/types/src/y/extensions/RelativePositionMapping.d.ts +4 -0
  316. package/types/src/y/extensions/RelativePositionMapping.test.d.ts +1 -0
  317. package/types/src/y/extensions/Suggestions.d.ts +36 -0
  318. package/types/src/y/extensions/Versioning.d.ts +17 -0
  319. package/types/src/y/extensions/Versioning.test.d.ts +1 -0
  320. package/types/src/y/extensions/YAttributionMarks.d.ts +67 -0
  321. package/types/src/y/extensions/YCursorPlugin.d.ts +14 -0
  322. package/types/src/y/extensions/YSync.d.ts +32 -0
  323. package/types/src/y/extensions/blockMatchNodes.d.ts +25 -0
  324. package/types/src/y/extensions/index.d.ts +189 -0
  325. package/types/src/y/index.d.ts +4 -0
  326. package/types/src/y/utils.d.ts +82 -0
  327. package/types/src/y/utils.test.d.ts +1 -0
  328. package/types/src/y/versioning/__test__/yhub.test.d.ts +1 -0
  329. package/types/src/y/versioning/index.d.ts +1 -0
  330. package/types/src/y/versioning/yhub.d.ts +87 -0
  331. package/types/src/{comments/threadstore/yjs → yjs/comments}/RESTYjsThreadStore.d.ts +6 -10
  332. package/types/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.d.ts +3 -3
  333. package/types/src/yjs/comments/YjsThreadStore.test.d.ts +1 -0
  334. package/types/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStoreBase.d.ts +3 -3
  335. package/types/src/yjs/comments/index.d.ts +3 -0
  336. package/types/src/{comments/threadstore/yjs → yjs/comments}/yjsHelpers.d.ts +1 -1
  337. package/types/src/yjs/extensions/FixUpSchema.d.ts +3 -0
  338. package/types/src/yjs/extensions/FixUpSchema.test.d.ts +1 -0
  339. package/types/src/yjs/extensions/ForkYDoc.d.ts +27 -0
  340. package/types/src/yjs/extensions/ForkYDoc.test.d.ts +1 -0
  341. package/types/src/yjs/extensions/RelativePositionMapping.d.ts +4 -0
  342. package/types/src/yjs/extensions/RelativePositionMapping.test.d.ts +1 -0
  343. package/types/src/yjs/extensions/Versioning.d.ts +26 -0
  344. package/types/src/yjs/extensions/Versioning.test.d.ts +1 -0
  345. package/types/src/{extensions/Collaboration → yjs/extensions}/YCursorPlugin.d.ts +5 -2
  346. package/types/src/{extensions/Collaboration → yjs/extensions}/YSync.d.ts +1 -1
  347. package/types/src/{extensions/Collaboration/Collaboration.d.ts → yjs/extensions/index.d.ts} +36 -15
  348. package/types/src/yjs/extensions/schemaMigration/migrationRules/moveColorAttributes.test.d.ts +1 -0
  349. package/types/src/yjs/index.d.ts +2 -0
  350. package/types/src/yjs/utils.d.ts +5 -0
  351. package/dist/BlockNoteExtension-B6RhuQ3V.js +0 -27
  352. package/dist/BlockNoteExtension-B6RhuQ3V.js.map +0 -1
  353. package/dist/BlockNoteExtension-ab0REuob.cjs +0 -2
  354. package/dist/BlockNoteExtension-ab0REuob.cjs.map +0 -1
  355. package/dist/EventEmitter-CuPnGDYt.js +0 -22
  356. package/dist/EventEmitter-CuPnGDYt.js.map +0 -1
  357. package/dist/EventEmitter-DHdSnYCD.cjs +0 -2
  358. package/dist/EventEmitter-DHdSnYCD.cjs.map +0 -1
  359. package/dist/ShowSelection-BsHFfdMi.js +0 -29
  360. package/dist/ShowSelection-BsHFfdMi.js.map +0 -1
  361. package/dist/ShowSelection-DhXglbt8.cjs +0 -2
  362. package/dist/ShowSelection-DhXglbt8.cjs.map +0 -1
  363. package/dist/blocks-Bm6IfL1R.cjs +0 -11
  364. package/dist/blocks-Bm6IfL1R.cjs.map +0 -1
  365. package/dist/blocks-DGsP5WKr.js.map +0 -1
  366. package/dist/en-B9hMApn4.js.map +0 -1
  367. package/dist/en-Cj5r8sW_.cjs.map +0 -1
  368. package/dist/extensions-Co4y7P63.js.map +0 -1
  369. package/dist/extensions-IJK3t0sz.cjs +0 -52
  370. package/dist/extensions-IJK3t0sz.cjs.map +0 -1
  371. package/dist/src-B6rlChSc.cjs +0 -21
  372. package/dist/src-B6rlChSc.cjs.map +0 -1
  373. package/dist/src-Bcud0PIg.js.map +0 -1
  374. package/src/comments/userstore/UserStore.ts +0 -72
  375. package/src/extensions/Collaboration/Collaboration.ts +0 -55
  376. package/src/extensions/Collaboration/ForkYDoc.test.ts +0 -179
  377. package/src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.ts +0 -175
  378. package/types/src/comments/userstore/UserStore.d.ts +0 -31
  379. package/types/src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.d.ts +0 -4
  380. /package/src/{extensions/Collaboration → yjs/extensions}/YUndo.ts +0 -0
  381. /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-editor-forked.json +0 -0
  382. /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-editor.json +0 -0
  383. /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-forked.html +0 -0
  384. /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap.html +0 -0
  385. /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/SchemaMigration.ts +0 -0
  386. /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/index.ts +0 -0
  387. /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/migrationRule.ts +0 -0
  388. /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.ts +0 -0
  389. /package/types/src/{comments/threadstore/yjs/YjsThreadStore.test.d.ts → api/getBlockInfoFromPos.test.d.ts} +0 -0
  390. /package/types/src/{extensions/Collaboration/ForkYDoc.test.d.ts → api/nodeConversions/blockToNode.test.d.ts} +0 -0
  391. /package/types/src/{extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.d.ts → editor/managers/ExtensionManager/ExtensionManager.test.d.ts} +0 -0
  392. /package/types/src/{extensions/Collaboration → yjs/extensions}/YUndo.d.ts +0 -0
  393. /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/SchemaMigration.d.ts +0 -0
  394. /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/index.d.ts +0 -0
  395. /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/migrationRule.d.ts +0 -0
  396. /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ import { getExtensionField as e } from "@tiptap/core";
2
+ import { Store as t } from "@tanstack/store";
3
+ //#region src/schema/markGroups.ts
4
+ var n = "annotation";
5
+ function r(t) {
6
+ return t && t.options.extensions.some((t) => {
7
+ if (t.type !== "mark") return !1;
8
+ let n = e(t, "group");
9
+ return typeof n == "string" && n.split(" ").includes("annotation");
10
+ }) ? n : "";
11
+ }
12
+ //#endregion
13
+ //#region src/editor/managers/ExtensionManager/symbol.ts
14
+ var i = Symbol("originalFactory");
15
+ //#endregion
16
+ //#region src/editor/BlockNoteExtension.ts
17
+ function a(e) {
18
+ if (typeof e == "object" && "key" in e) return function t() {
19
+ return e[i] = t, e;
20
+ };
21
+ if (typeof e != "function") throw Error("factory must be a function");
22
+ return function t(n) {
23
+ return (r) => {
24
+ let a = e({
25
+ editor: r.editor,
26
+ options: n
27
+ });
28
+ return a[i] = t, a;
29
+ };
30
+ };
31
+ }
32
+ function o(e, n) {
33
+ return new t(e, n);
34
+ }
35
+ //#endregion
36
+ export { r as a, n as i, o as n, i as r, a as t };
37
+
38
+ //# sourceMappingURL=BlockNoteExtension-B_IEJHS8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockNoteExtension-B_IEJHS8.js","names":[],"sources":["../src/schema/markGroups.ts","../src/editor/managers/ExtensionManager/symbol.ts","../src/editor/BlockNoteExtension.ts"],"sourcesContent":["import { Editor, getExtensionField } from \"@tiptap/core\";\n\n/**\n * ProseMirror mark group for \"non-formatting\" marks: comments and the\n * suggestion/diff marks (the AI `insertion`/`deletion`/`modification` marks and\n * the Yjs `y-attributed-*` marks). These annotate content without representing\n * inline formatting and are ignored by BlockNote's content model\n * (`blocknoteIgnore`).\n *\n * They are the only marks allowed on `\"plain\"` blocks (e.g. code blocks), which\n * otherwise disallow all formatting marks. A block references this group rather\n * than the individual marks because each of them comes from an optional\n * extension (comments, AI suggestions, Yjs attribution) and so is only present\n * when that extension is configured.\n */\nexport const NON_FORMATTING_MARK_GROUP = \"annotation\";\n\n/**\n * The `marks` field value for `\"plain\"` blocks (e.g. code blocks), which hold\n * unstyled text and so disallow formatting marks but still allow the\n * non-formatting ones.\n *\n * Every mark in {@link NON_FORMATTING_MARK_GROUP} comes from an optional\n * extension, so a node spec that referenced the group unconditionally would make\n * ProseMirror throw \"Unknown mark type: 'annotation'\" while building the schema\n * of an editor that has none of them registered — an empty mark group is an\n * unknown reference just like a missing mark is. (This mirrors `suggestionMarks`\n * for the block-level suggestion group.)\n *\n * Returns the group name (which ProseMirror expands to every mark in it) when at\n * least one such mark is registered, or `\"\"` otherwise. Evaluated at\n * schema-build time, where the tiptap editor's fully-flattened extension list is\n * available on `this.editor`.\n */\nexport function nonFormattingMarks(editor: Editor | undefined): string {\n if (!editor) {\n return \"\";\n }\n const hasNonFormattingMark = editor.options.extensions.some((extension) => {\n if (extension.type !== \"mark\") {\n return false;\n }\n const group = getExtensionField(extension, \"group\") as string | undefined;\n return (\n typeof group === \"string\" &&\n group.split(\" \").includes(NON_FORMATTING_MARK_GROUP)\n );\n });\n return hasNonFormattingMark ? NON_FORMATTING_MARK_GROUP : \"\";\n}\n","/**\n * Symbol used to track the original factory function for extensions.\n * This allows us to retrieve the original factory for comparison and other operations.\n */\nexport const originalFactorySymbol = Symbol(\"originalFactory\");\n","import { Store, StoreOptions } from \"@tanstack/store\";\nimport { type AnyExtension } from \"@tiptap/core\";\nimport type { Plugin as ProsemirrorPlugin } from \"prosemirror-state\";\nimport type { PartialBlockNoDefaults } from \"../schema/index.js\";\nimport type { BlockNoteEditor } from \"./BlockNoteEditor.js\";\nimport { originalFactorySymbol } from \"./managers/ExtensionManager/symbol.js\";\n\n/**\n * This function is called when the extension is destroyed.\n */\ntype OnDestroy = () => void;\n\n/**\n * Describes a BlockNote extension.\n */\nexport interface Extension<State = any, Key extends string = string> {\n /**\n * The unique identifier for the extension.\n */\n readonly key: Key;\n\n /**\n * Triggered when the extension is mounted to the editor.\n */\n readonly mount?: (ctx: {\n /**\n * The DOM element that the editor is mounted to.\n */\n dom: HTMLElement;\n /**\n * The root document of the {@link document} that the editor is mounted to.\n */\n root: Document | ShadowRoot;\n /**\n * An {@link AbortSignal} that will be aborted when the extension is destroyed.\n */\n signal: AbortSignal;\n }) => void | OnDestroy;\n\n /**\n * The store for the extension.\n */\n readonly store?: Store<State>;\n\n /**\n * Declares what {@link Extension}s that this extension depends on.\n */\n readonly runsBefore?: ReadonlyArray<string>;\n\n /**\n * Input rules for a block: An input rule is what is used to replace text in a block when a regular expression match is found.\n * As an example, typing `#` in a paragraph block will trigger an input rule to replace the text with a heading block.\n */\n readonly inputRules?: ReadonlyArray<InputRule>;\n\n /**\n * A mapping of a keyboard shortcut to a function that will be called when the shortcut is pressed\n *\n * The keys are in the format:\n * - Key names may be strings like `Shift-Ctrl-Enter`—a key identifier prefixed with zero or more modifiers\n * - Key identifiers are based on the strings that can appear in KeyEvent.key\n * - Use lowercase letters to refer to letter keys (or uppercase letters if you want shift to be held)\n * - You may use `Space` as an alias for the \" \" name\n * - Modifiers can be given in any order: `Shift-` (or `s-`), `Alt-` (or `a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or `Meta-`)\n * - For characters that are created by holding shift, the Shift- prefix is implied, and should not be added explicitly\n * - You can use Mod- as a shorthand for Cmd- on Mac and Ctrl- on other platforms\n *\n * @example\n * ```typescript\n * keyboardShortcuts: {\n * \"Mod-Enter\": (ctx) => { return true; },\n * \"Shift-Ctrl-Space\": (ctx) => { return true; },\n * \"a\": (ctx) => { return true; },\n * \"Space\": (ctx) => { return true; }\n * }\n * ```\n */\n readonly keyboardShortcuts?: Record<\n string,\n (ctx: { editor: BlockNoteEditor<any, any, any> }) => boolean\n >;\n\n /**\n * Add additional prosemirror plugins to the editor.\n */\n readonly prosemirrorPlugins?: ReadonlyArray<ProsemirrorPlugin>;\n\n /**\n * Add additional tiptap extensions to the editor.\n */\n readonly tiptapExtensions?: ReadonlyArray<AnyExtension>;\n\n /**\n * Add additional BlockNote extensions to the editor.\n */\n readonly blockNoteExtensions?: ReadonlyArray<ExtensionFactoryInstance>;\n}\n\n/**\n * An input rule is what is used to replace text in a block when a regular expression match is found.\n * As an example, typing `#` in a paragraph block will trigger an input rule to replace the text with a heading block.\n */\ntype InputRule = {\n /**\n * The regex to match when to trigger the input rule\n */\n find: RegExp;\n /**\n * The function to call when the input rule is matched\n * @returns undefined if the input rule should not be triggered, or an object with the type and props to update the block\n */\n replace: (props: {\n /**\n * The result of the regex match\n */\n match: RegExpMatchArray;\n // TODO this will be a Point, when we have the Location API\n /**\n * The range of the text that was matched\n */\n range: { from: number; to: number };\n /**\n * The editor instance\n */\n editor: BlockNoteEditor<any, any, any>;\n }) => undefined | PartialBlockNoDefaults<any, any, any>;\n};\n\n/**\n * These are the arguments that are passed to an {@link ExtensionFactoryInstance}.\n */\nexport interface ExtensionOptions<\n Options extends Record<string, any> | undefined =\n | Record<string, any>\n | undefined,\n> {\n options: Options;\n editor: BlockNoteEditor<any, any, any>;\n}\n\n// a type that maps the extension key to the return type of the extension factory\nexport type ExtensionMap<T extends ReadonlyArray<ExtensionFactoryInstance>> = {\n [K in T[number] extends ExtensionFactoryInstance<infer Ext>\n ? Ext[\"key\"]\n : never]: T[number] extends ExtensionFactoryInstance<infer Ext>\n ? Ext\n : never;\n};\n\n/**\n * This is a type that represents the function which will actually create the extension.\n * It requires the editor instance to be passed in, but will already have the options applied automatically.\n *\n * @note Only the BlockNoteEditor should instantiate this function, not the user. Look at {@link createExtension} for user-facing functions.\n */\nexport type ExtensionFactoryInstance<\n Ext extends Extension<any, any> = Extension<any, any>,\n> = (ctx: Omit<ExtensionOptions<any>, \"options\">) => Ext;\n\n/**\n * This is the return type of the {@link createExtension} function.\n * It is a function that can be invoked with the extension's options to create a new extension factory.\n */\nexport type ExtensionFactory<\n State = any,\n Key extends string = string,\n Factory extends (ctx: any) => Extension<State, Key> = (\n ctx: ExtensionOptions<any>,\n ) => Extension<State, Key>,\n> =\n Parameters<Factory>[0] extends ExtensionOptions<infer Options>\n ? undefined extends Options\n ? (\n options?: Exclude<Options, undefined>,\n ) => ExtensionFactoryInstance<ReturnType<Factory>>\n : (options: Options) => ExtensionFactoryInstance<ReturnType<Factory>>\n : () => ExtensionFactoryInstance<ReturnType<Factory>>;\n\n/**\n * Constructs a BlockNote {@link ExtensionFactory} from a factory function or object\n */\n// This overload is for `createExtension({ key: \"test\", ... })`\nexport function createExtension<\n const State = any,\n const Key extends string = string,\n const Ext extends Extension<State, Key> = Extension<State, Key>,\n>(factory: Ext): ExtensionFactoryInstance<Ext>;\n// This overload is for `createExtension(({editor, options}) => ({ key: \"test\", ... }))`\nexport function createExtension<\n const State = any,\n const Options extends Record<string, any> | undefined = any,\n const Key extends string = string,\n const Factory extends (ctx: any) => Extension<State, Key> = (\n ctx: ExtensionOptions<Options>,\n ) => Extension<State, Key>,\n>(factory: Factory): ExtensionFactory<State, Key, Factory>;\n// This overload is for both of the above overloads as it is the implementation of the function\nexport function createExtension<\n const State = any,\n const Options extends Record<string, any> | undefined = any,\n const Key extends string = string,\n const Factory extends\n | Extension<State, Key>\n | ((ctx: any) => Extension<State, Key>) = (\n ctx: ExtensionOptions<Options>,\n ) => Extension<State, Key>,\n>(\n factory: Factory,\n): Factory extends Extension<State, Key>\n ? ExtensionFactoryInstance<Factory>\n : Factory extends (ctx: any) => Extension<State, Key>\n ? ExtensionFactory<State, Key, Factory>\n : never {\n if (typeof factory === \"object\" && \"key\" in factory) {\n return function factoryFn() {\n (factory as any)[originalFactorySymbol] = factoryFn;\n return factory;\n } as any;\n }\n\n if (typeof factory !== \"function\") {\n throw new Error(\"factory must be a function\");\n }\n\n return function factoryFn(options: Options) {\n return (ctx: { editor: BlockNoteEditor<any, any, any> }) => {\n const extension = factory({ editor: ctx.editor, options });\n // We stick a symbol onto the extension to allow us to retrieve the original factory for comparison later.\n // This enables us to do things like: `editor.getExtension(YSync).prosemirrorPlugins`\n (extension as any)[originalFactorySymbol] = factoryFn;\n return extension;\n };\n } as any;\n}\n\nexport function createStore<T = any>(\n initialState: T,\n options?: StoreOptions<T>,\n): Store<T> {\n return new Store(initialState, options);\n}\n"],"mappings":";;;AAeA,IAAa,IAA4B;AAmBzC,SAAgB,EAAmB,GAAoC;CAcrE,OAbK,KAGwB,EAAO,QAAQ,WAAW,MAAM,MAAc;EACzE,IAAI,EAAU,SAAS,QACrB,OAAO;EAET,IAAM,IAAQ,EAAkB,GAAW,OAAO;EAClD,OACE,OAAO,KAAU,YACjB,EAAM,MAAM,GAAG,EAAE,SAAA,YAAkC;CAEvD,CACO,IAAuB,IAA4B;AAC5D;;;AC7CA,IAAa,IAAwB,OAAO,iBAAiB;;;ACiM7D,SAAgB,EAUd,GAKU;CACV,IAAI,OAAO,KAAY,YAAY,SAAS,GAC1C,OAAO,SAAS,IAAY;EAE1B,OADA,EAAiB,KAAyB,GACnC;CACT;CAGF,IAAI,OAAO,KAAY,YACrB,MAAU,MAAM,4BAA4B;CAG9C,OAAO,SAAS,EAAU,GAAkB;EAC1C,QAAQ,MAAoD;GAC1D,IAAM,IAAY,EAAQ;IAAE,QAAQ,EAAI;IAAQ;GAAQ,CAAC;GAIzD,OADA,EAAmB,KAAyB,GACrC;EACT;CACF;AACF;AAEA,SAAgB,EACd,GACA,GACU;CACV,OAAO,IAAI,EAAM,GAAc,CAAO;AACxC"}
@@ -0,0 +1,2 @@
1
+ let e=require("@tiptap/core"),t=require("@tanstack/store");var n=`annotation`;function r(t){return t&&t.options.extensions.some(t=>{if(t.type!==`mark`)return!1;let n=(0,e.getExtensionField)(t,`group`);return typeof n==`string`&&n.split(` `).includes(`annotation`)})?n:``}var i=Symbol(`originalFactory`);function a(e){if(typeof e==`object`&&`key`in e)return function t(){return e[i]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let a=e({editor:r.editor,options:n});return a[i]=t,a}}}function o(e,n){return new t.Store(e,n)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=BlockNoteExtension-M0znTzxP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockNoteExtension-M0znTzxP.cjs","names":[],"sources":["../src/schema/markGroups.ts","../src/editor/managers/ExtensionManager/symbol.ts","../src/editor/BlockNoteExtension.ts"],"sourcesContent":["import { Editor, getExtensionField } from \"@tiptap/core\";\n\n/**\n * ProseMirror mark group for \"non-formatting\" marks: comments and the\n * suggestion/diff marks (the AI `insertion`/`deletion`/`modification` marks and\n * the Yjs `y-attributed-*` marks). These annotate content without representing\n * inline formatting and are ignored by BlockNote's content model\n * (`blocknoteIgnore`).\n *\n * They are the only marks allowed on `\"plain\"` blocks (e.g. code blocks), which\n * otherwise disallow all formatting marks. A block references this group rather\n * than the individual marks because each of them comes from an optional\n * extension (comments, AI suggestions, Yjs attribution) and so is only present\n * when that extension is configured.\n */\nexport const NON_FORMATTING_MARK_GROUP = \"annotation\";\n\n/**\n * The `marks` field value for `\"plain\"` blocks (e.g. code blocks), which hold\n * unstyled text and so disallow formatting marks but still allow the\n * non-formatting ones.\n *\n * Every mark in {@link NON_FORMATTING_MARK_GROUP} comes from an optional\n * extension, so a node spec that referenced the group unconditionally would make\n * ProseMirror throw \"Unknown mark type: 'annotation'\" while building the schema\n * of an editor that has none of them registered — an empty mark group is an\n * unknown reference just like a missing mark is. (This mirrors `suggestionMarks`\n * for the block-level suggestion group.)\n *\n * Returns the group name (which ProseMirror expands to every mark in it) when at\n * least one such mark is registered, or `\"\"` otherwise. Evaluated at\n * schema-build time, where the tiptap editor's fully-flattened extension list is\n * available on `this.editor`.\n */\nexport function nonFormattingMarks(editor: Editor | undefined): string {\n if (!editor) {\n return \"\";\n }\n const hasNonFormattingMark = editor.options.extensions.some((extension) => {\n if (extension.type !== \"mark\") {\n return false;\n }\n const group = getExtensionField(extension, \"group\") as string | undefined;\n return (\n typeof group === \"string\" &&\n group.split(\" \").includes(NON_FORMATTING_MARK_GROUP)\n );\n });\n return hasNonFormattingMark ? NON_FORMATTING_MARK_GROUP : \"\";\n}\n","/**\n * Symbol used to track the original factory function for extensions.\n * This allows us to retrieve the original factory for comparison and other operations.\n */\nexport const originalFactorySymbol = Symbol(\"originalFactory\");\n","import { Store, StoreOptions } from \"@tanstack/store\";\nimport { type AnyExtension } from \"@tiptap/core\";\nimport type { Plugin as ProsemirrorPlugin } from \"prosemirror-state\";\nimport type { PartialBlockNoDefaults } from \"../schema/index.js\";\nimport type { BlockNoteEditor } from \"./BlockNoteEditor.js\";\nimport { originalFactorySymbol } from \"./managers/ExtensionManager/symbol.js\";\n\n/**\n * This function is called when the extension is destroyed.\n */\ntype OnDestroy = () => void;\n\n/**\n * Describes a BlockNote extension.\n */\nexport interface Extension<State = any, Key extends string = string> {\n /**\n * The unique identifier for the extension.\n */\n readonly key: Key;\n\n /**\n * Triggered when the extension is mounted to the editor.\n */\n readonly mount?: (ctx: {\n /**\n * The DOM element that the editor is mounted to.\n */\n dom: HTMLElement;\n /**\n * The root document of the {@link document} that the editor is mounted to.\n */\n root: Document | ShadowRoot;\n /**\n * An {@link AbortSignal} that will be aborted when the extension is destroyed.\n */\n signal: AbortSignal;\n }) => void | OnDestroy;\n\n /**\n * The store for the extension.\n */\n readonly store?: Store<State>;\n\n /**\n * Declares what {@link Extension}s that this extension depends on.\n */\n readonly runsBefore?: ReadonlyArray<string>;\n\n /**\n * Input rules for a block: An input rule is what is used to replace text in a block when a regular expression match is found.\n * As an example, typing `#` in a paragraph block will trigger an input rule to replace the text with a heading block.\n */\n readonly inputRules?: ReadonlyArray<InputRule>;\n\n /**\n * A mapping of a keyboard shortcut to a function that will be called when the shortcut is pressed\n *\n * The keys are in the format:\n * - Key names may be strings like `Shift-Ctrl-Enter`—a key identifier prefixed with zero or more modifiers\n * - Key identifiers are based on the strings that can appear in KeyEvent.key\n * - Use lowercase letters to refer to letter keys (or uppercase letters if you want shift to be held)\n * - You may use `Space` as an alias for the \" \" name\n * - Modifiers can be given in any order: `Shift-` (or `s-`), `Alt-` (or `a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or `Meta-`)\n * - For characters that are created by holding shift, the Shift- prefix is implied, and should not be added explicitly\n * - You can use Mod- as a shorthand for Cmd- on Mac and Ctrl- on other platforms\n *\n * @example\n * ```typescript\n * keyboardShortcuts: {\n * \"Mod-Enter\": (ctx) => { return true; },\n * \"Shift-Ctrl-Space\": (ctx) => { return true; },\n * \"a\": (ctx) => { return true; },\n * \"Space\": (ctx) => { return true; }\n * }\n * ```\n */\n readonly keyboardShortcuts?: Record<\n string,\n (ctx: { editor: BlockNoteEditor<any, any, any> }) => boolean\n >;\n\n /**\n * Add additional prosemirror plugins to the editor.\n */\n readonly prosemirrorPlugins?: ReadonlyArray<ProsemirrorPlugin>;\n\n /**\n * Add additional tiptap extensions to the editor.\n */\n readonly tiptapExtensions?: ReadonlyArray<AnyExtension>;\n\n /**\n * Add additional BlockNote extensions to the editor.\n */\n readonly blockNoteExtensions?: ReadonlyArray<ExtensionFactoryInstance>;\n}\n\n/**\n * An input rule is what is used to replace text in a block when a regular expression match is found.\n * As an example, typing `#` in a paragraph block will trigger an input rule to replace the text with a heading block.\n */\ntype InputRule = {\n /**\n * The regex to match when to trigger the input rule\n */\n find: RegExp;\n /**\n * The function to call when the input rule is matched\n * @returns undefined if the input rule should not be triggered, or an object with the type and props to update the block\n */\n replace: (props: {\n /**\n * The result of the regex match\n */\n match: RegExpMatchArray;\n // TODO this will be a Point, when we have the Location API\n /**\n * The range of the text that was matched\n */\n range: { from: number; to: number };\n /**\n * The editor instance\n */\n editor: BlockNoteEditor<any, any, any>;\n }) => undefined | PartialBlockNoDefaults<any, any, any>;\n};\n\n/**\n * These are the arguments that are passed to an {@link ExtensionFactoryInstance}.\n */\nexport interface ExtensionOptions<\n Options extends Record<string, any> | undefined =\n | Record<string, any>\n | undefined,\n> {\n options: Options;\n editor: BlockNoteEditor<any, any, any>;\n}\n\n// a type that maps the extension key to the return type of the extension factory\nexport type ExtensionMap<T extends ReadonlyArray<ExtensionFactoryInstance>> = {\n [K in T[number] extends ExtensionFactoryInstance<infer Ext>\n ? Ext[\"key\"]\n : never]: T[number] extends ExtensionFactoryInstance<infer Ext>\n ? Ext\n : never;\n};\n\n/**\n * This is a type that represents the function which will actually create the extension.\n * It requires the editor instance to be passed in, but will already have the options applied automatically.\n *\n * @note Only the BlockNoteEditor should instantiate this function, not the user. Look at {@link createExtension} for user-facing functions.\n */\nexport type ExtensionFactoryInstance<\n Ext extends Extension<any, any> = Extension<any, any>,\n> = (ctx: Omit<ExtensionOptions<any>, \"options\">) => Ext;\n\n/**\n * This is the return type of the {@link createExtension} function.\n * It is a function that can be invoked with the extension's options to create a new extension factory.\n */\nexport type ExtensionFactory<\n State = any,\n Key extends string = string,\n Factory extends (ctx: any) => Extension<State, Key> = (\n ctx: ExtensionOptions<any>,\n ) => Extension<State, Key>,\n> =\n Parameters<Factory>[0] extends ExtensionOptions<infer Options>\n ? undefined extends Options\n ? (\n options?: Exclude<Options, undefined>,\n ) => ExtensionFactoryInstance<ReturnType<Factory>>\n : (options: Options) => ExtensionFactoryInstance<ReturnType<Factory>>\n : () => ExtensionFactoryInstance<ReturnType<Factory>>;\n\n/**\n * Constructs a BlockNote {@link ExtensionFactory} from a factory function or object\n */\n// This overload is for `createExtension({ key: \"test\", ... })`\nexport function createExtension<\n const State = any,\n const Key extends string = string,\n const Ext extends Extension<State, Key> = Extension<State, Key>,\n>(factory: Ext): ExtensionFactoryInstance<Ext>;\n// This overload is for `createExtension(({editor, options}) => ({ key: \"test\", ... }))`\nexport function createExtension<\n const State = any,\n const Options extends Record<string, any> | undefined = any,\n const Key extends string = string,\n const Factory extends (ctx: any) => Extension<State, Key> = (\n ctx: ExtensionOptions<Options>,\n ) => Extension<State, Key>,\n>(factory: Factory): ExtensionFactory<State, Key, Factory>;\n// This overload is for both of the above overloads as it is the implementation of the function\nexport function createExtension<\n const State = any,\n const Options extends Record<string, any> | undefined = any,\n const Key extends string = string,\n const Factory extends\n | Extension<State, Key>\n | ((ctx: any) => Extension<State, Key>) = (\n ctx: ExtensionOptions<Options>,\n ) => Extension<State, Key>,\n>(\n factory: Factory,\n): Factory extends Extension<State, Key>\n ? ExtensionFactoryInstance<Factory>\n : Factory extends (ctx: any) => Extension<State, Key>\n ? ExtensionFactory<State, Key, Factory>\n : never {\n if (typeof factory === \"object\" && \"key\" in factory) {\n return function factoryFn() {\n (factory as any)[originalFactorySymbol] = factoryFn;\n return factory;\n } as any;\n }\n\n if (typeof factory !== \"function\") {\n throw new Error(\"factory must be a function\");\n }\n\n return function factoryFn(options: Options) {\n return (ctx: { editor: BlockNoteEditor<any, any, any> }) => {\n const extension = factory({ editor: ctx.editor, options });\n // We stick a symbol onto the extension to allow us to retrieve the original factory for comparison later.\n // This enables us to do things like: `editor.getExtension(YSync).prosemirrorPlugins`\n (extension as any)[originalFactorySymbol] = factoryFn;\n return extension;\n };\n } as any;\n}\n\nexport function createStore<T = any>(\n initialState: T,\n options?: StoreOptions<T>,\n): Store<T> {\n return new Store(initialState, options);\n}\n"],"mappings":"2DAeA,IAAa,EAA4B,aAmBzC,SAAgB,EAAmB,EAAoC,CAcrE,OAbK,GAGwB,EAAO,QAAQ,WAAW,KAAM,GAAc,CACzE,GAAI,EAAU,OAAS,OACrB,MAAO,GAET,IAAM,GAAA,EAAA,EAAA,mBAA0B,EAAW,OAAO,EAClD,OACE,OAAO,GAAU,UACjB,EAAM,MAAM,GAAG,EAAE,SAAA,YAAkC,CAEvD,CACO,EAAuB,EAA4B,EAC5D,CC7CA,IAAa,EAAwB,OAAO,iBAAiB,ECiM7D,SAAgB,EAUd,EAKU,CACV,GAAI,OAAO,GAAY,UAAY,QAAS,EAC1C,OAAO,SAAS,GAAY,CAE1B,MADA,GAAiB,GAAyB,EACnC,CACT,EAGF,GAAI,OAAO,GAAY,WACrB,MAAU,MAAM,4BAA4B,EAG9C,OAAO,SAAS,EAAU,EAAkB,CAC1C,MAAQ,IAAoD,CAC1D,IAAM,EAAY,EAAQ,CAAE,OAAQ,EAAI,OAAQ,SAAQ,CAAC,EAIzD,MADA,GAAmB,GAAyB,EACrC,CACT,CACF,CACF,CAEA,SAAgB,EACd,EACA,EACU,CACV,OAAO,IAAI,EAAA,MAAM,EAAc,CAAO,CACxC"}
@@ -0,0 +1,2 @@
1
+ var e=class{auth;constructor(e){this.auth=e}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
2
+ //# sourceMappingURL=ThreadStore-Bx-gSEh1.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadStore-Bx-gSEh1.cjs","names":[],"sources":["../src/comments/threadstore/ThreadStore.ts"],"sourcesContent":["import { BlockNoteEditor } from \"../../editor/BlockNoteEditor.js\";\nimport { CommentBody, CommentData, ThreadData } from \"../types.js\";\nimport { ThreadStoreAuth } from \"./ThreadStoreAuth.js\";\n\n/**\n * ThreadStore is an abstract class that defines the interface\n * to read / add / update / delete threads and comments.\n */\nexport abstract class ThreadStore {\n public readonly auth: ThreadStoreAuth;\n\n constructor(auth: ThreadStoreAuth) {\n this.auth = auth;\n }\n\n /**\n * A \"thread\" in the ThreadStore only contains information about the content\n * of the thread / comments. It does not contain information about the position.\n *\n * This function can be implemented to store the thread in the document (by creating a mark)\n * If not implemented, default behavior will apply (creating the mark via TipTap)\n * See CommentsPlugin.ts for more details.\n */\n abstract addThreadToDocument?(options: {\n threadId: string;\n selection: {\n head: number;\n anchor: number;\n };\n editor: BlockNoteEditor<any, any, any>;\n }): Promise<void>;\n\n /**\n * Creates a new thread with an initial comment.\n */\n abstract createThread(options: {\n initialComment: {\n body: CommentBody;\n metadata?: any;\n };\n metadata?: any;\n }): Promise<ThreadData>;\n\n /**\n * Adds a comment to a thread.\n */\n abstract addComment(options: {\n comment: {\n body: CommentBody;\n metadata?: any;\n };\n threadId: string;\n }): Promise<CommentData>;\n\n /**\n * Updates a comment in a thread.\n */\n abstract updateComment(options: {\n comment: {\n body: CommentBody;\n metadata?: any;\n };\n threadId: string;\n commentId: string;\n }): Promise<void>;\n\n /**\n * Deletes a comment from a thread.\n */\n abstract deleteComment(options: {\n threadId: string;\n commentId: string;\n }): Promise<void>;\n\n /**\n * Deletes a thread.\n */\n abstract deleteThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Marks a thread as resolved.\n */\n abstract resolveThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Marks a thread as unresolved.\n */\n abstract unresolveThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Adds a reaction to a comment.\n *\n * Auth: should be possible by anyone with comment access\n */\n abstract addReaction(options: {\n threadId: string;\n commentId: string;\n emoji: string;\n }): Promise<void>;\n\n /**\n * Deletes a reaction from a comment.\n *\n * Auth: should be possible by the reaction author\n */\n abstract deleteReaction(options: {\n threadId: string;\n commentId: string;\n emoji: string;\n }): Promise<void>;\n\n /**\n * Retrieve data for a specific thread.\n */\n abstract getThread(threadId: string): ThreadData;\n\n /**\n * Retrieve all threads.\n */\n abstract getThreads(): Map<string, ThreadData>;\n\n /**\n * Subscribe to changes in the thread store.\n *\n * @returns a function to unsubscribe from the thread store\n */\n abstract subscribe(\n cb: (threads: Map<string, ThreadData>) => void,\n ): () => void;\n}\n"],"mappings":"AAQA,IAAsB,EAAtB,KAAkC,CAChC,KAEA,YAAY,EAAuB,CACjC,KAAK,KAAO,CACd,CAoHF"}
@@ -0,0 +1,11 @@
1
+ //#region src/comments/threadstore/ThreadStore.ts
2
+ var e = class {
3
+ auth;
4
+ constructor(e) {
5
+ this.auth = e;
6
+ }
7
+ };
8
+ //#endregion
9
+ export { e as t };
10
+
11
+ //# sourceMappingURL=ThreadStore-et9wB5Xt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadStore-et9wB5Xt.js","names":[],"sources":["../src/comments/threadstore/ThreadStore.ts"],"sourcesContent":["import { BlockNoteEditor } from \"../../editor/BlockNoteEditor.js\";\nimport { CommentBody, CommentData, ThreadData } from \"../types.js\";\nimport { ThreadStoreAuth } from \"./ThreadStoreAuth.js\";\n\n/**\n * ThreadStore is an abstract class that defines the interface\n * to read / add / update / delete threads and comments.\n */\nexport abstract class ThreadStore {\n public readonly auth: ThreadStoreAuth;\n\n constructor(auth: ThreadStoreAuth) {\n this.auth = auth;\n }\n\n /**\n * A \"thread\" in the ThreadStore only contains information about the content\n * of the thread / comments. It does not contain information about the position.\n *\n * This function can be implemented to store the thread in the document (by creating a mark)\n * If not implemented, default behavior will apply (creating the mark via TipTap)\n * See CommentsPlugin.ts for more details.\n */\n abstract addThreadToDocument?(options: {\n threadId: string;\n selection: {\n head: number;\n anchor: number;\n };\n editor: BlockNoteEditor<any, any, any>;\n }): Promise<void>;\n\n /**\n * Creates a new thread with an initial comment.\n */\n abstract createThread(options: {\n initialComment: {\n body: CommentBody;\n metadata?: any;\n };\n metadata?: any;\n }): Promise<ThreadData>;\n\n /**\n * Adds a comment to a thread.\n */\n abstract addComment(options: {\n comment: {\n body: CommentBody;\n metadata?: any;\n };\n threadId: string;\n }): Promise<CommentData>;\n\n /**\n * Updates a comment in a thread.\n */\n abstract updateComment(options: {\n comment: {\n body: CommentBody;\n metadata?: any;\n };\n threadId: string;\n commentId: string;\n }): Promise<void>;\n\n /**\n * Deletes a comment from a thread.\n */\n abstract deleteComment(options: {\n threadId: string;\n commentId: string;\n }): Promise<void>;\n\n /**\n * Deletes a thread.\n */\n abstract deleteThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Marks a thread as resolved.\n */\n abstract resolveThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Marks a thread as unresolved.\n */\n abstract unresolveThread(options: { threadId: string }): Promise<void>;\n\n /**\n * Adds a reaction to a comment.\n *\n * Auth: should be possible by anyone with comment access\n */\n abstract addReaction(options: {\n threadId: string;\n commentId: string;\n emoji: string;\n }): Promise<void>;\n\n /**\n * Deletes a reaction from a comment.\n *\n * Auth: should be possible by the reaction author\n */\n abstract deleteReaction(options: {\n threadId: string;\n commentId: string;\n emoji: string;\n }): Promise<void>;\n\n /**\n * Retrieve data for a specific thread.\n */\n abstract getThread(threadId: string): ThreadData;\n\n /**\n * Retrieve all threads.\n */\n abstract getThreads(): Map<string, ThreadData>;\n\n /**\n * Subscribe to changes in the thread store.\n *\n * @returns a function to unsubscribe from the thread store\n */\n abstract subscribe(\n cb: (threads: Map<string, ThreadData>) => void,\n ): () => void;\n}\n"],"mappings":";AAQA,IAAsB,IAAtB,MAAkC;CAChC;CAEA,YAAY,GAAuB;EACjC,KAAK,OAAO;CACd;AAoHF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./BlockNoteExtension-M0znTzxP.cjs");let t=require("prosemirror-state"),n=require("prosemirror-view");var r=new t.PluginKey(`blocknote-show-selection`),i=e.t(({editor:i})=>{let a=e.n({enabledSet:new Set},{onUpdate(){i.transact(e=>e.setMeta(r,{}))}});return{key:`showSelection`,store:a,prosemirrorPlugins:[new t.Plugin({key:r,props:{decorations:e=>{let{doc:t,selection:r}=e;if(a.state.enabledSet.size===0)return n.DecorationSet.empty;let i=n.Decoration.inline(r.from,r.to,{"data-show-selection":`true`});return n.DecorationSet.create(t,[i])}}})],showSelection(e,t){a.setState({enabledSet:e?new Set([...a.state.enabledSet,t]):new Set([...a.state.enabledSet].filter(e=>e!==t))})}}});function a(t){if(!t)throw Error(`resolveUsers is required to create a user store`);let n=e.n(new Map),r=new Set,i={store:n,async loadUsers(e){await a(e.filter(e=>!n.state.has(e)&&!r.has(e)))},async refetchUsers(e){await a(e.filter(e=>!r.has(e)))},getUser(e){return n.state.get(e)},setUser(e){let t=Array.isArray(e)?e:[e];n.setState(e=>{let n=new Map(e);for(let e of t)n.set(e.id,e);return n})}};async function a(e){if(e.length!==0){for(let t of e)r.add(t);try{let r=await t(e,i);r.length>0&&n.setState(e=>{let t=new Map(e);for(let e of r)t.set(e.id,e);return t})}finally{for(let t of e)r.delete(t)}}}return i}function o(e){return typeof e==`function`?a(e):e??a(async()=>[])}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=UserStore-DCG6lsla.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserStore-DCG6lsla.cjs","names":[],"sources":["../src/extensions/ShowSelection/ShowSelection.ts","../src/user/UserStore.ts"],"sourcesContent":["import { Plugin, PluginKey } from \"prosemirror-state\";\nimport { Decoration, DecorationSet } from \"prosemirror-view\";\nimport {\n createExtension,\n createStore,\n} from \"../../editor/BlockNoteExtension.js\";\n\nconst PLUGIN_KEY = new PluginKey(`blocknote-show-selection`);\n\n/**\n * Plugin that shows adds a decoration around the current selection\n * This can be used to highlight the current selection in the UI even when the\n * text editor is not focused.\n */\nexport const ShowSelectionExtension = createExtension(({ editor }) => {\n const store = createStore(\n { enabledSet: new Set<string>() },\n {\n onUpdate() {\n editor.transact((tr) => tr.setMeta(PLUGIN_KEY, {}));\n },\n },\n );\n return {\n key: \"showSelection\",\n store,\n prosemirrorPlugins: [\n new Plugin({\n key: PLUGIN_KEY,\n props: {\n decorations: (state) => {\n const { doc, selection } = state;\n if (store.state.enabledSet.size === 0) {\n return DecorationSet.empty;\n }\n const dec = Decoration.inline(selection.from, selection.to, {\n \"data-show-selection\": \"true\",\n });\n return DecorationSet.create(doc, [dec]);\n },\n },\n }),\n ],\n /**\n * Show or hide the selection decoration\n *\n * @param shouldShow - Whether to show the selection decoration\n * @param key - The key of the selection to show or hide,\n * this is necessary to prevent disabling ShowSelection from one place\n * will interfere with other parts of the code that need to show the selection decoration\n * (e.g.: CreateLinkButton and AIExtension)\n */\n showSelection(shouldShow: boolean, key: string) {\n store.setState({\n enabledSet: shouldShow\n ? new Set([...store.state.enabledSet, key])\n : new Set([...store.state.enabledSet].filter((k) => k !== key)),\n });\n },\n } as const;\n});\n","import { Store } from \"@tanstack/store\";\nimport { createStore } from \"../editor/BlockNoteExtension.js\";\n\n/**\n * A collaborator of the document.\n */\nexport type User = {\n /**\n * The {@link User}'s unique identifier\n */\n id: string;\n /**\n * The {@link User}'s name/label\n */\n username: string;\n /**\n * The {@link User}'s profile image\n */\n avatarUrl: string;\n /**\n * The color used to represent the user (e.g. for collaboration cursors).\n */\n color?: string;\n /**\n * A lighter variant of {@link color}.\n */\n colorLight?: string;\n};\n\n/**\n * A store that retrieves and caches information about users, generic over the\n * resolved user type `U`.\n *\n * Created via {@link createUserStore}. Features that need to resolve user ids to\n * user information (comments, suggestions, versions) build one internally and\n * expose it on their extension instance so their UI can read from it.\n */\nexport type UserStore<U extends User = User> = {\n /**\n * A store mapping user ids to the resolved {@link User} information.\n */\n store: Store<Map<User[\"id\"], U>>;\n /**\n * Load information about users based on an array of user ids.\n *\n * Users that are already cached or currently being loaded are skipped, so\n * it is safe to call this often (e.g. on every render).\n */\n loadUsers: (userIds: User[\"id\"][]) => Promise<void>;\n /**\n * Re-fetch information about users, ignoring the cache. Users that are\n * currently being loaded are still skipped to avoid duplicate requests.\n */\n refetchUsers: (userIds: User[\"id\"][]) => Promise<void>;\n /**\n * Retrieve information about a user based on their id, if cached.\n *\n * The user has to be loaded via `loadUsers` first.\n */\n getUser: (userId: User[\"id\"]) => U | undefined;\n /**\n * Manually set information about a user. This is useful if you have a\n * resolver that returns partial information (e.g. just the username) and you\n * want to fill in the rest later (e.g. avatarUrl).\n */\n setUser: (user: U | U[]) => void;\n};\n\nexport type UserStoreResolver<U extends User = User> = (\n /**\n * The user ids to resolve. The resolver should return information for all of\n * these users, or an empty array if none could be resolved.\n */\n userIds: User[\"id\"][],\n /**\n * The {@link UserStore} that is calling this resolver. This allows you to return a user synchronously, and update the store later if you need to fetch additional information asynchronously.\n */\n store: UserStore<any>,\n) => Promise<U[]>;\n\n/**\n * A resolver callback or an already-built {@link UserStore} — the shape that\n * user-facing options (comments, collaboration) accept so callers can either let\n * the extension build a store or pass a shared one.\n */\nexport type UserStoreOrResolver<U extends User = User> =\n | ((userIds: User[\"id\"][], store: UserStore<any>) => Promise<U[]>)\n | UserStore<any>;\n\n/**\n * Creates a {@link UserStore} that retrieves and caches information about users.\n *\n * It does this by calling `resolveUsers` for users that are not yet cached, and\n * stores the results in a BlockNote store so they can be subscribed to (e.g. via\n * `useStore` in React).\n *\n * `resolveUsers` is called with the ids of users that are not yet cached, and\n * should return the information for those users. The type of the returned users\n * is inferred and flows through to {@link UserStore.getUser} and the store, so\n * you can return a type with additional properties and have them be reported\n * back.\n *\n * See [Comments](https://www.blocknotejs.org/docs/features/collaboration/comments) for more info.\n */\nexport function createUserStore<U extends User = User>(\n resolveUsers: (userIds: User[\"id\"][], store: UserStore<any>) => Promise<U[]>,\n): UserStore<U> {\n if (!resolveUsers) {\n throw new Error(\"resolveUsers is required to create a user store\");\n }\n\n const store = createStore(new Map<User[\"id\"], U>());\n\n // Tracks users that are currently being fetched, to avoid duplicate\n // in-flight requests. This is intentionally kept out of the store as it is\n // not state that consumers need to subscribe to.\n const loadingUsers = new Set<User[\"id\"]>();\n\n const userStore: UserStore<U> = {\n store,\n async loadUsers(userIds) {\n const missingUsers = userIds.filter(\n (id) => !store.state.has(id) && !loadingUsers.has(id),\n );\n await fetchUsers(missingUsers);\n },\n async refetchUsers(userIds) {\n const usersToFetch = userIds.filter((id) => !loadingUsers.has(id));\n await fetchUsers(usersToFetch);\n },\n getUser(userId) {\n return store.state.get(userId);\n },\n setUser(users) {\n const usersArray = Array.isArray(users) ? users : [users];\n store.setState((prevState) => {\n const nextState = new Map(prevState);\n for (const user of usersArray) {\n nextState.set(user.id, user);\n }\n return nextState;\n });\n },\n };\n\n async function fetchUsers(userIds: User[\"id\"][]) {\n if (userIds.length === 0) {\n return;\n }\n\n for (const id of userIds) {\n loadingUsers.add(id);\n }\n\n try {\n const users = await resolveUsers(userIds, userStore);\n // Only update the store if any users were actually resolved. Emitting\n // an update when nothing changed (e.g. when the resolver can't find a\n // user) would needlessly notify subscribers and, combined with a\n // subscriber that re-triggers loading, could cause an infinite loop.\n // See https://github.com/TypeCellOS/BlockNote/issues/1548\n if (users.length > 0) {\n store.setState((prevState) => {\n const nextState = new Map(prevState);\n for (const user of users) {\n nextState.set(user.id, user);\n }\n return nextState;\n });\n }\n } finally {\n for (const id of userIds) {\n // Remove the users from the loading set. On a next call to `loadUsers`\n // we will either return the cached user, or retry loading the user if\n // the request failed.\n loadingUsers.delete(id);\n }\n }\n }\n\n return userStore;\n}\n\n/**\n * Normalize a {@link UserStoreOrResolver} to a {@link UserStore}:\n * - an existing store is returned as-is (so a single de-duped cache can be\n * shared across extensions),\n * - a resolver function is wrapped with {@link createUserStore},\n * - `undefined` yields an empty store that resolves nothing (consumers then fall\n * back to showing raw user ids).\n */\nexport function normalizeToUserStore<U extends User = User>(\n resolveUsersOrStore?: UserStoreOrResolver<U>,\n): UserStore<U> {\n if (typeof resolveUsersOrStore === \"function\") {\n return createUserStore(resolveUsersOrStore);\n }\n return resolveUsersOrStore ?? createUserStore<U>(async () => []);\n}\n"],"mappings":"sHAOA,IAAM,EAAa,IAAI,EAAA,UAAU,0BAA0B,EAO9C,EAAyB,EAAA,GAAiB,CAAE,YAAa,CACpE,IAAM,EAAQ,EAAA,EACZ,CAAE,WAAY,IAAI,GAAc,EAChC,CACE,UAAW,CACT,EAAO,SAAU,GAAO,EAAG,QAAQ,EAAY,CAAC,CAAC,CAAC,CACpD,CACF,CACF,EACA,MAAO,CACL,IAAK,gBACL,QACA,mBAAoB,CAClB,IAAI,EAAA,OAAO,CACT,IAAK,EACL,MAAO,CACL,YAAc,GAAU,CACtB,GAAM,CAAE,MAAK,aAAc,EAC3B,GAAI,EAAM,MAAM,WAAW,OAAS,EAClC,OAAO,EAAA,cAAc,MAEvB,IAAM,EAAM,EAAA,WAAW,OAAO,EAAU,KAAM,EAAU,GAAI,CAC1D,sBAAuB,MACzB,CAAC,EACD,OAAO,EAAA,cAAc,OAAO,EAAK,CAAC,CAAG,CAAC,CACxC,CACF,CACF,CAAC,CACH,EAUA,cAAc,EAAqB,EAAa,CAC9C,EAAM,SAAS,CACb,WAAY,EACR,IAAI,IAAI,CAAC,GAAG,EAAM,MAAM,WAAY,CAAG,CAAC,EACxC,IAAI,IAAI,CAAC,GAAG,EAAM,MAAM,UAAU,EAAE,OAAQ,GAAM,IAAM,CAAG,CAAC,CAClE,CAAC,CACH,CACF,CACF,CAAC,EC4CD,SAAgB,EACd,EACc,CACd,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,EAGnE,IAAM,EAAQ,EAAA,EAAY,IAAI,GAAoB,EAK5C,EAAe,IAAI,IAEnB,EAA0B,CAC9B,QACA,MAAM,UAAU,EAAS,CAIvB,MAAM,EAHe,EAAQ,OAC1B,GAAO,CAAC,EAAM,MAAM,IAAI,CAAE,GAAK,CAAC,EAAa,IAAI,CAAE,CAErC,CAAY,CAC/B,EACA,MAAM,aAAa,EAAS,CAE1B,MAAM,EADe,EAAQ,OAAQ,GAAO,CAAC,EAAa,IAAI,CAAE,CAC/C,CAAY,CAC/B,EACA,QAAQ,EAAQ,CACd,OAAO,EAAM,MAAM,IAAI,CAAM,CAC/B,EACA,QAAQ,EAAO,CACb,IAAM,EAAa,MAAM,QAAQ,CAAK,EAAI,EAAQ,CAAC,CAAK,EACxD,EAAM,SAAU,GAAc,CAC5B,IAAM,EAAY,IAAI,IAAI,CAAS,EACnC,IAAK,IAAM,KAAQ,EACjB,EAAU,IAAI,EAAK,GAAI,CAAI,EAE7B,OAAO,CACT,CAAC,CACH,CACF,EAEA,eAAe,EAAW,EAAuB,CAC3C,KAAQ,SAAW,EAIvB,KAAK,IAAM,KAAM,EACf,EAAa,IAAI,CAAE,EAGrB,GAAI,CACF,IAAM,EAAQ,MAAM,EAAa,EAAS,CAAS,EAM/C,EAAM,OAAS,GACjB,EAAM,SAAU,GAAc,CAC5B,IAAM,EAAY,IAAI,IAAI,CAAS,EACnC,IAAK,IAAM,KAAQ,EACjB,EAAU,IAAI,EAAK,GAAI,CAAI,EAE7B,OAAO,CACT,CAAC,CAEL,QAAU,CACR,IAAK,IAAM,KAAM,EAIf,EAAa,OAAO,CAAE,CAE1B,CA1BqB,CA2BvB,CAEA,OAAO,CACT,CAUA,SAAgB,EACd,EACc,CAId,OAHI,OAAO,GAAwB,WAC1B,EAAgB,CAAmB,EAErC,GAAuB,EAAmB,SAAY,CAAC,CAAC,CACjE"}
@@ -0,0 +1,73 @@
1
+ import { n as e, t } from "./BlockNoteExtension-B_IEJHS8.js";
2
+ import { Plugin as n, PluginKey as r } from "prosemirror-state";
3
+ import { Decoration as i, DecorationSet as a } from "prosemirror-view";
4
+ //#region src/extensions/ShowSelection/ShowSelection.ts
5
+ var o = new r("blocknote-show-selection"), s = t(({ editor: t }) => {
6
+ let r = e({ enabledSet: /* @__PURE__ */ new Set() }, { onUpdate() {
7
+ t.transact((e) => e.setMeta(o, {}));
8
+ } });
9
+ return {
10
+ key: "showSelection",
11
+ store: r,
12
+ prosemirrorPlugins: [new n({
13
+ key: o,
14
+ props: { decorations: (e) => {
15
+ let { doc: t, selection: n } = e;
16
+ if (r.state.enabledSet.size === 0) return a.empty;
17
+ let o = i.inline(n.from, n.to, { "data-show-selection": "true" });
18
+ return a.create(t, [o]);
19
+ } }
20
+ })],
21
+ showSelection(e, t) {
22
+ r.setState({ enabledSet: e ? new Set([...r.state.enabledSet, t]) : new Set([...r.state.enabledSet].filter((e) => e !== t)) });
23
+ }
24
+ };
25
+ });
26
+ //#endregion
27
+ //#region src/user/UserStore.ts
28
+ function c(t) {
29
+ if (!t) throw Error("resolveUsers is required to create a user store");
30
+ let n = e(/* @__PURE__ */ new Map()), r = /* @__PURE__ */ new Set(), i = {
31
+ store: n,
32
+ async loadUsers(e) {
33
+ await a(e.filter((e) => !n.state.has(e) && !r.has(e)));
34
+ },
35
+ async refetchUsers(e) {
36
+ await a(e.filter((e) => !r.has(e)));
37
+ },
38
+ getUser(e) {
39
+ return n.state.get(e);
40
+ },
41
+ setUser(e) {
42
+ let t = Array.isArray(e) ? e : [e];
43
+ n.setState((e) => {
44
+ let n = new Map(e);
45
+ for (let e of t) n.set(e.id, e);
46
+ return n;
47
+ });
48
+ }
49
+ };
50
+ async function a(e) {
51
+ if (e.length !== 0) {
52
+ for (let t of e) r.add(t);
53
+ try {
54
+ let r = await t(e, i);
55
+ r.length > 0 && n.setState((e) => {
56
+ let t = new Map(e);
57
+ for (let e of r) t.set(e.id, e);
58
+ return t;
59
+ });
60
+ } finally {
61
+ for (let t of e) r.delete(t);
62
+ }
63
+ }
64
+ }
65
+ return i;
66
+ }
67
+ function l(e) {
68
+ return typeof e == "function" ? c(e) : e ?? c(async () => []);
69
+ }
70
+ //#endregion
71
+ export { l as n, s as r, c as t };
72
+
73
+ //# sourceMappingURL=UserStore-QbbPFj0z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserStore-QbbPFj0z.js","names":[],"sources":["../src/extensions/ShowSelection/ShowSelection.ts","../src/user/UserStore.ts"],"sourcesContent":["import { Plugin, PluginKey } from \"prosemirror-state\";\nimport { Decoration, DecorationSet } from \"prosemirror-view\";\nimport {\n createExtension,\n createStore,\n} from \"../../editor/BlockNoteExtension.js\";\n\nconst PLUGIN_KEY = new PluginKey(`blocknote-show-selection`);\n\n/**\n * Plugin that shows adds a decoration around the current selection\n * This can be used to highlight the current selection in the UI even when the\n * text editor is not focused.\n */\nexport const ShowSelectionExtension = createExtension(({ editor }) => {\n const store = createStore(\n { enabledSet: new Set<string>() },\n {\n onUpdate() {\n editor.transact((tr) => tr.setMeta(PLUGIN_KEY, {}));\n },\n },\n );\n return {\n key: \"showSelection\",\n store,\n prosemirrorPlugins: [\n new Plugin({\n key: PLUGIN_KEY,\n props: {\n decorations: (state) => {\n const { doc, selection } = state;\n if (store.state.enabledSet.size === 0) {\n return DecorationSet.empty;\n }\n const dec = Decoration.inline(selection.from, selection.to, {\n \"data-show-selection\": \"true\",\n });\n return DecorationSet.create(doc, [dec]);\n },\n },\n }),\n ],\n /**\n * Show or hide the selection decoration\n *\n * @param shouldShow - Whether to show the selection decoration\n * @param key - The key of the selection to show or hide,\n * this is necessary to prevent disabling ShowSelection from one place\n * will interfere with other parts of the code that need to show the selection decoration\n * (e.g.: CreateLinkButton and AIExtension)\n */\n showSelection(shouldShow: boolean, key: string) {\n store.setState({\n enabledSet: shouldShow\n ? new Set([...store.state.enabledSet, key])\n : new Set([...store.state.enabledSet].filter((k) => k !== key)),\n });\n },\n } as const;\n});\n","import { Store } from \"@tanstack/store\";\nimport { createStore } from \"../editor/BlockNoteExtension.js\";\n\n/**\n * A collaborator of the document.\n */\nexport type User = {\n /**\n * The {@link User}'s unique identifier\n */\n id: string;\n /**\n * The {@link User}'s name/label\n */\n username: string;\n /**\n * The {@link User}'s profile image\n */\n avatarUrl: string;\n /**\n * The color used to represent the user (e.g. for collaboration cursors).\n */\n color?: string;\n /**\n * A lighter variant of {@link color}.\n */\n colorLight?: string;\n};\n\n/**\n * A store that retrieves and caches information about users, generic over the\n * resolved user type `U`.\n *\n * Created via {@link createUserStore}. Features that need to resolve user ids to\n * user information (comments, suggestions, versions) build one internally and\n * expose it on their extension instance so their UI can read from it.\n */\nexport type UserStore<U extends User = User> = {\n /**\n * A store mapping user ids to the resolved {@link User} information.\n */\n store: Store<Map<User[\"id\"], U>>;\n /**\n * Load information about users based on an array of user ids.\n *\n * Users that are already cached or currently being loaded are skipped, so\n * it is safe to call this often (e.g. on every render).\n */\n loadUsers: (userIds: User[\"id\"][]) => Promise<void>;\n /**\n * Re-fetch information about users, ignoring the cache. Users that are\n * currently being loaded are still skipped to avoid duplicate requests.\n */\n refetchUsers: (userIds: User[\"id\"][]) => Promise<void>;\n /**\n * Retrieve information about a user based on their id, if cached.\n *\n * The user has to be loaded via `loadUsers` first.\n */\n getUser: (userId: User[\"id\"]) => U | undefined;\n /**\n * Manually set information about a user. This is useful if you have a\n * resolver that returns partial information (e.g. just the username) and you\n * want to fill in the rest later (e.g. avatarUrl).\n */\n setUser: (user: U | U[]) => void;\n};\n\nexport type UserStoreResolver<U extends User = User> = (\n /**\n * The user ids to resolve. The resolver should return information for all of\n * these users, or an empty array if none could be resolved.\n */\n userIds: User[\"id\"][],\n /**\n * The {@link UserStore} that is calling this resolver. This allows you to return a user synchronously, and update the store later if you need to fetch additional information asynchronously.\n */\n store: UserStore<any>,\n) => Promise<U[]>;\n\n/**\n * A resolver callback or an already-built {@link UserStore} — the shape that\n * user-facing options (comments, collaboration) accept so callers can either let\n * the extension build a store or pass a shared one.\n */\nexport type UserStoreOrResolver<U extends User = User> =\n | ((userIds: User[\"id\"][], store: UserStore<any>) => Promise<U[]>)\n | UserStore<any>;\n\n/**\n * Creates a {@link UserStore} that retrieves and caches information about users.\n *\n * It does this by calling `resolveUsers` for users that are not yet cached, and\n * stores the results in a BlockNote store so they can be subscribed to (e.g. via\n * `useStore` in React).\n *\n * `resolveUsers` is called with the ids of users that are not yet cached, and\n * should return the information for those users. The type of the returned users\n * is inferred and flows through to {@link UserStore.getUser} and the store, so\n * you can return a type with additional properties and have them be reported\n * back.\n *\n * See [Comments](https://www.blocknotejs.org/docs/features/collaboration/comments) for more info.\n */\nexport function createUserStore<U extends User = User>(\n resolveUsers: (userIds: User[\"id\"][], store: UserStore<any>) => Promise<U[]>,\n): UserStore<U> {\n if (!resolveUsers) {\n throw new Error(\"resolveUsers is required to create a user store\");\n }\n\n const store = createStore(new Map<User[\"id\"], U>());\n\n // Tracks users that are currently being fetched, to avoid duplicate\n // in-flight requests. This is intentionally kept out of the store as it is\n // not state that consumers need to subscribe to.\n const loadingUsers = new Set<User[\"id\"]>();\n\n const userStore: UserStore<U> = {\n store,\n async loadUsers(userIds) {\n const missingUsers = userIds.filter(\n (id) => !store.state.has(id) && !loadingUsers.has(id),\n );\n await fetchUsers(missingUsers);\n },\n async refetchUsers(userIds) {\n const usersToFetch = userIds.filter((id) => !loadingUsers.has(id));\n await fetchUsers(usersToFetch);\n },\n getUser(userId) {\n return store.state.get(userId);\n },\n setUser(users) {\n const usersArray = Array.isArray(users) ? users : [users];\n store.setState((prevState) => {\n const nextState = new Map(prevState);\n for (const user of usersArray) {\n nextState.set(user.id, user);\n }\n return nextState;\n });\n },\n };\n\n async function fetchUsers(userIds: User[\"id\"][]) {\n if (userIds.length === 0) {\n return;\n }\n\n for (const id of userIds) {\n loadingUsers.add(id);\n }\n\n try {\n const users = await resolveUsers(userIds, userStore);\n // Only update the store if any users were actually resolved. Emitting\n // an update when nothing changed (e.g. when the resolver can't find a\n // user) would needlessly notify subscribers and, combined with a\n // subscriber that re-triggers loading, could cause an infinite loop.\n // See https://github.com/TypeCellOS/BlockNote/issues/1548\n if (users.length > 0) {\n store.setState((prevState) => {\n const nextState = new Map(prevState);\n for (const user of users) {\n nextState.set(user.id, user);\n }\n return nextState;\n });\n }\n } finally {\n for (const id of userIds) {\n // Remove the users from the loading set. On a next call to `loadUsers`\n // we will either return the cached user, or retry loading the user if\n // the request failed.\n loadingUsers.delete(id);\n }\n }\n }\n\n return userStore;\n}\n\n/**\n * Normalize a {@link UserStoreOrResolver} to a {@link UserStore}:\n * - an existing store is returned as-is (so a single de-duped cache can be\n * shared across extensions),\n * - a resolver function is wrapped with {@link createUserStore},\n * - `undefined` yields an empty store that resolves nothing (consumers then fall\n * back to showing raw user ids).\n */\nexport function normalizeToUserStore<U extends User = User>(\n resolveUsersOrStore?: UserStoreOrResolver<U>,\n): UserStore<U> {\n if (typeof resolveUsersOrStore === \"function\") {\n return createUserStore(resolveUsersOrStore);\n }\n return resolveUsersOrStore ?? createUserStore<U>(async () => []);\n}\n"],"mappings":";;;;AAOA,IAAM,IAAa,IAAI,EAAU,0BAA0B,GAO9C,IAAyB,GAAiB,EAAE,gBAAa;CACpE,IAAM,IAAQ,EACZ,EAAE,4BAAY,IAAI,IAAY,EAAE,GAChC,EACE,WAAW;EACT,EAAO,UAAU,MAAO,EAAG,QAAQ,GAAY,CAAC,CAAC,CAAC;CACpD,EACF,CACF;CACA,OAAO;EACL,KAAK;EACL;EACA,oBAAoB,CAClB,IAAI,EAAO;GACT,KAAK;GACL,OAAO,EACL,cAAc,MAAU;IACtB,IAAM,EAAE,QAAK,iBAAc;IAC3B,IAAI,EAAM,MAAM,WAAW,SAAS,GAClC,OAAO,EAAc;IAEvB,IAAM,IAAM,EAAW,OAAO,EAAU,MAAM,EAAU,IAAI,EAC1D,uBAAuB,OACzB,CAAC;IACD,OAAO,EAAc,OAAO,GAAK,CAAC,CAAG,CAAC;GACxC,EACF;EACF,CAAC,CACH;EAUA,cAAc,GAAqB,GAAa;GAC9C,EAAM,SAAS,EACb,YAAY,IACR,IAAI,IAAI,CAAC,GAAG,EAAM,MAAM,YAAY,CAAG,CAAC,IACxC,IAAI,IAAI,CAAC,GAAG,EAAM,MAAM,UAAU,EAAE,QAAQ,MAAM,MAAM,CAAG,CAAC,EAClE,CAAC;EACH;CACF;AACF,CAAC;;;AC4CD,SAAgB,EACd,GACc;CACd,IAAI,CAAC,GACH,MAAU,MAAM,iDAAiD;CAGnE,IAAM,IAAQ,kBAAY,IAAI,IAAmB,CAAC,GAK5C,oBAAe,IAAI,IAAgB,GAEnC,IAA0B;EAC9B;EACA,MAAM,UAAU,GAAS;GAIvB,MAAM,EAHe,EAAQ,QAC1B,MAAO,CAAC,EAAM,MAAM,IAAI,CAAE,KAAK,CAAC,EAAa,IAAI,CAAE,CAErC,CAAY;EAC/B;EACA,MAAM,aAAa,GAAS;GAE1B,MAAM,EADe,EAAQ,QAAQ,MAAO,CAAC,EAAa,IAAI,CAAE,CAC/C,CAAY;EAC/B;EACA,QAAQ,GAAQ;GACd,OAAO,EAAM,MAAM,IAAI,CAAM;EAC/B;EACA,QAAQ,GAAO;GACb,IAAM,IAAa,MAAM,QAAQ,CAAK,IAAI,IAAQ,CAAC,CAAK;GACxD,EAAM,UAAU,MAAc;IAC5B,IAAM,IAAY,IAAI,IAAI,CAAS;IACnC,KAAK,IAAM,KAAQ,GACjB,EAAU,IAAI,EAAK,IAAI,CAAI;IAE7B,OAAO;GACT,CAAC;EACH;CACF;CAEA,eAAe,EAAW,GAAuB;EAC3C,MAAQ,WAAW,GAIvB;QAAK,IAAM,KAAM,GACf,EAAa,IAAI,CAAE;GAGrB,IAAI;IACF,IAAM,IAAQ,MAAM,EAAa,GAAS,CAAS;IAMnD,AAAI,EAAM,SAAS,KACjB,EAAM,UAAU,MAAc;KAC5B,IAAM,IAAY,IAAI,IAAI,CAAS;KACnC,KAAK,IAAM,KAAQ,GACjB,EAAU,IAAI,EAAK,IAAI,CAAI;KAE7B,OAAO;IACT,CAAC;GAEL,UAAU;IACR,KAAK,IAAM,KAAM,GAIf,EAAa,OAAO,CAAE;GAE1B;EA1BqB;CA2BvB;CAEA,OAAO;AACT;AAUA,SAAgB,EACd,GACc;CAId,OAHI,OAAO,KAAwB,aAC1B,EAAgB,CAAmB,IAErC,KAAuB,EAAmB,YAAY,CAAC,CAAC;AACjE"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./BlockNoteExtension-ab0REuob.cjs`),t=require(`./blocks-Bm6IfL1R.cjs`),n=require(`./src-B6rlChSc.cjs`),r=require(`./extensions-IJK3t0sz.cjs`),i=require(`./ShowSelection-DhXglbt8.cjs`),a=require(`./EventEmitter-DHdSnYCD.cjs`);exports.BlockChangeExtension=r.E,exports.BlockNoteEditor=n.i,exports.BlockNoteSchema=t.t,exports.COLORS_DARK_MODE_DEFAULT=t.xt,exports.COLORS_DEFAULT=t.St,exports.CustomBlockNoteSchema=t.Ht,exports.DEFAULT_LINK_PROTOCOL=r.h,exports.DRAG_EXCLUSION_CLASSNAME=r.y,exports.DropCursorExtension=r.b,exports.EMPTY_CELL_HEIGHT=t.T,exports.EMPTY_CELL_WIDTH=t.E,exports.EventEmitter=a.t,exports.Exporter=n.r,exports.FILE_AUDIO_ICON_SVG=t.st,exports.FILE_IMAGE_ICON_SVG=t.U,exports.FILE_VIDEO_ICON_SVG=t.y,exports.FilePanelExtension=t.mt,exports.ForkYDocExtension=r.S,exports.FormattingToolbarExtension=t.m,exports.HTMLToBlocks=n.l,exports.HistoryExtension=r.v,exports.LinkToolbarExtension=r._,exports.NodeSelectionKeyboardExtension=r.m,exports.PlaceholderExtension=r.p,exports.PreviousBlockTypeExtension=r.f,exports.SchemaMigration=r.x,exports.ShowSelectionExtension=i.t,exports.SideMenuExtension=r.o,exports.SideMenuView=r.s,exports.SuggestionMenu=t.f,exports.TableHandlesExtension=r.n,exports.TableHandlesView=r.r,exports.TrailingNodeExtension=r.t,exports.UniqueID=t.Yn,exports.UnreachableCaseError=t.zn,exports.VALID_LINK_PROTOCOLS=r.g,exports.YCursorExtension=r.T,exports.YSyncExtension=r.w,exports.YUndoExtension=r.C,exports.addDefaultPropsExternalHTML=t.ht,exports.addInlineContentAttributes=t.Zt,exports.addInlineContentKeyboardShortcuts=t.Qt,exports.addNodeAndExtensionsToSpec=t.bn,exports.addStyleAttributes=t.Kt,exports.applyNonSelectableBlockFix=t.xn,exports.assertEmpty=t.Bn,exports.audioParse=t.ct,exports.audioRender=t.lt,exports.audioToExternalHTML=t.ut,exports.blockHasType=t.h,exports.blockToNode=t.kt,exports.blocksToMarkdown=r.u,exports.camelToDataKebab=t.kn,exports.captureCellAnchor=t.Ct,exports.checkPageBreakBlocksInSchema=t.s,exports.cleanHTMLToMarkdown=r.d,exports.combineByGroup=n.t,exports.contentNodeToInlineContent=t.nn,exports.contentNodeToTableContent=t.rn,exports.createAudioBlockConfig=t.dt,exports.createAudioBlockSpec=t.ft,exports.createBlockConfig=t.Sn,exports.createBlockSpec=t.Cn,exports.createBlockSpecFromTiptapNode=t.Tn,exports.createBulletListItemBlockConfig=t.B,exports.createBulletListItemBlockSpec=t.V,exports.createCheckListItemBlockSpec=t.R,exports.createCheckListItemConfig=t.z,exports.createCodeBlockConfig=t.it,exports.createCodeBlockSpec=t.at,exports.createDefaultBlockDOMOutputSpec=t.Mn,exports.createDividerBlockConfig=t.nt,exports.createDividerBlockSpec=t.rt,exports.createExtension=e.t,exports.createExternalHTMLExporter=r.O,exports.createFileBlockConfig=t.$,exports.createFileBlockSpec=t.et,exports.createHeadingBlockConfig=t.Y,exports.createHeadingBlockSpec=t.X,exports.createImageBlockConfig=t.W,exports.createImageBlockSpec=t.G,exports.createInlineContentSpec=n.b,exports.createInlineContentSpecFromTipTapNode=t.$t,exports.createInternalHTMLSerializer=n.m,exports.createInternalInlineContentSpec=t.en,exports.createInternalStyleSpec=t.qt,exports.createNumberedListItemBlockConfig=t.I,exports.createNumberedListItemBlockSpec=t.L,exports.createPageBreakBlockConfig=t.j,exports.createPageBreakBlockSpec=t.M,exports.createParagraphBlockConfig=t.k,exports.createParagraphBlockSpec=t.A,exports.createQuoteBlockConfig=t.D,exports.createQuoteBlockSpec=t.O,exports.createStore=e.n,exports.createStyleSpec=t.Wt,exports.createStyleSpecFromTipTapMark=t.Jt,exports.createTableBlockSpec=t.C,exports.createToggleListItemBlockConfig=t.P,exports.createToggleListItemBlockSpec=t.F,exports.createToggleWrapper=t.Z,exports.createVideoBlockConfig=t.b,exports.createVideoBlockSpec=t.x,exports.defaultBlockSpecs=t.n,exports.defaultBlockToHTML=t.Nn,exports.defaultInlineContentSchema=t.r,exports.defaultInlineContentSpecs=t.i,exports.defaultProps=t.gt,exports.defaultStyleSchema=t.a,exports.defaultStyleSpecs=t.o,exports.defaultToggledState=t.Q,exports.docToBlocks=t.in,exports.editorHasBlockWithType=t.g,exports.expandPMRangeToWords=n.a,exports.fileParse=t.tt,exports.filenameFromURL=t.An,exports.filterSuggestionItems=t.l,exports.fixColumnList=n.g,exports.formatKeyboardShortcut=t.Fn,exports.getBackgroundColorAttribute=t._t,exports.getBlock=n.u,exports.getBlockCache=t.cn,exports.getBlockFromPos=t.En,exports.getBlockInfo=t.mn,exports.getBlockInfoFromResolvedPos=t.hn,exports.getBlockInfoFromSelection=t.gn,exports.getBlockInfoFromTransaction=t._n,exports.getBlockInfoWithManualOffset=t.vn,exports.getBlockNoteSchema=t.ln,exports.getBlockSchema=t.un,exports.getBlocksChangedByTransaction=r.D,exports.getColspan=t.Vn,exports.getDefaultEmojiPickerItems=r.a,exports.getDefaultSlashMenuItems=t.u,exports.getInlineContentParseRules=n.x,exports.getInlineContentSchema=t.dn,exports.getInlineContentSchemaFromSpecs=t.tn,exports.getLanguageId=t.ot,exports.getNearestBlockPos=t.yn,exports.getNextBlock=n.d,exports.getNodeById=t.Dt,exports.getPageBreakSlashMenuItems=t.c,exports.getParentBlock=n.f,exports.getParseRules=t.wn,exports.getPmSchema=t.fn,exports.getPrevBlock=n.p,exports.getRowspan=t.Hn,exports.getStyleParseRules=t.Gt,exports.getStyleSchema=t.pn,exports.getStyleSchemaFromSpecs=t.Yt,exports.getTextAlignmentAttribute=t.vt,exports.getTextColorAttribute=t.yt,exports.imageParse=t.K,exports.imageRender=t.q,exports.imageToExternalHTML=t.J,exports.inlineContentToNodes=t.At,exports.insertBlocks=n.y,exports.insertOrUpdateBlockForSlashMenu=t.d,exports.isAppleOS=t.In,exports.isEmptyColumn=n._,exports.isLinkInlineContent=t.Kn,exports.isNodeBlock=t.Ot,exports.isPartialLinkInlineContent=t.qn,exports.isPartialTableCell=t.Un,exports.isSafari=t.Ln,exports.isStyledTextInlineContent=t.Jn,exports.isTableCell=t.Wn,exports.isTableCellSelection=t._,exports.isVideoUrl=t.jn,exports.mapTableCell=t.Gn,exports.mappingFactory=n.n,exports.markdownToBlocks=n.s,exports.markdownToHTML=n.c,exports.mergeCSSClasses=t.Rn,exports.mergeParagraphs=t.Pn,exports.nodeToBlock=t.an,exports.nodeToCustomInlineContent=t.on,exports.parseAudioElement=t.pt,exports.parseDefaultProps=t.bt,exports.propsToAttributes=t.Dn,exports.prosemirrorSliceToSlicedBlocks=t.sn,exports.removeAndInsertBlocks=n.h,exports.removeEmptyColumns=n.v,exports.selectedFragmentToHTML=n.o,exports.sideMenuPluginKey=r.c,exports.stylePropsToAttributes=t.Xt,exports.tableContentToNodes=t.jt,exports.tableHandlesPluginKey=r.i,exports.tablePropSchema=t.w,exports.trackPosition=t.p,exports.updateBlock=t.wt,exports.updateBlockCommand=t.Tt,exports.updateBlockTr=t.Et,exports.uploadToTmpFilesDotOrg_DEV_ONLY=t.v,exports.videoParse=t.S,exports.withPageBreak=t.N,exports.wrapInBlockStructure=t.On;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./blocks-BqHv0xhc.cjs"),t=require("./BlockNoteExtension-M0znTzxP.cjs"),n=require("./src-OfbaVbMw.cjs"),r=require("./extensions-Ghr9QqqR.cjs"),i=require("./UserStore-DCG6lsla.cjs");exports.BLOCK_LEVEL_SUGGESTION_GROUP=e.D,exports.BlockChangeExtension=r.O,exports.BlockNoteEditor=n.i,exports.BlockNoteSchema=e.t,exports.COLORS_DARK_MODE_DEFAULT=e.Ct,exports.COLORS_DEFAULT=e.wt,exports.CURRENT_VERSION_ID=r.i,exports.CustomBlockNoteSchema=e.Wt,exports.DEFAULT_LINK_PROTOCOL=r.S,exports.DRAG_EXCLUSION_CLASSNAME=r.E,exports.DropCursorExtension=r.D,exports.EMPTY_CELL_HEIGHT=e.T,exports.EMPTY_CELL_WIDTH=e.E,exports.EventEmitter=n.m,exports.Exporter=n.r,exports.FILE_AUDIO_ICON_SVG=e.lt,exports.FILE_IMAGE_ICON_SVG=e.G,exports.FILE_VIDEO_ICON_SVG=e.y,exports.FilePanelExtension=e.gt,exports.FormattingToolbarExtension=e.m,exports.HTMLToBlocks=n.l,exports.HistoryExtension=r.T,exports.LinkToolbarExtension=r.w,exports.NON_FORMATTING_MARK_GROUP=t.i,exports.NodeSelectionKeyboardExtension=r.x,exports.PlaceholderExtension=r.b,exports.PositionMappingExtension=r.y,exports.PreviousBlockTypeExtension=r.v,exports.ShowSelectionExtension=i.r,exports.SideMenuExtension=r.f,exports.SideMenuView=r.p,exports.SuggestionMenu=e.f,exports.TableHandlesExtension=r.c,exports.TableHandlesView=r.l,exports.TrailingNodeExtension=r.s,exports.UniqueID=e.Kn,exports.UnreachableCaseError=e.In,exports.VALID_LINK_PROTOCOLS=r.C,exports.VersioningExtension=r.a,exports.addDefaultPropsExternalHTML=e._t,exports.addInlineContentAttributes=e.$t,exports.addInlineContentKeyboardShortcuts=e.en,exports.addNodeAndExtensionsToSpec=e.in,exports.addStyleAttributes=e.Jt,exports.applyNonSelectableBlockFix=e.an,exports.assertEmpty=e.Ln,exports.audioParse=e.ut,exports.audioRender=e.dt,exports.audioToExternalHTML=e.ft,exports.blockHasType=e.h,exports.blockToNode=e.jt,exports.blocksToMarkdown=r.g,exports.camelToDataKebab=e.pn,exports.captureCellAnchor=e.Tt,exports.checkPageBreakBlocksInSchema=e.s,exports.cleanHTMLToMarkdown=r._,exports.colorsForUserIds=n.h,exports.combineByGroup=n.t,exports.contentNodeToInlineContent=e.gn,exports.contentNodeToTableContent=e._n,exports.createAudioBlockConfig=e.pt,exports.createAudioBlockSpec=e.mt,exports.createBlockConfig=e.on,exports.createBlockSpec=e.sn,exports.createBlockSpecFromTiptapNode=e.ln,exports.createBulletListItemBlockConfig=e.H,exports.createBulletListItemBlockSpec=e.U,exports.createCheckListItemBlockSpec=e.B,exports.createCheckListItemConfig=e.V,exports.createCodeBlockConfig=e.ot,exports.createCodeBlockSpec=e.st,exports.createDefaultBlockDOMOutputSpec=e.kn,exports.createDividerBlockConfig=e.it,exports.createDividerBlockSpec=e.at,exports.createExtension=t.t,exports.createExternalHTMLExporter=r.A,exports.createFileBlockConfig=e.tt,exports.createFileBlockSpec=e.nt,exports.createHeadingBlockConfig=e.Z,exports.createHeadingBlockSpec=e.Q,exports.createImageBlockConfig=e.K,exports.createImageBlockSpec=e.q,exports.createInMemoryPreviewController=r.t,exports.createInMemoryVersioningAdapter=r.n,exports.createInMemoryVersioningEndpoints=r.r,exports.createInlineContentSpec=n.E,exports.createInlineContentSpecFromTipTapNode=e.tn,exports.createInternalHTMLSerializer=n.b,exports.createInternalInlineContentSpec=e.nn,exports.createInternalStyleSpec=e.Yt,exports.createNumberedListItemBlockConfig=e.R,exports.createNumberedListItemBlockSpec=e.z,exports.createPageBreakBlockConfig=e.N,exports.createPageBreakBlockSpec=e.P,exports.createParagraphBlockConfig=e.j,exports.createParagraphBlockSpec=e.M,exports.createQuoteBlockConfig=e.k,exports.createQuoteBlockSpec=e.A,exports.createStore=t.n,exports.createStyleSpec=e.Kt,exports.createStyleSpecFromTipTapMark=e.Xt,exports.createTableBlockSpec=e.C,exports.createToggleListItemBlockConfig=e.I,exports.createToggleListItemBlockSpec=e.L,exports.createToggleWrapper=e.$,exports.createUserStore=i.t,exports.createVideoBlockConfig=e.b,exports.createVideoBlockSpec=e.x,exports.cssVarUserId=n.g,exports.defaultBlockSpecs=e.n,exports.defaultBlockToHTML=e.An,exports.defaultInlineContentSchema=e.r,exports.defaultInlineContentSpecs=e.i,exports.defaultProps=e.vt,exports.defaultStyleSchema=e.a,exports.defaultStyleSpecs=e.o,exports.defaultToggledState=e.et,exports.docToBlocks=e.vn,exports.editorHasBlockWithType=e.g,exports.expandPMRangeToWords=n.a,exports.fallbackColorForUserId=n._,exports.fileParse=e.rt,exports.filenameFromURL=e.mn,exports.filterSuggestionItems=e.l,exports.fixColumnList=n.S,exports.formatKeyboardShortcut=e.Mn,exports.getBackgroundColorAttribute=e.yt,exports.getBlock=n.u,exports.getBlockCache=e.Sn,exports.getBlockFromPos=e.un,exports.getBlockInfo=e.qn,exports.getBlockInfoAtNearest=e.Jn,exports.getBlockInfoFromResolvedPos=e.Yn,exports.getBlockInfoFromSelection=e.Xn,exports.getBlockInfoWithManualOffset=e.Zn,exports.getBlockNoteSchema=e.Cn,exports.getBlockSchema=e.wn,exports.getBlocksChangedByTransaction=r.k,exports.getColspan=e.Rn,exports.getDefaultEmojiPickerItems=r.d,exports.getDefaultSlashMenuItems=e.u,exports.getInlineContentParseRules=n.D,exports.getInlineContentSchema=e.Tn,exports.getInlineContentSchemaFromSpecs=e.rn,exports.getLanguageId=e.ct,exports.getNearestBlockPos=e.Qn,exports.getNextBlock=n.d,exports.getNodeById=e.kt,exports.getNodeId=e.$n,exports.getPageBreakSlashMenuItems=e.c,exports.getParentBlock=n.f,exports.getParseRules=e.cn,exports.getPmSchema=e.En,exports.getPrevBlock=n.p,exports.getRowspan=e.zn,exports.getStyleParseRules=e.qt,exports.getStyleSchema=e.Dn,exports.getStyleSchemaFromSpecs=e.Zt,exports.getTextAlignmentAttribute=e.bt,exports.getTextColorAttribute=e.xt,exports.imageParse=e.J,exports.imageRender=e.Y,exports.imageToExternalHTML=e.X,exports.inlineContentToNodes=e.Mt,exports.insertBlocks=n.T,exports.insertOrUpdateBlockForSlashMenu=e.d,exports.isAppleOS=e.Nn,exports.isEmptyColumn=n.C,exports.isLinkInlineContent=e.Un,exports.isNodeBlock=e.At,exports.isPartialLinkInlineContent=e.Wn,exports.isPartialTableCell=e.Bn,exports.isPlainContentNodeType=e.On,exports.isSafari=e.Pn,exports.isStyledTextInlineContent=e.Gn,exports.isSuggestedDeletionNode=e.er,exports.isTableCell=e.Vn,exports.isTableCellSelection=e._,exports.isVideoUrl=e.hn,exports.mapTableCell=e.Hn,exports.mappingFactory=n.n,exports.markdownToBlocks=n.s,exports.markdownToHTML=n.c,exports.mergeCSSClasses=e.Fn,exports.mergeParagraphs=e.jn,exports.nodeToBlock=e.yn,exports.nodeToCustomInlineContent=e.bn,exports.nonFormattingMarks=t.a,exports.normalizeToUserStore=i.n,exports.parseAudioElement=e.ht,exports.parseDefaultProps=e.St,exports.propsToAttributes=e.dn,exports.prosemirrorSliceToSlicedBlocks=e.xn,exports.removeAndInsertBlocks=n.x,exports.removeEmptyColumns=n.w,exports.selectedFragmentToHTML=n.o,exports.sideMenuPluginKey=r.m,exports.sortSnapshotsNewestFirst=r.o,exports.stylePropsToAttributes=e.Qt,exports.suggestionMarks=e.O,exports.tableContentToNodes=e.Nt,exports.tableHandlesPluginKey=r.u,exports.tablePropSchema=e.w,exports.trackPosition=e.p,exports.updateBlock=e.Et,exports.updateBlockCommand=e.Dt,exports.updateBlockTr=e.Ot,exports.uploadToTmpFilesDotOrg_DEV_ONLY=e.v,exports.userColorPalette=n.v,exports.userColorVarNames=n.y,exports.videoParse=e.S,exports.withPageBreak=e.F,exports.wrapInBlockStructure=e.fn;
package/dist/blocknote.js CHANGED
@@ -1,7 +1,6 @@
1
- import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bn as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as h, F as g, Fn as _, G as v, Gn as y, Gt as b, Hn as x, Ht as S, I as C, In as w, J as T, Jn as E, Jt as D, K as O, Kn as k, Kt as A, L as j, Ln as M, M as N, Mn as P, N as F, Nn as I, O as L, On as R, Ot as z, P as B, Pn as V, Q as H, Qt as U, R as W, Rn as G, S as K, Sn as q, St as J, T as Y, Tn as X, Tt as Z, U as Q, Un as $, V as ee, Vn as te, W as ne, Wn as re, Wt as ie, X as ae, Xt as oe, Y as se, Yn as ce, Yt as le, Z as ue, Zt as de, _ as fe, _n as pe, _t as me, a as he, an as ge, at as _e, b as ve, bn as ye, bt as be, c as xe, cn as Se, ct as Ce, d as we, dn as Te, dt as Ee, en as De, et as Oe, f as ke, fn as Ae, ft as je, g as Me, gn as Ne, gt as Pe, h as Fe, hn as Ie, ht as Le, i as Re, in as ze, it as Be, j as Ve, jn as He, jt as Ue, k as We, kn as Ge, kt as Ke, l as qe, ln as Je, lt as Ye, m as Xe, mn as Ze, mt as Qe, n as $e, nn as et, nt as tt, o as nt, on as rt, ot as it, p as at, pn as ot, pt as st, q as ct, qn as lt, qt as ut, r as dt, rn as ft, rt as pt, s as mt, sn as ht, st as gt, t as _t, tn as vt, tt as yt, u as bt, un as xt, ut as St, v as Ct, vn as wt, vt as Tt, w as Et, wn as Dt, wt as Ot, x as kt, xn as At, xt as jt, y as Mt, yn as Nt, yt as Pt, z as Ft, zn as It } from "./blocks-DGsP5WKr.js";
2
- import { _ as Lt, a as Rt, b as zt, c as Bt, d as Vt, f as Ht, g as Ut, h as Wt, i as Gt, l as Kt, m as qt, n as Jt, o as Yt, p as Xt, r as Zt, s as Qt, t as $t, u as en, v as tn, x as nn, y as rn } from "./src-Bcud0PIg.js";
3
- import { C as an, D as on, E as sn, O as cn, S as ln, T as un, _ as dn, a as fn, b as pn, c as mn, d as hn, f as gn, g as _n, h as vn, i as yn, m as bn, n as xn, o as Sn, p as Cn, r as wn, s as Tn, t as En, u as Dn, v as On, w as kn, x as An, y as jn } from "./extensions-Co4y7P63.js";
4
- import { n as Mn, t as Nn } from "./BlockNoteExtension-B6RhuQ3V.js";
5
- import { t as Pn } from "./ShowSelection-BsHFfdMi.js";
6
- import { t as Fn } from "./EventEmitter-CuPnGDYt.js";
7
- export { sn as BlockChangeExtension, Gt as BlockNoteEditor, _t as BlockNoteSchema, jt as COLORS_DARK_MODE_DEFAULT, J as COLORS_DEFAULT, S as CustomBlockNoteSchema, vn as DEFAULT_LINK_PROTOCOL, jn as DRAG_EXCLUSION_CLASSNAME, pn as DropCursorExtension, Y as EMPTY_CELL_HEIGHT, p as EMPTY_CELL_WIDTH, Fn as EventEmitter, Zt as Exporter, gt as FILE_AUDIO_ICON_SVG, Q as FILE_IMAGE_ICON_SVG, Mt as FILE_VIDEO_ICON_SVG, Qe as FilePanelExtension, ln as ForkYDocExtension, Xe as FormattingToolbarExtension, Kt as HTMLToBlocks, On as HistoryExtension, dn as LinkToolbarExtension, bn as NodeSelectionKeyboardExtension, Cn as PlaceholderExtension, gn as PreviousBlockTypeExtension, An as SchemaMigration, Pn as ShowSelectionExtension, Sn as SideMenuExtension, Tn as SideMenuView, ke as SuggestionMenu, xn as TableHandlesExtension, wn as TableHandlesView, En as TrailingNodeExtension, ce as UniqueID, It as UnreachableCaseError, _n as VALID_LINK_PROTOCOLS, un as YCursorExtension, kn as YSyncExtension, an as YUndoExtension, Le as addDefaultPropsExternalHTML, de as addInlineContentAttributes, U as addInlineContentKeyboardShortcuts, ye as addNodeAndExtensionsToSpec, A as addStyleAttributes, At as applyNonSelectableBlockFix, o as assertEmpty, Ce as audioParse, Ye as audioRender, St as audioToExternalHTML, Fe as blockHasType, Ke as blockToNode, Dn as blocksToMarkdown, Ge as camelToDataKebab, l as captureCellAnchor, mt as checkPageBreakBlocksInSchema, hn as cleanHTMLToMarkdown, $t as combineByGroup, et as contentNodeToInlineContent, ft as contentNodeToTableContent, Ee as createAudioBlockConfig, je as createAudioBlockSpec, q as createBlockConfig, c as createBlockSpec, X as createBlockSpecFromTiptapNode, a as createBulletListItemBlockConfig, ee as createBulletListItemBlockSpec, W as createCheckListItemBlockSpec, Ft as createCheckListItemConfig, Be as createCodeBlockConfig, _e as createCodeBlockSpec, P as createDefaultBlockDOMOutputSpec, tt as createDividerBlockConfig, pt as createDividerBlockSpec, Nn as createExtension, cn as createExternalHTMLExporter, e as createFileBlockConfig, Oe as createFileBlockSpec, se as createHeadingBlockConfig, ae as createHeadingBlockSpec, ne as createImageBlockConfig, v as createImageBlockSpec, zt as createInlineContentSpec, t as createInlineContentSpecFromTipTapNode, qt as createInternalHTMLSerializer, De as createInternalInlineContentSpec, ut as createInternalStyleSpec, C as createNumberedListItemBlockConfig, j as createNumberedListItemBlockSpec, Ve as createPageBreakBlockConfig, N as createPageBreakBlockSpec, We as createParagraphBlockConfig, n as createParagraphBlockSpec, u as createQuoteBlockConfig, L as createQuoteBlockSpec, Mn as createStore, ie as createStyleSpec, D as createStyleSpecFromTipTapMark, s as createTableBlockSpec, B as createToggleListItemBlockConfig, g as createToggleListItemBlockSpec, ue as createToggleWrapper, ve as createVideoBlockConfig, kt as createVideoBlockSpec, $e as defaultBlockSpecs, I as defaultBlockToHTML, dt as defaultInlineContentSchema, Re as defaultInlineContentSpecs, Pe as defaultProps, he as defaultStyleSchema, nt as defaultStyleSpecs, H as defaultToggledState, ze as docToBlocks, Me as editorHasBlockWithType, Rt as expandPMRangeToWords, yt as fileParse, r as filenameFromURL, qe as filterSuggestionItems, Ut as fixColumnList, _ as formatKeyboardShortcut, me as getBackgroundColorAttribute, en as getBlock, Se as getBlockCache, m as getBlockFromPos, Ze as getBlockInfo, Ie as getBlockInfoFromResolvedPos, Ne as getBlockInfoFromSelection, pe as getBlockInfoFromTransaction, wt as getBlockInfoWithManualOffset, Je as getBlockNoteSchema, xt as getBlockSchema, on as getBlocksChangedByTransaction, te as getColspan, fn as getDefaultEmojiPickerItems, bt as getDefaultSlashMenuItems, nn as getInlineContentParseRules, Te as getInlineContentSchema, vt as getInlineContentSchemaFromSpecs, it as getLanguageId, Nt as getNearestBlockPos, Vt as getNextBlock, f as getNodeById, xe as getPageBreakSlashMenuItems, Ht as getParentBlock, Dt as getParseRules, Ae as getPmSchema, Xt as getPrevBlock, x as getRowspan, b as getStyleParseRules, ot as getStyleSchema, le as getStyleSchemaFromSpecs, Tt as getTextAlignmentAttribute, Pt as getTextColorAttribute, O as imageParse, ct as imageRender, T as imageToExternalHTML, i as inlineContentToNodes, rn as insertBlocks, we as insertOrUpdateBlockForSlashMenu, w as isAppleOS, Lt as isEmptyColumn, k as isLinkInlineContent, z as isNodeBlock, lt as isPartialLinkInlineContent, $ as isPartialTableCell, M as isSafari, E as isStyledTextInlineContent, re as isTableCell, fe as isTableCellSelection, He as isVideoUrl, y as mapTableCell, Jt as mappingFactory, Qt as markdownToBlocks, Bt as markdownToHTML, G as mergeCSSClasses, V as mergeParagraphs, ge as nodeToBlock, rt as nodeToCustomInlineContent, st as parseAudioElement, be as parseDefaultProps, d as propsToAttributes, ht as prosemirrorSliceToSlicedBlocks, Wt as removeAndInsertBlocks, tn as removeEmptyColumns, Yt as selectedFragmentToHTML, mn as sideMenuPluginKey, oe as stylePropsToAttributes, Ue as tableContentToNodes, yn as tableHandlesPluginKey, Et as tablePropSchema, at as trackPosition, Ot as updateBlock, Z as updateBlockCommand, h as updateBlockTr, Ct as uploadToTmpFilesDotOrg_DEV_ONLY, K as videoParse, F as withPageBreak, R as wrapInBlockStructure };
1
+ import { $ as e, $n as t, $t as n, A as r, An as i, At as a, B as o, Bn as s, C as c, Cn as l, Ct as u, D as d, Dn as f, Dt as p, E as m, En as h, Et as g, F as _, Fn as v, G as y, Gn as b, H as x, Hn as S, I as C, In as w, J as T, Jn as E, Jt as D, K as O, Kn as k, Kt as A, L as j, Ln as M, M as N, Mn as P, Mt as F, N as I, Nn as L, Nt as R, O as z, On as B, Ot as V, P as H, Pn as U, Q as W, Qn as G, Qt as K, R as q, Rn as J, S as Y, Sn as X, St as Z, T as Q, Tn as $, Tt as ee, U as te, Un as ne, V as re, Vn as ie, Wn as ae, Wt as oe, X as se, Xn as ce, Xt as le, Y as ue, Yn as de, Yt as fe, Z as pe, Zn as me, Zt as he, _ as ge, _n as _e, _t as ve, a as ye, an as be, at as xe, b as Se, bn as Ce, bt as we, c as Te, cn as Ee, ct as De, d as Oe, dn as ke, dt as Ae, en as je, er as Me, et as Ne, f as Pe, fn as Fe, ft as Ie, g as Le, gn as Re, gt as ze, h as Be, hn as Ve, ht as He, i as Ue, in as We, it as Ge, j as Ke, jn as qe, jt as Je, k as Ye, kn as Xe, kt as Ze, l as Qe, ln as $e, lt as et, m as tt, mn as nt, mt as rt, n as it, nn as at, nt as ot, o as st, on as ct, ot as lt, p as ut, pn as dt, pt as ft, q as pt, qn as mt, qt as ht, r as gt, rn as _t, rt as vt, s as yt, sn as bt, st as xt, t as St, tn as Ct, tt as wt, u as Tt, un as Et, ut as Dt, v as Ot, vn as kt, vt as At, w as jt, wn as Mt, wt as Nt, x as Pt, xn as Ft, xt as It, y as Lt, yn as Rt, yt as zt, z as Bt, zn as Vt } from "./blocks-CiuUGa1E.js";
2
+ import { a as Ht, i as Ut, n as Wt, t as Gt } from "./BlockNoteExtension-B_IEJHS8.js";
3
+ import { C as Kt, D as qt, E as Jt, S as Yt, T as Xt, _ as Zt, a as Qt, b as $t, c as en, d as tn, f as nn, g as rn, h as an, i as on, l as sn, m as cn, n as ln, o as un, p as dn, r as fn, s as pn, t as mn, u as hn, v as gn, w as _n, x as vn, y as yn } from "./src-DTF83Cl9.js";
4
+ import { A as bn, C as xn, D as Sn, E as Cn, O as wn, S as Tn, T as En, _ as Dn, a as On, b as kn, c as An, d as jn, f as Mn, g as Nn, i as Pn, k as Fn, l as In, m as Ln, n as Rn, o as zn, p as Bn, r as Vn, s as Hn, t as Un, u as Wn, v as Gn, w as Kn, x as qn, y as Jn } from "./extensions-CrUGDOks.js";
5
+ import { n as Yn, r as Xn, t as Zn } from "./UserStore-QbbPFj0z.js";
6
+ export { d as BLOCK_LEVEL_SUGGESTION_GROUP, wn as BlockChangeExtension, on as BlockNoteEditor, St as BlockNoteSchema, u as COLORS_DARK_MODE_DEFAULT, Nt as COLORS_DEFAULT, Pn as CURRENT_VERSION_ID, oe as CustomBlockNoteSchema, Tn as DEFAULT_LINK_PROTOCOL, Cn as DRAG_EXCLUSION_CLASSNAME, Sn as DropCursorExtension, Q as EMPTY_CELL_HEIGHT, m as EMPTY_CELL_WIDTH, cn as EventEmitter, fn as Exporter, et as FILE_AUDIO_ICON_SVG, y as FILE_IMAGE_ICON_SVG, Lt as FILE_VIDEO_ICON_SVG, ze as FilePanelExtension, tt as FormattingToolbarExtension, sn as HTMLToBlocks, En as HistoryExtension, Kn as LinkToolbarExtension, Ut as NON_FORMATTING_MARK_GROUP, qn as NodeSelectionKeyboardExtension, kn as PlaceholderExtension, Jn as PositionMappingExtension, Gn as PreviousBlockTypeExtension, Xn as ShowSelectionExtension, Mn as SideMenuExtension, Bn as SideMenuView, Pe as SuggestionMenu, An as TableHandlesExtension, In as TableHandlesView, Hn as TrailingNodeExtension, k as UniqueID, w as UnreachableCaseError, xn as VALID_LINK_PROTOCOLS, On as VersioningExtension, ve as addDefaultPropsExternalHTML, n as addInlineContentAttributes, je as addInlineContentKeyboardShortcuts, We as addNodeAndExtensionsToSpec, D as addStyleAttributes, be as applyNonSelectableBlockFix, M as assertEmpty, Dt as audioParse, Ae as audioRender, Ie as audioToExternalHTML, Be as blockHasType, Je as blockToNode, Nn as blocksToMarkdown, dt as camelToDataKebab, ee as captureCellAnchor, yt as checkPageBreakBlocksInSchema, Dn as cleanHTMLToMarkdown, an as colorsForUserIds, mn as combineByGroup, Re as contentNodeToInlineContent, _e as contentNodeToTableContent, ft as createAudioBlockConfig, rt as createAudioBlockSpec, ct as createBlockConfig, bt as createBlockSpec, $e as createBlockSpecFromTiptapNode, x as createBulletListItemBlockConfig, te as createBulletListItemBlockSpec, o as createCheckListItemBlockSpec, re as createCheckListItemConfig, lt as createCodeBlockConfig, xt as createCodeBlockSpec, Xe as createDefaultBlockDOMOutputSpec, Ge as createDividerBlockConfig, xe as createDividerBlockSpec, Gt as createExtension, bn as createExternalHTMLExporter, wt as createFileBlockConfig, ot as createFileBlockSpec, pe as createHeadingBlockConfig, W as createHeadingBlockSpec, O as createImageBlockConfig, pt as createImageBlockSpec, Un as createInMemoryPreviewController, Rn as createInMemoryVersioningAdapter, Vn as createInMemoryVersioningEndpoints, Jt as createInlineContentSpec, Ct as createInlineContentSpecFromTipTapNode, $t as createInternalHTMLSerializer, at as createInternalInlineContentSpec, fe as createInternalStyleSpec, q as createNumberedListItemBlockConfig, Bt as createNumberedListItemBlockSpec, I as createPageBreakBlockConfig, H as createPageBreakBlockSpec, Ke as createParagraphBlockConfig, N as createParagraphBlockSpec, Ye as createQuoteBlockConfig, r as createQuoteBlockSpec, Wt as createStore, A as createStyleSpec, le as createStyleSpecFromTipTapMark, c as createTableBlockSpec, C as createToggleListItemBlockConfig, j as createToggleListItemBlockSpec, e as createToggleWrapper, Zn as createUserStore, Se as createVideoBlockConfig, Pt as createVideoBlockSpec, rn as cssVarUserId, it as defaultBlockSpecs, i as defaultBlockToHTML, gt as defaultInlineContentSchema, Ue as defaultInlineContentSpecs, At as defaultProps, ye as defaultStyleSchema, st as defaultStyleSpecs, Ne as defaultToggledState, kt as docToBlocks, Le as editorHasBlockWithType, Qt as expandPMRangeToWords, Zt as fallbackColorForUserId, vt as fileParse, nt as filenameFromURL, Qe as filterSuggestionItems, Yt as fixColumnList, P as formatKeyboardShortcut, zt as getBackgroundColorAttribute, hn as getBlock, X as getBlockCache, Et as getBlockFromPos, mt as getBlockInfo, E as getBlockInfoAtNearest, de as getBlockInfoFromResolvedPos, ce as getBlockInfoFromSelection, me as getBlockInfoWithManualOffset, l as getBlockNoteSchema, Mt as getBlockSchema, Fn as getBlocksChangedByTransaction, J as getColspan, jn as getDefaultEmojiPickerItems, Tt as getDefaultSlashMenuItems, qt as getInlineContentParseRules, $ as getInlineContentSchema, _t as getInlineContentSchemaFromSpecs, De as getLanguageId, G as getNearestBlockPos, tn as getNextBlock, Ze as getNodeById, t as getNodeId, Te as getPageBreakSlashMenuItems, nn as getParentBlock, Ee as getParseRules, h as getPmSchema, dn as getPrevBlock, Vt as getRowspan, ht as getStyleParseRules, f as getStyleSchema, he as getStyleSchemaFromSpecs, we as getTextAlignmentAttribute, It as getTextColorAttribute, T as imageParse, ue as imageRender, se as imageToExternalHTML, F as inlineContentToNodes, Xt as insertBlocks, Oe as insertOrUpdateBlockForSlashMenu, L as isAppleOS, Kt as isEmptyColumn, ne as isLinkInlineContent, a as isNodeBlock, ae as isPartialLinkInlineContent, s as isPartialTableCell, B as isPlainContentNodeType, U as isSafari, b as isStyledTextInlineContent, Me as isSuggestedDeletionNode, ie as isTableCell, ge as isTableCellSelection, Ve as isVideoUrl, S as mapTableCell, ln as mappingFactory, pn as markdownToBlocks, en as markdownToHTML, v as mergeCSSClasses, qe as mergeParagraphs, Rt as nodeToBlock, Ce as nodeToCustomInlineContent, Ht as nonFormattingMarks, Yn as normalizeToUserStore, He as parseAudioElement, Z as parseDefaultProps, ke as propsToAttributes, Ft as prosemirrorSliceToSlicedBlocks, vn as removeAndInsertBlocks, _n as removeEmptyColumns, un as selectedFragmentToHTML, Ln as sideMenuPluginKey, zn as sortSnapshotsNewestFirst, K as stylePropsToAttributes, z as suggestionMarks, R as tableContentToNodes, Wn as tableHandlesPluginKey, jt as tablePropSchema, ut as trackPosition, g as updateBlock, p as updateBlockCommand, V as updateBlockTr, Ot as uploadToTmpFilesDotOrg_DEV_ONLY, gn as userColorPalette, yn as userColorVarNames, Y as videoParse, _ as withPageBreak, Fe as wrapInBlockStructure };