@blocknote/core 0.25.2 → 0.26.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 (63) hide show
  1. package/dist/blocknote.cjs +7 -7
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +759 -618
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/comments.cjs +1 -1
  6. package/dist/comments.cjs.map +1 -1
  7. package/dist/comments.js +45 -44
  8. package/dist/comments.js.map +1 -1
  9. package/dist/style.css +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/webpack-stats.json +1 -1
  12. package/package.json +2 -2
  13. package/src/api/nodeConversions/nodeToBlock.ts +1 -0
  14. package/src/api/parsers/html/__snapshots__/parse-2-tables.json +129 -0
  15. package/src/api/parsers/html/parseHTML.test.ts +35 -0
  16. package/src/comments/threadstore/yjs/YjsThreadStore.ts +1 -0
  17. package/src/comments/threadstore/yjs/yjsHelpers.ts +3 -1
  18. package/src/comments/types.ts +4 -0
  19. package/src/editor/Block.css +1 -1
  20. package/src/editor/BlockNoteEditor.ts +1 -1
  21. package/src/editor/BlockNoteTipTapEditor.ts +18 -7
  22. package/src/extensions/Comments/CommentsPlugin.ts +76 -29
  23. package/src/extensions/SideMenu/dragging.ts +13 -0
  24. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +6 -2
  25. package/src/extensions/TableHandles/TableHandlesPlugin.ts +24 -23
  26. package/src/i18n/locales/ar.ts +4 -0
  27. package/src/i18n/locales/de.ts +15 -1
  28. package/src/i18n/locales/en.ts +4 -0
  29. package/src/i18n/locales/es.ts +15 -1
  30. package/src/i18n/locales/fr.ts +4 -0
  31. package/src/i18n/locales/hr.ts +21 -4
  32. package/src/i18n/locales/is.ts +4 -0
  33. package/src/i18n/locales/it.ts +15 -1
  34. package/src/i18n/locales/ja.ts +4 -0
  35. package/src/i18n/locales/ko.ts +4 -0
  36. package/src/i18n/locales/nl.ts +4 -0
  37. package/src/i18n/locales/no.ts +4 -0
  38. package/src/i18n/locales/pl.ts +4 -0
  39. package/src/i18n/locales/pt.ts +4 -0
  40. package/src/i18n/locales/ru.ts +4 -0
  41. package/src/i18n/locales/uk.ts +4 -0
  42. package/src/i18n/locales/vi.ts +4 -0
  43. package/src/i18n/locales/zh.ts +4 -0
  44. package/types/src/comments/types.d.ts +4 -0
  45. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -1
  46. package/types/src/extensions/Comments/CommentsPlugin.d.ts +16 -1
  47. package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +47 -0
  48. package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +121 -0
  49. package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +12 -0
  50. package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +97 -0
  51. package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +83 -0
  52. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +79 -0
  53. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +1 -0
  54. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +15 -0
  55. package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +13 -0
  56. package/types/src/extensions/Comments/types.d.ts +109 -0
  57. package/types/src/i18n/locales/de.d.ts +2 -304
  58. package/types/src/i18n/locales/en.d.ts +4 -0
  59. package/types/src/i18n/locales/es.d.ts +2 -269
  60. package/types/src/i18n/locales/hr.d.ts +2 -266
  61. package/types/src/i18n/locales/it.d.ts +2 -269
  62. package/types/src/models/User.d.ts +5 -0
  63. package/types/src/blocks/CodeBlockContent/shiki.bundle.d.ts +0 -82
