@blocknote/core 0.41.1 → 0.42.1

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 (81) hide show
  1. package/dist/BlockNoteSchema-Bi-eeHal.js +3288 -0
  2. package/dist/BlockNoteSchema-Bi-eeHal.js.map +1 -0
  3. package/dist/BlockNoteSchema-DjDaA2C3.cjs +6 -0
  4. package/dist/BlockNoteSchema-DjDaA2C3.cjs.map +1 -0
  5. package/dist/blockToNode-DIfPWLH8.js +1140 -0
  6. package/dist/blockToNode-DIfPWLH8.js.map +1 -0
  7. package/dist/blockToNode-w7H99R6p.cjs +7 -0
  8. package/dist/blockToNode-w7H99R6p.cjs.map +1 -0
  9. package/dist/blocknote.cjs +4 -4
  10. package/dist/blocknote.cjs.map +1 -1
  11. package/dist/blocknote.js +1413 -1366
  12. package/dist/blocknote.js.map +1 -1
  13. package/dist/blocks.cjs +1 -1
  14. package/dist/blocks.js +1 -1
  15. package/dist/comments.cjs +1 -1
  16. package/dist/comments.cjs.map +1 -1
  17. package/dist/comments.js +49 -49
  18. package/dist/comments.js.map +1 -1
  19. package/dist/en-Cl87Uuyf.cjs.map +1 -1
  20. package/dist/en-njEqD7AG.js.map +1 -1
  21. package/dist/locales.cjs.map +1 -1
  22. package/dist/locales.js.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -0
  24. package/dist/webpack-stats.json +1 -1
  25. package/dist/yjs.cjs +2 -0
  26. package/dist/yjs.cjs.map +1 -0
  27. package/dist/yjs.js +44 -0
  28. package/dist/yjs.js.map +1 -0
  29. package/package.json +30 -25
  30. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +19 -6
  31. package/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts +173 -0
  32. package/src/api/nodeConversions/nodeToBlock.ts +17 -14
  33. package/src/blocks/Code/block.ts +1 -0
  34. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +2 -1
  35. package/src/blocks/defaultBlockTypeGuards.ts +7 -18
  36. package/src/comments/threadstore/yjs/YjsThreadStoreBase.ts +3 -1
  37. package/src/editor/BlockNoteEditor.test.ts +70 -1
  38. package/src/editor/BlockNoteEditor.ts +55 -4
  39. package/src/editor/managers/ExportManager.ts +1 -1
  40. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +2 -2
  41. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +2 -2
  42. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
  43. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
  44. package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +10 -3
  45. package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts +130 -0
  46. package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts +34 -21
  47. package/src/extensions/Comments/CommentsPlugin.ts +37 -7
  48. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +30 -128
  49. package/src/extensions/SideMenu/SideMenuPlugin.ts +2 -0
  50. package/src/index.ts +1 -0
  51. package/src/schema/inlineContent/createSpec.ts +3 -0
  52. package/src/schema/inlineContent/types.ts +1 -0
  53. package/src/schema/schema.ts +49 -6
  54. package/src/schema/styles/createSpec.ts +6 -0
  55. package/src/schema/styles/types.ts +1 -0
  56. package/src/yjs/index.ts +1 -0
  57. package/src/yjs/utils.test.ts +1023 -0
  58. package/src/yjs/utils.ts +150 -0
  59. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +1 -1
  60. package/types/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.d.ts +32 -0
  61. package/types/src/api/nodeConversions/nodeToBlock.d.ts +1 -1
  62. package/types/src/editor/BlockNoteEditor.d.ts +6 -1
  63. package/types/src/editor/managers/ExportManager.d.ts +1 -1
  64. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.d.ts +1 -0
  65. package/types/src/extensions/Comments/CommentsPlugin.d.ts +1 -1
  66. package/types/src/index.d.ts +1 -0
  67. package/types/src/schema/inlineContent/createSpec.d.ts +1 -0
  68. package/types/src/schema/inlineContent/types.d.ts +1 -0
  69. package/types/src/schema/styles/createSpec.d.ts +1 -0
  70. package/types/src/schema/styles/types.d.ts +1 -0
  71. package/types/src/yjs/index.d.ts +1 -0
  72. package/types/src/yjs/utils.d.ts +55 -0
  73. package/types/src/yjs/utils.test.d.ts +1 -0
  74. package/dist/BlockNoteSchema-COA0fsXW.cjs +0 -11
  75. package/dist/BlockNoteSchema-COA0fsXW.cjs.map +0 -1
  76. package/dist/BlockNoteSchema-CYRHak18.js +0 -4375
  77. package/dist/BlockNoteSchema-CYRHak18.js.map +0 -1
  78. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +0 -46
  79. package/src/extensions/TextColor/TextColorMark.ts +0 -38
  80. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +0 -10
  81. package/types/src/extensions/TextColor/TextColorMark.d.ts +0 -10
