@blocknote/core 0.35.0 → 0.36.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.
- package/LICENSE +1 -1
- package/README.md +7 -25
- package/dist/blocknote.cjs +8 -8
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +1030 -959
- package/dist/blocknote.js.map +1 -1
- package/dist/{en-Dx9fwHD4.js → en-CvDoFvhc.js} +4 -1
- package/dist/en-CvDoFvhc.js.map +1 -0
- package/dist/{en-CsgPjHa4.cjs → en-ub2yVBX0.cjs} +2 -2
- package/dist/en-ub2yVBX0.cjs.map +1 -0
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +62 -2
- 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 +16 -16
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +132 -4
- package/src/api/clipboard/toClipboard/copyExtension.ts +2 -0
- package/src/blocks/ImageBlockContent/parseImageElement.ts +2 -1
- package/src/blocks/ToggleWrapper/createToggleWrapper.ts +2 -1
- package/src/editor/editor.css +8 -17
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +57 -1
- package/src/extensions/SideMenu/SideMenuPlugin.ts +6 -15
- package/src/i18n/locales/ar.ts +3 -0
- package/src/i18n/locales/de.ts +4 -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/he.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 +4 -1
- package/src/i18n/locales/nl.ts +3 -0
- package/src/i18n/locales/no.ts +3 -0
- package/src/i18n/locales/pl.ts +4 -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/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +16 -3
- package/types/src/blocks/ImageBlockContent/parseImageElement.d.ts +1 -0
- package/types/src/i18n/locales/en.d.ts +3 -0
- package/types/src/i18n/locales/sk.d.ts +3 -0
- package/dist/en-CsgPjHa4.cjs.map +0 -1
- package/dist/en-Dx9fwHD4.js.map +0 -1
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":1753434995875,"assets":[{"name":"blocknote.cjs","size":198633},{"name":"comments.cjs","size":11826},{"name":"locales.cjs","size":157807},{"name":"en-CsgPjHa4.cjs","size":6613},{"name":"en-CsgPjHa4.cjs.map","size":14979},{"name":"comments.cjs.map","size":47628},{"name":"locales.cjs.map","size":326018},{"name":"blocknote.cjs.map","size":949091}],"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-CsgPjHa4.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":643,"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":3647,"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":3625,"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/ToggleWrapper/createToggleWrapper.ts","size":5193,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3467,"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/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1495,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.ts","size":2228,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/getListItemContent.ts","size":1425,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3162,"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":4098,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1520,"chunks":["a1ee98a"]},{"name":"./src/blocks/QuoteBlockContent/QuoteBlockContent.ts","size":2338,"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":1197,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2098,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":8656,"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":2035,"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":4255,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1140,"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/BlockChange/BlockChangePlugin.ts","size":988,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":4699,"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":6101,"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":16801,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1652,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9360,"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":4307,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5435,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":5736,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":37801,"chunks":["a1ee98a"]},{"name":"./src/editor/defaultColors.ts","size":1193,"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":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":9382,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10527,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10087,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11038,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9115,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":9907,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10089,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10512,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":8965,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8454,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10016,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10196,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9721,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":9888,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11054,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9773,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10721,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9777,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8448,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8488,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/en.ts","size":9418,"chunks":["a1e239a"]}]}
|
|
1
|
+
{"builtAt":1756129017162,"assets":[{"name":"blocknote.cjs","size":200464},{"name":"comments.cjs","size":11826},{"name":"locales.cjs","size":159619},{"name":"en-ub2yVBX0.cjs","size":6684},{"name":"en-ub2yVBX0.cjs.map","size":15098},{"name":"comments.cjs.map","size":47628},{"name":"locales.cjs.map","size":328798},{"name":"blocknote.cjs.map","size":957749}],"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-ub2yVBX0.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":643,"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":3647,"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":3625,"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":8371,"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/ToggleWrapper/createToggleWrapper.ts","size":5204,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3467,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts","size":4836,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/parseImageElement.ts","size":224,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":3374,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/commands/splitBlock/splitBlock.ts","size":868,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1495,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.ts","size":2228,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/getListItemContent.ts","size":1425,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":3162,"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":4098,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1520,"chunks":["a1ee98a"]},{"name":"./src/blocks/QuoteBlockContent/QuoteBlockContent.ts","size":2338,"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":1197,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":2098,"chunks":["a1ee98a"]},{"name":"./src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":8656,"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":2035,"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":4255,"chunks":["a1ee98a"]},{"name":"./src/api/clipboard/fromClipboard/fileDropExtension.ts","size":884,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/detectMarkdown.ts","size":1140,"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":5192,"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/BlockChange/BlockChangePlugin.ts","size":988,"chunks":["a1ee98a"]},{"name":"./src/extensions/Collaboration/CursorPlugin.ts","size":4699,"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":7075,"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":16723,"chunks":["a1ee98a"]},{"name":"./src/api/positionMapping.ts","size":1652,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":9360,"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":4307,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":5435,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":2604,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":5736,"chunks":["a1ee98a"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":37801,"chunks":["a1ee98a"]},{"name":"./src/editor/defaultColors.ts","size":1193,"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":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":9460,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/de.ts","size":10643,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/es.ts","size":10181,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/fr.ts","size":11129,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/he.ts","size":9193,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/hr.ts","size":10002,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/is.ts","size":10183,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/it.ts","size":10607,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ja.ts","size":9036,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ko.ts","size":8532,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/nl.ts","size":10113,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/no.ts","size":10289,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pl.ts","size":9828,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/pt.ts","size":9982,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/ru.ts","size":11154,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/sk.ts","size":9870,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/uk.ts","size":10817,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/vi.ts","size":9858,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh.ts","size":8510,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/zh-tw.ts","size":8550,"chunks":["9eaffe2"]},{"name":"./src/i18n/index.ts","size":0,"chunks":["9eaffe2"]},{"name":"./src/i18n/locales/en.ts","size":9502,"chunks":["a1e239a"]}]}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/core"
|
|
12
12
|
},
|
|
13
13
|
"license": "MPL-2.0",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.36.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"types",
|
|
@@ -66,21 +66,21 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@emoji-mart/data": "^1.2.1",
|
|
68
68
|
"@shikijs/types": "3.2.1",
|
|
69
|
-
"@tiptap/core": "^2.
|
|
70
|
-
"@tiptap/extension-bold": "^2.
|
|
71
|
-
"@tiptap/extension-code": "^2.
|
|
72
|
-
"@tiptap/extension-gapcursor": "^2.
|
|
73
|
-
"@tiptap/extension-history": "^2.
|
|
74
|
-
"@tiptap/extension-horizontal-rule": "^2.
|
|
75
|
-
"@tiptap/extension-italic": "^2.
|
|
76
|
-
"@tiptap/extension-link": "^2.
|
|
77
|
-
"@tiptap/extension-paragraph": "^2.
|
|
78
|
-
"@tiptap/extension-strike": "^2.
|
|
79
|
-
"@tiptap/extension-table-cell": "^2.
|
|
80
|
-
"@tiptap/extension-table-header": "^2.
|
|
81
|
-
"@tiptap/extension-text": "^2.
|
|
82
|
-
"@tiptap/extension-underline": "^2.
|
|
83
|
-
"@tiptap/pm": "^2.
|
|
69
|
+
"@tiptap/core": "^2.26.1",
|
|
70
|
+
"@tiptap/extension-bold": "^2.26.1",
|
|
71
|
+
"@tiptap/extension-code": "^2.26.1",
|
|
72
|
+
"@tiptap/extension-gapcursor": "^2.26.1",
|
|
73
|
+
"@tiptap/extension-history": "^2.26.1",
|
|
74
|
+
"@tiptap/extension-horizontal-rule": "^2.26.1",
|
|
75
|
+
"@tiptap/extension-italic": "^2.26.1",
|
|
76
|
+
"@tiptap/extension-link": "^2.26.1",
|
|
77
|
+
"@tiptap/extension-paragraph": "^2.26.1",
|
|
78
|
+
"@tiptap/extension-strike": "^2.26.1",
|
|
79
|
+
"@tiptap/extension-table-cell": "^2.26.1",
|
|
80
|
+
"@tiptap/extension-table-header": "^2.26.1",
|
|
81
|
+
"@tiptap/extension-text": "^2.26.1",
|
|
82
|
+
"@tiptap/extension-underline": "^2.26.1",
|
|
83
|
+
"@tiptap/pm": "^2.26.1",
|
|
84
84
|
"emoji-mart": "^5.6.0",
|
|
85
85
|
"hast-util-from-dom": "^5.0.1",
|
|
86
86
|
"prosemirror-dropcursor": "^1.8.2",
|
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
type Node as PMNode,
|
|
5
5
|
Slice,
|
|
6
6
|
} from "prosemirror-model";
|
|
7
|
-
import
|
|
8
|
-
|
|
7
|
+
import { TextSelection, Transaction } from "prosemirror-state";
|
|
8
|
+
import { TableMap } from "prosemirror-tables";
|
|
9
9
|
import { ReplaceStep, Transform } from "prosemirror-transform";
|
|
10
|
+
|
|
10
11
|
import type { Block, PartialBlock } from "../../../../blocks/defaultBlocks.js";
|
|
11
12
|
import type {
|
|
12
13
|
BlockIdentifier,
|
|
@@ -56,7 +57,7 @@ export function updateBlockTr<
|
|
|
56
57
|
I extends InlineContentSchema,
|
|
57
58
|
S extends StyleSchema,
|
|
58
59
|
>(
|
|
59
|
-
tr: Transform,
|
|
60
|
+
tr: Transform | Transaction,
|
|
60
61
|
posBeforeBlock: number,
|
|
61
62
|
block: PartialBlock<BSchema, I, S>,
|
|
62
63
|
replaceFromPos?: number,
|
|
@@ -64,6 +65,11 @@ export function updateBlockTr<
|
|
|
64
65
|
) {
|
|
65
66
|
const blockInfo = getBlockInfoFromResolvedPos(tr.doc.resolve(posBeforeBlock));
|
|
66
67
|
|
|
68
|
+
let cellAnchor: CellAnchor | null = null;
|
|
69
|
+
if (blockInfo.blockNoteType === "table") {
|
|
70
|
+
cellAnchor = captureCellAnchor(tr);
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
const pmSchema = getPmSchema(tr);
|
|
68
74
|
|
|
69
75
|
if (
|
|
@@ -143,6 +149,10 @@ export function updateBlockTr<
|
|
|
143
149
|
...blockInfo.bnBlock.node.attrs,
|
|
144
150
|
...block.props,
|
|
145
151
|
});
|
|
152
|
+
|
|
153
|
+
if (cellAnchor) {
|
|
154
|
+
restoreCellAnchor(tr, blockInfo, cellAnchor);
|
|
155
|
+
}
|
|
146
156
|
}
|
|
147
157
|
|
|
148
158
|
function updateBlockContentNode<
|
|
@@ -301,7 +311,7 @@ export function updateBlock<
|
|
|
301
311
|
I extends InlineContentSchema = any,
|
|
302
312
|
S extends StyleSchema = any,
|
|
303
313
|
>(
|
|
304
|
-
tr:
|
|
314
|
+
tr: Transform,
|
|
305
315
|
blockToUpdate: BlockIdentifier,
|
|
306
316
|
update: PartialBlock<BSchema, I, S>,
|
|
307
317
|
replaceFromPos?: number,
|
|
@@ -329,3 +339,121 @@ export function updateBlock<
|
|
|
329
339
|
const pmSchema = getPmSchema(tr);
|
|
330
340
|
return nodeToBlock(blockContainerNode, pmSchema);
|
|
331
341
|
}
|
|
342
|
+
|
|
343
|
+
type CellAnchor = { row: number; col: number; offset: number };
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Captures the cell anchor from the current selection.
|
|
347
|
+
* @param tr - The transaction to capture the cell anchor from.
|
|
348
|
+
*
|
|
349
|
+
* @returns The cell anchor, or null if no cell is selected.
|
|
350
|
+
*/
|
|
351
|
+
export function captureCellAnchor(tr: Transform): CellAnchor | null {
|
|
352
|
+
const sel = "selection" in tr ? tr.selection : null;
|
|
353
|
+
if (!(sel instanceof TextSelection)) {
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const $head = tr.doc.resolve(sel.head);
|
|
358
|
+
// Find enclosing cell and table
|
|
359
|
+
let cellDepth = -1;
|
|
360
|
+
let tableDepth = -1;
|
|
361
|
+
for (let d = $head.depth; d >= 0; d--) {
|
|
362
|
+
const name = $head.node(d).type.name;
|
|
363
|
+
if (cellDepth < 0 && (name === "tableCell" || name === "tableHeader")) {
|
|
364
|
+
cellDepth = d;
|
|
365
|
+
}
|
|
366
|
+
if (name === "table") {
|
|
367
|
+
tableDepth = d;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (cellDepth < 0 || tableDepth < 0) {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Absolute positions (before the cell)
|
|
376
|
+
const cellPos = $head.before(cellDepth);
|
|
377
|
+
const tablePos = $head.before(tableDepth);
|
|
378
|
+
const table = tr.doc.nodeAt(tablePos);
|
|
379
|
+
if (!table || table.type.name !== "table") {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Visual grid position via TableMap (handles spans)
|
|
384
|
+
const map = TableMap.get(table);
|
|
385
|
+
const rel = cellPos - (tablePos + 1); // relative to inside table
|
|
386
|
+
const idx = map.map.indexOf(rel);
|
|
387
|
+
if (idx < 0) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const row = Math.floor(idx / map.width);
|
|
392
|
+
const col = idx % map.width;
|
|
393
|
+
|
|
394
|
+
// Caret offset relative to the start of paragraph text
|
|
395
|
+
const paraPos = cellPos + 1; // pos BEFORE tableParagraph
|
|
396
|
+
const textStart = paraPos + 1; // start of paragraph text
|
|
397
|
+
const offset = Math.max(0, sel.head - textStart);
|
|
398
|
+
|
|
399
|
+
return { row, col, offset };
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function restoreCellAnchor(
|
|
403
|
+
tr: Transform | Transaction,
|
|
404
|
+
blockInfo: BlockInfo,
|
|
405
|
+
a: CellAnchor,
|
|
406
|
+
): boolean {
|
|
407
|
+
if (blockInfo.blockNoteType !== "table") {
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// 1) Resolve the table node in the current document
|
|
412
|
+
let tablePos = -1;
|
|
413
|
+
|
|
414
|
+
if (blockInfo.isBlockContainer) {
|
|
415
|
+
// Prefer the blockContent position when available (points directly at the PM table node)
|
|
416
|
+
tablePos = tr.mapping.map(blockInfo.blockContent.beforePos);
|
|
417
|
+
} else {
|
|
418
|
+
// Fallback: scan within the mapped bnBlock range to find the inner table node
|
|
419
|
+
const start = tr.mapping.map(blockInfo.bnBlock.beforePos);
|
|
420
|
+
const end = start + (tr.doc.nodeAt(start)?.nodeSize || 0);
|
|
421
|
+
tr.doc.nodesBetween(start, end, (node, pos) => {
|
|
422
|
+
if (node.type.name === "table") {
|
|
423
|
+
tablePos = pos;
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return true;
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const table = tablePos >= 0 ? tr.doc.nodeAt(tablePos) : null;
|
|
431
|
+
if (!table || table.type.name !== "table") {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// 2) Clamp row/col to the table’s current grid
|
|
436
|
+
const map = TableMap.get(table);
|
|
437
|
+
const row = Math.max(0, Math.min(a.row, map.height - 1));
|
|
438
|
+
const col = Math.max(0, Math.min(a.col, map.width - 1));
|
|
439
|
+
|
|
440
|
+
// 3) Compute the absolute position of the target cell (pos BEFORE the cell)
|
|
441
|
+
const cellIndex = row * map.width + col;
|
|
442
|
+
const relCellPos = map.map[cellIndex]; // relative to (tablePos + 1)
|
|
443
|
+
if (relCellPos == null) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
const cellPos = tablePos + 1 + relCellPos;
|
|
447
|
+
|
|
448
|
+
// 4) Place the caret inside the cell, clamping the text offset
|
|
449
|
+
const textPos = cellPos + 1;
|
|
450
|
+
const textNode = tr.doc.nodeAt(textPos);
|
|
451
|
+
const textStart = textPos + 1;
|
|
452
|
+
const max = textNode ? textNode.content.size : 0;
|
|
453
|
+
const head = textStart + Math.max(0, Math.min(a.offset, max));
|
|
454
|
+
|
|
455
|
+
if ("selection" in tr) {
|
|
456
|
+
tr.setSelection(TextSelection.create(tr.doc, head));
|
|
457
|
+
}
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
contentNodeToInlineContent,
|
|
18
18
|
contentNodeToTableContent,
|
|
19
19
|
} from "../../nodeConversions/nodeToBlock.js";
|
|
20
|
+
import { initializeESMDependencies } from "../../../util/esmDependencies.js";
|
|
20
21
|
|
|
21
22
|
function fragmentToExternalHTML<
|
|
22
23
|
BSchema extends BlockSchema,
|
|
@@ -208,6 +209,7 @@ export const createCopyToClipboardExtension = <
|
|
|
208
209
|
Extension.create<{ editor: BlockNoteEditor<BSchema, I, S> }, undefined>({
|
|
209
210
|
name: "copyToClipboard",
|
|
210
211
|
addProseMirrorPlugins() {
|
|
212
|
+
initializeESMDependencies();
|
|
211
213
|
return [
|
|
212
214
|
new Plugin({
|
|
213
215
|
props: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const parseImageElement = (imageElement: HTMLImageElement) => {
|
|
2
2
|
const url = imageElement.src || undefined;
|
|
3
3
|
const previewWidth = imageElement.width || undefined;
|
|
4
|
+
const name = imageElement.alt || undefined;
|
|
4
5
|
|
|
5
|
-
return { url, previewWidth };
|
|
6
|
+
return { url, previewWidth, name };
|
|
6
7
|
};
|
|
@@ -77,7 +77,8 @@ export const createToggleWrapper = (
|
|
|
77
77
|
const toggleAddBlockButton = document.createElement("button");
|
|
78
78
|
toggleAddBlockButton.className = "bn-toggle-add-block-button";
|
|
79
79
|
toggleAddBlockButton.type = "button";
|
|
80
|
-
toggleAddBlockButton.textContent =
|
|
80
|
+
toggleAddBlockButton.textContent =
|
|
81
|
+
editor.dictionary.toggle_blocks.add_block_button;
|
|
81
82
|
const toggleAddBlockButtonMouseDown = (event: MouseEvent) =>
|
|
82
83
|
event.preventDefault();
|
|
83
84
|
toggleAddBlockButton.addEventListener(
|
package/src/editor/editor.css
CHANGED
|
@@ -148,25 +148,16 @@ Tippy popups that are appended to document.body directly
|
|
|
148
148
|
transition: all 0.2s;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
/* .tableWrapper {
|
|
152
|
-
padding
|
|
153
|
-
} */
|
|
154
|
-
|
|
155
151
|
.bn-editor [data-content-type="table"] .tableWrapper {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
min-width: calc(100% + 16px);
|
|
161
|
-
padding-bottom: 16px;
|
|
152
|
+
/* Size of + buttons to add rows/columns. */
|
|
153
|
+
--bn-table-widget-size: 22px;
|
|
154
|
+
/* Size of table handles, divided by 2 since half the element is in the cell. */
|
|
155
|
+
--bn-table-handle-size: calc(18px / 2);
|
|
162
156
|
overflow-y: hidden;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/* top: -16px;
|
|
168
|
-
left: -16px; */
|
|
169
|
-
padding: 16px;
|
|
157
|
+
padding: var(--bn-table-handle-size) var(--bn-table-widget-size)
|
|
158
|
+
var(--bn-table-widget-size) var(--bn-table-handle-size);
|
|
159
|
+
position: relative;
|
|
160
|
+
width: 100%;
|
|
170
161
|
}
|
|
171
162
|
|
|
172
163
|
/* table related: */
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { isNodeSelection, isTextSelection, posToDOMRect } from "@tiptap/core";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
EditorState,
|
|
4
|
+
Plugin,
|
|
5
|
+
PluginKey,
|
|
6
|
+
PluginView,
|
|
7
|
+
TextSelection,
|
|
8
|
+
} from "prosemirror-state";
|
|
3
9
|
import { EditorView } from "prosemirror-view";
|
|
4
10
|
|
|
5
11
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
@@ -198,6 +204,56 @@ export class FormattingToolbarView implements PluginView {
|
|
|
198
204
|
// e.g. the download file button, should still be accessible. Therefore,
|
|
199
205
|
// logic for hiding when the editor is non-editable is handled
|
|
200
206
|
// individually in each button.
|
|
207
|
+
const newReferencePos = this.getSelectionBoundingBox();
|
|
208
|
+
|
|
209
|
+
// Workaround to ensure the correct reference position when rendering
|
|
210
|
+
// React components. Without this, e.g. updating styles on React inline
|
|
211
|
+
// content causes the formatting toolbar to be in the wrong place. We
|
|
212
|
+
// know the component has not yet rendered if the reference position has
|
|
213
|
+
// zero dimensions.
|
|
214
|
+
if (
|
|
215
|
+
newReferencePos.x === 0 ||
|
|
216
|
+
newReferencePos.y === 0 ||
|
|
217
|
+
newReferencePos.height === 0
|
|
218
|
+
) {
|
|
219
|
+
// Updates the reference position again following the render.
|
|
220
|
+
queueMicrotask(() => {
|
|
221
|
+
const nextState = {
|
|
222
|
+
show: true,
|
|
223
|
+
referencePos: this.getSelectionBoundingBox(),
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
this.state = nextState;
|
|
227
|
+
this.emitUpdate();
|
|
228
|
+
|
|
229
|
+
// For some reason, while the selection doesn't actually change and
|
|
230
|
+
// remains correct, it visually appears to be collapsed. This forces
|
|
231
|
+
// a ProseMirror view update, which fixes the issue.
|
|
232
|
+
view.dispatch(
|
|
233
|
+
view.state.tr.setSelection(
|
|
234
|
+
TextSelection.create(
|
|
235
|
+
view.state.doc,
|
|
236
|
+
view.state.selection.from + 1,
|
|
237
|
+
view.state.selection.to,
|
|
238
|
+
),
|
|
239
|
+
),
|
|
240
|
+
);
|
|
241
|
+
// 2 separate `dispatch` calls are needed, else ProseMirror realizes
|
|
242
|
+
// that the transaction is a no-op and doesn't update the view.
|
|
243
|
+
view.dispatch(
|
|
244
|
+
view.state.tr.setSelection(
|
|
245
|
+
TextSelection.create(
|
|
246
|
+
view.state.doc,
|
|
247
|
+
view.state.selection.from - 1,
|
|
248
|
+
view.state.selection.to,
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
201
257
|
const nextState = {
|
|
202
258
|
show: true,
|
|
203
259
|
referencePos: this.getSelectionBoundingBox(),
|
|
@@ -242,21 +242,11 @@ export class SideMenuView<
|
|
|
242
242
|
|
|
243
243
|
this.hoveredBlock = block.node;
|
|
244
244
|
|
|
245
|
-
// Gets the block's content node, which lets to ignore child blocks when determining the block menu's position.
|
|
246
|
-
// TODO: needed?
|
|
247
|
-
const blockContent = block.node.firstChild as HTMLElement;
|
|
248
|
-
|
|
249
|
-
if (!blockContent) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// TODO: needed?
|
|
254
|
-
|
|
255
245
|
// Shows or updates elements.
|
|
256
246
|
if (this.editor.isEditable) {
|
|
257
|
-
const blockContentBoundingBox =
|
|
247
|
+
const blockContentBoundingBox = block.node.getBoundingClientRect();
|
|
258
248
|
const column = block.node.closest("[data-node-type=column]");
|
|
259
|
-
this.
|
|
249
|
+
this.state = {
|
|
260
250
|
show: true,
|
|
261
251
|
referencePos: new DOMRect(
|
|
262
252
|
column
|
|
@@ -275,7 +265,8 @@ export class SideMenuView<
|
|
|
275
265
|
block: this.editor.getBlock(
|
|
276
266
|
this.hoveredBlock!.getAttribute("data-id")!,
|
|
277
267
|
)!,
|
|
278
|
-
}
|
|
268
|
+
};
|
|
269
|
+
this.updateState(this.state);
|
|
279
270
|
}
|
|
280
271
|
};
|
|
281
272
|
|
|
@@ -435,9 +426,9 @@ export class SideMenuView<
|
|
|
435
426
|
// We need to check if there is text content that is being dragged (select some text & just drag it)
|
|
436
427
|
const textContentIsBeingDragged =
|
|
437
428
|
!event.dataTransfer?.types.includes("blocknote/html") &&
|
|
438
|
-
|
|
429
|
+
!!this.pmView.dragging;
|
|
439
430
|
// This is the side menu drag from this plugin
|
|
440
|
-
const sideMenuIsBeingDragged =
|
|
431
|
+
const sideMenuIsBeingDragged = !!this.isDragOrigin;
|
|
441
432
|
// Tells us that the current editor instance has a drag ongoing (either text or side menu)
|
|
442
433
|
const isDragOrigin = textContentIsBeingDragged || sideMenuIsBeingDragged;
|
|
443
434
|
|
package/src/i18n/locales/ar.ts
CHANGED
package/src/i18n/locales/de.ts
CHANGED
|
@@ -217,6 +217,10 @@ export const de: Dictionary = {
|
|
|
217
217
|
add_button_text: "Datei hinzufügen",
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
|
+
toggle_blocks: {
|
|
221
|
+
add_block_button:
|
|
222
|
+
"Leerer aufklappbarer Bereich. Klicken, um einen Block hinzuzufügen.",
|
|
223
|
+
},
|
|
220
224
|
side_menu: {
|
|
221
225
|
add_block_label: "Block hinzufügen",
|
|
222
226
|
drag_handle_label: "Blockmenü öffnen",
|
package/src/i18n/locales/en.ts
CHANGED
package/src/i18n/locales/es.ts
CHANGED
|
@@ -197,6 +197,9 @@ export const es: Dictionary = {
|
|
|
197
197
|
add_button_text: "Agregar archivo",
|
|
198
198
|
},
|
|
199
199
|
},
|
|
200
|
+
toggle_blocks: {
|
|
201
|
+
add_block_button: "Toggle vacío. Haz clic para añadir un bloque.",
|
|
202
|
+
},
|
|
200
203
|
side_menu: {
|
|
201
204
|
add_block_label: "Agregar bloque",
|
|
202
205
|
drag_handle_label: "Abrir menú de bloque",
|
package/src/i18n/locales/fr.ts
CHANGED
|
@@ -243,6 +243,9 @@ export const fr: Dictionary = {
|
|
|
243
243
|
add_button_text: "Ajouter un fichier",
|
|
244
244
|
},
|
|
245
245
|
},
|
|
246
|
+
toggle_blocks: {
|
|
247
|
+
add_block_button: "Toggle vide. Cliquez pour ajouter un bloc.",
|
|
248
|
+
},
|
|
246
249
|
// from react package:
|
|
247
250
|
side_menu: {
|
|
248
251
|
add_block_label: "Ajouter un bloc",
|
package/src/i18n/locales/he.ts
CHANGED
|
@@ -199,6 +199,9 @@ export const he: Dictionary = {
|
|
|
199
199
|
add_button_text: "הוסף קובץ",
|
|
200
200
|
},
|
|
201
201
|
},
|
|
202
|
+
toggle_blocks: {
|
|
203
|
+
add_block_button: "מתג ריק. לחץ כדי להוסיף בלוק.",
|
|
204
|
+
},
|
|
202
205
|
side_menu: {
|
|
203
206
|
add_block_label: "הוסף בלוק",
|
|
204
207
|
drag_handle_label: "פתח תפריט בלוק",
|
package/src/i18n/locales/hr.ts
CHANGED
|
@@ -210,6 +210,9 @@ export const hr: Dictionary = {
|
|
|
210
210
|
add_button_text: "Dodaj datoteku",
|
|
211
211
|
},
|
|
212
212
|
},
|
|
213
|
+
toggle_blocks: {
|
|
214
|
+
add_block_button: "Prazan sklopivi blok. Klikni da dodaš sadržaj.",
|
|
215
|
+
},
|
|
213
216
|
// from react package:
|
|
214
217
|
side_menu: {
|
|
215
218
|
add_block_label: "Dodaj blok",
|
package/src/i18n/locales/is.ts
CHANGED
|
@@ -211,6 +211,9 @@ export const is: Dictionary = {
|
|
|
211
211
|
add_button_text: "Bæta við skrá",
|
|
212
212
|
},
|
|
213
213
|
},
|
|
214
|
+
toggle_blocks: {
|
|
215
|
+
add_block_button: "Tóm fellilína. Smelltu til að bæta við blokk.",
|
|
216
|
+
},
|
|
214
217
|
side_menu: {
|
|
215
218
|
add_block_label: "Bæta við blokki",
|
|
216
219
|
drag_handle_label: "Opna blokkarvalmynd",
|
package/src/i18n/locales/it.ts
CHANGED
|
@@ -219,6 +219,9 @@ export const it: Dictionary = {
|
|
|
219
219
|
add_button_text: "Aggiungi file",
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
|
+
toggle_blocks: {
|
|
223
|
+
add_block_button: "Toggle vuoto. Clicca per aggiungere un blocco.",
|
|
224
|
+
},
|
|
222
225
|
// from react package:
|
|
223
226
|
side_menu: {
|
|
224
227
|
add_block_label: "Aggiungi blocco",
|
package/src/i18n/locales/ja.ts
CHANGED