@@ -1 +1 @@
1
- {"builtAt":1741855634620,"assets":[{"name":"blocknote.cjs","size":287175},{"name":"comments.cjs","size":11720},{"name":"comments.cjs.map","size":47301},{"name":"blocknote.cjs.map","size":1059573}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":7622,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":8039,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":7724,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":7897,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":8964,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":7828,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":7959,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/it.ts","size":7990,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":7258,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":7034,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":8189,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/no.ts","size":8071,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":7874,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":8126,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":8806,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/uk.ts","size":8740,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":7976,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":6961,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3648,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":9054,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/util/table.ts","size":1212,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1755,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":299,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":4130,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3609,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":9512,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1398,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2739,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":6903,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":490,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":4754,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":5122,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":3264,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts","size":342,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts","size":1725,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/parseAudioElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/AudioBlockContent.ts","size":3155,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/defaultSupportedLanguages.ts","size":1707,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/CodeBlockContent.ts","size":9104,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1460,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts","size":4637,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/parseImageElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3243,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts","size":854,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3418,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1429,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3415,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7148,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":2207,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":4427,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1434,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":2275,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":4708,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/parseVideoElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3162,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1147,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1688,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":6763,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/schema.ts","size":350,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":1141,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5693,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2324,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":2533,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts","size":123,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2452,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1120,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":4698,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts","size":2880,"chunks":["a1ee98a"]},{"name":"./src/util/esmDependencies.ts","size":820,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":969,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":837,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":115,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3917,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":1552,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":859,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5228,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":819,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/createCollaborationExtensions.ts","size":3553,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1354,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":6448,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":3584,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":5323,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3228,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":14774,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7611,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1195,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3609,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4826,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":967,"chunks":["a1ee98a"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4482,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14087,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":8070,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":26922,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":976,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":753,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1563,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2038,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1102,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":4887,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":3846,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":29564,"chunks":["a1ee98a"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1075,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1204,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":3860,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"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":2907,"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":7223,"chunks":["1627b02"]},{"name":"./src/comments/index.ts","size":0,"chunks":["1627b02"]}]}
1
+ {"builtAt":1742379509520,"assets":[{"name":"blocknote.cjs","size":290407},{"name":"comments.cjs","size":11826},{"name":"comments.cjs.map","size":47556},{"name":"blocknote.cjs.map","size":1068595}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]}],"modules":[{"name":"./src/i18n/locales/ar.ts","size":7747,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/de.ts","size":8463,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/en.ts","size":7849,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/es.ts","size":8327,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":9094,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/hr.ts","size":8359,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/is.ts","size":8080,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/it.ts","size":8419,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ja.ts","size":7369,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ko.ts","size":7145,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":8321,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/no.ts","size":8191,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pl.ts","size":8011,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/pt.ts","size":8259,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ru.ts","size":8944,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/uk.ts","size":8877,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/vi.ts","size":8114,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":7068,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3648,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":9054,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/util/table.ts","size":1212,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1755,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":299,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":4130,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3609,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":9521,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1398,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2739,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/tables/tables.ts","size":10346,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/blockToNode.ts","size":6903,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":490,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":4754,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":5122,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":3264,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":288,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts","size":342,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts","size":1725,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts","size":753,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts","size":307,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts","size":294,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/parseAudioElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/AudioBlockContent/AudioBlockContent.ts","size":3155,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/defaultSupportedLanguages.ts","size":1707,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/CodeBlockContent.ts","size":9104,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1460,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts","size":4637,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/parseImageElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3243,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts","size":854,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3418,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1429,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3415,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7148,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":2207,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":4427,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1434,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":2275,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":4708,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/parseVideoElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3162,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1147,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1688,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":6811,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/schema.ts","size":350,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":1141,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts","size":5693,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2324,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":2533,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts","size":123,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":2452,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1120,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":4698,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts","size":2880,"chunks":["a1ee98a"]},{"name":"./src/util/esmDependencies.ts","size":820,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts","size":969,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":837,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":115,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3917,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleVSCodePaste.ts","size":661,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/pasteExtension.ts","size":1552,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/fragmentToBlocks.ts","size":859,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5228,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":819,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/createCollaborationExtensions.ts","size":3553,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1354,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":7660,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":3584,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":5323,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3228,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":14774,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7611,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1195,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3609,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4826,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":967,"chunks":["a1ee98a"]},{"name":"./src/extensions/getDraggableBlockFromElement.ts","size":404,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/dragging.ts","size":4733,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14087,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":8070,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":26718,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":976,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":753,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1563,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":2038,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1102,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":4887,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":3938,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":29570,"chunks":["a1ee98a"]},{"name":"./src/editor/defaultColors.ts","size":1193,"chunks":["a1ee98a"]},{"name":"./src/exporter/Exporter.ts","size":1075,"chunks":["a1ee98a"]},{"name":"./src/exporter/mapping.ts","size":197,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts","size":1204,"chunks":["a1ee98a"]},{"name":"./src/util/combineByGroup.ts","size":550,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":3860,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"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"]}]}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "*.css"
7
7
  ],