@@ -1 +1 @@
1
- {"builtAt":1760026112272,"assets":[{"name":"blocks.cjs","size":3859},{"name":"comments.cjs","size":11826},{"name":"locales.cjs","size":161252},{"name":"blocknote.cjs","size":140748},{"name":"en-Cl87Uuyf.cjs","size":6760},{"name":"BlockNoteSchema-COA0fsXW.cjs","size":84766},{"name":"en-Cl87Uuyf.cjs.map","size":15254},{"name":"BlockNoteSchema-COA0fsXW.cjs.map","size":416105},{"name":"blocks.cjs.map","size":91},{"name":"comments.cjs.map","size":47628},{"name":"locales.cjs.map","size":331893},{"name":"blocknote.cjs.map","size":631064}],"chunks":[{"id":"c90dbef","entry":true,"initial":true,"files":["blocks.cjs"],"names":["blocks"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-Cl87Uuyf.cjs"],"names":["en"]},{"id":"7515671","entry":false,"initial":true,"files":["BlockNoteSchema-COA0fsXW.cjs"],"names":["BlockNoteSchema"]}],"modules":[{"name":"./src/blocks/index.ts","size":0,"chunks":["c90dbef"]},{"name":"./src/comments/threadstore/ThreadStoreAuth.ts","size":25,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/DefaultThreadStoreAuth.ts","size":2014,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStore.ts","size":77,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/TipTapThreadStore.ts","size":5321,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/yjsHelpers.ts","size":3002,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStoreBase.ts","size":790,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/RESTYjsThreadStore.ts","size":2069,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStore.ts","size":7267,"chunks":["1627b02"]},{"name":"./src/comments/index.ts","size":0,"chunks":["1627b02"]},{"name":"./src/i18n/locales/ar.ts","size":9531,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10742,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10261,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11221,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9268,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":10088,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10269,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10687,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":9098,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8586,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10215,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10394,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9911,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":10066,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11236,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9951,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10896,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9932,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8562,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8602,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":3784,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":849,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":1940,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":7444,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":904,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":4965,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/api/getBlocksChangedByTransaction.ts","size":6577,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":4176,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1144,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":2412,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":775,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts","size":470,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":674,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":677,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5191,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":308,"chunks":["a1ee98a"]},{"name":"./src/extensions/BlockChange/BlockChangePlugin.ts","size":1064,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":4715,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/SyncPlugin.ts","size":260,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/UndoPlugin.ts","size":281,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/ForkYDocPlugin.ts","size":4323,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts","size":1403,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/index.ts","size":45,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts","size":882,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1370,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":7942,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":4151,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":7068,"chunks":["a1ee98a"]},{"name":"./src/extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3292,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2067,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":18593,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7731,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1383,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3813,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4843,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":1059,"chunks":["a1ee98a"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1700,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4744,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":16659,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1639,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9266,"chunks":["a1ee98a"]},{"name":"./src/extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":27510,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":936,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":293,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1563,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2186,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5444,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5706,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2087,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/BlockManager.ts","size":6469,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/CollaborationManager.ts","size":2919,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/EventManager.ts","size":1929,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2170,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":439,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1760,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExportManager.ts","size":3700,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager.ts","size":2087,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5301,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2606,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/SelectionManager.ts","size":2588,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StateManager.ts","size":5730,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StyleManager.ts","size":4342,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2620,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":35370,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1101,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1296,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":9591,"chunks":["a1e239a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8905,"chunks":["7515671"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["7515671"]},{"name":"./src/util/table.ts","size":1212,"chunks":["7515671"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["7515671"]},{"name":"./src/util/browser.ts","size":643,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2103,"chunks":["7515671"]},{"name":"./src/util/string.ts","size":656,"chunks":["7515671"]},{"name":"./src/schema/blocks/internal.ts","size":3387,"chunks":["7515671"]},{"name":"./src/schema/blocks/createSpec.ts","size":6665,"chunks":["7515671"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["7515671"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["7515671"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13005,"chunks":["7515671"]},{"name":"./src/schema/inlineContent/internal.ts","size":1428,"chunks":["7515671"]},{"name":"./src/schema/styles/internal.ts","size":2909,"chunks":["7515671"]},{"name":"./src/schema/styles/createSpec.ts","size":2276,"chunks":["7515671"]},{"name":"./src/util/topo-sort.ts","size":2271,"chunks":["7515671"]},{"name":"./src/schema/schema.ts","size":3360,"chunks":["7515671"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["7515671"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":7193,"chunks":["7515671"]},{"name":"./src/api/nodeUtil.ts","size":549,"chunks":["7515671"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":8371,"chunks":["7515671"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["7515671"]},{"name":"./src/blocks/defaultProps.ts","size":3350,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/parse/parseFigureElement.ts","size":342,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createAddFileButton.ts","size":1809,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createFileBlockWrapper.ts","size":1374,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["7515671"]},{"name":"./src/blocks/Audio/parseAudioElement.ts","size":108,"chunks":["7515671"]},{"name":"./src/blocks/Audio/block.ts","size":3593,"chunks":["7515671"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["7515671"]},{"name":"./src/editor/BlockNoteExtension.ts","size":1873,"chunks":["7515671"]},{"name":"./src/blocks/Code/shiki.ts","size":1699,"chunks":["7515671"]},{"name":"./src/blocks/Code/block.ts","size":6492,"chunks":["7515671"]},{"name":"./src/blocks/Divider/block.ts","size":747,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["7515671"]},{"name":"./src/blocks/File/block.ts","size":1766,"chunks":["7515671"]},{"name":"./src/blocks/ToggleWrapper/createToggleWrapper.ts","size":5204,"chunks":["7515671"]},{"name":"./src/blocks/Heading/block.ts","size":2639,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createResizableFileBlockWrapper.ts","size":6266,"chunks":["7515671"]},{"name":"./src/blocks/Image/parseImageElement.ts","size":224,"chunks":["7515671"]},{"name":"./src/blocks/Image/block.ts","size":3777,"chunks":["7515671"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":909,"chunks":["7515671"]},{"name":"./src/blocks/utils/listItemEnterHandler.ts","size":880,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/getListItemContent.ts","size":1425,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/BulletListItem/block.ts","size":2399,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/CheckListItem/block.ts","size":3824,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts","size":3124,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/NumberedListItem/block.ts","size":2929,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/ToggleListItem/block.ts","size":1458,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/block.ts","size":883,"chunks":["7515671"]},{"name":"./src/blocks/Paragraph/block.ts","size":1337,"chunks":["7515671"]},{"name":"./src/blocks/Quote/block.ts","size":1654,"chunks":["7515671"]},{"name":"./src/blocks/Table/TableExtension.ts","size":2297,"chunks":["7515671"]},{"name":"./src/blocks/Table/block.ts","size":9792,"chunks":["7515671"]},{"name":"./src/blocks/Video/parseVideoElement.ts","size":175,"chunks":["7515671"]},{"name":"./src/blocks/Video/block.ts","size":3577,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2213,"chunks":["7515671"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":9024,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/getPageBreakSlashMenuItems.ts","size":447,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlocks.ts","size":2851,"chunks":["7515671"]},{"name":"./src/blocks/BlockNoteSchema.ts","size":330,"chunks":["7515671"]}]}
1
+ {"builtAt":1763459614094,"assets":[{"name":"blocks.cjs","size":3859},{"name":"yjs.cjs","size":882},{"name":"comments.cjs","size":11846},{"name":"locales.cjs","size":161252},{"name":"blocknote.cjs","size":142492},{"name":"en-Cl87Uuyf.cjs","size":6760},{"name":"blockToNode-w7H99R6p.cjs","size":19430},{"name":"BlockNoteSchema-DjDaA2C3.cjs","size":66198},{"name":"en-Cl87Uuyf.cjs.map","size":15254},{"name":"blockToNode-w7H99R6p.cjs.map","size":122080},{"name":"BlockNoteSchema-DjDaA2C3.cjs.map","size":296414},{"name":"yjs.cjs.map","size":5601},{"name":"blocks.cjs.map","size":91},{"name":"comments.cjs.map","size":47692},{"name":"locales.cjs.map","size":331893},{"name":"blocknote.cjs.map","size":641068}],"chunks":[{"id":"c90dbef","entry":true,"initial":true,"files":["blocks.cjs"],"names":["blocks"]},{"id":"526cf7b","entry":true,"initial":true,"files":["yjs.cjs"],"names":["yjs"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-Cl87Uuyf.cjs"],"names":["en"]},{"id":"cdc653a","entry":false,"initial":true,"files":["blockToNode-w7H99R6p.cjs"],"names":["blockToNode"]},{"id":"7515671","entry":false,"initial":true,"files":["BlockNoteSchema-DjDaA2C3.cjs"],"names":["BlockNoteSchema"]}],"modules":[{"name":"./src/blocks/index.ts","size":0,"chunks":["c90dbef"]},{"name":"./src/yjs/utils.ts","size":1121,"chunks":["526cf7b"]},{"name":"./src/yjs/index.ts","size":0,"chunks":["526cf7b"]},{"name":"./src/comments/threadstore/ThreadStoreAuth.ts","size":25,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/DefaultThreadStoreAuth.ts","size":2014,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/ThreadStore.ts","size":77,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/TipTapThreadStore.ts","size":5321,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/yjsHelpers.ts","size":3002,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStoreBase.ts","size":849,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/RESTYjsThreadStore.ts","size":2069,"chunks":["1627b02"]},{"name":"./src/comments/threadstore/yjs/YjsThreadStore.ts","size":7267,"chunks":["1627b02"]},{"name":"./src/comments/index.ts","size":0,"chunks":["1627b02"]},{"name":"./src/i18n/locales/ar.ts","size":9531,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10742,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10261,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11221,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9268,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":10088,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10269,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10687,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":9098,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8586,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10215,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10394,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9911,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":10066,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11236,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9951,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10896,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9932,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8562,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8602,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":3810,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":837,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts","size":3571,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":2248,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":7424,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":904,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":4945,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/api/getBlocksChangedByTransaction.ts","size":6569,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":4172,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1144,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":2412,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":775,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts","size":470,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":674,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":665,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5183,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":308,"chunks":["a1ee98a"]},{"name":"./src/extensions/BlockChange/BlockChangePlugin.ts","size":1064,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":4715,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/SyncPlugin.ts","size":260,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/UndoPlugin.ts","size":281,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/ForkYDocPlugin.ts","size":4323,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts","size":1688,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/migrationRules/index.ts","size":45,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts","size":1352,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1370,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":8731,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":4151,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":7068,"chunks":["a1ee98a"]},{"name":"./src/extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":2907,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2059,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":15693,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7727,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1383,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3813,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4843,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":1059,"chunks":["a1ee98a"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1700,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4744,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":16683,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1639,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9266,"chunks":["a1ee98a"]},{"name":"./src/extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":27450,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":936,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":293,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1563,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2186,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5440,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5698,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2055,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/BlockManager.ts","size":6465,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/CollaborationManager.ts","size":2919,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/EventManager.ts","size":1929,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2170,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":435,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1760,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExportManager.ts","size":3723,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/ExtensionManager.ts","size":2087,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5257,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2566,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/SelectionManager.ts","size":2588,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StateManager.ts","size":5730,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/editor/managers/StyleManager.ts","size":4330,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2616,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":36643,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1101,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1296,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":9591,"chunks":["a1e239a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8905,"chunks":["cdc653a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["cdc653a"]},{"name":"./src/util/table.ts","size":1212,"chunks":["cdc653a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["cdc653a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["cdc653a"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13078,"chunks":["cdc653a"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["cdc653a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":7193,"chunks":["cdc653a"]},{"name":"./src/util/browser.ts","size":643,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2115,"chunks":["7515671"]},{"name":"./src/util/string.ts","size":656,"chunks":["7515671"]},{"name":"./src/schema/blocks/internal.ts","size":3387,"chunks":["7515671"]},{"name":"./src/schema/blocks/createSpec.ts","size":6665,"chunks":["7515671"]},{"name":"./src/schema/inlineContent/internal.ts","size":1428,"chunks":["7515671"]},{"name":"./src/schema/styles/internal.ts","size":2909,"chunks":["7515671"]},{"name":"./src/schema/styles/createSpec.ts","size":2498,"chunks":["7515671"]},{"name":"./src/util/topo-sort.ts","size":2271,"chunks":["7515671"]},{"name":"./src/schema/schema.ts","size":4429,"chunks":["7515671"]},{"name":"./src/api/nodeUtil.ts","size":549,"chunks":["7515671"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":8527,"chunks":["7515671"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["7515671"]},{"name":"./src/blocks/defaultProps.ts","size":3350,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/parse/parseFigureElement.ts","size":342,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createAddFileButton.ts","size":1809,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createFileBlockWrapper.ts","size":1374,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["7515671"]},{"name":"./src/blocks/Audio/parseAudioElement.ts","size":108,"chunks":["7515671"]},{"name":"./src/blocks/Audio/block.ts","size":3593,"chunks":["7515671"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["7515671"]},{"name":"./src/editor/BlockNoteExtension.ts","size":1873,"chunks":["7515671"]},{"name":"./src/blocks/Code/shiki.ts","size":1699,"chunks":["7515671"]},{"name":"./src/blocks/Code/block.ts","size":6528,"chunks":["7515671"]},{"name":"./src/blocks/Divider/block.ts","size":747,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["7515671"]},{"name":"./src/blocks/File/block.ts","size":1766,"chunks":["7515671"]},{"name":"./src/blocks/ToggleWrapper/createToggleWrapper.ts","size":5204,"chunks":["7515671"]},{"name":"./src/blocks/Heading/block.ts","size":2639,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/render/createResizableFileBlockWrapper.ts","size":6266,"chunks":["7515671"]},{"name":"./src/blocks/Image/parseImageElement.ts","size":224,"chunks":["7515671"]},{"name":"./src/blocks/Image/block.ts","size":3777,"chunks":["7515671"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":945,"chunks":["7515671"]},{"name":"./src/blocks/utils/listItemEnterHandler.ts","size":892,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/getListItemContent.ts","size":1425,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/BulletListItem/block.ts","size":2411,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/CheckListItem/block.ts","size":3824,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts","size":3203,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/NumberedListItem/block.ts","size":2941,"chunks":["7515671"]},{"name":"./src/blocks/ListItem/ToggleListItem/block.ts","size":1458,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/block.ts","size":883,"chunks":["7515671"]},{"name":"./src/blocks/Paragraph/block.ts","size":1337,"chunks":["7515671"]},{"name":"./src/blocks/Quote/block.ts","size":1654,"chunks":["7515671"]},{"name":"./src/blocks/Table/TableExtension.ts","size":2297,"chunks":["7515671"]},{"name":"./src/blocks/Table/block.ts","size":9792,"chunks":["7515671"]},{"name":"./src/blocks/Video/parseVideoElement.ts","size":175,"chunks":["7515671"]},{"name":"./src/blocks/Video/block.ts","size":3577,"chunks":["7515671"]},{"name":"./src/blocks/File/helpers/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2005,"chunks":["7515671"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":9036,"chunks":["7515671"]},{"name":"./src/blocks/PageBreak/getPageBreakSlashMenuItems.ts","size":447,"chunks":["7515671"]},{"name":"./src/blocks/defaultBlocks.ts","size":2851,"chunks":["7515671"]},{"name":"./src/blocks/BlockNoteSchema.ts","size":330,"chunks":["7515671"]}]}
package/dist/yjs.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("y-prosemirror"),m=require("./blockToNode-w7H99R6p.cjs");function l(o,r){const e=o.pmSchema.nodeFromJSON(r);return m.docToBlocks(e)}function n(o,r){const e=r.map(t=>m.blockToNode(t,o.pmSchema));return o.pmSchema.topNodeType.create(null,o.pmSchema.nodes.blockGroup.create(null,e))}function s(o,r){const e=c.yXmlFragmentToProseMirrorRootNode(r,o.pmSchema);return m.docToBlocks(e)}function T(o,r,e){return c.prosemirrorToYXmlFragment(n(o,r),e)}function u(o,r,e="prosemirror"){return s(o,r.getXmlFragment(e))}function i(o,r,e="prosemirror"){return c.prosemirrorToYDoc(n(o,r),e)}exports._blocksToProsemirrorNode=n;exports._prosemirrorJSONToBlocks=l;exports.blocksToYDoc=i;exports.blocksToYXmlFragment=T;exports.yDocToBlocks=u;exports.yXmlFragmentToBlocks=s;
2
+ //# sourceMappingURL=yjs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yjs.cjs","sources":["../src/yjs/utils.ts"],"sourcesContent":["import {\n prosemirrorToYDoc,\n prosemirrorToYXmlFragment,\n yXmlFragmentToProseMirrorRootNode,\n} from \"y-prosemirror\";\nimport * as Y from \"yjs\";\n\nimport {\n type Block,\n type BlockNoteEditor,\n type BlockSchema,\n type InlineContentSchema,\n type PartialBlock,\n type StyleSchema,\n blockToNode,\n docToBlocks,\n} from \"../index.js\";\n\n/**\n * Turn Prosemirror JSON to BlockNote style JSON\n * @param editor BlockNote editor\n * @param json Prosemirror JSON\n * @returns BlockNote style JSON\n */\nexport function _prosemirrorJSONToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(editor: BlockNoteEditor<BSchema, ISchema, SSchema>, json: any) {\n // note: theoretically this should also be possible without creating prosemirror nodes,\n // but this is definitely the easiest way\n const doc = editor.pmSchema.nodeFromJSON(json);\n return docToBlocks<BSchema, ISchema, SSchema>(doc);\n}\n\n/**\n * Turn BlockNote JSON to Prosemirror node / state\n * @param editor BlockNote editor\n * @param blocks BlockNote blocks\n * @returns Prosemirror root node\n */\nexport function _blocksToProsemirrorNode<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: PartialBlock<BSchema, ISchema, SSchema>[],\n) {\n const pmNodes = blocks.map((b) => blockToNode(b, editor.pmSchema));\n\n const doc = editor.pmSchema.topNodeType.create(\n null,\n editor.pmSchema.nodes[\"blockGroup\"].create(null, pmNodes),\n );\n return doc;\n}\n\n/** YJS / BLOCKNOTE conversions */\n\n/**\n * Turn a Y.XmlFragment collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)\n * @param editor BlockNote editor\n * @param xmlFragment Y.XmlFragment\n * @returns BlockNote document (BlockNote style JSON of all blocks)\n */\nexport function yXmlFragmentToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n xmlFragment: Y.XmlFragment,\n) {\n const pmNode = yXmlFragmentToProseMirrorRootNode(\n xmlFragment,\n editor.pmSchema,\n );\n return docToBlocks<BSchema, ISchema, SSchema>(pmNode);\n}\n\n/**\n * Convert blocks to a Y.XmlFragment\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param editor BlockNote editor\n * @param blocks the blocks to convert\n * @param xmlFragment XML fragment name\n * @returns Y.XmlFragment\n */\nexport function blocksToYXmlFragment<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: Block<BSchema, ISchema, SSchema>[],\n xmlFragment?: Y.XmlFragment,\n) {\n return prosemirrorToYXmlFragment(\n _blocksToProsemirrorNode(editor, blocks),\n xmlFragment,\n );\n}\n\n/**\n * Turn a Y.Doc collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)\n * @param editor BlockNote editor\n * @param ydoc Y.Doc\n * @param xmlFragment XML fragment name\n * @returns BlockNote document (BlockNote style JSON of all blocks)\n */\nexport function yDocToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n ydoc: Y.Doc,\n xmlFragment = \"prosemirror\",\n) {\n return yXmlFragmentToBlocks(editor, ydoc.getXmlFragment(xmlFragment));\n}\n\n/**\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param editor BlockNote editor\n * @param blocks the blocks to convert\n * @param xmlFragment XML fragment name\n */\nexport function blocksToYDoc<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: PartialBlock<BSchema, ISchema, SSchema>[],\n xmlFragment = \"prosemirror\",\n) {\n return prosemirrorToYDoc(\n _blocksToProsemirrorNode(editor, blocks),\n xmlFragment,\n );\n}\n"],"names":["_prosemirrorJSONToBlocks","editor","json","doc","docToBlocks","_blocksToProsemirrorNode","blocks","pmNodes","b","blockToNode","yXmlFragmentToBlocks","xmlFragment","pmNode","yXmlFragmentToProseMirrorRootNode","blocksToYXmlFragment","prosemirrorToYXmlFragment","yDocToBlocks","ydoc","blocksToYDoc","prosemirrorToYDoc"],"mappings":"yJAwBO,SAASA,EAIdC,EAAoDC,EAAW,CAG/D,MAAMC,EAAMF,EAAO,SAAS,aAAaC,CAAI,EAC7C,OAAOE,EAAAA,YAAuCD,CAAG,CACnD,CAQO,SAASE,EAKdJ,EACAK,EACA,CACA,MAAMC,EAAUD,EAAO,IAAKE,GAAMC,EAAAA,YAAYD,EAAGP,EAAO,QAAQ,CAAC,EAMjE,OAJYA,EAAO,SAAS,YAAY,OACtC,KACAA,EAAO,SAAS,MAAM,WAAc,OAAO,KAAMM,CAAO,CAAA,CAG5D,CAUO,SAASG,EAKdT,EACAU,EACA,CACA,MAAMC,EAASC,EAAAA,kCACbF,EACAV,EAAO,QAAA,EAET,OAAOG,EAAAA,YAAuCQ,CAAM,CACtD,CAcO,SAASE,EAKdb,EACAK,EACAK,EACA,CACA,OAAOI,EAAAA,0BACLV,EAAyBJ,EAAQK,CAAM,EACvCK,CAAA,CAEJ,CASO,SAASK,EAKdf,EACAgB,EACAN,EAAc,cACd,CACA,OAAOD,EAAqBT,EAAQgB,EAAK,eAAeN,CAAW,CAAC,CACtE,CAWO,SAASO,EAKdjB,EACAK,EACAK,EAAc,cACd,CACA,OAAOQ,EAAAA,kBACLd,EAAyBJ,EAAQK,CAAM,EACvCK,CAAA,CAEJ"}
package/dist/yjs.js ADDED
@@ -0,0 +1,44 @@
1
+ import { yXmlFragmentToProseMirrorRootNode as t, prosemirrorToYXmlFragment as s, prosemirrorToYDoc as p } from "y-prosemirror";
2
+ import { d as m, b as l } from "./blockToNode-DIfPWLH8.js";
3
+ function d(o, r) {
4
+ const e = o.pmSchema.nodeFromJSON(r);
5
+ return m(e);
6
+ }
7
+ function c(o, r) {
8
+ const e = r.map((n) => l(n, o.pmSchema));
9
+ return o.pmSchema.topNodeType.create(
10
+ null,
11
+ o.pmSchema.nodes.blockGroup.create(null, e)
12
+ );
13
+ }
14
+ function a(o, r) {
15
+ const e = t(
16
+ r,
17
+ o.pmSchema
18
+ );
19
+ return m(e);
20
+ }
21
+ function k(o, r, e) {
22
+ return s(
23
+ c(o, r),
24
+ e
25
+ );
26
+ }
27
+ function f(o, r, e = "prosemirror") {
28
+ return a(o, r.getXmlFragment(e));
29
+ }
30
+ function N(o, r, e = "prosemirror") {
31
+ return p(
32
+ c(o, r),
33
+ e
34
+ );
35
+ }
36
+ export {
37
+ c as _blocksToProsemirrorNode,
38
+ d as _prosemirrorJSONToBlocks,
39
+ N as blocksToYDoc,
40
+ k as blocksToYXmlFragment,
41
+ f as yDocToBlocks,
42
+ a as yXmlFragmentToBlocks
43
+ };
44
+ //# sourceMappingURL=yjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yjs.js","sources":["../src/yjs/utils.ts"],"sourcesContent":["import {\n prosemirrorToYDoc,\n prosemirrorToYXmlFragment,\n yXmlFragmentToProseMirrorRootNode,\n} from \"y-prosemirror\";\nimport * as Y from \"yjs\";\n\nimport {\n type Block,\n type BlockNoteEditor,\n type BlockSchema,\n type InlineContentSchema,\n type PartialBlock,\n type StyleSchema,\n blockToNode,\n docToBlocks,\n} from \"../index.js\";\n\n/**\n * Turn Prosemirror JSON to BlockNote style JSON\n * @param editor BlockNote editor\n * @param json Prosemirror JSON\n * @returns BlockNote style JSON\n */\nexport function _prosemirrorJSONToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(editor: BlockNoteEditor<BSchema, ISchema, SSchema>, json: any) {\n // note: theoretically this should also be possible without creating prosemirror nodes,\n // but this is definitely the easiest way\n const doc = editor.pmSchema.nodeFromJSON(json);\n return docToBlocks<BSchema, ISchema, SSchema>(doc);\n}\n\n/**\n * Turn BlockNote JSON to Prosemirror node / state\n * @param editor BlockNote editor\n * @param blocks BlockNote blocks\n * @returns Prosemirror root node\n */\nexport function _blocksToProsemirrorNode<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: PartialBlock<BSchema, ISchema, SSchema>[],\n) {\n const pmNodes = blocks.map((b) => blockToNode(b, editor.pmSchema));\n\n const doc = editor.pmSchema.topNodeType.create(\n null,\n editor.pmSchema.nodes[\"blockGroup\"].create(null, pmNodes),\n );\n return doc;\n}\n\n/** YJS / BLOCKNOTE conversions */\n\n/**\n * Turn a Y.XmlFragment collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)\n * @param editor BlockNote editor\n * @param xmlFragment Y.XmlFragment\n * @returns BlockNote document (BlockNote style JSON of all blocks)\n */\nexport function yXmlFragmentToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n xmlFragment: Y.XmlFragment,\n) {\n const pmNode = yXmlFragmentToProseMirrorRootNode(\n xmlFragment,\n editor.pmSchema,\n );\n return docToBlocks<BSchema, ISchema, SSchema>(pmNode);\n}\n\n/**\n * Convert blocks to a Y.XmlFragment\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param editor BlockNote editor\n * @param blocks the blocks to convert\n * @param xmlFragment XML fragment name\n * @returns Y.XmlFragment\n */\nexport function blocksToYXmlFragment<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: Block<BSchema, ISchema, SSchema>[],\n xmlFragment?: Y.XmlFragment,\n) {\n return prosemirrorToYXmlFragment(\n _blocksToProsemirrorNode(editor, blocks),\n xmlFragment,\n );\n}\n\n/**\n * Turn a Y.Doc collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)\n * @param editor BlockNote editor\n * @param ydoc Y.Doc\n * @param xmlFragment XML fragment name\n * @returns BlockNote document (BlockNote style JSON of all blocks)\n */\nexport function yDocToBlocks<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n ydoc: Y.Doc,\n xmlFragment = \"prosemirror\",\n) {\n return yXmlFragmentToBlocks(editor, ydoc.getXmlFragment(xmlFragment));\n}\n\n/**\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param editor BlockNote editor\n * @param blocks the blocks to convert\n * @param xmlFragment XML fragment name\n */\nexport function blocksToYDoc<\n BSchema extends BlockSchema,\n ISchema extends InlineContentSchema,\n SSchema extends StyleSchema,\n>(\n editor: BlockNoteEditor<BSchema, ISchema, SSchema>,\n blocks: PartialBlock<BSchema, ISchema, SSchema>[],\n xmlFragment = \"prosemirror\",\n) {\n return prosemirrorToYDoc(\n _blocksToProsemirrorNode(editor, blocks),\n xmlFragment,\n );\n}\n"],"names":["_prosemirrorJSONToBlocks","editor","json","doc","docToBlocks","_blocksToProsemirrorNode","blocks","pmNodes","b","blockToNode","yXmlFragmentToBlocks","xmlFragment","pmNode","yXmlFragmentToProseMirrorRootNode","blocksToYXmlFragment","prosemirrorToYXmlFragment","yDocToBlocks","ydoc","blocksToYDoc","prosemirrorToYDoc"],"mappings":";;AAwBO,SAASA,EAIdC,GAAoDC,GAAW;AAG/D,QAAMC,IAAMF,EAAO,SAAS,aAAaC,CAAI;AAC7C,SAAOE,EAAuCD,CAAG;AACnD;AAQO,SAASE,EAKdJ,GACAK,GACA;AACA,QAAMC,IAAUD,EAAO,IAAI,CAACE,MAAMC,EAAYD,GAAGP,EAAO,QAAQ,CAAC;AAMjE,SAJYA,EAAO,SAAS,YAAY;AAAA,IACtC;AAAA,IACAA,EAAO,SAAS,MAAM,WAAc,OAAO,MAAMM,CAAO;AAAA,EAAA;AAG5D;AAUO,SAASG,EAKdT,GACAU,GACA;AACA,QAAMC,IAASC;AAAA,IACbF;AAAA,IACAV,EAAO;AAAA,EAAA;AAET,SAAOG,EAAuCQ,CAAM;AACtD;AAcO,SAASE,EAKdb,GACAK,GACAK,GACA;AACA,SAAOI;AAAA,IACLV,EAAyBJ,GAAQK,CAAM;AAAA,IACvCK;AAAA,EAAA;AAEJ;AASO,SAASK,EAKdf,GACAgB,GACAN,IAAc,eACd;AACA,SAAOD,EAAqBT,GAAQgB,EAAK,eAAeN,CAAW,CAAC;AACtE;AAWO,SAASO,EAKdjB,GACAK,GACAK,IAAc,eACd;AACA,SAAOQ;AAAA,IACLd,EAAyBJ,GAAQK,CAAM;AAAA,IACvCK;AAAA,EAAA;AAEJ;"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/core"
12
12
  },
13
13
  "license": "MPL-2.0",
14
- "version": "0.41.1",
14
+ "version": "0.42.1",
15
15
  "files": [
16
16
  "dist",
17
17
  "types",
@@ -66,34 +66,39 @@
66
66
  "types": "./types/src/i18n/index.d.ts",
67
67
  "import": "./dist/locales.js",
68
68
  "require": "./dist/locales.cjs"
69
+ },
70
+ "./yjs": {
71
+ "types": "./types/src/yjs/index.d.ts",
72
+ "import": "./dist/yjs.js",
73
+ "require": "./dist/yjs.cjs"
69
74
  }
70
75
  },
71
76
  "dependencies": {
72
77
  "@emoji-mart/data": "^1.2.1",
73
78
  "@shikijs/types": "3.13.0",
74
- "@tiptap/core": "^3.4.3",
75
- "@tiptap/extension-bold": "^3",
76
- "@tiptap/extension-code": "^3",
77
- "@tiptap/extension-gapcursor": "^3",
78
- "@tiptap/extension-history": "^3",
79
- "@tiptap/extension-horizontal-rule": "^3",
80
- "@tiptap/extension-italic": "^3",
81
- "@tiptap/extension-link": "^3",
82
- "@tiptap/extension-paragraph": "^3",
83
- "@tiptap/extension-strike": "^3",
84
- "@tiptap/extension-text": "^3",
85
- "@tiptap/extension-underline": "^3",
86
- "@tiptap/pm": "^3.4.3",
79
+ "@tiptap/core": "^3.10.2",
80
+ "@tiptap/extension-bold": "^3.7.2",
81
+ "@tiptap/extension-code": "^3.7.2",
82
+ "@tiptap/extension-gapcursor": "^3.7.2",
83
+ "@tiptap/extension-history": "^3.7.2",
84
+ "@tiptap/extension-horizontal-rule": "^3.7.2",
85
+ "@tiptap/extension-italic": "^3.7.2",
86
+ "@tiptap/extension-link": "^3.7.2",
87
+ "@tiptap/extension-paragraph": "^3.7.2",
88
+ "@tiptap/extension-strike": "^3.7.2",
89
+ "@tiptap/extension-text": "^3.7.2",
90
+ "@tiptap/extension-underline": "^3.7.2",
91
+ "@tiptap/pm": "^3.10.2",
87
92
  "emoji-mart": "^5.6.0",
88
- "fast-deep-equal": "^3",
93
+ "fast-deep-equal": "^3.1.3",
89
94
  "hast-util-from-dom": "^5.0.1",
90
95
  "prosemirror-dropcursor": "^1.8.2",
91
96
  "prosemirror-highlight": "^0.13.0",
92
- "prosemirror-model": "^1.25.3",
93
- "prosemirror-state": "^1.4.3",
94
- "prosemirror-tables": "^1.6.4",
97
+ "prosemirror-model": "^1.25.4",
98
+ "prosemirror-state": "^1.4.4",
99
+ "prosemirror-tables": "^1.8.1",
95
100
  "prosemirror-transform": "^1.10.4",
96
- "prosemirror-view": "^1.41.2",
101
+ "prosemirror-view": "^1.41.3",
97
102
  "rehype-format": "^5.0.1",
98
103
  "rehype-parse": "^9.0.1",
99
104
  "rehype-remark": "^10.0.1",
@@ -113,14 +118,14 @@
113
118
  "@types/emoji-mart": "^3.0.14",
114
119
  "@types/hast": "^3.0.4",
115
120
  "@types/uuid": "^8.3.4",
116
- "eslint": "^8.10.0",
121
+ "eslint": "^8.57.1",
117
122
  "jsdom": "^25.0.1",
118
- "rimraf": "^5.0.5",
119
- "rollup-plugin-webpack-stats": "^0.2.2",
120
- "typescript": "^5.3.3",
121
- "vite": "^5.3.4",
123
+ "rimraf": "^5.0.10",
124
+ "rollup-plugin-webpack-stats": "^0.2.6",
125
+ "typescript": "^5.9.3",
126
+ "vite": "^5.4.20",
122
127
  "vite-plugin-eslint": "^1.8.1",
123
- "vitest": "^2.0.3"
128
+ "vitest": "^2.1.9"
124
129
  },
125
130
  "peerDependencies": {
126
131
  "@hocuspocus/provider": "^2.15.2"
@@ -1,5 +1,5 @@
1
- import type { Node } from "prosemirror-model";
2
- import type { Transaction } from "prosemirror-state";
1
+ import { type Node } from "prosemirror-model";
2
+ import { type Transaction } from "prosemirror-state";
3
3
  import type { Block, PartialBlock } from "../../../../blocks/defaultBlocks.js";
4
4
  import type {
5
5
  BlockIdentifier,
@@ -10,6 +10,7 @@ import type {
10
10
  import { blockToNode } from "../../../nodeConversions/blockToNode.js";
11
11
  import { nodeToBlock } from "../../../nodeConversions/nodeToBlock.js";
12
12
  import { getPmSchema } from "../../../pmUtil.js";
13
+ import { fixColumnList } from "./util/fixColumnList.js";
13
14
 
14
15
  export function removeAndInsertBlocks<
15
16
  BSchema extends BlockSchema,
@@ -36,6 +37,7 @@ export function removeAndInsertBlocks<
36
37
  ),
37
38
  );
38
39
  const removedBlocks: Block<BSchema, I, S>[] = [];
40
+ const columnListPositions = new Set<number>();
39
41
 
40
42
  const idOfFirstBlock =
41
43
  typeof blocksToRemove[0] === "string"
@@ -70,26 +72,35 @@ export function removeAndInsertBlocks<
70
72
  }
71
73
 
72
74
  const oldDocSize = tr.doc.nodeSize;
73
- // Checks if the block is the only child of its parent. In this case, we
74
- // need to delete the parent `blockGroup` node instead of just the
75
- // `blockContainer`.
75
+
76
76
  const $pos = tr.doc.resolve(pos - removedSize);
77
+
78
+ if ($pos.node().type.name === "column") {
79
+ columnListPositions.add($pos.before(-1));
80
+ } else if ($pos.node().type.name === "columnList") {
81
+ columnListPositions.add($pos.before());
82
+ }
83
+
77
84
  if (
78
85
  $pos.node().type.name === "blockGroup" &&
79
86
  $pos.node($pos.depth - 1).type.name !== "doc" &&
80
87
  $pos.node().childCount === 1
81
88
  ) {
89
+ // Checks if the block is the only child of a parent `blockGroup` node.
90
+ // In this case, we need to delete the parent `blockGroup` node instead
91
+ // of just the `blockContainer`.
82
92
  tr.delete($pos.before(), $pos.after());
83
93
  } else {
84
94
  tr.delete(pos - removedSize, pos - removedSize + node.nodeSize);
85
95
  }
96
+
86
97
  const newDocSize = tr.doc.nodeSize;
87
98
  removedSize += oldDocSize - newDocSize;
88
99
 
89
100
  return false;
90
101
  });
91
102
 
92
- // Throws an error if now all blocks could be found.
103
+ // Throws an error if not all blocks could be found.
93
104
  if (idsOfBlocksToRemove.size > 0) {
94
105
  const notFoundIds = [...idsOfBlocksToRemove].join("\n");
95
106
 
@@ -99,6 +110,8 @@ export function removeAndInsertBlocks<
99
110
  );
100
111
  }
101
112
 
113
+ columnListPositions.forEach((pos) => fixColumnList(tr, pos));
114
+
102
115
  // Converts the nodes created from `blocksToInsert` into full `Block`s.
103
116
  const insertedBlocks = nodesToInsert.map((node) =>
104
117
  nodeToBlock(node, pmSchema),
@@ -0,0 +1,173 @@
1
+ import { Slice, type Node } from "prosemirror-model";
2
+ import { type Transaction } from "prosemirror-state";
3
+ import { ReplaceAroundStep } from "prosemirror-transform";
4
+
5
+ /**
6
+ * Checks if a `column` node is empty, i.e. if it has only a single empty
7
+ * paragraph.
8
+ * @param column The column to check.
9
+ * @returns Whether the column is empty.
10
+ */
11
+ export function isEmptyColumn(column: Node) {
12
+ if (!column || column.type.name !== "column") {
13
+ throw new Error("Invalid columnPos: does not point to column node.");
14
+ }
15
+
16
+ const blockContainer = column.firstChild;
17
+ if (!blockContainer) {
18
+ throw new Error("Invalid column: does not have child node.");
19
+ }
20
+
21
+ const blockContent = blockContainer.firstChild;
22
+ if (!blockContent) {
23
+ throw new Error("Invalid blockContainer: does not have child node.");
24
+ }
25
+
26
+ return (
27
+ column.childCount === 1 &&
28
+ blockContainer.childCount === 1 &&
29
+ blockContent.type.name === "paragraph" &&
30
+ blockContent.content.content.length === 0
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Removes all empty `column` nodes in a `columnList`. A `column` node is empty
36
+ * if it has only a single empty block. If, however, removing the `column`s
37
+ * leaves the `columnList` that has fewer than two, ProseMirror will re-add
38
+ * empty columns.
39
+ * @param tr The `Transaction` to add the changes to.
40
+ * @param columnListPos The position just before the `columnList` node.
41
+ */
42
+ export function removeEmptyColumns(tr: Transaction, columnListPos: number) {
43
+ const $columnListPos = tr.doc.resolve(columnListPos);
44
+ const columnList = $columnListPos.nodeAfter;
45
+ if (!columnList || columnList.type.name !== "columnList") {
46
+ throw new Error(
47
+ "Invalid columnListPos: does not point to columnList node.",
48
+ );
49
+ }
50
+
51
+ for (
52
+ let columnIndex = columnList.childCount - 1;
53
+ columnIndex >= 0;
54
+ columnIndex--
55
+ ) {
56
+ const columnPos = tr.doc
57
+ .resolve($columnListPos.pos + 1)
58
+ .posAtIndex(columnIndex);
59
+ const $columnPos = tr.doc.resolve(columnPos);
60
+ const column = $columnPos.nodeAfter;
61
+ if (!column || column.type.name !== "column") {
62
+ throw new Error("Invalid columnPos: does not point to column node.");
63
+ }
64
+
65
+ if (isEmptyColumn(column)) {
66
+ tr.delete(columnPos, columnPos + column.nodeSize);
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Fixes potential issues in a `columnList` node after a
73
+ * `blockContainer`/`column` node is (re)moved from it:
74
+ *
75
+ * - Removes all empty `column` nodes. A `column` node is empty if it has only
76
+ * a single empty block.
77
+ * - If all but one `column` nodes are empty, replaces the `columnList` with
78
+ * the content of the non-empty `column`.
79
+ * - If all `column` nodes are empty, removes the `columnList` entirely.
80
+ * @param tr The `Transaction` to add the changes to.
81
+ * @param columnListPos
82
+ * @returns The position just before the `columnList` node.
83
+ */
84
+ export function fixColumnList(tr: Transaction, columnListPos: number) {
85
+ removeEmptyColumns(tr, columnListPos);
86
+
87
+ const $columnListPos = tr.doc.resolve(columnListPos);
88
+ const columnList = $columnListPos.nodeAfter;
89
+ if (!columnList || columnList.type.name !== "columnList") {
90
+ throw new Error(
91
+ "Invalid columnListPos: does not point to columnList node.",
92
+ );
93
+ }
94
+
95
+ if (columnList.childCount > 2) {
96
+ // Do nothing if the `columnList` has more than two non-empty `column`s. In
97
+ // the case that the `columnList` has exactly two columns, we may need to
98
+ // still remove it, as it's possible that one or both columns are empty.
99
+ // This is because after `removeEmptyColumns` is called, if the
100
+ // `columnList` has fewer than two `column`s, ProseMirror will re-add empty
101
+ // `column`s until there are two total, in order to fit the schema.
102
+ return;
103
+ }
104
+
105
+ if (columnList.childCount < 2) {
106
+ // Throw an error if the `columnList` has fewer than two columns. After
107
+ // `removeEmptyColumns` is called, if the `columnList` has fewer than two
108
+ // `column`s, ProseMirror will re-add empty `column`s until there are two
109
+ // total, in order to fit the schema. So if there are fewer than two here,
110
+ // either the schema, or ProseMirror's internals, must have changed.
111
+ throw new Error("Invalid columnList: contains fewer than two children.");
112
+ }
113
+
114
+ const firstColumnBeforePos = columnListPos + 1;
115
+ const $firstColumnBeforePos = tr.doc.resolve(firstColumnBeforePos);
116
+ const firstColumn = $firstColumnBeforePos.nodeAfter;
117
+
118
+ const lastColumnAfterPos = columnListPos + columnList.nodeSize - 1;
119
+ const $lastColumnAfterPos = tr.doc.resolve(lastColumnAfterPos);
120
+ const lastColumn = $lastColumnAfterPos.nodeBefore;
121
+
122
+ if (!firstColumn || !lastColumn) {
123
+ throw new Error("Invalid columnList: does not contain children.");
124
+ }
125
+
126
+ const firstColumnEmpty = isEmptyColumn(firstColumn);
127
+ const lastColumnEmpty = isEmptyColumn(lastColumn);
128
+
129
+ if (firstColumnEmpty && lastColumnEmpty) {
130
+ // Removes `columnList`
131
+ tr.delete(columnListPos, columnListPos + columnList.nodeSize);
132
+
133
+ return;
134
+ }
135
+
136
+ if (firstColumnEmpty) {
137
+ tr.step(
138
+ new ReplaceAroundStep(
139
+ // Replaces `columnList`.
140
+ columnListPos,
141
+ columnListPos + columnList.nodeSize,
142
+ // Replaces with content of last `column`.
143
+ lastColumnAfterPos - lastColumn.nodeSize + 1,
144
+ lastColumnAfterPos - 1,
145
+ // Doesn't append anything.
146
+ Slice.empty,
147
+ 0,
148
+ false,
149
+ ),
150
+ );
151
+
152
+ return;
153
+ }
154
+
155
+ if (lastColumnEmpty) {
156
+ tr.step(
157
+ new ReplaceAroundStep(
158
+ // Replaces `columnList`.
159
+ columnListPos,
160
+ columnListPos + columnList.nodeSize,
161
+ // Replaces with content of first `column`.
162
+ firstColumnBeforePos + 1,
163
+ firstColumnBeforePos + firstColumn.nodeSize - 1,
164
+ // Doesn't append anything.
165
+ Slice.empty,
166
+ 0,
167
+ false,
168
+ ),
169
+ );
170
+
171
+ return;
172
+ }
173
+ }
@@ -23,6 +23,7 @@ import {
23
23
  getBlockCache,
24
24
  getBlockSchema,
25
25
  getInlineContentSchema,
26
+ getPmSchema,
26
27
  getStyleSchema,
27
28
  } from "../pmUtil.js";
28
29
 
@@ -503,26 +504,28 @@ export function docToBlocks<
503
504
  S extends StyleSchema,
504
505
  >(
505
506
  doc: Node,
506
- schema: Schema,
507
+ schema: Schema = getPmSchema(doc),
507
508
  blockSchema: BSchema = getBlockSchema(schema) as BSchema,
508
509
  inlineContentSchema: I = getInlineContentSchema(schema) as I,
509
510
  styleSchema: S = getStyleSchema(schema) as S,
510
511
  blockCache = getBlockCache(schema),
511
512
  ) {
512
513
  const blocks: Block<BSchema, I, S>[] = [];
513
- doc.firstChild!.descendants((node) => {
514
- blocks.push(
515
- nodeToBlock(
516
- node,
517
- schema,
518
- blockSchema,
519
- inlineContentSchema,
520
- styleSchema,
521
- blockCache,
522
- ),
523
- );
524
- return false;
525
- });
514
+ if (doc.firstChild) {
515
+ doc.firstChild.descendants((node) => {
516
+ blocks.push(
517
+ nodeToBlock(
518
+ node,
519
+ schema,
520
+ blockSchema,
521
+ inlineContentSchema,
522
+ styleSchema,
523
+ blockCache,
524
+ ),
525
+ );
526
+ return false;
527
+ });
528
+ }
526
529
  return blocks;
527
530
  }
528
531
 
@@ -102,6 +102,7 @@ export const createCodeBlockSpec = createBlockSpec(
102
102
  const code = el.firstElementChild!;
103
103
 
104
104
  return parser.parse(code, {
105
+ preserveWhitespace: "full",
105
106
  topNode: schema.nodes["codeBlock"].create(),
106
107
  }).content;
107
108
  },
@@ -112,10 +112,11 @@ function getDecorations(
112
112
  );
113
113
 
114
114
  if (existingDecorations.length === 0) {
115
+ const blockNode = tr.doc.nodeAt(pos + 1);
115
116
  // Create a widget decoration to display the index
116
117
  decorationsToAdd.push(
117
118
  // move in by 1 to account for the block container
118
- Decoration.node(pos + 1, pos + node.nodeSize - 1, {
119
+ Decoration.node(pos + 1, pos + 1 + blockNode!.nodeSize, {
119
120
  "data-index": index.toString(),
120
121
  }),
121
122
  );