@blocknote/core 0.31.1 → 0.31.3
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.
- package/dist/blocknote.cjs +7 -7
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +506 -485
- package/dist/blocknote.js.map +1 -1
- package/dist/{en-BXVKCwYt.cjs → en-C0Chm3Nc.cjs} +2 -2
- package/dist/{en-BXVKCwYt.cjs.map → en-C0Chm3Nc.cjs.map} +1 -1
- package/dist/{en-qGo6sk9V.js → en-CdzlzPhp.js} +4 -1
- package/dist/{en-qGo6sk9V.js.map → en-CdzlzPhp.js.map} +1 -1
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +62 -5
- package/dist/locales.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +1 -1
- package/src/api/nodeConversions/blockToNode.ts +6 -2
- package/src/editor/Block.css +14 -19
- package/src/editor/BlockNoteExtensions.ts +1 -1
- package/src/extensions/Collaboration/ForkYDocPlugin.ts +26 -8
- package/src/extensions/Collaboration/UndoPlugin.ts +3 -2
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +16 -4
- package/src/i18n/locales/ar.ts +3 -0
- package/src/i18n/locales/de.ts +3 -0
- package/src/i18n/locales/en.ts +3 -0
- package/src/i18n/locales/es.ts +3 -0
- package/src/i18n/locales/fr.ts +3 -0
- package/src/i18n/locales/hr.ts +3 -0
- package/src/i18n/locales/is.ts +3 -0
- package/src/i18n/locales/it.ts +3 -0
- package/src/i18n/locales/ja.ts +3 -0
- package/src/i18n/locales/ko.ts +3 -0
- package/src/i18n/locales/nl.ts +3 -0
- package/src/i18n/locales/no.ts +3 -0
- package/src/i18n/locales/pl.ts +3 -0
- package/src/i18n/locales/pt.ts +3 -0
- package/src/i18n/locales/ru.ts +3 -0
- package/src/i18n/locales/sk.ts +3 -0
- package/src/i18n/locales/uk.ts +3 -0
- package/src/i18n/locales/vi.ts +3 -0
- package/src/i18n/locales/zh-tw.ts +3 -0
- package/src/i18n/locales/zh.ts +3 -0
- package/types/src/extensions/Collaboration/UndoPlugin.d.ts +4 -1
- package/types/src/i18n/locales/en.d.ts +3 -0
- package/types/src/i18n/locales/sk.d.ts +3 -0
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":1747989946961,"assets":[{"name":"blocknote.cjs","size":190950},{"name":"comments.cjs","size":11826},{"name":"locales.cjs","size":122928},{"name":"en-BXVKCwYt.cjs","size":5518},{"name":"en-BXVKCwYt.cjs.map","size":12761},{"name":"comments.cjs.map","size":47628},{"name":"locales.cjs.map","size":259333},{"name":"blocknote.cjs.map","size":913210}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-BXVKCwYt.cjs"],"names":["en"]}],"modules":[{"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/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2080,"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":4072,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3612,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["a1ee98a"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13005,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1398,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2559,"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":7135,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":3150,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":785,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":1876,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":5637,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":5025,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":3099,"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":1710,"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":3219,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/CodeBlockContent.ts","size":9248,"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/FileBlockContent/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1524,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3376,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts","size":4836,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/parseImageElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3374,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/getListItemContent.ts","size":1425,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1443,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3121,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7286,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":2207,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":4057,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1520,"chunks":["a1ee98a"]},{"name":"./src/blocks/QuoteBlockContent/QuoteBlockContent.ts","size":1953,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":2297,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":6183,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/parseVideoElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3293,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1163,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1688,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":7012,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts","size":854,"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/moveBlocks/moveBlocks.ts","size":5642,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2284,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":1895,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5093,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2430,"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":429,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1129,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3928,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1112,"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/nodeConversions/fragmentToBlocks.ts","size":629,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5159,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":819,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtension.ts","size":345,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":3785,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/SyncPlugin.ts","size":244,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/UndoPlugin.ts","size":227,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1354,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":7815,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":4135,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":6083,"chunks":["a1ee98a"]},{"name":"./src/extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3228,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":18080,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7699,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1367,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3895,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":5232,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":1043,"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":4718,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14178,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1652,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9079,"chunks":["a1ee98a"]},{"name":"./src/extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":27335,"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":2170,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1146,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/ForkYDocPlugin.ts","size":3911,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5400,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":5702,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":37455,"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/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"]},{"name":"./src/i18n/locales/ar.ts","size":7874,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":8600,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":8457,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":9228,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":8490,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":8222,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":8553,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":7485,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":7261,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":8458,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":8333,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":8145,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":8391,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":9077,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":8288,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":9004,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":8253,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":7179,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":7204,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/en.ts","size":7979,"chunks":["a1e239a"]}]}
|
|
1
|
+
{"builtAt":1750242497062,"assets":[{"name":"blocknote.cjs","size":191470},{"name":"comments.cjs","size":11826},{"name":"locales.cjs","size":124426},{"name":"en-C0Chm3Nc.cjs","size":5586},{"name":"en-C0Chm3Nc.cjs.map","size":12892},{"name":"comments.cjs.map","size":47628},{"name":"locales.cjs.map","size":262029},{"name":"blocknote.cjs.map","size":915002}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.cjs"],"names":["blocknote"]},{"id":"1627b02","entry":true,"initial":true,"files":["comments.cjs"],"names":["comments"]},{"id":"9eaffe2","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"a1e239a","entry":false,"initial":true,"files":["en-C0Chm3Nc.cjs"],"names":["en"]}],"modules":[{"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/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":2080,"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":4072,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":3612,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":3797,"chunks":["a1ee98a"]},{"name":"./src/api/pmUtil.ts","size":651,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeToBlock.ts","size":13005,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1398,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":2559,"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":7193,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":3150,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts","size":785,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts","size":1876,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/updateBlock/updateBlock.ts","size":5637,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksExternalHTML.ts","size":5025,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":886,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/serializeBlocksInternalHTML.ts","size":3099,"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":1710,"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":3219,"chunks":["a1ee98a"]},{"name":"./src/blocks/CodeBlockContent/CodeBlockContent.ts","size":9248,"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/FileBlockContent/helpers/parse/parseEmbedElement.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/FileBlockContent.ts","size":1524,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3376,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts","size":4836,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/parseImageElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3374,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/getListItemContent.ts","size":1425,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1443,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3121,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts","size":7286,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":2207,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":4057,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1520,"chunks":["a1ee98a"]},{"name":"./src/blocks/QuoteBlockContent/QuoteBlockContent.ts","size":1953,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":2297,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":6183,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/parseVideoElement.ts","size":175,"chunks":["a1ee98a"]},{"name":"./src/blocks/VideoBlockContent/VideoBlockContent.ts","size":3293,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1163,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":1688,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":7012,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":1044,"chunks":["a1ee98a"]},{"name":"./src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts","size":854,"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/moveBlocks/moveBlocks.ts","size":5642,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/nestBlock/nestBlock.ts","size":2284,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/getBlock/getBlock.ts","size":1895,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/insertContentAt.ts","size":1049,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/selection.ts","size":5093,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/selections/textCursorPosition.ts","size":2430,"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":429,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1129,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/acceptedMIMETypes.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/handleFileInsertion.ts","size":3928,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1112,"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/nodeConversions/fragmentToBlocks.ts","size":629,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/toClipboard/copyExtension.ts","size":5159,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":819,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtension.ts","size":345,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":3785,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/SyncPlugin.ts","size":244,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/UndoPlugin.ts","size":265,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentMark.ts","size":1428,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/userstore/UserStore.ts","size":1354,"chunks":["a1ee98a"]},{"name":"./src/extensions/Comments/CommentsPlugin.ts","size":7815,"chunks":["a1ee98a"]},{"name":"./src/extensions/FilePanel/FilePanelPlugin.ts","size":4135,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":6083,"chunks":["a1ee98a"]},{"name":"./src/extensions/HardBreak/HardBreak.ts","size":376,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts","size":3228,"chunks":["a1ee98a"]},{"name":"./src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts","size":18379,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7699,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/protocols.ts","size":172,"chunks":["a1ee98a"]},{"name":"./src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts","size":1367,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":3895,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":5232,"chunks":["a1ee98a"]},{"name":"./src/extensions/ShowSelection/ShowSelectionPlugin.ts","size":1043,"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":4718,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14178,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1652,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9079,"chunks":["a1ee98a"]},{"name":"./src/extensions/Suggestions/SuggestionMarks.ts","size":4452,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":27335,"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":2170,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1146,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":134,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/ForkYDocPlugin.ts","size":4306,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5423,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":5702,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":37455,"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/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"]},{"name":"./src/i18n/locales/ar.ts","size":7962,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":8698,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":8549,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":9323,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":8580,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":8308,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":8645,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":7566,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":7338,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":8551,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":8422,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":8236,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":8482,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":9171,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":8378,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":9104,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":8341,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":7256,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":7281,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/en.ts","size":8065,"chunks":["a1e239a"]}]}
|
package/package.json
CHANGED
|
@@ -40,9 +40,13 @@ function styledTextToNodes<T extends StyleSchema>(
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (config.propSchema === "boolean") {
|
|
43
|
-
|
|
43
|
+
if (value) {
|
|
44
|
+
marks.push(schema.mark(style));
|
|
45
|
+
}
|
|
44
46
|
} else if (config.propSchema === "string") {
|
|
45
|
-
|
|
47
|
+
if (value) {
|
|
48
|
+
marks.push(schema.mark(style, { stringValue: value }));
|
|
49
|
+
}
|
|
46
50
|
} else {
|
|
47
51
|
throw new UnreachableCaseError(config.propSchema);
|
|
48
52
|
}
|
package/src/editor/Block.css
CHANGED
|
@@ -15,26 +15,9 @@ BASIC STYLES
|
|
|
15
15
|
|
|
16
16
|
.bn-block-content {
|
|
17
17
|
padding: 3px 0;
|
|
18
|
+
display: flex;
|
|
18
19
|
transition: font-size 0.2s;
|
|
19
20
|
width: 100%;
|
|
20
|
-
/*
|
|
21
|
-
because the content elements are display: block
|
|
22
|
-
we use flex to position them next to list markers
|
|
23
|
-
*/
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* We can't set `display: flex` on `.bn-block-content` while it has inline
|
|
27
|
-
content (see #1629). However, it's necessary to set alignment of blocks
|
|
28
|
-
without content as these can't use `text-align`, so this additional rule is
|
|
29
|
-
used. */
|
|
30
|
-
.bn-block-content:not(:has(.bn-inline-content)) {
|
|
31
|
-
display: flex;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.bn-block-content::before {
|
|
35
|
-
/* content: ""; */
|
|
36
|
-
transition: all 0.2s;
|
|
37
|
-
/*margin: 0px;*/
|
|
38
21
|
}
|
|
39
22
|
|
|
40
23
|
.bn-block-content.ProseMirror-selectednode > *,
|
|
@@ -44,6 +27,19 @@ used. */
|
|
|
44
27
|
outline: 4px solid rgb(100, 160, 255);
|
|
45
28
|
}
|
|
46
29
|
|
|
30
|
+
.bn-block-content::before {
|
|
31
|
+
content: "";
|
|
32
|
+
margin-right: 0;
|
|
33
|
+
transition: all 0.2s;
|
|
34
|
+
/* Workaround for selection issue on Chrome, see #1588 and also here:
|
|
35
|
+
https://discuss.prosemirror.net/t/mouse-down-selection-behaviour-different-on-chrome/8426
|
|
36
|
+
The :before element causes the selection to be set in the wrong place vs
|
|
37
|
+
other browsers. Setting no height fixes this, while list item indicators are
|
|
38
|
+
still displayed fine as overflow is not hidden. */
|
|
39
|
+
height: 0;
|
|
40
|
+
overflow: visible;
|
|
41
|
+
}
|
|
42
|
+
|
|
47
43
|
.bn-inline-content {
|
|
48
44
|
width: 100%;
|
|
49
45
|
}
|
|
@@ -175,7 +171,6 @@ NESTED BLOCKS
|
|
|
175
171
|
.bn-block-content::before {
|
|
176
172
|
margin-right: 0;
|
|
177
173
|
content: "";
|
|
178
|
-
display: inline;
|
|
179
174
|
}
|
|
180
175
|
|
|
181
176
|
/* Ordered */
|
|
@@ -116,7 +116,7 @@ export const getBlockNoteExtensions = <
|
|
|
116
116
|
|
|
117
117
|
if (opts.collaboration) {
|
|
118
118
|
ret["ySyncPlugin"] = new SyncPlugin(opts.collaboration.fragment);
|
|
119
|
-
ret["yUndoPlugin"] = new UndoPlugin();
|
|
119
|
+
ret["yUndoPlugin"] = new UndoPlugin({ editor: opts.editor });
|
|
120
120
|
|
|
121
121
|
if (opts.collaboration.provider?.awareness) {
|
|
122
122
|
ret["yCursorPlugin"] = new CursorPlugin(opts.collaboration);
|
|
@@ -86,6 +86,7 @@ export class ForkYDocPlugin extends BlockNoteExtension<{
|
|
|
86
86
|
private forkedState:
|
|
87
87
|
| {
|
|
88
88
|
originalFragment: Y.XmlFragment;
|
|
89
|
+
undoStack: Y.UndoManager["undoStack"];
|
|
89
90
|
forkedFragment: Y.XmlFragment;
|
|
90
91
|
}
|
|
91
92
|
| undefined;
|
|
@@ -114,6 +115,8 @@ export class ForkYDocPlugin extends BlockNoteExtension<{
|
|
|
114
115
|
const forkedFragment = this.findTypeInOtherYdoc(originalFragment, doc);
|
|
115
116
|
|
|
116
117
|
this.forkedState = {
|
|
118
|
+
undoStack: yUndoPluginKey.getState(this.editor.prosemirrorState)!
|
|
119
|
+
.undoManager.undoStack,
|
|
117
120
|
originalFragment,
|
|
118
121
|
forkedFragment,
|
|
119
122
|
};
|
|
@@ -128,7 +131,9 @@ export class ForkYDocPlugin extends BlockNoteExtension<{
|
|
|
128
131
|
this.editor._tiptapEditor.registerPlugin(
|
|
129
132
|
new SyncPlugin(forkedFragment).plugins[0],
|
|
130
133
|
);
|
|
131
|
-
this.editor._tiptapEditor.registerPlugin(
|
|
134
|
+
this.editor._tiptapEditor.registerPlugin(
|
|
135
|
+
new UndoPlugin({ editor: this.editor }).plugins[0],
|
|
136
|
+
);
|
|
132
137
|
// No need to register the cursor plugin again, it's a local fork
|
|
133
138
|
this.emit("forked", true);
|
|
134
139
|
}
|
|
@@ -146,17 +151,15 @@ export class ForkYDocPlugin extends BlockNoteExtension<{
|
|
|
146
151
|
this.editor._tiptapEditor.unregisterPlugin(ySyncPluginKey);
|
|
147
152
|
this.editor._tiptapEditor.unregisterPlugin(yUndoPluginKey);
|
|
148
153
|
|
|
149
|
-
const { originalFragment, forkedFragment } = this.forkedState;
|
|
150
|
-
if (keepChanges) {
|
|
151
|
-
// Apply any changes that have been made to the fork, onto the original doc
|
|
152
|
-
const update = Y.encodeStateAsUpdate(forkedFragment.doc!);
|
|
153
|
-
Y.applyUpdate(originalFragment.doc!, update);
|
|
154
|
-
}
|
|
154
|
+
const { originalFragment, forkedFragment, undoStack } = this.forkedState;
|
|
155
155
|
this.editor.extensions["ySyncPlugin"] = new SyncPlugin(originalFragment);
|
|
156
156
|
this.editor.extensions["yCursorPlugin"] = new CursorPlugin(
|
|
157
157
|
this.collaboration!,
|
|
158
158
|
);
|
|
159
|
-
this.editor.extensions["yUndoPlugin"] = new UndoPlugin(
|
|
159
|
+
this.editor.extensions["yUndoPlugin"] = new UndoPlugin({
|
|
160
|
+
editor: this.editor,
|
|
161
|
+
});
|
|
162
|
+
|
|
160
163
|
// Register the plugins again, based on the original fragment
|
|
161
164
|
this.editor._tiptapEditor.registerPlugin(
|
|
162
165
|
this.editor.extensions["ySyncPlugin"].plugins[0],
|
|
@@ -167,6 +170,21 @@ export class ForkYDocPlugin extends BlockNoteExtension<{
|
|
|
167
170
|
this.editor._tiptapEditor.registerPlugin(
|
|
168
171
|
this.editor.extensions["yUndoPlugin"].plugins[0],
|
|
169
172
|
);
|
|
173
|
+
|
|
174
|
+
// Reset the undo stack to the original undo stack
|
|
175
|
+
yUndoPluginKey.getState(
|
|
176
|
+
this.editor.prosemirrorState,
|
|
177
|
+
)!.undoManager.undoStack = undoStack;
|
|
178
|
+
|
|
179
|
+
if (keepChanges) {
|
|
180
|
+
// Apply any changes that have been made to the fork, onto the original doc
|
|
181
|
+
const update = Y.encodeStateAsUpdate(
|
|
182
|
+
forkedFragment.doc!,
|
|
183
|
+
Y.encodeStateVector(originalFragment.doc!),
|
|
184
|
+
);
|
|
185
|
+
// Applying this change will add to the undo stack, allowing it to be undone normally
|
|
186
|
+
Y.applyUpdate(originalFragment.doc!, update, this.editor);
|
|
187
|
+
}
|
|
170
188
|
// Reset the forked state
|
|
171
189
|
this.forkedState = undefined;
|
|
172
190
|
this.emit("forked", false);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { yUndoPlugin } from "y-prosemirror";
|
|
2
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
3
|
import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
|
|
3
4
|
|
|
4
5
|
export class UndoPlugin extends BlockNoteExtension {
|
|
@@ -6,9 +7,9 @@ export class UndoPlugin extends BlockNoteExtension {
|
|
|
6
7
|
return "yUndoPlugin";
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
constructor() {
|
|
10
|
+
constructor({ editor }: { editor: BlockNoteEditor<any, any, any> }) {
|
|
10
11
|
super();
|
|
11
|
-
this.addProsemirrorPlugin(yUndoPlugin());
|
|
12
|
+
this.addProsemirrorPlugin(yUndoPlugin({ trackedOrigins: [editor] }));
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
public get priority() {
|
|
@@ -434,7 +434,7 @@ export const KeyboardShortcutsExtension = Extension.create<{
|
|
|
434
434
|
]);
|
|
435
435
|
|
|
436
436
|
const handleEnter = (withShift = false) => {
|
|
437
|
-
return this.editor.commands.first(({ commands }) => [
|
|
437
|
+
return this.editor.commands.first(({ commands, tr }) => [
|
|
438
438
|
// Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
|
|
439
439
|
// of the block.
|
|
440
440
|
() =>
|
|
@@ -486,9 +486,21 @@ export const KeyboardShortcutsExtension = Extension.create<{
|
|
|
486
486
|
// both enter and shift+enter.
|
|
487
487
|
blockHardBreakShortcut === "enter"
|
|
488
488
|
) {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
const marks =
|
|
490
|
+
tr.storedMarks ||
|
|
491
|
+
tr.selection.$head
|
|
492
|
+
.marks()
|
|
493
|
+
.filter((m) =>
|
|
494
|
+
this.editor.extensionManager.splittableMarks.includes(
|
|
495
|
+
m.type.name,
|
|
496
|
+
),
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
tr.insert(
|
|
500
|
+
tr.selection.head,
|
|
501
|
+
tr.doc.type.schema.nodes.hardBreak.create(),
|
|
502
|
+
).ensureMarks(marks);
|
|
503
|
+
return true;
|
|
492
504
|
}
|
|
493
505
|
|
|
494
506
|
return false;
|
package/src/i18n/locales/ar.ts
CHANGED
package/src/i18n/locales/de.ts
CHANGED
package/src/i18n/locales/en.ts
CHANGED
package/src/i18n/locales/es.ts
CHANGED
package/src/i18n/locales/fr.ts
CHANGED
package/src/i18n/locales/hr.ts
CHANGED
package/src/i18n/locales/is.ts
CHANGED
package/src/i18n/locales/it.ts
CHANGED
package/src/i18n/locales/ja.ts
CHANGED
package/src/i18n/locales/ko.ts
CHANGED
package/src/i18n/locales/nl.ts
CHANGED
package/src/i18n/locales/no.ts
CHANGED
package/src/i18n/locales/pl.ts
CHANGED
package/src/i18n/locales/pt.ts
CHANGED
package/src/i18n/locales/ru.ts
CHANGED
package/src/i18n/locales/sk.ts
CHANGED
package/src/i18n/locales/uk.ts
CHANGED
package/src/i18n/locales/vi.ts
CHANGED
package/src/i18n/locales/zh.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
1
2
|
import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
|
|
2
3
|
export declare class UndoPlugin extends BlockNoteExtension {
|
|
3
4
|
static key(): string;
|
|
4
|
-
constructor(
|
|
5
|
+
constructor({ editor }: {
|
|
6
|
+
editor: BlockNoteEditor<any, any, any>;
|
|
7
|
+
});
|
|
5
8
|
get priority(): number;
|
|
6
9
|
}
|