8
8
  "license": "MPL-2.0",
9
- "version": "0.25.2",
9
+ "version": "0.26.0",
10
10
  "files": [
11
11
  "dist",
12
12
  "types",
@@ -137,5 +137,5 @@
137
137
  "access": "public",
138
138
  "registry": "https://registry.npmjs.org/"
139
139
  },
140
- "gitHead": "8bb9bc6be7b7865ff3a6baffef1877ab079244e9"
140
+ "gitHead": "7d8c79c62c750db921208c373e6ae7b0c42f994c"
141
141
  }
@@ -82,6 +82,7 @@ export function contentNodeToTableContent<
82
82
 
83
83
  // Only merge if the last and first content are both styled text nodes and have the same styles
84
84
  if (
85
+ first &&
85
86
  isStyledTextInlineContent(last) &&
86
87
  isStyledTextInlineContent(first) &&
87
88
  JSON.stringify(last.styles) === JSON.stringify(first.styles)
@@ -0,0 +1,129 @@
1
+ [
2
+ {
3
+ "id": "1",
4
+ "type": "table",
5
+ "props": {
6
+ "textColor": "default"
7
+ },
8
+ "content": {
9
+ "type": "tableContent",
10
+ "columnWidths": [
11
+ null
12
+ ],
13
+ "rows": [
14
+ {
15
+ "cells": [
16
+ {
17
+ "type": "tableCell",
18
+ "content": [
19
+ {
20
+ "type": "text",
21
+ "text": "Company",
22
+ "styles": {
23
+ "underline": true
24
+ }
25
+ }
26
+ ],
27
+ "props": {
28
+ "colspan": 1,
29
+ "rowspan": 1,
30
+ "backgroundColor": "default",
31
+ "textColor": "default",
32
+ "textAlignment": "left"
33
+ }
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "cells": [
39
+ {
40
+ "type": "tableCell",
41
+ "content": [
42
+ {
43
+ "type": "text",
44
+ "text": "Example Company Inc.",
45
+ "styles": {
46
+ "bold": true
47
+ }
48
+ },
49
+ {
50
+ "type": "text",
51
+ "text": "\n \nName: [Company Representative]\nTitle: Chief Executive Officer",
52
+ "styles": {}
53
+ }
54
+ ],
55
+ "props": {
56
+ "colspan": 1,
57
+ "rowspan": 1,
58
+ "backgroundColor": "default",
59
+ "textColor": "default",
60
+ "textAlignment": "left"
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ },
67
+ "children": []
68
+ },
69
+ {
70
+ "id": "2",
71
+ "type": "table",
72
+ "props": {
73
+ "textColor": "default"
74
+ },
75
+ "content": {
76
+ "type": "tableContent",
77
+ "columnWidths": [
78
+ null
79
+ ],
80
+ "rows": [
81
+ {
82
+ "cells": [
83
+ {
84
+ "type": "tableCell",
85
+ "content": [
86
+ {
87
+ "type": "text",
88
+ "text": "Advisor",
89
+ "styles": {
90
+ "underline": true
91
+ }
92
+ }
93
+ ],
94
+ "props": {
95
+ "colspan": 1,
96
+ "rowspan": 1,
97
+ "backgroundColor": "default",
98
+ "textColor": "default",
99
+ "textAlignment": "left"
100
+ }
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "cells": [
106
+ {
107
+ "type": "tableCell",
108
+ "content": [
109
+ {
110
+ "type": "text",
111
+ "text": "[Advisor Name]",
112
+ "styles": {}
113
+ }
114
+ ],
115
+ "props": {
116
+ "colspan": 1,
117
+ "rowspan": 1,
118
+ "backgroundColor": "default",
119
+ "textColor": "default",
120
+ "textAlignment": "left"
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ },
127
+ "children": []
128
+ }
129
+ ]
@@ -346,6 +346,41 @@ describe("Parse HTML", () => {
346
346
  await parseHTMLAndCompareSnapshots(html, "parse-div-with-inline-content");
347
347
  });
348
348
 
349
+ it("Parses 2 tables", async () => {
350
+ const html = `
351
+ <table style="border-collapse:collapse;margin-left:255.478pt" cellspacing="0">
352
+ <tr style="height:22pt">
353
+ <td style="width:203pt">
354
+ <p data-text-alignment="left" data-text-indent="0pt"><u>Company</u></p>
355
+ </td>
356
+ </tr>
357
+ <tr style="height:86pt">
358
+ <td style="width:203pt">
359
+ <p data-text-alignment="left" data-text-indent="0pt"><b>Example Company Inc.</b></p>
360
+ <p data-text-alignment="left" data-text-indent="0pt">
361
+ <p>Name: [Company Representative]</p>
362
+ </p>
363
+ <p data-text-alignment="left" data-text-indent="0pt">Title: Chief Executive Officer</p>
364
+ </td>
365
+ </tr>
366
+ </table>
367
+
368
+ <table style="border-collapse:collapse;margin-left:256.5pt" cellspacing="0">
369
+ <tr style="height:58pt">
370
+ <td style="width:209pt;border-bottom-style:solid;border-bottom-width:2pt">
371
+ <p data-text-alignment="left" data-text-indent="0pt"><u>Advisor</u></p>
372
+ </td>
373
+ </tr>
374
+ <tr style="height:13pt">
375
+ <td style="width:209pt;border-top-style:solid;border-top-width:2pt">
376
+ <p data-text-alignment="left" data-text-indent="0pt">[Advisor Name]</p>
377
+ </td>
378
+ </tr>
379
+ </table>`;
380
+
381
+ await parseHTMLAndCompareSnapshots(html, "parse-2-tables");
382
+ });
383
+
349
384
  it("Parse Notion HTML", async () => {
350
385
  // A few notes on Notion output HTML:
351
386
  // - Does not preserve text/background colors
@@ -237,6 +237,7 @@ export class YjsThreadStore extends YjsThreadStoreBase {
237
237
 
238
238
  yThread.set("resolved", true);
239
239
  yThread.set("resolvedUpdatedAt", new Date().getTime());
240
+ yThread.set("resolvedBy", this.userId);
240
241
  });
241
242
 
242
243
  public unresolveThread = this.transact((options: { threadId: string }) => {
@@ -40,6 +40,7 @@ export function threadToYMap(thread: ThreadData) {
40
40
  yMap.set("comments", commentsArray);
41
41
  yMap.set("resolved", thread.resolved);
42
42
  yMap.set("resolvedUpdatedAt", thread.resolvedUpdatedAt?.getTime());
43
+ yMap.set("resolvedBy", thread.resolvedBy);
43
44
  yMap.set("metadata", thread.metadata);
44
45
  return yMap;
45
46
  }
@@ -115,7 +116,8 @@ export function yMapToThread(yMap: Y.Map<any>): ThreadData {
115
116
  (comment) => yMapToComment(comment)
116
117
  ),
117
118
  resolved: yMap.get("resolved"),
118
- resolvedUpdatedAt: yMap.get("resolvedUpdatedAt"),
119
+ resolvedUpdatedAt: new Date(yMap.get("resolvedUpdatedAt")),
120
+ resolvedBy: yMap.get("resolvedBy"),
119
121
  metadata: yMap.get("metadata"),
120
122
  };
121
123
  }
@@ -105,6 +105,10 @@ export type ThreadData = {
105
105
  * The date when the thread was marked as resolved.
106
106
  */
107
107
  resolvedUpdatedAt?: Date;
108
+ /**
109
+ * The id of the user that marked the thread as resolved.
110
+ */
111
+ resolvedBy?: string;
108
112
  /**
109
113
  * You can use this store any additional information about the thread.
110
114
  */
@@ -542,6 +542,6 @@ NESTED BLOCKS
542
542
  background: rgba(255, 200, 0, 0.15);
543
543
  }
544
544
 
545
- .bn-thread-mark:not([data-orphan="true"]) .bn-thread-mark-selected {
545
+ .bn-thread-mark .bn-thread-mark-selected {
546
546
  background: rgba(255, 200, 0, 0.25);
547
547
  }
@@ -688,7 +688,7 @@ export class BlockNoteEditor<
688
688
  parentElement?: HTMLElement | null,
689
689
  contentComponent?: any
690
690
  ) => {
691
- this._tiptapEditor.mount(parentElement, contentComponent);
691
+ this._tiptapEditor.mount(this, parentElement, contentComponent);
692
692
  };
693
693
 
694
694
  /**
@@ -10,6 +10,7 @@ import { EditorState, Transaction } from "@tiptap/pm/state";
10
10
  import { blockToNode } from "../api/nodeConversions/blockToNode.js";
11
11
  import { PartialBlock } from "../blocks/defaultBlocks.js";
12
12
  import { StyleSchema } from "../schema/index.js";
13
+ import type { BlockNoteEditor } from "./BlockNoteEditor.js";
13
14
 
14
15
  export type BlockNoteTipTapEditorOptions = Partial<
15
16
  Omit<EditorOptions, "content">
@@ -149,7 +150,10 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
149
150
  /**
150
151
  * Replace the default `createView` method with a custom one - which we call on mount
151
152
  */
152
- private createViewAlternative(contentComponent?: any) {
153
+ private createViewAlternative(
154
+ blockNoteEditor: BlockNoteEditor<any, any, any>,
155
+ contentComponent?: any
156
+ ) {
153
157
  (this as any).contentComponent = contentComponent;
154
158
 
155
159
  const markViews: any = {};
@@ -157,7 +161,8 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
157
161
  if (extension.type === "mark" && extension.config.addMarkView) {
158
162
  // Note: migrate to using `addMarkView` from tiptap as soon as this lands
159
163
  // (currently tiptap doesn't support markviews)
160
- markViews[extension.name] = extension.config.addMarkView;
164
+ markViews[extension.name] =
165
+ extension.config.addMarkView(blockNoteEditor);
161
166
  }
162
167
  });
163
168
 
@@ -169,19 +174,21 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
169
174
  dispatchTransaction: this.dispatchTransaction.bind(this),
170
175
  state: this.state,
171
176
  markViews,
177
+ nodeViews: this.extensionManager.nodeViews,
172
178
  }
173
179
  );
174
180
 
175
181
  // `editor.view` is not yet available at this time.
176
- // Therefore we will add all plugins and node views directly afterwards.
182
+ // Therefore we will add all plugins directly afterwards.
183
+ //
184
+ // To research: this is the default tiptap behavior, but might actually not be necessary
185
+ // it feels like it's a workaround for plugins that don't account for the view not being available yet
177
186
  const newState = this.state.reconfigure({
178
187
  plugins: this.extensionManager.plugins,
179
188
  });
180
189
 
181
190
  this.view.updateState(newState);
182
191
 
183
- this.createNodeViews();
184
-
185
192
  // emit the created event, call here manually because we blocked the default call in the constructor
186
193
  // (https://github.com/ueberdosis/tiptap/blob/45bac803283446795ad1b03f43d3746fa54a68ff/packages/core/src/Editor.ts#L117)
187
194
  this.commands.focus(
@@ -198,12 +205,16 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
198
205
  *
199
206
  * @param element DOM element to mount to, ur null / undefined to destroy
200
207
  */
201
- public mount = (element?: HTMLElement | null, contentComponent?: any) => {
208
+ public mount = (
209
+ blockNoteEditor: BlockNoteEditor<any, any, any>,
210
+ element?: HTMLElement | null,
211
+ contentComponent?: any
212
+ ) => {
202
213
  if (!element) {
203
214
  this.destroy();
204
215
  } else {
205
216
  this.options.element = element;
206
- this.createViewAlternative(contentComponent);
217
+ this.createViewAlternative(blockNoteEditor, contentComponent);
207
218
  }
208
219
  };
209
220
  }
@@ -16,11 +16,6 @@ const PLUGIN_KEY = new PluginKey(`blocknote-comments`);
16
16
  const SET_SELECTED_THREAD_ID = "SET_SELECTED_THREAD_ID";
17
17
 
18
18
  type CommentsPluginState = {
19
- /**
20
- * Store the positions of all threads in the document.
21
- * this can be used later to implement a floating sidebar
22
- */
23
- threadPositions: Map<string, { from: number; to: number }>;
24
19
  /**
25
20
  * Decorations to be rendered, specifically to indicate the selected thread
26
21
  */
@@ -28,15 +23,11 @@ type CommentsPluginState = {
28
23
  };
29
24
 
30
25
  /**
31
- * Get a new state (theadPositions and decorations) from the current document state
26
+ * Calculate the thread positions from the current document state
32
27
  */
33
- function updateState(
34
- doc: Node,
35
- selectedThreadId: string | undefined,
36
- markType: string
37
- ): CommentsPluginState {
28
+ function getUpdatedThreadPositions(doc: Node, markType: string) {
38
29
  const threadPositions = new Map<string, { from: number; to: number }>();
39
- const decorations: Decoration[] = [];
30
+
40
31
  // find all thread marks and store their position + create decoration for selected thread
41
32
  doc.descendants((node, pos) => {
42
33
  node.marks.forEach((mark) => {
@@ -59,34 +50,38 @@ function updateState(
59
50
  from: Math.min(from, currentPosition.from),
60
51
  to: Math.max(to, currentPosition.to),
61
52
  });
62
-
63
- if (selectedThreadId === thisThreadId) {
64
- decorations.push(
65
- Decoration.inline(from, to, {
66
- class: "bn-thread-mark-selected",
67
- })
68
- );
69
- }
70
53
  }
71
54
  });
72
55
  });
73
- return {
74
- decorations: DecorationSet.create(doc, decorations),
75
- threadPositions,
76
- };
56
+ return threadPositions;
77
57
  }
78
58
 
79
59
  export class CommentsPlugin extends EventEmitter<any> {
80
60
  public readonly plugin: Plugin;
81
61
  public readonly userStore: UserStore<User>;
82
62
 
63
+ /**
64
+ * Whether a comment is currently being composed
65
+ */
83
66
  private pendingComment = false;
67
+
68
+ /**
69
+ * The currently selected thread id
70
+ */
84
71
  private selectedThreadId: string | undefined;
85
72
 
73
+ /**
74
+ * Store the positions of all threads in the document.
75
+ * this can be used later to implement a floating sidebar
76
+ */
77
+ private threadPositions: Map<string, { from: number; to: number }> =
78
+ new Map();
79
+
86
80
  private emitStateUpdate() {
87
81
  this.emit("update", {
88
82
  selectedThreadId: this.selectedThreadId,
89
83
  pendingComment: this.pendingComment,
84
+ threadPositions: this.threadPositions,
90
85
  });
91
86
  }
92
87
 
@@ -168,18 +163,51 @@ export class CommentsPlugin extends EventEmitter<any> {
168
163
  state: {
169
164
  init() {
170
165
  return {
171
- threadPositions: new Map<string, { from: number; to: number }>(),
172
166
  decorations: DecorationSet.empty,
173
167
  };
174
168
  },
175
169
  apply(tr, state) {
176
170
  const action = tr.getMeta(PLUGIN_KEY);
171
+
177
172
  if (!tr.docChanged && !action) {
178
173
  return state;
179
174
  }
180
175
 
181
- // The doc changed or the selected thread changed
182
- return updateState(tr.doc, self.selectedThreadId, markType);
176
+ // only update threadPositions if the doc changed
177
+ const threadPositions = tr.docChanged
178
+ ? getUpdatedThreadPositions(tr.doc, self.markType)
179
+ : self.threadPositions;
180
+
181
+ if (threadPositions.size > 0 || self.threadPositions.size > 0) {
182
+ // small optimization; don't emit event if threadPositions before / after were both empty
183
+ self.threadPositions = threadPositions;
184
+ self.emitStateUpdate();
185
+ }
186
+
187
+ // update decorations if doc or selected thread changed
188
+ const decorations = [];
189
+
190
+ if (self.selectedThreadId) {
191
+ const selectedThreadPosition = threadPositions.get(
192
+ self.selectedThreadId
193
+ );
194
+
195
+ if (selectedThreadPosition) {
196
+ decorations.push(
197
+ Decoration.inline(
198
+ selectedThreadPosition.from,
199
+ selectedThreadPosition.to,
200
+ {
201
+ class: "bn-thread-mark-selected",
202
+ }
203
+ )
204
+ );
205
+ }
206
+ }
207
+
208
+ return {
209
+ decorations: DecorationSet.create(tr.doc, decorations),
210
+ };
183
211
  },
184
212
  },
185
213
  props: {
@@ -206,7 +234,7 @@ export class CommentsPlugin extends EventEmitter<any> {
206
234
  );
207
235
 
208
236
  const threadId = commentMark?.attrs.threadId as string | undefined;
209
- self.selectThread(threadId);
237
+ self.selectThread(threadId, false);
210
238
  },
211
239
  },
212
240
  });
@@ -219,6 +247,7 @@ export class CommentsPlugin extends EventEmitter<any> {
219
247
  callback: (state: {
220
248
  pendingComment: boolean;
221
249
  selectedThreadId: string | undefined;
250
+ threadPositions: Map<string, { from: number; to: number }>;
222
251
  }) => void
223
252
  ) {
224
253
  return this.on("update", callback);
@@ -227,7 +256,7 @@ export class CommentsPlugin extends EventEmitter<any> {
227
256
  /**
228
257
  * Set the selected thread
229
258
  */
230
- public selectThread(threadId: string | undefined) {
259
+ public selectThread(threadId: string | undefined, scrollToThread = true) {
231
260
  if (this.selectedThreadId === threadId) {
232
261
  return;
233
262
  }
@@ -238,6 +267,24 @@ export class CommentsPlugin extends EventEmitter<any> {
238
267
  name: SET_SELECTED_THREAD_ID,
239
268
  })
240
269
  );
270
+
271
+ if (threadId && scrollToThread) {
272
+ const selectedThreadPosition = this.threadPositions.get(threadId);
273
+
274
+ if (!selectedThreadPosition) {
275
+ return;
276
+ }
277
+
278
+ // When a new thread is selected, scrolls the page to its reference text in
279
+ // the editor.
280
+ (
281
+ this.editor.prosemirrorView?.domAtPos(selectedThreadPosition.from)
282
+ .node as Element | undefined
283
+ )?.scrollIntoView({
284
+ behavior: "smooth",
285
+ block: "center",
286
+ });
287
+ }
241
288
  }
242
289
 
243
290
  /**
@@ -99,6 +99,19 @@ function setDragImage(view: EditorView, from: number, to = from) {
99
99
  unsetDragImage(view.root);
100
100
  dragImageElement = parentClone;
101
101
 
102
+ // Browsers may have CORS policies which prevents iframes from being
103
+ // manipulated, so better to stay on the safe side and remove them from the
104
+ // drag preview. The drag preview doesn't work with iframes anyway.
105
+ const iframes = dragImageElement.getElementsByTagName("iframe");
106
+ for (let i = 0; i < iframes.length; i++) {
107
+ const iframe = iframes[i];
108
+ const parent = iframe.parentElement;
109
+
110
+ if (parent) {
111
+ parent.removeChild(iframe);
112
+ }
113
+ }
114
+
102
115
  // TODO: This is hacky, need a better way of assigning classes to the editor so that they can also be applied to the
103
116
  // drag preview.
104
117
  const classes = view.dom.className.split(" ");