@blocknote/core 0.21.0 → 0.23.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/dist/blocknote.js +2320 -1692
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.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 +3 -3
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteImage.html +111 -0
- package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteTable.html +149 -0
- package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +124 -0
- package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +1 -0
- package/src/api/clipboard/clipboardExternal.test.ts +161 -0
- package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +186 -38
- package/src/api/clipboard/testUtil.ts +27 -0
- package/src/api/clipboard/toClipboard/copyExtension.ts +1 -0
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/internal.html +1 -0
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -1
- package/src/api/exporters/markdown/__snapshots__/pageBreak/basic/markdown.md +0 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +16 -0
- package/src/api/nodeConversions/nodeToBlock.ts +4 -1
- package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +62 -0
- package/src/api/parsers/html/parseHTML.test.ts +9 -0
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
- package/src/api/testUtil/cases/defaultSchema.ts +15 -1
- package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +32 -11
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -28
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +1 -1
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +4 -16
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +26 -6
- package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +49 -0
- package/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts +45 -0
- package/src/blocks/PageBreakBlockContent/schema.ts +40 -0
- package/src/editor/Block.css +18 -4
- package/src/editor/BlockNoteEditor.test.ts +21 -1
- package/src/editor/BlockNoteEditor.ts +17 -0
- package/src/editor/BlockNoteExtensions.ts +111 -16
- package/src/editor/editor.css +28 -13
- package/src/editor/transformPasted.ts +57 -4
- package/src/extensions/SideMenu/SideMenuPlugin.ts +115 -23
- package/src/extensions/SideMenu/dragging.ts +0 -1
- package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +1 -1
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +6 -0
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +6 -0
- package/src/i18n/locales/fr.ts +47 -17
- package/src/i18n/locales/hr.ts +72 -54
- package/src/i18n/locales/index.ts +1 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/it.ts +315 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +6 -0
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/index.ts +3 -0
- package/src/schema/blocks/createSpec.ts +1 -1
- package/src/schema/blocks/internal.ts +16 -6
- package/src/schema/inlineContent/internal.ts +4 -1
- package/src/schema/propTypes.ts +41 -18
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -0
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
- package/types/src/api/clipboard/testUtil.d.ts +509 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +8 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +8 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +8 -0
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +2 -1
- package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +2 -0
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
- package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +31 -0
- package/types/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.d.ts +8 -0
- package/types/src/blocks/PageBreakBlockContent/schema.d.ts +86 -0
- package/types/src/blocks/defaultBlocks.d.ts +16 -0
- package/types/src/editor/BlockNoteEditor.d.ts +15 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -0
- package/types/src/editor/transformPasted.d.ts +8 -4
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +25 -5
- package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +1 -1
- package/types/src/i18n/locales/de.d.ts +6 -0
- package/types/src/i18n/locales/en.d.ts +6 -0
- package/types/src/i18n/locales/es.d.ts +6 -0
- package/types/src/i18n/locales/hr.d.ts +6 -0
- package/types/src/i18n/locales/index.d.ts +1 -0
- package/types/src/i18n/locales/it.d.ts +245 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/schema/propTypes.d.ts +20 -2
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +0 -30
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +0 -99
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +0 -97
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +0 -88
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +0 -219
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +0 -175
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +0 -57
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +0 -5
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +0 -31
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +0 -71
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +0 -157
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +0 -27
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +0 -67
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +0 -148
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +0 -252
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/getBlock/getBlock.js +0 -56
- package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/insertContentAt.js +0 -64
- package/dist/src/api/blockManipulation/insertContentAt.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.js +0 -149
- package/dist/src/api/blockManipulation/selections/selection.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.test.js +0 -39
- package/dist/src/api/blockManipulation/selections/selection.test.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +0 -79
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +0 -33
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +0 -1
- package/dist/src/api/blockManipulation/setupTestEnv.js +0 -172
- package/dist/src/api/blockManipulation/setupTestEnv.js.map +0 -1
- package/dist/src/api/clipboard/clipboard.test.js +0 -249
- package/dist/src/api/clipboard/clipboard.test.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +0 -8
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +0 -38
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +0 -111
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +0 -25
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +0 -57
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +0 -1
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +0 -134
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +0 -1
- package/dist/src/api/exporters/html/externalHTMLExporter.js +0 -35
- package/dist/src/api/exporters/html/externalHTMLExporter.js.map +0 -1
- package/dist/src/api/exporters/html/htmlConversion.test.js +0 -72
- package/dist/src/api/exporters/html/htmlConversion.test.js.map +0 -1
- package/dist/src/api/exporters/html/internalHTMLSerializer.js +0 -21
- package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +0 -141
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +0 -96
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.js +0 -31
- package/dist/src/api/exporters/markdown/markdownExporter.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.test.js +0 -57
- package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +0 -1
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +0 -33
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +0 -1
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +0 -37
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +0 -1
- package/dist/src/api/getBlockInfoFromPos.js +0 -165
- package/dist/src/api/getBlockInfoFromPos.js.map +0 -1
- package/dist/src/api/nodeConversions/blockToNode.js +0 -197
- package/dist/src/api/nodeConversions/blockToNode.js.map +0 -1
- package/dist/src/api/nodeConversions/fragmentToBlocks.js +0 -50
- package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeConversions.test.js +0 -54
- package/dist/src/api/nodeConversions/nodeConversions.test.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeToBlock.js +0 -316
- package/dist/src/api/nodeConversions/nodeToBlock.js.map +0 -1
- package/dist/src/api/nodeUtil.js +0 -28
- package/dist/src/api/nodeUtil.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.js +0 -19
- package/dist/src/api/parsers/html/parseHTML.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.test.js +0 -470
- package/dist/src/api/parsers/html/parseHTML.test.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.js +0 -106
- package/dist/src/api/parsers/html/util/nestedLists.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.test.js +0 -166
- package/dist/src/api/parsers/html/util/nestedLists.test.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.js +0 -52
- package/dist/src/api/parsers/markdown/parseMarkdown.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +0 -112
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +0 -1
- package/dist/src/api/testUtil/cases/customBlocks.js +0 -313
- package/dist/src/api/testUtil/cases/customBlocks.js.map +0 -1
- package/dist/src/api/testUtil/cases/customInlineContent.js +0 -91
- package/dist/src/api/testUtil/cases/customInlineContent.js.map +0 -1
- package/dist/src/api/testUtil/cases/customStyles.js +0 -83
- package/dist/src/api/testUtil/cases/customStyles.js.map +0 -1
- package/dist/src/api/testUtil/cases/defaultSchema.js +0 -673
- package/dist/src/api/testUtil/cases/defaultSchema.js.map +0 -1
- package/dist/src/api/testUtil/index.js +0 -2
- package/dist/src/api/testUtil/index.js.map +0 -1
- package/dist/src/api/testUtil/partialBlockTestUtil.js +0 -114
- package/dist/src/api/testUtil/partialBlockTestUtil.js.map +0 -1
- package/dist/src/api/testUtil/paste.js +0 -29
- package/dist/src/api/testUtil/paste.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +0 -104
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/parseAudioElement.js +0 -5
- package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +0 -281
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +0 -110
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +0 -71
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +0 -5
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +0 -10
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +0 -39
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +0 -51
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +0 -17
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +0 -147
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +0 -9
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +0 -11
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +0 -15
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +0 -1
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +0 -145
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +0 -114
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/parseImageElement.js +0 -6
- package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +0 -113
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +0 -224
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +0 -45
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +0 -58
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +0 -130
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +0 -52
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -129
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableExtension.js +0 -64
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +0 -114
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/parseVideoElement.js +0 -6
- package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +0 -1
- package/dist/src/blocks/defaultBlockHelpers.js +0 -50
- package/dist/src/blocks/defaultBlockHelpers.js.map +0 -1
- package/dist/src/blocks/defaultBlockTypeGuards.js +0 -40
- package/dist/src/blocks/defaultBlockTypeGuards.js.map +0 -1
- package/dist/src/blocks/defaultBlocks.js +0 -50
- package/dist/src/blocks/defaultBlocks.js.map +0 -1
- package/dist/src/blocks/defaultProps.js +0 -19
- package/dist/src/blocks/defaultProps.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.js +0 -751
- package/dist/src/editor/BlockNoteEditor.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.test.js +0 -65
- package/dist/src/editor/BlockNoteEditor.test.js.map +0 -1
- package/dist/src/editor/BlockNoteExtensions.js +0 -192
- package/dist/src/editor/BlockNoteExtensions.js.map +0 -1
- package/dist/src/editor/BlockNoteSchema.js +0 -38
- package/dist/src/editor/BlockNoteSchema.js.map +0 -1
- package/dist/src/editor/BlockNoteTipTapEditor.js +0 -169
- package/dist/src/editor/BlockNoteTipTapEditor.js.map +0 -1
- package/dist/src/editor/cursorPositionTypes.js +0 -2
- package/dist/src/editor/cursorPositionTypes.js.map +0 -1
- package/dist/src/editor/defaultColors.js +0 -77
- package/dist/src/editor/defaultColors.js.map +0 -1
- package/dist/src/editor/selectionTypes.js +0 -2
- package/dist/src/editor/selectionTypes.js.map +0 -1
- package/dist/src/editor/transformPasted.js +0 -79
- package/dist/src/editor/transformPasted.js.map +0 -1
- package/dist/src/exporter/Exporter.js +0 -36
- package/dist/src/exporter/Exporter.js.map +0 -1
- package/dist/src/exporter/index.js +0 -3
- package/dist/src/exporter/index.js.map +0 -1
- package/dist/src/exporter/mapping.js +0 -12
- package/dist/src/exporter/mapping.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +0 -30
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +0 -39
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +0 -1
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js +0 -131
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +0 -1
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +0 -197
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +0 -341
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +0 -1
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +0 -251
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/LinkToolbar/protocols.js +0 -14
- package/dist/src/extensions/LinkToolbar/protocols.js.map +0 -1
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +0 -54
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +0 -1
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +0 -90
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +0 -1
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +0 -187
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +0 -68
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +0 -1
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +0 -347
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/dragging.js +0 -135
- package/dist/src/extensions/SideMenu/dragging.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +0 -245
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +0 -26
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +0 -241
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +0 -1
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +0 -579
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +0 -1
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +0 -36
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorExtension.js +0 -29
- package/dist/src/extensions/TextColor/TextColorExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorMark.js +0 -37
- package/dist/src/extensions/TextColor/TextColorMark.js.map +0 -1
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +0 -58
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +0 -1
- package/dist/src/extensions/UniqueID/UniqueID.js +0 -283
- package/dist/src/extensions/UniqueID/UniqueID.js.map +0 -1
- package/dist/src/extensions/getDraggableBlockFromElement.js +0 -13
- package/dist/src/extensions/getDraggableBlockFromElement.js.map +0 -1
- package/dist/src/extensions-shared/UiElementPosition.js +0 -2
- package/dist/src/extensions-shared/UiElementPosition.js.map +0 -1
- package/dist/src/i18n/dictionary.js +0 -4
- package/dist/src/i18n/dictionary.js.map +0 -1
- package/dist/src/i18n/locales/ar.js +0 -298
- package/dist/src/i18n/locales/ar.js.map +0 -1
- package/dist/src/i18n/locales/de.js +0 -313
- package/dist/src/i18n/locales/de.js.map +0 -1
- package/dist/src/i18n/locales/en.js +0 -314
- package/dist/src/i18n/locales/en.js.map +0 -1
- package/dist/src/i18n/locales/es.js +0 -312
- package/dist/src/i18n/locales/es.js.map +0 -1
- package/dist/src/i18n/locales/fr.js +0 -313
- package/dist/src/i18n/locales/fr.js.map +0 -1
- package/dist/src/i18n/locales/hr.js +0 -308
- package/dist/src/i18n/locales/hr.js.map +0 -1
- package/dist/src/i18n/locales/index.js +0 -16
- package/dist/src/i18n/locales/index.js.map +0 -1
- package/dist/src/i18n/locales/is.js +0 -305
- package/dist/src/i18n/locales/is.js.map +0 -1
- package/dist/src/i18n/locales/ja.js +0 -333
- package/dist/src/i18n/locales/ja.js.map +0 -1
- package/dist/src/i18n/locales/ko.js +0 -326
- package/dist/src/i18n/locales/ko.js.map +0 -1
- package/dist/src/i18n/locales/nl.js +0 -313
- package/dist/src/i18n/locales/nl.js.map +0 -1
- package/dist/src/i18n/locales/pl.js +0 -297
- package/dist/src/i18n/locales/pl.js.map +0 -1
- package/dist/src/i18n/locales/pt.js +0 -305
- package/dist/src/i18n/locales/pt.js.map +0 -1
- package/dist/src/i18n/locales/ru.js +0 -340
- package/dist/src/i18n/locales/ru.js.map +0 -1
- package/dist/src/i18n/locales/vi.js +0 -312
- package/dist/src/i18n/locales/vi.js.map +0 -1
- package/dist/src/i18n/locales/zh.js +0 -346
- package/dist/src/i18n/locales/zh.js.map +0 -1
- package/dist/src/index.js +0 -63
- package/dist/src/index.js.map +0 -1
- package/dist/src/pm-nodes/BlockContainer.js +0 -72
- package/dist/src/pm-nodes/BlockContainer.js.map +0 -1
- package/dist/src/pm-nodes/BlockGroup.js +0 -43
- package/dist/src/pm-nodes/BlockGroup.js.map +0 -1
- package/dist/src/pm-nodes/Doc.js +0 -7
- package/dist/src/pm-nodes/Doc.js.map +0 -1
- package/dist/src/pm-nodes/index.js +0 -4
- package/dist/src/pm-nodes/index.js.map +0 -1
- package/dist/src/schema/blocks/createSpec.js +0 -126
- package/dist/src/schema/blocks/createSpec.js.map +0 -1
- package/dist/src/schema/blocks/internal.js +0 -147
- package/dist/src/schema/blocks/internal.js.map +0 -1
- package/dist/src/schema/blocks/types.js +0 -2
- package/dist/src/schema/blocks/types.js.map +0 -1
- package/dist/src/schema/index.js +0 -11
- package/dist/src/schema/index.js.map +0 -1
- package/dist/src/schema/inlineContent/createSpec.js +0 -64
- package/dist/src/schema/inlineContent/createSpec.js.map +0 -1
- package/dist/src/schema/inlineContent/internal.js +0 -52
- package/dist/src/schema/inlineContent/internal.js.map +0 -1
- package/dist/src/schema/inlineContent/types.js +0 -10
- package/dist/src/schema/inlineContent/types.js.map +0 -1
- package/dist/src/schema/propTypes.js +0 -2
- package/dist/src/schema/propTypes.js.map +0 -1
- package/dist/src/schema/styles/createSpec.js +0 -48
- package/dist/src/schema/styles/createSpec.js.map +0 -1
- package/dist/src/schema/styles/internal.js +0 -53
- package/dist/src/schema/styles/internal.js.map +0 -1
- package/dist/src/schema/styles/types.js +0 -2
- package/dist/src/schema/styles/types.js.map +0 -1
- package/dist/src/util/EventEmitter.js +0 -33
- package/dist/src/util/EventEmitter.js.map +0 -1
- package/dist/src/util/browser.js +0 -17
- package/dist/src/util/browser.js.map +0 -1
- package/dist/src/util/combineByGroup.js +0 -20
- package/dist/src/util/combineByGroup.js.map +0 -1
- package/dist/src/util/esmDependencies.js +0 -35
- package/dist/src/util/esmDependencies.js.map +0 -1
- package/dist/src/util/string.js +0 -14
- package/dist/src/util/string.js.map +0 -1
- package/dist/src/util/typescript.js +0 -12
- package/dist/src/util/typescript.js.map +0 -1
- /package/src/api/clipboard/__snapshots__/{childToParent.html → internal/childToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParent.html → internal/childrenToNextParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParentsChildren.html → internal/childrenToNextParentsChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{image.html → internal/image.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleChildren.html → internal/multipleChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleStyledText.html → internal/multipleStyledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{nestedImage.html → internal/nestedImage.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{partialChildToParent.html → internal/partialChildToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{styledText.html → internal/styledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableAllCells.html → internal/tableAllCells.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableCell.html → internal/tableCell.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableCellText.html → internal/tableCellText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableRow.html → internal/tableRow.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{unstyledText.html → internal/unstyledText.html} +0 -0
- /package/types/src/api/clipboard/{clipboard.test.d.ts → clipboardExternal.test.d.ts} +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { InputRule } from "@tiptap/core";
|
|
2
|
-
import { updateBlockCommand } from "../../api/blockManipulation/commands/updateBlock/updateBlock.js";
|
|
3
|
-
import { getBlockInfoFromSelection } from "../../api/getBlockInfoFromPos.js";
|
|
4
|
-
import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../schema/index.js";
|
|
5
|
-
import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
|
|
6
|
-
import { defaultProps } from "../defaultProps.js";
|
|
7
|
-
export const headingPropSchema = {
|
|
8
|
-
...defaultProps,
|
|
9
|
-
level: { default: 1, values: [1, 2, 3] },
|
|
10
|
-
};
|
|
11
|
-
const HeadingBlockContent = createStronglyTypedTiptapNode({
|
|
12
|
-
name: "heading",
|
|
13
|
-
content: "inline*",
|
|
14
|
-
group: "blockContent",
|
|
15
|
-
addAttributes() {
|
|
16
|
-
return {
|
|
17
|
-
level: {
|
|
18
|
-
default: 1,
|
|
19
|
-
// instead of "level" attributes, use "data-level"
|
|
20
|
-
parseHTML: (element) => {
|
|
21
|
-
const attr = element.getAttribute("data-level");
|
|
22
|
-
const parsed = parseInt(attr);
|
|
23
|
-
if (isFinite(parsed)) {
|
|
24
|
-
return parsed;
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
},
|
|
28
|
-
renderHTML: (attributes) => {
|
|
29
|
-
return {
|
|
30
|
-
"data-level": attributes.level.toString(),
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
addInputRules() {
|
|
37
|
-
return [
|
|
38
|
-
...[1, 2, 3].map((level) => {
|
|
39
|
-
// Creates a heading of appropriate level when starting with "#", "##", or "###".
|
|
40
|
-
return new InputRule({
|
|
41
|
-
find: new RegExp(`^(#{${level}})\\s$`),
|
|
42
|
-
handler: ({ state, chain, range }) => {
|
|
43
|
-
const blockInfo = getBlockInfoFromSelection(state);
|
|
44
|
-
if (!blockInfo.isBlockContainer ||
|
|
45
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
chain()
|
|
49
|
-
.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
50
|
-
type: "heading",
|
|
51
|
-
props: {
|
|
52
|
-
level: level,
|
|
53
|
-
},
|
|
54
|
-
}))
|
|
55
|
-
// Removes the "#" character(s) used to set the heading.
|
|
56
|
-
.deleteRange({ from: range.from, to: range.to })
|
|
57
|
-
.run();
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
}),
|
|
61
|
-
];
|
|
62
|
-
},
|
|
63
|
-
addKeyboardShortcuts() {
|
|
64
|
-
return {
|
|
65
|
-
"Mod-Alt-1": () => {
|
|
66
|
-
const blockInfo = getBlockInfoFromSelection(this.editor.state);
|
|
67
|
-
if (!blockInfo.isBlockContainer ||
|
|
68
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
// call updateBlockCommand
|
|
72
|
-
return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
73
|
-
type: "heading",
|
|
74
|
-
props: {
|
|
75
|
-
level: 1,
|
|
76
|
-
},
|
|
77
|
-
}));
|
|
78
|
-
},
|
|
79
|
-
"Mod-Alt-2": () => {
|
|
80
|
-
const blockInfo = getBlockInfoFromSelection(this.editor.state);
|
|
81
|
-
if (!blockInfo.isBlockContainer ||
|
|
82
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
86
|
-
type: "heading",
|
|
87
|
-
props: {
|
|
88
|
-
level: 2,
|
|
89
|
-
},
|
|
90
|
-
}));
|
|
91
|
-
},
|
|
92
|
-
"Mod-Alt-3": () => {
|
|
93
|
-
const blockInfo = getBlockInfoFromSelection(this.editor.state);
|
|
94
|
-
if (!blockInfo.isBlockContainer ||
|
|
95
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
99
|
-
type: "heading",
|
|
100
|
-
props: {
|
|
101
|
-
level: 3,
|
|
102
|
-
},
|
|
103
|
-
}));
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
},
|
|
107
|
-
parseHTML() {
|
|
108
|
-
return [
|
|
109
|
-
{
|
|
110
|
-
tag: "div[data-content-type=" + this.name + "]",
|
|
111
|
-
getAttrs: (element) => {
|
|
112
|
-
if (typeof element === "string") {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
level: element.getAttribute("data-level"),
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
tag: "h1",
|
|
122
|
-
attrs: { level: 1 },
|
|
123
|
-
node: "heading",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
tag: "h2",
|
|
127
|
-
attrs: { level: 2 },
|
|
128
|
-
node: "heading",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
tag: "h3",
|
|
132
|
-
attrs: { level: 3 },
|
|
133
|
-
node: "heading",
|
|
134
|
-
},
|
|
135
|
-
];
|
|
136
|
-
},
|
|
137
|
-
renderHTML({ node, HTMLAttributes }) {
|
|
138
|
-
return createDefaultBlockDOMOutputSpec(this.name, `h${node.attrs.level}`, {
|
|
139
|
-
...(this.options.domAttributes?.blockContent || {}),
|
|
140
|
-
...HTMLAttributes,
|
|
141
|
-
}, this.options.domAttributes?.inlineContent || {});
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
export const Heading = createBlockSpecFromStronglyTypedTiptapNode(HeadingBlockContent, headingPropSchema);
|
|
145
|
-
//# sourceMappingURL=HeadingBlockContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HeadingBlockContent.js","sourceRoot":"","sources":["../../../../src/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BAAmB,EACnB,iBAAiB,CAClB,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { createBlockSpec, } from "../../schema/index.js";
|
|
2
|
-
import { defaultProps } from "../defaultProps.js";
|
|
3
|
-
import { parseFigureElement } from "../FileBlockContent/helpers/parse/parseFigureElement.js";
|
|
4
|
-
import { createFigureWithCaption } from "../FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js";
|
|
5
|
-
import { createLinkWithCaption } from "../FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
|
|
6
|
-
import { createResizableFileBlockWrapper } from "../FileBlockContent/helpers/render/createResizableFileBlockWrapper.js";
|
|
7
|
-
import { parseImageElement } from "./parseImageElement.js";
|
|
8
|
-
export const FILE_IMAGE_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';
|
|
9
|
-
export const imagePropSchema = {
|
|
10
|
-
textAlignment: defaultProps.textAlignment,
|
|
11
|
-
backgroundColor: defaultProps.backgroundColor,
|
|
12
|
-
// File name.
|
|
13
|
-
name: {
|
|
14
|
-
default: "",
|
|
15
|
-
},
|
|
16
|
-
// File url.
|
|
17
|
-
url: {
|
|
18
|
-
default: "",
|
|
19
|
-
},
|
|
20
|
-
// File caption.
|
|
21
|
-
caption: {
|
|
22
|
-
default: "",
|
|
23
|
-
},
|
|
24
|
-
showPreview: {
|
|
25
|
-
default: true,
|
|
26
|
-
},
|
|
27
|
-
// File preview width in px.
|
|
28
|
-
previewWidth: {
|
|
29
|
-
default: 512,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const imageBlockConfig = {
|
|
33
|
-
type: "image",
|
|
34
|
-
propSchema: imagePropSchema,
|
|
35
|
-
content: "none",
|
|
36
|
-
isFileBlock: true,
|
|
37
|
-
fileBlockAccept: ["image/*"],
|
|
38
|
-
};
|
|
39
|
-
export const imageRender = (block, editor) => {
|
|
40
|
-
const icon = document.createElement("div");
|
|
41
|
-
icon.innerHTML = FILE_IMAGE_ICON_SVG;
|
|
42
|
-
const imageWrapper = document.createElement("div");
|
|
43
|
-
imageWrapper.className = "bn-visual-media-wrapper";
|
|
44
|
-
const image = document.createElement("img");
|
|
45
|
-
image.className = "bn-visual-media";
|
|
46
|
-
if (editor.resolveFileUrl) {
|
|
47
|
-
editor.resolveFileUrl(block.props.url).then((downloadUrl) => {
|
|
48
|
-
image.src = downloadUrl;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
image.src = block.props.url;
|
|
53
|
-
}
|
|
54
|
-
image.alt = block.props.name || block.props.caption || "BlockNote image";
|
|
55
|
-
image.contentEditable = "false";
|
|
56
|
-
image.draggable = false;
|
|
57
|
-
imageWrapper.appendChild(image);
|
|
58
|
-
return createResizableFileBlockWrapper(block, editor, { dom: imageWrapper }, imageWrapper, editor.dictionary.file_blocks.image.add_button_text, icon.firstElementChild);
|
|
59
|
-
};
|
|
60
|
-
export const imageParse = (element) => {
|
|
61
|
-
if (element.tagName === "IMG") {
|
|
62
|
-
return parseImageElement(element);
|
|
63
|
-
}
|
|
64
|
-
if (element.tagName === "FIGURE") {
|
|
65
|
-
const parsedFigure = parseFigureElement(element, "img");
|
|
66
|
-
if (!parsedFigure) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
const { targetElement, caption } = parsedFigure;
|
|
70
|
-
return {
|
|
71
|
-
...parseImageElement(targetElement),
|
|
72
|
-
caption,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
return undefined;
|
|
76
|
-
};
|
|
77
|
-
export const imageToExternalHTML = (block) => {
|
|
78
|
-
if (!block.props.url) {
|
|
79
|
-
const div = document.createElement("p");
|
|
80
|
-
div.textContent = "Add image";
|
|
81
|
-
return {
|
|
82
|
-
dom: div,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
let image;
|
|
86
|
-
if (block.props.showPreview) {
|
|
87
|
-
image = document.createElement("img");
|
|
88
|
-
image.src = block.props.url;
|
|
89
|
-
image.alt = block.props.name || block.props.caption || "BlockNote image";
|
|
90
|
-
image.width = block.props.previewWidth;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
image = document.createElement("a");
|
|
94
|
-
image.href = block.props.url;
|
|
95
|
-
image.textContent = block.props.name || block.props.url;
|
|
96
|
-
}
|
|
97
|
-
if (block.props.caption) {
|
|
98
|
-
if (block.props.showPreview) {
|
|
99
|
-
return createFigureWithCaption(image, block.props.caption);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
return createLinkWithCaption(image, block.props.caption);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
dom: image,
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
export const ImageBlock = createBlockSpec(imageBlockConfig, {
|
|
110
|
-
render: imageRender,
|
|
111
|
-
parse: imageParse,
|
|
112
|
-
toExternalHTML: imageToExternalHTML,
|
|
113
|
-
});
|
|
114
|
-
//# sourceMappingURL=ImageBlockContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/ImageBlockContent/ImageBlockContent.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,uBA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CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,OAAO,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,EAAE,KAAK;KACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,gBAAgB,EAAE;IAC1D,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,UAAU;IACjB,cAAc,EAAE,mBAAmB;CACpC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseImageElement.js","sourceRoot":"","sources":["../../../../src/blocks/ImageBlockContent/parseImageElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,EAAE;IAClE,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC;IAC1C,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,IAAI,SAAS,CAAC;IAErD,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { InputRule } from "@tiptap/core";
|
|
2
|
-
import { updateBlockCommand } from "../../../api/blockManipulation/commands/updateBlock/updateBlock.js";
|
|
3
|
-
import { getBlockInfoFromSelection } from "../../../api/getBlockInfoFromPos.js";
|
|
4
|
-
import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../../schema/index.js";
|
|
5
|
-
import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js";
|
|
6
|
-
import { defaultProps } from "../../defaultProps.js";
|
|
7
|
-
import { handleEnter } from "../ListItemKeyboardShortcuts.js";
|
|
8
|
-
export const bulletListItemPropSchema = {
|
|
9
|
-
...defaultProps,
|
|
10
|
-
};
|
|
11
|
-
const BulletListItemBlockContent = createStronglyTypedTiptapNode({
|
|
12
|
-
name: "bulletListItem",
|
|
13
|
-
content: "inline*",
|
|
14
|
-
group: "blockContent",
|
|
15
|
-
// This is to make sure that check list parse rules run before, since they
|
|
16
|
-
// both parse `li` elements but check lists are more specific.
|
|
17
|
-
priority: 90,
|
|
18
|
-
addInputRules() {
|
|
19
|
-
return [
|
|
20
|
-
// Creates an unordered list when starting with "-", "+", or "*".
|
|
21
|
-
new InputRule({
|
|
22
|
-
find: new RegExp(`^[-+*]\\s$`),
|
|
23
|
-
handler: ({ state, chain, range }) => {
|
|
24
|
-
const blockInfo = getBlockInfoFromSelection(state);
|
|
25
|
-
if (!blockInfo.isBlockContainer ||
|
|
26
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
chain()
|
|
30
|
-
.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
31
|
-
type: "bulletListItem",
|
|
32
|
-
props: {},
|
|
33
|
-
}))
|
|
34
|
-
// Removes the "-", "+", or "*" character used to set the list.
|
|
35
|
-
.deleteRange({ from: range.from, to: range.to });
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
];
|
|
39
|
-
},
|
|
40
|
-
addKeyboardShortcuts() {
|
|
41
|
-
return {
|
|
42
|
-
Enter: () => handleEnter(this.options.editor),
|
|
43
|
-
"Mod-Shift-8": () => {
|
|
44
|
-
const blockInfo = getBlockInfoFromSelection(this.editor.state);
|
|
45
|
-
if (!blockInfo.isBlockContainer ||
|
|
46
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
50
|
-
type: "bulletListItem",
|
|
51
|
-
props: {},
|
|
52
|
-
}));
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
parseHTML() {
|
|
57
|
-
return [
|
|
58
|
-
// Case for regular HTML list structure.
|
|
59
|
-
{
|
|
60
|
-
tag: "div[data-content-type=" + this.name + "]", // TODO: remove if we can't come up with test case that needs this
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
tag: "li",
|
|
64
|
-
getAttrs: (element) => {
|
|
65
|
-
if (typeof element === "string") {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
const parent = element.parentElement;
|
|
69
|
-
if (parent === null) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
if (parent.tagName === "UL" ||
|
|
73
|
-
(parent.tagName === "DIV" && parent.parentElement.tagName === "UL")) {
|
|
74
|
-
return {};
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
},
|
|
78
|
-
node: "bulletListItem",
|
|
79
|
-
},
|
|
80
|
-
// Case for BlockNote list structure.
|
|
81
|
-
{
|
|
82
|
-
tag: "p",
|
|
83
|
-
getAttrs: (element) => {
|
|
84
|
-
if (typeof element === "string") {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
const parent = element.parentElement;
|
|
88
|
-
if (parent === null) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
if (parent.getAttribute("data-content-type") === "bulletListItem") {
|
|
92
|
-
return {};
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
},
|
|
96
|
-
priority: 300,
|
|
97
|
-
node: "bulletListItem",
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
},
|
|
101
|
-
renderHTML({ HTMLAttributes }) {
|
|
102
|
-
return createDefaultBlockDOMOutputSpec(this.name,
|
|
103
|
-
// We use a <p> tag, because for <li> tags we'd need a <ul> element to put
|
|
104
|
-
// them in to be semantically correct, which we can't have due to the
|
|
105
|
-
// schema.
|
|
106
|
-
"p", {
|
|
107
|
-
...(this.options.domAttributes?.blockContent || {}),
|
|
108
|
-
...HTMLAttributes,
|
|
109
|
-
}, this.options.domAttributes?.inlineContent || {});
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
export const BulletListItem = createBlockSpecFromStronglyTypedTiptapNode(BulletListItemBlockContent, bulletListItemPropSchema);
|
|
113
|
-
//# sourceMappingURL=BulletListItemBlockContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BulletListItemBlockContent.js","sourceRoot":"","sources":["../../../../../src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAEL,0CAA0C,EAC1C,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,GAAG,YAAY;CACK,CAAC;AAEvB,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;IAC/D,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,cAAc;IACrB,0EAA0E;IAC1E,8DAA8D;IAC9D,QAAQ,EAAE,EAAE;IACZ,aAAa;QACX,OAAO;YACL,iEAAiE;YACjE,IAAI,SAAS,CAAC;gBACZ,IAAI,EAAE,IAAI,MAAM,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;oBACnC,MAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;oBACnD,IACE,CAAC,SAAS,CAAC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E;QACrE,UAAU;QACV,GAAG,EACH;YACE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,IAAI,EAAE,CAAC;YACnD,GAAG,cAAc;SAClB,EACD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,EAAE,CAChD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,0CAA0C,CACtE,0BAA0B,EAC1B,wBAAwB,CACzB,CAAC"}
|
package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { InputRule } from "@tiptap/core";
|
|
2
|
-
import { updateBlockCommand } from "../../../api/blockManipulation/commands/updateBlock/updateBlock.js";
|
|
3
|
-
import { getBlockInfoFromSelection, getNearestBlockPos, } from "../../../api/getBlockInfoFromPos.js";
|
|
4
|
-
import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../../schema/index.js";
|
|
5
|
-
import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js";
|
|
6
|
-
import { defaultProps } from "../../defaultProps.js";
|
|
7
|
-
import { handleEnter } from "../ListItemKeyboardShortcuts.js";
|
|
8
|
-
export const checkListItemPropSchema = {
|
|
9
|
-
...defaultProps,
|
|
10
|
-
checked: {
|
|
11
|
-
default: false,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
const checkListItemBlockContent = createStronglyTypedTiptapNode({
|
|
15
|
-
name: "checkListItem",
|
|
16
|
-
content: "inline*",
|
|
17
|
-
group: "blockContent",
|
|
18
|
-
addAttributes() {
|
|
19
|
-
return {
|
|
20
|
-
checked: {
|
|
21
|
-
default: false,
|
|
22
|
-
// instead of "checked" attributes, use "data-checked"
|
|
23
|
-
parseHTML: (element) => element.getAttribute("data-checked") === "true" || undefined,
|
|
24
|
-
renderHTML: (attributes) => {
|
|
25
|
-
return attributes.checked
|
|
26
|
-
? {
|
|
27
|
-
"data-checked": attributes.checked.toString(),
|
|
28
|
-
}
|
|
29
|
-
: {};
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
addInputRules() {
|
|
35
|
-
return [
|
|
36
|
-
// Creates a checklist when starting with "[]" or "[X]".
|
|
37
|
-
new InputRule({
|
|
38
|
-
find: new RegExp(`\\[\\s*\\]\\s$`),
|
|
39
|
-
handler: ({ state, chain, range }) => {
|
|
40
|
-
const blockInfo = getBlockInfoFromSelection(state);
|
|
41
|
-
if (!blockInfo.isBlockContainer ||
|
|
42
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
chain()
|
|
46
|
-
.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
47
|
-
type: "checkListItem",
|
|
48
|
-
props: {
|
|
49
|
-
checked: false,
|
|
50
|
-
},
|
|
51
|
-
}))
|
|
52
|
-
// Removes the characters used to set the list.
|
|
53
|
-
.deleteRange({ from: range.from, to: range.to });
|
|
54
|
-
},
|
|
55
|
-
}),
|
|
56
|
-
new InputRule({
|
|
57
|
-
find: new RegExp(`\\[[Xx]\\]\\s$`),
|
|
58
|
-
handler: ({ state, chain, range }) => {
|
|
59
|
-
const blockInfo = getBlockInfoFromSelection(state);
|
|
60
|
-
if (!blockInfo.isBlockContainer ||
|
|
61
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
chain()
|
|
65
|
-
.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
66
|
-
type: "checkListItem",
|
|
67
|
-
props: {
|
|
68
|
-
checked: true,
|
|
69
|
-
},
|
|
70
|
-
}))
|
|
71
|
-
// Removes the characters used to set the list.
|
|
72
|
-
.deleteRange({ from: range.from, to: range.to });
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
];
|
|
76
|
-
},
|
|
77
|
-
addKeyboardShortcuts() {
|
|
78
|
-
return {
|
|
79
|
-
Enter: () => handleEnter(this.options.editor),
|
|
80
|
-
"Mod-Shift-9": () => {
|
|
81
|
-
const blockInfo = getBlockInfoFromSelection(this.editor.state);
|
|
82
|
-
if (!blockInfo.isBlockContainer ||
|
|
83
|
-
blockInfo.blockContent.node.type.spec.content !== "inline*") {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
|
|
87
|
-
type: "checkListItem",
|
|
88
|
-
props: {},
|
|
89
|
-
}));
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
parseHTML() {
|
|
94
|
-
return [
|
|
95
|
-
{
|
|
96
|
-
tag: "div[data-content-type=" + this.name + "]", // TODO: remove if we can't come up with test case that needs this
|
|
97
|
-
},
|
|
98
|
-
// Checkbox only.
|
|
99
|
-
{
|
|
100
|
-
tag: "input",
|
|
101
|
-
getAttrs: (element) => {
|
|
102
|
-
if (typeof element === "string") {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
if (element.type === "checkbox") {
|
|
106
|
-
return { checked: element.checked };
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
},
|
|
110
|
-
node: "checkListItem",
|
|
111
|
-
},
|
|
112
|
-
// Container element for checkbox + label.
|
|
113
|
-
{
|
|
114
|
-
tag: "li",
|
|
115
|
-
getAttrs: (element) => {
|
|
116
|
-
if (typeof element === "string") {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
const parent = element.parentElement;
|
|
120
|
-
if (parent === null) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (parent.tagName === "UL" ||
|
|
124
|
-
(parent.tagName === "DIV" && parent.parentElement.tagName === "UL")) {
|
|
125
|
-
const checkbox = element.querySelector("input[type=checkbox]") || null;
|
|
126
|
-
if (checkbox === null) {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
return { checked: checkbox.checked };
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
},
|
|
133
|
-
node: "checkListItem",
|
|
134
|
-
},
|
|
135
|
-
];
|
|
136
|
-
},
|
|
137
|
-
// Since there is no HTML checklist element, there isn't really any
|
|
138
|
-
// standardization for what checklists should look like in the DOM. GDocs'
|
|
139
|
-
// and Notion's aren't cross compatible, for example. This implementation
|
|
140
|
-
// has a semantically correct DOM structure (though missing a label for the
|
|
141
|
-
// checkbox) which is also converted correctly to Markdown by remark.
|
|
142
|
-
renderHTML({ node, HTMLAttributes }) {
|
|
143
|
-
const checkbox = document.createElement("input");
|
|
144
|
-
checkbox.type = "checkbox";
|
|
145
|
-
checkbox.checked = node.attrs.checked;
|
|
146
|
-
if (node.attrs.checked) {
|
|
147
|
-
checkbox.setAttribute("checked", "");
|
|
148
|
-
}
|
|
149
|
-
const { dom, contentDOM } = createDefaultBlockDOMOutputSpec(this.name, "p", {
|
|
150
|
-
...(this.options.domAttributes?.blockContent || {}),
|
|
151
|
-
...HTMLAttributes,
|
|
152
|
-
}, this.options.domAttributes?.inlineContent || {});
|
|
153
|
-
dom.insertBefore(checkbox, contentDOM);
|
|
154
|
-
return { dom, contentDOM };
|
|
155
|
-
},
|
|
156
|
-
// Need to render node view since the checkbox needs to be able to update the
|
|
157
|
-
// node. This is only possible with a node view as it exposes `getPos`.
|
|
158
|
-
addNodeView() {
|
|
159
|
-
return ({ node, getPos, editor, HTMLAttributes }) => {
|
|
160
|
-
// Need to wrap certain elements in a div or keyboard navigation gets
|
|
161
|
-
// confused.
|
|
162
|
-
const wrapper = document.createElement("div");
|
|
163
|
-
const checkboxWrapper = document.createElement("div");
|
|
164
|
-
checkboxWrapper.contentEditable = "false";
|
|
165
|
-
const checkbox = document.createElement("input");
|
|
166
|
-
checkbox.type = "checkbox";
|
|
167
|
-
checkbox.checked = node.attrs.checked;
|
|
168
|
-
if (node.attrs.checked) {
|
|
169
|
-
checkbox.setAttribute("checked", "");
|
|
170
|
-
}
|
|
171
|
-
const changeHandler = () => {
|
|
172
|
-
if (!editor.isEditable) {
|
|
173
|
-
// This seems like the most effective way of blocking the checkbox
|
|
174
|
-
// from being toggled, as event.preventDefault() does not stop it for
|
|
175
|
-
// "click" or "change" events.
|
|
176
|
-
checkbox.checked = !checkbox.checked;
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
// TODO: test
|
|
180
|
-
if (typeof getPos !== "boolean") {
|
|
181
|
-
const beforeBlockContainerPos = getNearestBlockPos(editor.state.doc, getPos());
|
|
182
|
-
if (beforeBlockContainerPos.node.type.name !== "blockContainer") {
|
|
183
|
-
throw new Error(`Expected blockContainer node, got ${beforeBlockContainerPos.node.type.name}`);
|
|
184
|
-
}
|
|
185
|
-
this.editor.commands.command(updateBlockCommand(this.options.editor, beforeBlockContainerPos.posBeforeNode, {
|
|
186
|
-
type: "checkListItem",
|
|
187
|
-
props: {
|
|
188
|
-
checked: checkbox.checked,
|
|
189
|
-
},
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
checkbox.addEventListener("change", changeHandler);
|
|
194
|
-
const { dom, contentDOM } = createDefaultBlockDOMOutputSpec(this.name, "p", {
|
|
195
|
-
...(this.options.domAttributes?.blockContent || {}),
|
|
196
|
-
...HTMLAttributes,
|
|
197
|
-
}, this.options.domAttributes?.inlineContent || {});
|
|
198
|
-
if (typeof getPos !== "boolean") {
|
|
199
|
-
// Since `node` is a blockContent node, we have to get the block ID from
|
|
200
|
-
// the parent blockContainer node. This means we can't add the label in
|
|
201
|
-
// `renderHTML` as we can't use `getPos` and therefore can't get the
|
|
202
|
-
// parent blockContainer node.
|
|
203
|
-
const blockID = this.editor.state.doc.resolve(getPos()).node().attrs.id;
|
|
204
|
-
const label = "label-" + blockID;
|
|
205
|
-
checkbox.setAttribute("aria-labelledby", label);
|
|
206
|
-
contentDOM.id = label;
|
|
207
|
-
}
|
|
208
|
-
dom.removeChild(contentDOM);
|
|
209
|
-
dom.appendChild(wrapper);
|
|
210
|
-
wrapper.appendChild(checkboxWrapper);
|
|
211
|
-
wrapper.appendChild(contentDOM);
|
|
212
|
-
checkboxWrapper.appendChild(checkbox);
|
|
213
|
-
return {
|
|
214
|
-
dom,
|
|
215
|
-
contentDOM,
|
|
216
|
-
destroy: () => {
|
|
217
|
-
checkbox.removeEventListener("change", changeHandler);
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
|
-
export const CheckListItem = createBlockSpecFromStronglyTypedTiptapNode(checkListItemBlockContent, checkListItemPropSchema);
|
|
224
|
-
//# sourceMappingURL=CheckListItemBlockContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckListItemBlockContent.js","sourceRoot":"","sources":["../../../../../src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AACxG,OAAO,EACL,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,0CAA0C,EAC1C,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,YAAY;IACf,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;KACf;CACmB,CAAC;AAEvB,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;IAC9D,IAAI,EAAE,eAAe;I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