@contentful/field-editor-rich-text 3.4.21 → 3.5.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/cjs/ContentfulEditorProvider.js +59 -0
- package/dist/cjs/RichTextEditor.js +170 -0
- package/dist/cjs/RichTextEditor.styles.js +66 -0
- package/dist/cjs/SdkProvider.js +69 -0
- package/dist/cjs/Toolbar/_tests_/toolbar.test.js +152 -0
- package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +87 -0
- package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +69 -0
- package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +29 -0
- package/dist/cjs/Toolbar/index.js +222 -0
- package/dist/cjs/__fixtures__/FakeSdk.js +183 -0
- package/dist/cjs/__fixtures__/asset/index.js +37 -0
- package/dist/cjs/__fixtures__/content-type/index.js +16 -0
- package/dist/cjs/__fixtures__/entry/index.js +33 -0
- package/dist/cjs/__fixtures__/fixtures.js +71 -0
- package/dist/cjs/__fixtures__/locale/index.js +40 -0
- package/dist/cjs/__fixtures__/space/index.js +16 -0
- package/dist/cjs/constants/Schema.js +172 -0
- package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +348 -0
- package/dist/cjs/dialogs/openRichTextDialog.js +64 -0
- package/dist/cjs/dialogs/renderRichTextDialog.js +63 -0
- package/dist/cjs/helpers/__tests__/extractNodes.test.js +299 -0
- package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +52 -0
- package/dist/cjs/helpers/__tests__/validations.test.js +49 -0
- package/dist/cjs/helpers/editor.js +276 -0
- package/dist/cjs/helpers/environment.js +20 -0
- package/dist/cjs/helpers/extractNodes.js +27 -0
- package/dist/cjs/helpers/formatDateAndTime.js +45 -0
- package/dist/cjs/helpers/getLinkedContentTypeIdsForNodeType.js +24 -0
- package/dist/cjs/helpers/newEntitySelectorConfigFromRichTextField.js +33 -0
- package/dist/cjs/helpers/nodeFactory.js +51 -0
- package/dist/cjs/helpers/removeInternalMarks.js +26 -0
- package/dist/cjs/helpers/sanitizeIncomingSlateDoc.js +33 -0
- package/dist/cjs/helpers/sdkNavigatorSlideIn.js +57 -0
- package/dist/cjs/helpers/sdkNavigatorSlideIn.spec.js +209 -0
- package/dist/cjs/helpers/transformers.js +61 -0
- package/dist/cjs/helpers/validations.js +56 -0
- package/dist/cjs/index.js +66 -0
- package/dist/cjs/internal/constants.js +51 -0
- package/dist/cjs/internal/hooks.js +65 -0
- package/dist/cjs/internal/index.js +21 -0
- package/dist/cjs/internal/misc.js +103 -0
- package/dist/cjs/internal/queries.js +407 -0
- package/dist/cjs/internal/transforms.js +195 -0
- package/dist/cjs/internal/types/editor.js +4 -0
- package/dist/cjs/internal/types/index.js +19 -0
- package/dist/cjs/internal/types/plugins.js +4 -0
- package/dist/cjs/plugins/Break/createExitBreakPlugin.js +26 -0
- package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +36 -0
- package/dist/cjs/plugins/Break/createResetNodePlugin.js +32 -0
- package/dist/cjs/plugins/Break/createSoftBreakPlugin.js +23 -0
- package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +47 -0
- package/dist/cjs/plugins/Break/index.js +20 -0
- package/dist/cjs/plugins/CommandPalette/components/CommandList.js +167 -0
- package/dist/cjs/plugins/CommandPalette/components/CommandList.styles.js +103 -0
- package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +69 -0
- package/dist/cjs/plugins/CommandPalette/constants.js +11 -0
- package/dist/cjs/plugins/CommandPalette/createCommandPalettePlugin.js +24 -0
- package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +138 -0
- package/dist/cjs/plugins/CommandPalette/index.js +11 -0
- package/dist/cjs/plugins/CommandPalette/onKeyDown.js +51 -0
- package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +83 -0
- package/dist/cjs/plugins/CommandPalette/useCommands.js +222 -0
- package/dist/cjs/plugins/CommandPalette/utils/createInlineEntryNode.js +30 -0
- package/dist/cjs/plugins/CommandPalette/utils/fetchAssets.js +31 -0
- package/dist/cjs/plugins/CommandPalette/utils/fetchEntries.js +39 -0
- package/dist/cjs/plugins/CommandPalette/utils/insertBlock.js +42 -0
- package/dist/cjs/plugins/CommandPalette/utils/trimLeadingSlash.js +16 -0
- package/dist/cjs/plugins/DragAndDrop/index.js +54 -0
- package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +128 -0
- package/dist/cjs/plugins/EmbeddedEntityBlock/ToolbarIcon.js +106 -0
- package/dist/cjs/plugins/EmbeddedEntityBlock/Util.js +108 -0
- package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +100 -0
- package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +158 -0
- package/dist/cjs/plugins/EmbeddedEntityInline/Util.js +30 -0
- package/dist/cjs/plugins/EmbeddedEntityInline/index.js +221 -0
- package/dist/cjs/plugins/Heading/__tests__/createHeadingPlugin.test.js +117 -0
- package/dist/cjs/plugins/Heading/components/Heading.js +127 -0
- package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +173 -0
- package/dist/cjs/plugins/Heading/createHeadingPlugin.js +102 -0
- package/dist/cjs/plugins/Heading/index.js +19 -0
- package/dist/cjs/plugins/Hr/index.js +193 -0
- package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +282 -0
- package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +25 -0
- package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +93 -0
- package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +78 -0
- package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +86 -0
- package/dist/cjs/plugins/Hyperlink/components/styles.js +36 -0
- package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +179 -0
- package/dist/cjs/plugins/Hyperlink/index.js +20 -0
- package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +95 -0
- package/dist/cjs/plugins/Hyperlink/utils.js +43 -0
- package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +47 -0
- package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +77 -0
- package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +64 -0
- package/dist/cjs/plugins/List/components/List.js +108 -0
- package/dist/cjs/plugins/List/components/ListItem.js +73 -0
- package/dist/cjs/plugins/List/components/ToolbarListButton.js +86 -0
- package/dist/cjs/plugins/List/createListPlugin.js +76 -0
- package/dist/cjs/plugins/List/index.js +19 -0
- package/dist/cjs/plugins/List/insertListBreak.js +60 -0
- package/dist/cjs/plugins/List/insertListFragment.js +98 -0
- package/dist/cjs/plugins/List/onKeyDownList.js +46 -0
- package/dist/cjs/plugins/List/transforms/insertListItem.js +92 -0
- package/dist/cjs/plugins/List/transforms/moveListItemDown.js +47 -0
- package/dist/cjs/plugins/List/transforms/moveListItems.js +56 -0
- package/dist/cjs/plugins/List/transforms/moveListItems.test.js +72 -0
- package/dist/cjs/plugins/List/transforms/toggleList.js +141 -0
- package/dist/cjs/plugins/List/transforms/toggleList.spec.js +139 -0
- package/dist/cjs/plugins/List/transforms/unwrapList.js +38 -0
- package/dist/cjs/plugins/List/utils.js +122 -0
- package/dist/cjs/plugins/List/withList.js +32 -0
- package/dist/cjs/plugins/Marks/Bold.js +119 -0
- package/dist/cjs/plugins/Marks/Code.js +122 -0
- package/dist/cjs/plugins/Marks/Italic.js +114 -0
- package/dist/cjs/plugins/Marks/Subscript.js +109 -0
- package/dist/cjs/plugins/Marks/Superscript.js +107 -0
- package/dist/cjs/plugins/Marks/Underline.js +106 -0
- package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +105 -0
- package/dist/cjs/plugins/Marks/helpers.js +48 -0
- package/dist/cjs/plugins/Marks/index.js +27 -0
- package/dist/cjs/plugins/Normalizer/baseRules.js +38 -0
- package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.js +15 -0
- package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +117 -0
- package/dist/cjs/plugins/Normalizer/index.js +19 -0
- package/dist/cjs/plugins/Normalizer/types.js +4 -0
- package/dist/cjs/plugins/Normalizer/utils.js +39 -0
- package/dist/cjs/plugins/Normalizer/withNormalizer.js +88 -0
- package/dist/cjs/plugins/Paragraph/Paragraph.js +70 -0
- package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +125 -0
- package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +73 -0
- package/dist/cjs/plugins/Paragraph/index.js +18 -0
- package/dist/cjs/plugins/Paragraph/utils.js +24 -0
- package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +63 -0
- package/dist/cjs/plugins/PasteHTML/index.js +18 -0
- package/dist/cjs/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +54 -0
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeAnchors.js +43 -0
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeHTML.js +50 -0
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeSheets.js +44 -0
- package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +78 -0
- package/dist/cjs/plugins/Quote/components/Quote.js +69 -0
- package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +72 -0
- package/dist/cjs/plugins/Quote/createQuotePlugin.js +57 -0
- package/dist/cjs/plugins/Quote/index.js +19 -0
- package/dist/cjs/plugins/Quote/shouldResetQuote.js +40 -0
- package/dist/cjs/plugins/Quote/toggleQuote.js +56 -0
- package/dist/cjs/plugins/Quote/withQuote.js +48 -0
- package/dist/cjs/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +21 -0
- package/dist/cjs/plugins/SelectOnBackspace/index.js +18 -0
- package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +92 -0
- package/dist/cjs/plugins/Table/__tests__/helpers.test.js +18 -0
- package/dist/cjs/plugins/Table/actions/addColumn.js +63 -0
- package/dist/cjs/plugins/Table/actions/addRow.js +57 -0
- package/dist/cjs/plugins/Table/actions/index.js +20 -0
- package/dist/cjs/plugins/Table/actions/setHeader.js +34 -0
- package/dist/cjs/plugins/Table/components/Cell.js +79 -0
- package/dist/cjs/plugins/Table/components/HeaderCell.js +82 -0
- package/dist/cjs/plugins/Table/components/Row.js +69 -0
- package/dist/cjs/plugins/Table/components/Table.js +76 -0
- package/dist/cjs/plugins/Table/components/TableActions.js +175 -0
- package/dist/cjs/plugins/Table/components/ToolbarButton.js +73 -0
- package/dist/cjs/plugins/Table/createTablePlugin.js +119 -0
- package/dist/cjs/plugins/Table/helpers.js +152 -0
- package/dist/cjs/plugins/Table/index.js +19 -0
- package/dist/cjs/plugins/Table/insertTableFragment.js +50 -0
- package/dist/cjs/plugins/Table/onKeyDownTable.js +62 -0
- package/dist/cjs/plugins/Table/tableTracking.js +64 -0
- package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +79 -0
- package/dist/cjs/plugins/Text/createTextPlugin.js +136 -0
- package/dist/cjs/plugins/Text/index.js +18 -0
- package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +101 -0
- package/dist/cjs/plugins/Tracking/index.js +18 -0
- package/dist/cjs/plugins/Tracking/utils.js +64 -0
- package/dist/cjs/plugins/TrailingParagraph/index.js +20 -0
- package/dist/cjs/plugins/Voids/createVoidsPlugin.js +31 -0
- package/dist/cjs/plugins/Voids/index.js +18 -0
- package/dist/cjs/plugins/Voids/transformVoid.js +29 -0
- package/dist/cjs/plugins/index.js +76 -0
- package/dist/cjs/plugins/links-tracking.js +29 -0
- package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +113 -0
- package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +116 -0
- package/dist/cjs/plugins/shared/ToolbarButton.js +93 -0
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +107 -0
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +110 -0
- package/dist/cjs/prepareDocument.js +86 -0
- package/dist/cjs/test-utils/assertOutput.js +31 -0
- package/dist/cjs/test-utils/createEditor.js +31 -0
- package/dist/cjs/test-utils/hyperscript.d.js +1 -0
- package/dist/cjs/test-utils/index.js +21 -0
- package/dist/cjs/test-utils/jsx.js +159 -0
- package/dist/cjs/test-utils/mockPlugin.js +16 -0
- package/dist/cjs/test-utils/randomId.js +13 -0
- package/dist/cjs/test-utils/setEmptyDataAttribute.js +21 -0
- package/dist/cjs/test-utils/validation.js +127 -0
- package/dist/cjs/useOnValueChanged.js +58 -0
- package/dist/esm/ContentfulEditorProvider.js +29 -0
- package/dist/esm/RichTextEditor.js +108 -0
- package/dist/esm/RichTextEditor.styles.js +51 -0
- package/dist/esm/SdkProvider.js +7 -0
- package/dist/esm/Toolbar/_tests_/toolbar.test.js +104 -0
- package/dist/esm/Toolbar/components/EmbedEntityWidget.js +38 -0
- package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +20 -0
- package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +14 -0
- package/dist/esm/Toolbar/index.js +168 -0
- package/dist/esm/__fixtures__/FakeSdk.js +173 -0
- package/dist/esm/__fixtures__/asset/index.js +6 -0
- package/dist/esm/__fixtures__/content-type/index.js +2 -0
- package/dist/esm/__fixtures__/entry/index.js +5 -0
- package/dist/esm/__fixtures__/fixtures.js +6 -0
- package/dist/esm/__fixtures__/locale/index.js +15 -0
- package/dist/esm/__fixtures__/space/index.js +2 -0
- package/dist/esm/constants/Schema.js +162 -0
- package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +283 -0
- package/dist/esm/dialogs/openRichTextDialog.js +15 -0
- package/dist/esm/dialogs/renderRichTextDialog.js +14 -0
- package/dist/esm/helpers/__tests__/extractNodes.test.js +295 -0
- package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +48 -0
- package/dist/esm/helpers/__tests__/validations.test.js +45 -0
- package/dist/esm/helpers/editor.js +198 -0
- package/dist/esm/helpers/environment.js +2 -0
- package/dist/esm/helpers/extractNodes.js +17 -0
- package/dist/esm/helpers/formatDateAndTime.js +19 -0
- package/dist/esm/helpers/getLinkedContentTypeIdsForNodeType.js +9 -0
- package/dist/esm/helpers/newEntitySelectorConfigFromRichTextField.js +18 -0
- package/dist/esm/helpers/nodeFactory.js +24 -0
- package/dist/esm/helpers/removeInternalMarks.js +16 -0
- package/dist/esm/helpers/sanitizeIncomingSlateDoc.js +23 -0
- package/dist/esm/helpers/sdkNavigatorSlideIn.js +42 -0
- package/dist/esm/helpers/sdkNavigatorSlideIn.spec.js +200 -0
- package/dist/esm/helpers/transformers.js +34 -0
- package/dist/esm/helpers/validations.js +24 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/internal/constants.js +2 -0
- package/dist/esm/internal/hooks.js +5 -0
- package/dist/esm/internal/index.js +4 -0
- package/dist/esm/internal/misc.js +28 -0
- package/dist/esm/internal/queries.js +182 -0
- package/dist/esm/internal/transforms.js +75 -0
- package/dist/esm/internal/types/editor.js +1 -0
- package/dist/esm/internal/types/index.js +2 -0
- package/dist/esm/internal/types/plugins.js +1 -0
- package/dist/esm/plugins/Break/createExitBreakPlugin.js +16 -0
- package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +32 -0
- package/dist/esm/plugins/Break/createResetNodePlugin.js +22 -0
- package/dist/esm/plugins/Break/createSoftBreakPlugin.js +13 -0
- package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +43 -0
- package/dist/esm/plugins/Break/index.js +3 -0
- package/dist/esm/plugins/CommandPalette/components/CommandList.js +113 -0
- package/dist/esm/plugins/CommandPalette/components/CommandList.styles.js +88 -0
- package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +20 -0
- package/dist/esm/plugins/CommandPalette/constants.js +1 -0
- package/dist/esm/plugins/CommandPalette/createCommandPalettePlugin.js +14 -0
- package/dist/esm/plugins/CommandPalette/hooks/useCommandList.js +84 -0
- package/dist/esm/plugins/CommandPalette/index.js +1 -0
- package/dist/esm/plugins/CommandPalette/onKeyDown.js +36 -0
- package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +40 -0
- package/dist/esm/plugins/CommandPalette/useCommands.js +204 -0
- package/dist/esm/plugins/CommandPalette/utils/createInlineEntryNode.js +20 -0
- package/dist/esm/plugins/CommandPalette/utils/fetchAssets.js +21 -0
- package/dist/esm/plugins/CommandPalette/utils/fetchEntries.js +29 -0
- package/dist/esm/plugins/CommandPalette/utils/insertBlock.js +32 -0
- package/dist/esm/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -0
- package/dist/esm/plugins/DragAndDrop/index.js +44 -0
- package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +79 -0
- package/dist/esm/plugins/EmbeddedEntityBlock/ToolbarIcon.js +49 -0
- package/dist/esm/plugins/EmbeddedEntityBlock/Util.js +85 -0
- package/dist/esm/plugins/EmbeddedEntityBlock/index.js +74 -0
- package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +104 -0
- package/dist/esm/plugins/EmbeddedEntityInline/Util.js +20 -0
- package/dist/esm/plugins/EmbeddedEntityInline/index.js +159 -0
- package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +113 -0
- package/dist/esm/plugins/Heading/components/Heading.js +73 -0
- package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +119 -0
- package/dist/esm/plugins/Heading/createHeadingPlugin.js +87 -0
- package/dist/esm/plugins/Heading/index.js +2 -0
- package/dist/esm/plugins/Hr/index.js +125 -0
- package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +220 -0
- package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +21 -0
- package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +44 -0
- package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +29 -0
- package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +37 -0
- package/dist/esm/plugins/Hyperlink/components/styles.js +21 -0
- package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +125 -0
- package/dist/esm/plugins/Hyperlink/index.js +2 -0
- package/dist/esm/plugins/Hyperlink/useEntityInfo.js +85 -0
- package/dist/esm/plugins/Hyperlink/utils.js +25 -0
- package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +43 -0
- package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +73 -0
- package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +60 -0
- package/dist/esm/plugins/List/components/List.js +46 -0
- package/dist/esm/plugins/List/components/ListItem.js +19 -0
- package/dist/esm/plugins/List/components/ToolbarListButton.js +37 -0
- package/dist/esm/plugins/List/createListPlugin.js +66 -0
- package/dist/esm/plugins/List/index.js +2 -0
- package/dist/esm/plugins/List/insertListBreak.js +50 -0
- package/dist/esm/plugins/List/insertListFragment.js +88 -0
- package/dist/esm/plugins/List/onKeyDownList.js +31 -0
- package/dist/esm/plugins/List/transforms/insertListItem.js +82 -0
- package/dist/esm/plugins/List/transforms/moveListItemDown.js +37 -0
- package/dist/esm/plugins/List/transforms/moveListItems.js +46 -0
- package/dist/esm/plugins/List/transforms/moveListItems.test.js +68 -0
- package/dist/esm/plugins/List/transforms/toggleList.js +132 -0
- package/dist/esm/plugins/List/transforms/toggleList.spec.js +135 -0
- package/dist/esm/plugins/List/transforms/unwrapList.js +28 -0
- package/dist/esm/plugins/List/utils.js +89 -0
- package/dist/esm/plugins/List/withList.js +22 -0
- package/dist/esm/plugins/Marks/Bold.js +59 -0
- package/dist/esm/plugins/Marks/Code.js +59 -0
- package/dist/esm/plugins/Marks/Italic.js +54 -0
- package/dist/esm/plugins/Marks/Subscript.js +46 -0
- package/dist/esm/plugins/Marks/Superscript.js +44 -0
- package/dist/esm/plugins/Marks/Underline.js +46 -0
- package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +51 -0
- package/dist/esm/plugins/Marks/helpers.js +25 -0
- package/dist/esm/plugins/Marks/index.js +17 -0
- package/dist/esm/plugins/Normalizer/baseRules.js +28 -0
- package/dist/esm/plugins/Normalizer/createNormalizerPlugin.js +5 -0
- package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +113 -0
- package/dist/esm/plugins/Normalizer/index.js +2 -0
- package/dist/esm/plugins/Normalizer/types.js +1 -0
- package/dist/esm/plugins/Normalizer/utils.js +18 -0
- package/dist/esm/plugins/Normalizer/withNormalizer.js +73 -0
- package/dist/esm/plugins/Paragraph/Paragraph.js +16 -0
- package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +121 -0
- package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +58 -0
- package/dist/esm/plugins/Paragraph/index.js +1 -0
- package/dist/esm/plugins/Paragraph/utils.js +6 -0
- package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +42 -0
- package/dist/esm/plugins/PasteHTML/index.js +1 -0
- package/dist/esm/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +50 -0
- package/dist/esm/plugins/PasteHTML/utils/sanitizeAnchors.js +33 -0
- package/dist/esm/plugins/PasteHTML/utils/sanitizeHTML.js +40 -0
- package/dist/esm/plugins/PasteHTML/utils/sanitizeSheets.js +34 -0
- package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +74 -0
- package/dist/esm/plugins/Quote/components/Quote.js +15 -0
- package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +23 -0
- package/dist/esm/plugins/Quote/createQuotePlugin.js +47 -0
- package/dist/esm/plugins/Quote/index.js +2 -0
- package/dist/esm/plugins/Quote/shouldResetQuote.js +30 -0
- package/dist/esm/plugins/Quote/toggleQuote.js +33 -0
- package/dist/esm/plugins/Quote/withQuote.js +38 -0
- package/dist/esm/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +11 -0
- package/dist/esm/plugins/SelectOnBackspace/index.js +1 -0
- package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +88 -0
- package/dist/esm/plugins/Table/__tests__/helpers.test.js +14 -0
- package/dist/esm/plugins/Table/actions/addColumn.js +45 -0
- package/dist/esm/plugins/Table/actions/addRow.js +39 -0
- package/dist/esm/plugins/Table/actions/index.js +3 -0
- package/dist/esm/plugins/Table/actions/setHeader.js +24 -0
- package/dist/esm/plugins/Table/components/Cell.js +25 -0
- package/dist/esm/plugins/Table/components/HeaderCell.js +28 -0
- package/dist/esm/plugins/Table/components/Row.js +15 -0
- package/dist/esm/plugins/Table/components/Table.js +22 -0
- package/dist/esm/plugins/Table/components/TableActions.js +118 -0
- package/dist/esm/plugins/Table/components/ToolbarButton.js +24 -0
- package/dist/esm/plugins/Table/createTablePlugin.js +109 -0
- package/dist/esm/plugins/Table/helpers.js +116 -0
- package/dist/esm/plugins/Table/index.js +2 -0
- package/dist/esm/plugins/Table/insertTableFragment.js +40 -0
- package/dist/esm/plugins/Table/onKeyDownTable.js +52 -0
- package/dist/esm/plugins/Table/tableTracking.js +46 -0
- package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +75 -0
- package/dist/esm/plugins/Text/createTextPlugin.js +126 -0
- package/dist/esm/plugins/Text/index.js +1 -0
- package/dist/esm/plugins/Tracking/createTrackingPlugin.js +83 -0
- package/dist/esm/plugins/Tracking/index.js +1 -0
- package/dist/esm/plugins/Tracking/utils.js +10 -0
- package/dist/esm/plugins/TrailingParagraph/index.js +10 -0
- package/dist/esm/plugins/Voids/createVoidsPlugin.js +21 -0
- package/dist/esm/plugins/Voids/index.js +1 -0
- package/dist/esm/plugins/Voids/transformVoid.js +19 -0
- package/dist/esm/plugins/index.js +58 -0
- package/dist/esm/plugins/links-tracking.js +14 -0
- package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +59 -0
- package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +62 -0
- package/dist/esm/plugins/shared/ToolbarButton.js +39 -0
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +59 -0
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +62 -0
- package/dist/esm/prepareDocument.js +57 -0
- package/dist/esm/test-utils/assertOutput.js +21 -0
- package/dist/esm/test-utils/createEditor.js +21 -0
- package/dist/esm/test-utils/hyperscript.d.js +0 -0
- package/dist/esm/test-utils/index.js +4 -0
- package/dist/esm/test-utils/jsx.js +149 -0
- package/dist/esm/test-utils/mockPlugin.js +6 -0
- package/dist/esm/test-utils/randomId.js +3 -0
- package/dist/esm/test-utils/setEmptyDataAttribute.js +11 -0
- package/dist/esm/test-utils/validation.js +112 -0
- package/dist/esm/useOnValueChanged.js +43 -0
- package/dist/{ContentfulEditorProvider.d.ts → types/ContentfulEditorProvider.d.ts} +9 -9
- package/dist/{RichTextEditor.d.ts → types/RichTextEditor.d.ts} +21 -20
- package/dist/{RichTextEditor.styles.d.ts → types/RichTextEditor.styles.d.ts} +7 -7
- package/dist/{SdkProvider.d.ts → types/SdkProvider.d.ts} +7 -7
- package/dist/types/Toolbar/_tests_/toolbar.test.d.ts +1 -0
- package/dist/{Toolbar → types/Toolbar}/components/EmbedEntityWidget.d.ts +6 -5
- package/dist/{Toolbar → types/Toolbar}/components/EmbeddedEntityDropdownButton.d.ts +9 -9
- package/dist/{Toolbar → types/Toolbar}/components/StickyToolbarWrapper.d.ts +7 -7
- package/dist/types/Toolbar/index.d.ts +6 -0
- package/dist/types/__fixtures__/FakeSdk.d.ts +8 -0
- package/dist/types/__fixtures__/asset/index.d.ts +6 -0
- package/dist/types/__fixtures__/content-type/index.d.ts +2 -0
- package/dist/types/__fixtures__/entry/index.d.ts +5 -0
- package/dist/types/__fixtures__/fixtures.d.ts +6 -0
- package/dist/types/__fixtures__/locale/index.d.ts +42 -0
- package/dist/types/__fixtures__/space/index.d.ts +2 -0
- package/dist/{constants → types/constants}/Schema.d.ts +111 -111
- package/dist/{dialogs → types/dialogs}/HypelinkDialog/HyperlinkDialog.d.ts +63 -54
- package/dist/{dialogs → types/dialogs}/openRichTextDialog.d.ts +2 -2
- package/dist/{dialogs → types/dialogs}/renderRichTextDialog.d.ts +3 -2
- package/dist/types/helpers/__tests__/extractNodes.test.d.ts +1 -0
- package/dist/types/helpers/__tests__/removeInternalMarks.test.d.ts +2 -0
- package/dist/types/helpers/__tests__/validations.test.d.ts +1 -0
- package/dist/{helpers → types/helpers}/editor.d.ts +40 -40
- package/dist/{helpers → types/helpers}/environment.d.ts +2 -2
- package/dist/{helpers → types/helpers}/extractNodes.d.ts +5 -5
- package/dist/{helpers → types/helpers}/formatDateAndTime.d.ts +15 -15
- package/dist/{helpers → types/helpers}/getLinkedContentTypeIdsForNodeType.d.ts +26 -26
- package/dist/{helpers → types/helpers}/newEntitySelectorConfigFromRichTextField.d.ts +14 -14
- package/dist/{helpers → types/helpers}/nodeFactory.d.ts +24 -24
- package/dist/{helpers → types/helpers}/removeInternalMarks.d.ts +1 -1
- package/dist/{helpers → types/helpers}/sanitizeIncomingSlateDoc.d.ts +6 -6
- package/dist/{helpers → types/helpers}/sdkNavigatorSlideIn.d.ts +16 -16
- package/dist/types/helpers/sdkNavigatorSlideIn.spec.d.ts +1 -0
- package/dist/{helpers → types/helpers}/transformers.d.ts +7 -7
- package/dist/{helpers → types/helpers}/validations.d.ts +10 -10
- package/dist/{index.d.ts → types/index.d.ts} +4 -4
- package/dist/{internal → types/internal}/constants.d.ts +1 -1
- package/dist/{internal → types/internal}/hooks.d.ts +4 -4
- package/dist/{internal → types/internal}/index.d.ts +4 -4
- package/dist/{internal → types/internal}/misc.d.ts +37 -37
- package/dist/{internal → types/internal}/queries.d.ts +78 -78
- package/dist/{internal → types/internal}/transforms.d.ts +33 -33
- package/dist/types/internal/types/editor.d.ts +51 -0
- package/dist/{internal → types/internal}/types/index.d.ts +2 -2
- package/dist/{internal → types/internal}/types/plugins.d.ts +12 -12
- package/dist/{plugins → types/plugins}/Break/createExitBreakPlugin.d.ts +2 -2
- package/dist/types/plugins/Break/createExitBreakPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Break/createResetNodePlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Break/createSoftBreakPlugin.d.ts +2 -2
- package/dist/types/plugins/Break/createSoftBreakPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Break/index.d.ts +5 -5
- package/dist/{plugins → types/plugins}/CommandPalette/components/CommandList.d.ts +8 -7
- package/dist/{plugins → types/plugins}/CommandPalette/components/CommandList.styles.d.ts +14 -14
- package/dist/{plugins → types/plugins}/CommandPalette/components/CommandPrompt.d.ts +5 -4
- package/dist/{plugins → types/plugins}/CommandPalette/constants.d.ts +1 -1
- package/dist/{plugins → types/plugins}/CommandPalette/createCommandPalettePlugin.d.ts +13 -13
- package/dist/{plugins → types/plugins}/CommandPalette/hooks/useCommandList.d.ts +4 -4
- package/dist/{plugins → types/plugins}/CommandPalette/index.d.ts +1 -1
- package/dist/{plugins → types/plugins}/CommandPalette/onKeyDown.d.ts +2 -2
- package/dist/types/plugins/CommandPalette/onKeyDown.spec.d.ts +1 -0
- package/dist/{plugins → types/plugins}/CommandPalette/useCommands.d.ts +19 -19
- package/dist/{plugins → types/plugins}/CommandPalette/utils/createInlineEntryNode.d.ts +16 -16
- package/dist/{plugins → types/plugins}/CommandPalette/utils/fetchAssets.d.ts +8 -8
- package/dist/{plugins → types/plugins}/CommandPalette/utils/fetchEntries.d.ts +9 -9
- package/dist/{plugins → types/plugins}/CommandPalette/utils/insertBlock.d.ts +1 -1
- package/dist/{plugins → types/plugins}/CommandPalette/utils/trimLeadingSlash.d.ts +7 -7
- package/dist/{plugins → types/plugins}/DragAndDrop/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +20 -19
- package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/ToolbarIcon.d.ts +11 -10
- package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/Util.d.ts +4 -4
- package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/index.d.ts +5 -5
- package/dist/{plugins → types/plugins}/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +13 -13
- package/dist/{plugins → types/plugins}/EmbeddedEntityInline/Util.d.ts +16 -16
- package/dist/{plugins → types/plugins}/EmbeddedEntityInline/index.d.ts +10 -9
- package/dist/types/plugins/Heading/__tests__/createHeadingPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Heading/components/Heading.d.ts +10 -10
- package/dist/{plugins → types/plugins}/Heading/components/ToolbarHeadingButton.d.ts +5 -4
- package/dist/{plugins → types/plugins}/Heading/createHeadingPlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Heading/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Hr/index.d.ts +11 -11
- package/dist/{plugins → types/plugins}/Hyperlink/HyperlinkModal.d.ts +17 -16
- package/dist/types/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Hyperlink/components/EntityHyperlink.d.ts +21 -20
- package/dist/{plugins → types/plugins}/Hyperlink/components/ToolbarHyperlinkButton.d.ts +6 -5
- package/dist/{plugins → types/plugins}/Hyperlink/components/UrlHyperlink.d.ts +22 -21
- package/dist/{plugins → types/plugins}/Hyperlink/components/styles.d.ts +4 -4
- package/dist/{plugins → types/plugins}/Hyperlink/createHyperlinkPlugin.d.ts +3 -3
- package/dist/{plugins → types/plugins}/Hyperlink/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Hyperlink/useEntityInfo.d.ts +16 -16
- package/dist/{plugins → types/plugins}/Hyperlink/utils.d.ts +5 -5
- package/dist/types/plugins/List/__tests__/createListPlugin.test.d.ts +1 -0
- package/dist/types/plugins/List/__tests__/insertListBreak.test.d.ts +1 -0
- package/dist/types/plugins/List/__tests__/insertListFragment.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/List/components/List.d.ts +4 -3
- package/dist/{plugins → types/plugins}/List/components/ListItem.d.ts +3 -2
- package/dist/{plugins → types/plugins}/List/components/ToolbarListButton.d.ts +5 -4
- package/dist/{plugins → types/plugins}/List/createListPlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/List/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/List/insertListBreak.d.ts +2 -2
- package/dist/{plugins → types/plugins}/List/insertListFragment.d.ts +2 -2
- package/dist/{plugins → types/plugins}/List/onKeyDownList.d.ts +7 -7
- package/dist/{plugins → types/plugins}/List/transforms/insertListItem.d.ts +5 -5
- package/dist/{plugins → types/plugins}/List/transforms/moveListItemDown.d.ts +6 -6
- package/dist/{plugins → types/plugins}/List/transforms/moveListItems.d.ts +6 -6
- package/dist/types/plugins/List/transforms/moveListItems.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/List/transforms/toggleList.d.ts +4 -4
- package/dist/types/plugins/List/transforms/toggleList.spec.d.ts +1 -0
- package/dist/{plugins → types/plugins}/List/transforms/unwrapList.d.ts +4 -4
- package/dist/{plugins → types/plugins}/List/utils.d.ts +14 -14
- package/dist/{plugins → types/plugins}/List/withList.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Marks/Bold.d.ts +11 -10
- package/dist/{plugins → types/plugins}/Marks/Code.d.ts +17 -16
- package/dist/{plugins → types/plugins}/Marks/Italic.d.ts +11 -10
- package/dist/{plugins → types/plugins}/Marks/Subscript.d.ts +17 -16
- package/dist/{plugins → types/plugins}/Marks/Superscript.d.ts +17 -16
- package/dist/{plugins → types/plugins}/Marks/Underline.d.ts +11 -10
- package/dist/{plugins → types/plugins}/Marks/components/MarkToolbarButton.d.ts +13 -13
- package/dist/{plugins → types/plugins}/Marks/helpers.d.ts +4 -4
- package/dist/{plugins → types/plugins}/Marks/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Normalizer/baseRules.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Normalizer/createNormalizerPlugin.d.ts +2 -2
- package/dist/types/plugins/Normalizer/createNormalizerPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Normalizer/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Normalizer/types.d.ts +38 -38
- package/dist/{plugins → types/plugins}/Normalizer/utils.d.ts +5 -5
- package/dist/{plugins → types/plugins}/Normalizer/withNormalizer.d.ts +2 -2
- package/dist/types/plugins/Paragraph/Paragraph.d.ts +3 -0
- package/dist/types/plugins/Paragraph/__tests__/createParagraphPlugin.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Paragraph/createParagraphPlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Paragraph/index.d.ts +1 -1
- package/dist/{plugins → types/plugins}/Paragraph/utils.d.ts +2 -2
- package/dist/{plugins → types/plugins}/PasteHTML/createPasteHTMLPlugin.d.ts +8 -8
- package/dist/{plugins → types/plugins}/PasteHTML/index.d.ts +1 -1
- package/dist/types/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeAnchors.d.ts +19 -19
- package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeHTML.d.ts +1 -1
- package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeSheets.d.ts +4 -4
- package/dist/types/plugins/Quote/__test__/createQuotePlugin.test.d.ts +1 -0
- package/dist/types/plugins/Quote/components/Quote.d.ts +3 -0
- package/dist/{plugins → types/plugins}/Quote/components/ToolbarQuoteButton.d.ts +5 -4
- package/dist/{plugins → types/plugins}/Quote/createQuotePlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Quote/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Quote/shouldResetQuote.d.ts +8 -8
- package/dist/{plugins → types/plugins}/Quote/toggleQuote.d.ts +4 -4
- package/dist/{plugins → types/plugins}/Quote/withQuote.d.ts +2 -2
- package/dist/{plugins → types/plugins}/SelectOnBackspace/createSelectOnBackspacePlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/SelectOnBackspace/index.d.ts +1 -1
- package/dist/types/plugins/Table/__tests__/createTablePlugin.test.d.ts +1 -0
- package/dist/types/plugins/Table/__tests__/helpers.test.d.ts +1 -0
- package/dist/{plugins → types/plugins}/Table/actions/addColumn.d.ts +7 -7
- package/dist/{plugins → types/plugins}/Table/actions/addRow.d.ts +3 -3
- package/dist/{plugins → types/plugins}/Table/actions/index.d.ts +3 -3
- package/dist/{plugins → types/plugins}/Table/actions/setHeader.d.ts +2 -2
- package/dist/types/plugins/Table/components/Cell.d.ts +3 -0
- package/dist/{plugins → types/plugins}/Table/components/HeaderCell.d.ts +3 -2
- package/dist/types/plugins/Table/components/Row.d.ts +3 -0
- package/dist/{plugins → types/plugins}/Table/components/Table.d.ts +3 -2
- package/dist/types/plugins/Table/components/TableActions.d.ts +5 -0
- package/dist/{plugins → types/plugins}/Table/components/ToolbarButton.d.ts +5 -4
- package/dist/{plugins → types/plugins}/Table/createTablePlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Table/helpers.d.ts +15 -15
- package/dist/{plugins → types/plugins}/Table/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Table/insertTableFragment.d.ts +3 -3
- package/dist/{plugins → types/plugins}/Table/onKeyDownTable.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Table/tableTracking.d.ts +4 -4
- package/dist/types/plugins/Text/__tests__/createTextPlugin.test.d.ts +2 -0
- package/dist/{plugins → types/plugins}/Text/createTextPlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Text/index.d.ts +1 -1
- package/dist/{plugins → types/plugins}/Tracking/createTrackingPlugin.d.ts +12 -12
- package/dist/{plugins → types/plugins}/Tracking/index.d.ts +1 -1
- package/dist/{plugins → types/plugins}/Tracking/utils.d.ts +2 -2
- package/dist/{plugins → types/plugins}/TrailingParagraph/index.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Voids/createVoidsPlugin.d.ts +2 -2
- package/dist/{plugins → types/plugins}/Voids/index.d.ts +1 -1
- package/dist/{plugins → types/plugins}/Voids/transformVoid.d.ts +5 -5
- package/dist/{plugins → types/plugins}/index.d.ts +6 -6
- package/dist/{plugins → types/plugins}/links-tracking.d.ts +3 -3
- package/dist/{plugins → types/plugins}/shared/FetchingWrappedAssetCard.d.ts +14 -13
- package/dist/{plugins → types/plugins}/shared/FetchingWrappedEntryCard.d.ts +14 -13
- package/dist/{plugins → types/plugins}/shared/ToolbarButton.d.ts +12 -11
- package/dist/types/plugins/shared/__tests__/FetchingWrappedAssetCard.test.d.ts +1 -0
- package/dist/types/plugins/shared/__tests__/FetchingWrappedEntryCard.test.d.ts +1 -0
- package/dist/{prepareDocument.d.ts → types/prepareDocument.d.ts} +19 -19
- package/dist/{test-utils → types/test-utils}/assertOutput.d.ts +7 -7
- package/dist/{test-utils → types/test-utils}/createEditor.d.ts +31 -31
- package/dist/{test-utils → types/test-utils}/index.d.ts +4 -4
- package/dist/{test-utils → types/test-utils}/jsx.d.ts +28 -28
- package/dist/{test-utils → types/test-utils}/mockPlugin.d.ts +2 -2
- package/dist/{test-utils → types/test-utils}/randomId.d.ts +4 -4
- package/dist/{test-utils → types/test-utils}/setEmptyDataAttribute.d.ts +6 -6
- package/dist/{test-utils → types/test-utils}/validation.d.ts +1 -1
- package/dist/{useOnValueChanged.d.ts → types/useOnValueChanged.d.ts} +8 -8
- package/package.json +27 -21
- package/CHANGELOG.md +0 -946
- package/dist/Toolbar/index.d.ts +0 -5
- package/dist/field-editor-rich-text.cjs.development.js +0 -7210
- package/dist/field-editor-rich-text.cjs.development.js.map +0 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +0 -163
- package/dist/field-editor-rich-text.cjs.production.min.js.map +0 -1
- package/dist/field-editor-rich-text.esm.js +0 -7200
- package/dist/field-editor-rich-text.esm.js.map +0 -1
- package/dist/index.js +0 -8
- package/dist/internal/types/editor.d.ts +0 -51
- package/dist/plugins/List/transforms/deleteBackwardList.d.ts +0 -2
- package/dist/plugins/Paragraph/Paragraph.d.ts +0 -2
- package/dist/plugins/Quote/components/Quote.d.ts +0 -2
- package/dist/plugins/Table/components/Cell.d.ts +0 -2
- package/dist/plugins/Table/components/Row.d.ts +0 -2
- package/dist/plugins/Table/components/TableActions.d.ts +0 -4
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-exporting Plate/Slate queries (aka selectors) to reduce
|
|
3
|
-
* the blast radius of version upgrades
|
|
4
|
-
*/
|
|
5
|
-
import * as p from '@udecode/plate-core';
|
|
6
|
-
import * as s from 'slate';
|
|
7
|
-
import type { Value, PlateEditor, Location, Node, NodeEntry, BaseRange, Element, Text, Ancestor, BasePoint } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* Get text content at location
|
|
10
|
-
*/
|
|
11
|
-
export declare const getText: (editor: PlateEditor, at?:
|
|
12
|
-
export declare const isText: (value: unknown) => value is Text;
|
|
13
|
-
export declare const getEndPoint: (editor: PlateEditor, at: Location) => s.BasePoint;
|
|
14
|
-
export declare const getStartPoint: (editor: PlateEditor, at: Location) => s.BasePoint;
|
|
15
|
-
export declare const isNode: (value: unknown) => value is Node;
|
|
16
|
-
export declare const isSelectionAtBlockEnd: (editor: PlateEditor, options?: p.GetAboveNodeOptions<Value>
|
|
17
|
-
export declare const isSelectionAtBlockStart: (editor: PlateEditor, options?: p.GetAboveNodeOptions<Value>
|
|
18
|
-
export declare const getBlockAbove: (editor: PlateEditor, options?: p.GetAboveNodeOptions<p.Value>
|
|
19
|
-
export declare const getNodeEntry: (editor: PlateEditor, at: Location, options?: s.EditorNodeOptions
|
|
20
|
-
export declare const getNodeEntries: (editor: PlateEditor, options?: p.GetNodeEntriesOptions
|
|
21
|
-
export declare const getNodeChildren: (root: Ancestor, path: s.Path, options?: s.NodeChildrenOptions | undefined) => Generator<p.TNodeEntry<Text | Element | p.TDescendant>, void, undefined>;
|
|
22
|
-
export declare const getParentNode: (editor: PlateEditor, at: Location, options?: s.EditorParentOptions
|
|
23
|
-
export declare const someNode: (editor: PlateEditor, options: p.FindNodeOptions) => boolean;
|
|
24
|
-
export declare const getChildren: (entry: NodeEntry
|
|
25
|
-
export declare const isFirstChild: (path: s.Path) => boolean;
|
|
26
|
-
export declare const getDescendantNodeByPath: (root: Node, path: s.Path) => Node;
|
|
27
|
-
export declare const getNodeDescendants: (root: PlateEditor | Node, options?: s.NodeDescendantsOptions
|
|
28
|
-
export declare const isRangeCollapsed: (range?:
|
|
29
|
-
export declare const isRangeAcrossBlocks: (editor: p.TEditor<p.Value>, options?: (Omit<p.GetAboveNodeOptions<p.Value>, 'at'> & {
|
|
30
|
-
at?: s.BaseRange | null | undefined;
|
|
31
|
-
}) | undefined) => boolean | undefined;
|
|
32
|
-
export declare const isRangeExpanded: (range?:
|
|
33
|
-
export declare const getRange: (editor: PlateEditor, at: Location, to?:
|
|
34
|
-
export declare const getRangeEdges: (range: BaseRange) => [s.BasePoint, s.BasePoint];
|
|
35
|
-
export declare const getRangeStart: (range: BaseRange) => s.BasePoint;
|
|
36
|
-
export declare const getRangeEnd: (range: BaseRange) => s.BasePoint;
|
|
37
|
-
export declare const getAboveNode: (editor: PlateEditor, opts?: p.GetAboveNodeOptions<Value>
|
|
38
|
-
export declare const getNextNode: (editor: PlateEditor, opts?: p.GetNextNodeOptions<Value>
|
|
39
|
-
export declare const getCommonNode: (root: PlateEditor | Node, path: s.Path, another: s.Path) => NodeEntry
|
|
40
|
-
export declare const getNodeTexts: (root: Node, opts?: {
|
|
41
|
-
from?: s.Path | undefined;
|
|
42
|
-
to?: s.Path | undefined;
|
|
43
|
-
pass?: ((ne: NodeEntry
|
|
44
|
-
reverse?: boolean | undefined;
|
|
45
|
-
} | undefined) => Generator<p.TNodeEntry<p.TText>, void, undefined>;
|
|
46
|
-
export declare const findNode: (editor: PlateEditor, options?: p.FindNodeOptions<p.Value> | undefined) => p.TNodeEntry<p.ENode<p.Value>> | undefined;
|
|
47
|
-
export declare const isMarkActive: (editor: PlateEditor, type: string) => boolean;
|
|
48
|
-
export declare const getMarks: (editor: PlateEditor) => Partial<{
|
|
49
|
-
[x: string]: unknown;
|
|
50
|
-
[x: number]: unknown;
|
|
51
|
-
}> | null;
|
|
52
|
-
export declare const isEditor: (value: unknown) => value is PlateEditor;
|
|
53
|
-
export declare const isEditorReadOnly: (editor: PlateEditor) => boolean;
|
|
54
|
-
export declare const isElement: (value: unknown) => value is Element;
|
|
55
|
-
export declare const isBlockNode: (editor: PlateEditor, value: unknown) => value is Element;
|
|
56
|
-
export declare const findNodePath: (editor: PlateEditor, node: Node) => s.Path | undefined;
|
|
57
|
-
export declare const isAncestorPath: (path: s.Path, another: s.Path) => boolean;
|
|
58
|
-
export declare const isAncestorEmpty: (editor: PlateEditor, node: Ancestor) => boolean;
|
|
59
|
-
export declare const getParentPath: (path: s.Path) => s.Path;
|
|
60
|
-
export declare const getNextPath: (path: s.Path) => s.Path;
|
|
61
|
-
export declare const getPreviousPath: (path: s.Path) => s.Path;
|
|
62
|
-
export declare const getLastChildPath: (nodeEntry: NodeEntry
|
|
63
|
-
export declare const getPathLevels: (path: s.Path, options?: s.PathLevelsOptions
|
|
64
|
-
export declare const isCommonPath: (path: s.Path, anotherPath: s.Path) => boolean;
|
|
65
|
-
export declare const isFirstChildPath: (path: s.Path) => boolean;
|
|
66
|
-
export declare const isLastChildPath: (entry: NodeEntry
|
|
67
|
-
export declare const isChildPath: (path: s.Path, another: s.Path) => boolean;
|
|
68
|
-
export declare const matchNode: (node: Node, path: s.Path, fn: p.Predicate<PlateEditor | Node>) => boolean;
|
|
69
|
-
export declare const someHtmlElement: (rootNode: globalThis.Node, predicate: (node: HTMLElement) => boolean) => boolean;
|
|
70
|
-
export declare const getPointBefore: (editor: PlateEditor, at: Location, options?: s.EditorBeforeOptions
|
|
71
|
-
export declare const getPointAfter: (editor: PlateEditor, at: Location, options?: s.EditorAfterOptions
|
|
72
|
-
export declare const isEndPoint: (editor: PlateEditor, point: BasePoint | null | undefined, at: Location) => boolean;
|
|
73
|
-
export declare const isInline: (editor: PlateEditor, value: unknown) => boolean;
|
|
74
|
-
export declare const queryNode: (entry?: NodeEntry
|
|
75
|
-
export declare const getPluginType: (editor: PlateEditor, key: string) => string;
|
|
76
|
-
export declare const createPathRef: (editor: PlateEditor, at: s.Path) => s.PathRef;
|
|
77
|
-
export declare const match: (obj: Node, path: s.Path, predicate?: p.Predicate<Node> | undefined) => boolean;
|
|
78
|
-
export declare const getLastNodeByLevel: (editor: PlateEditor, level: number) => NodeEntry | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* Re-exporting Plate/Slate queries (aka selectors) to reduce
|
|
3
|
+
* the blast radius of version upgrades
|
|
4
|
+
*/
|
|
5
|
+
import * as p from '@udecode/plate-core';
|
|
6
|
+
import * as s from 'slate';
|
|
7
|
+
import type { Value, PlateEditor, Location, Node, NodeEntry, BaseRange, Element, Text, Ancestor, BasePoint, Path } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Get text content at location
|
|
10
|
+
*/
|
|
11
|
+
export declare const getText: (editor: PlateEditor, at?: Location) => string;
|
|
12
|
+
export declare const isText: (value: unknown) => value is Text;
|
|
13
|
+
export declare const getEndPoint: (editor: PlateEditor, at: Location) => s.BasePoint;
|
|
14
|
+
export declare const getStartPoint: (editor: PlateEditor, at: Location) => s.BasePoint;
|
|
15
|
+
export declare const isNode: (value: unknown) => value is Node;
|
|
16
|
+
export declare const isSelectionAtBlockEnd: (editor: PlateEditor, options?: p.GetAboveNodeOptions<Value>) => boolean;
|
|
17
|
+
export declare const isSelectionAtBlockStart: (editor: PlateEditor, options?: p.GetAboveNodeOptions<Value>) => boolean;
|
|
18
|
+
export declare const getBlockAbove: (editor: PlateEditor, options?: p.GetAboveNodeOptions<p.Value>) => p.TNodeEntry<p.TElement | p.TEditor> | undefined;
|
|
19
|
+
export declare const getNodeEntry: (editor: PlateEditor, at: Location, options?: s.EditorNodeOptions) => p.TNodeEntry<p.ENode<Value>>;
|
|
20
|
+
export declare const getNodeEntries: (editor: PlateEditor, options?: p.GetNodeEntriesOptions) => Generator<p.TNodeEntry<p.ENode<p.Value>>, void, undefined>;
|
|
21
|
+
export declare const getNodeChildren: (root: Ancestor, path: s.Path, options?: s.NodeChildrenOptions | undefined) => Generator<p.TNodeEntry<Text | Element | p.TDescendant>, void, undefined>;
|
|
22
|
+
export declare const getParentNode: (editor: PlateEditor, at: Location, options?: s.EditorParentOptions) => NodeEntry | undefined;
|
|
23
|
+
export declare const someNode: (editor: PlateEditor, options: p.FindNodeOptions) => boolean;
|
|
24
|
+
export declare const getChildren: (entry: NodeEntry) => NodeEntry[];
|
|
25
|
+
export declare const isFirstChild: (path: s.Path) => boolean;
|
|
26
|
+
export declare const getDescendantNodeByPath: (root: Node, path: s.Path) => Node;
|
|
27
|
+
export declare const getNodeDescendants: (root: PlateEditor | Node, options?: s.NodeDescendantsOptions) => Generator<p.TNodeEntry<p.TText | Element | p.TElement>, void, undefined>;
|
|
28
|
+
export declare const isRangeCollapsed: (range?: BaseRange) => boolean;
|
|
29
|
+
export declare const isRangeAcrossBlocks: (editor: p.TEditor<p.Value>, options?: (Omit<p.GetAboveNodeOptions<p.Value>, 'at'> & {
|
|
30
|
+
at?: s.BaseRange | null | undefined;
|
|
31
|
+
}) | undefined) => boolean | undefined;
|
|
32
|
+
export declare const isRangeExpanded: (range?: BaseRange) => boolean;
|
|
33
|
+
export declare const getRange: (editor: PlateEditor, at: Location, to?: Location) => s.BaseRange;
|
|
34
|
+
export declare const getRangeEdges: (range: BaseRange) => [s.BasePoint, s.BasePoint];
|
|
35
|
+
export declare const getRangeStart: (range: BaseRange) => s.BasePoint;
|
|
36
|
+
export declare const getRangeEnd: (range: BaseRange) => s.BasePoint;
|
|
37
|
+
export declare const getAboveNode: (editor: PlateEditor, opts?: p.GetAboveNodeOptions<Value>) => NodeEntry | undefined;
|
|
38
|
+
export declare const getNextNode: (editor: PlateEditor, opts?: p.GetNextNodeOptions<Value>) => NodeEntry | undefined;
|
|
39
|
+
export declare const getCommonNode: (root: PlateEditor | Node, path: s.Path, another: s.Path) => NodeEntry;
|
|
40
|
+
export declare const getNodeTexts: (root: Node, opts?: {
|
|
41
|
+
from?: s.Path | undefined;
|
|
42
|
+
to?: s.Path | undefined;
|
|
43
|
+
pass?: ((ne: NodeEntry) => boolean) | undefined;
|
|
44
|
+
reverse?: boolean | undefined;
|
|
45
|
+
} | undefined) => Generator<p.TNodeEntry<p.TText>, void, undefined>;
|
|
46
|
+
export declare const findNode: (editor: PlateEditor, options?: p.FindNodeOptions<p.Value> | undefined) => p.TNodeEntry<p.ENode<p.Value>> | undefined;
|
|
47
|
+
export declare const isMarkActive: (editor: PlateEditor, type: string) => boolean;
|
|
48
|
+
export declare const getMarks: (editor: PlateEditor) => Partial<{
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
[x: number]: unknown;
|
|
51
|
+
}> | null;
|
|
52
|
+
export declare const isEditor: (value: unknown) => value is PlateEditor;
|
|
53
|
+
export declare const isEditorReadOnly: (editor: PlateEditor) => boolean;
|
|
54
|
+
export declare const isElement: (value: unknown) => value is Element;
|
|
55
|
+
export declare const isBlockNode: (editor: PlateEditor, value: unknown) => value is Element;
|
|
56
|
+
export declare const findNodePath: (editor: PlateEditor, node: Node) => s.Path | undefined;
|
|
57
|
+
export declare const isAncestorPath: (path: s.Path, another: s.Path) => boolean;
|
|
58
|
+
export declare const isAncestorEmpty: (editor: PlateEditor, node: Ancestor) => boolean;
|
|
59
|
+
export declare const getParentPath: (path: s.Path) => s.Path;
|
|
60
|
+
export declare const getNextPath: (path: s.Path) => s.Path;
|
|
61
|
+
export declare const getPreviousPath: (path: s.Path) => s.Path;
|
|
62
|
+
export declare const getLastChildPath: (nodeEntry: NodeEntry) => s.Path;
|
|
63
|
+
export declare const getPathLevels: (path: s.Path, options?: s.PathLevelsOptions) => s.Path[];
|
|
64
|
+
export declare const isCommonPath: (path: s.Path, anotherPath: s.Path) => boolean;
|
|
65
|
+
export declare const isFirstChildPath: (path: s.Path) => boolean;
|
|
66
|
+
export declare const isLastChildPath: (entry: NodeEntry, childPath: s.Path) => boolean;
|
|
67
|
+
export declare const isChildPath: (path: s.Path, another: s.Path) => boolean;
|
|
68
|
+
export declare const matchNode: (node: Node, path: s.Path, fn: p.Predicate<PlateEditor | Node>) => boolean;
|
|
69
|
+
export declare const someHtmlElement: (rootNode: globalThis.Node, predicate: (node: HTMLElement) => boolean) => boolean;
|
|
70
|
+
export declare const getPointBefore: (editor: PlateEditor, at: Location, options?: s.EditorBeforeOptions) => s.BasePoint | undefined;
|
|
71
|
+
export declare const getPointAfter: (editor: PlateEditor, at: Location, options?: s.EditorAfterOptions) => s.BasePoint | undefined;
|
|
72
|
+
export declare const isEndPoint: (editor: PlateEditor, point: BasePoint | null | undefined, at: Location) => boolean;
|
|
73
|
+
export declare const isInline: (editor: PlateEditor, value: unknown) => boolean;
|
|
74
|
+
export declare const queryNode: (entry?: NodeEntry, options?: p.QueryNodeOptions) => boolean;
|
|
75
|
+
export declare const getPluginType: (editor: PlateEditor, key: string) => string;
|
|
76
|
+
export declare const createPathRef: (editor: PlateEditor, at: s.Path) => s.PathRef;
|
|
77
|
+
export declare const match: (obj: Node, path: s.Path, predicate?: p.Predicate<Node> | undefined) => boolean;
|
|
78
|
+
export declare const getLastNodeByLevel: (editor: PlateEditor, level: number) => NodeEntry | undefined;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import * as p from '@udecode/plate-core';
|
|
2
|
-
import * as s from 'slate';
|
|
3
|
-
import { Except } from 'type-fest';
|
|
4
|
-
import { PlateEditor, Node, ToggleNodeTypeOptions, EditorNodesOptions, BaseRange, Value, Element, Path, Span, BasePoint, Location } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Apply editor normalization rules
|
|
7
|
-
*/
|
|
8
|
-
export declare const normalize: (editor: PlateEditor, options?: s.EditorNormalizeOptions) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Set the selection to a location
|
|
11
|
-
*/
|
|
12
|
-
export declare const setSelection: (editor: PlateEditor, props: Partial<BaseRange>) => void;
|
|
13
|
-
export declare const select: (editor: PlateEditor, location: Location) => void;
|
|
14
|
-
export declare const moveSelection: (editor: PlateEditor, options?:
|
|
15
|
-
export declare const moveChildren: (editor: PlateEditor, options: p.MoveChildrenOptions<Value>) => number;
|
|
16
|
-
export declare const collapseSelection: (editor: PlateEditor, options?:
|
|
17
|
-
export declare const setNodes: (editor: PlateEditor, attrs: Partial<Except<Node, 'children' | 'text'>>, opts?: p.SetNodesOptions<Value>
|
|
18
|
-
export declare const unsetNodes: (editor: PlateEditor, props: string | number | (string | number)[], options?: p.UnsetNodesOptions<Value> | undefined) => void;
|
|
19
|
-
export declare const insertNodes: (editor: PlateEditor, nodes: Node | Node[], opts?: p.InsertNodesOptions
|
|
20
|
-
export declare const splitNodes: (editor: PlateEditor, options?: p.SplitNodesOptions<Value>
|
|
21
|
-
export declare const liftNodes: (editor: PlateEditor, options?: p.LiftNodesOptions<Value> | undefined) => void;
|
|
22
|
-
export declare const unwrapNodes: (editor: PlateEditor, options?: p.UnwrapNodesOptions<Value>
|
|
23
|
-
export declare const wrapNodes: (editor: PlateEditor, element: Element, options?: p.WrapNodesOptions<Value>
|
|
24
|
-
export declare const toggleNodeType: (editor: PlateEditor, options: ToggleNodeTypeOptions, editorOptions?: Omit<EditorNodesOptions,
|
|
25
|
-
export declare const removeMark: (editor: PlateEditor, type: string, at: BaseRange) => void;
|
|
26
|
-
export declare const unhangRange: (editor: PlateEditor, range?: Path | BasePoint | BaseRange | Span | null | undefined, options?: p.UnhangRangeOptions | undefined) => s.BaseRange | undefined;
|
|
27
|
-
export declare const toggleMark: (editor: PlateEditor, options: p.ToggleMarkOptions<Value, keyof p.TText>) => void;
|
|
28
|
-
export declare const addMark: (editor: PlateEditor, type: string, value?: unknown) => void;
|
|
29
|
-
export declare const insertText: (editor: PlateEditor, text: string, options?:
|
|
30
|
-
export declare const deleteText: (editor: PlateEditor, opts?: Parameters<typeof p.deleteText>['1']) => void;
|
|
31
|
-
export declare const removeNodes: (editor: PlateEditor, opts?: p.RemoveNodesOptions<Value>
|
|
32
|
-
export declare const moveNodes: (editor: PlateEditor, opts?: p.MoveNodesOptions<Value>
|
|
33
|
-
export declare const deleteFragment: (editor: PlateEditor, options?: s.EditorFragmentDeletionOptions | undefined) => void;
|
|
1
|
+
import * as p from '@udecode/plate-core';
|
|
2
|
+
import * as s from 'slate';
|
|
3
|
+
import { Except } from 'type-fest';
|
|
4
|
+
import { PlateEditor, Node, ToggleNodeTypeOptions, EditorNodesOptions, BaseRange, Value, SelectionMoveOptions, TextInsertTextOptions, Element, SelectionCollapseOptions, Path, Span, BasePoint, Location } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Apply editor normalization rules
|
|
7
|
+
*/
|
|
8
|
+
export declare const normalize: (editor: PlateEditor, options?: s.EditorNormalizeOptions) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Set the selection to a location
|
|
11
|
+
*/
|
|
12
|
+
export declare const setSelection: (editor: PlateEditor, props: Partial<BaseRange>) => void;
|
|
13
|
+
export declare const select: (editor: PlateEditor, location: Location) => void;
|
|
14
|
+
export declare const moveSelection: (editor: PlateEditor, options?: SelectionMoveOptions) => void;
|
|
15
|
+
export declare const moveChildren: (editor: PlateEditor, options: p.MoveChildrenOptions<Value>) => number;
|
|
16
|
+
export declare const collapseSelection: (editor: PlateEditor, options?: SelectionCollapseOptions) => void;
|
|
17
|
+
export declare const setNodes: (editor: PlateEditor, attrs: Partial<Except<Node, 'children' | 'text'>>, opts?: p.SetNodesOptions<Value>) => void;
|
|
18
|
+
export declare const unsetNodes: (editor: PlateEditor, props: string | number | (string | number)[], options?: p.UnsetNodesOptions<Value> | undefined) => void;
|
|
19
|
+
export declare const insertNodes: (editor: PlateEditor, nodes: Node | Node[], opts?: p.InsertNodesOptions) => void;
|
|
20
|
+
export declare const splitNodes: (editor: PlateEditor, options?: p.SplitNodesOptions<Value>) => void;
|
|
21
|
+
export declare const liftNodes: (editor: PlateEditor, options?: p.LiftNodesOptions<Value> | undefined) => void;
|
|
22
|
+
export declare const unwrapNodes: (editor: PlateEditor, options?: p.UnwrapNodesOptions<Value>) => void;
|
|
23
|
+
export declare const wrapNodes: (editor: PlateEditor, element: Element, options?: p.WrapNodesOptions<Value>) => void;
|
|
24
|
+
export declare const toggleNodeType: (editor: PlateEditor, options: ToggleNodeTypeOptions, editorOptions?: Omit<EditorNodesOptions, 'match'>) => void;
|
|
25
|
+
export declare const removeMark: (editor: PlateEditor, type: string, at: BaseRange) => void;
|
|
26
|
+
export declare const unhangRange: (editor: PlateEditor, range?: Path | BasePoint | BaseRange | Span | null | undefined, options?: p.UnhangRangeOptions | undefined) => s.BaseRange | undefined;
|
|
27
|
+
export declare const toggleMark: (editor: PlateEditor, options: p.ToggleMarkOptions<Value, keyof p.TText>) => void;
|
|
28
|
+
export declare const addMark: (editor: PlateEditor, type: string, value?: unknown) => void;
|
|
29
|
+
export declare const insertText: (editor: PlateEditor, text: string, options?: TextInsertTextOptions) => void;
|
|
30
|
+
export declare const deleteText: (editor: PlateEditor, opts?: Parameters<typeof p.deleteText>['1']) => void;
|
|
31
|
+
export declare const removeNodes: (editor: PlateEditor, opts?: p.RemoveNodesOptions<Value>) => void;
|
|
32
|
+
export declare const moveNodes: (editor: PlateEditor, opts?: p.MoveNodesOptions<Value>) => void;
|
|
33
|
+
export declare const deleteFragment: (editor: PlateEditor, options?: s.EditorFragmentDeletionOptions | undefined) => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://plate.udecode.io/docs/typescript
|
|
3
|
+
*/
|
|
4
|
+
import { MARKS } from '@contentful/rich-text-types';
|
|
5
|
+
import * as p from '@udecode/plate-core';
|
|
6
|
+
import * as s from 'slate';
|
|
7
|
+
import * as sr from 'slate-react';
|
|
8
|
+
import { SelectionMoveOptions as SlateSelectionMoveOptions, SelectionCollapseOptions as SlateSelectionCollapseOptions } from 'slate/dist/transforms/selection';
|
|
9
|
+
import { TextInsertTextOptions as SlateTextInsertTextOptions } from 'slate/dist/transforms/text';
|
|
10
|
+
import { TrackingPluginActions } from '../../plugins/Tracking';
|
|
11
|
+
export interface Text extends p.TText {
|
|
12
|
+
[MARKS.BOLD]?: boolean;
|
|
13
|
+
[MARKS.CODE]?: boolean;
|
|
14
|
+
[MARKS.ITALIC]?: boolean;
|
|
15
|
+
[MARKS.UNDERLINE]?: boolean;
|
|
16
|
+
[MARKS.SUPERSCRIPT]?: boolean;
|
|
17
|
+
[MARKS.SUBSCRIPT]?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface Element extends p.TElement {
|
|
20
|
+
type: string;
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
isVoid?: boolean;
|
|
23
|
+
children: (Text | Element)[];
|
|
24
|
+
}
|
|
25
|
+
export type Value = Element[];
|
|
26
|
+
export type ReactEditor = p.TReactEditor<Value>;
|
|
27
|
+
export interface PlateEditor extends p.PlateEditor<Value> {
|
|
28
|
+
tracking: TrackingPluginActions;
|
|
29
|
+
}
|
|
30
|
+
export type Node = p.ElementOf<PlateEditor> | p.TextOf<PlateEditor>;
|
|
31
|
+
export type Path = p.TPath;
|
|
32
|
+
export type NodeEntry<T extends Node = Node> = p.TNodeEntry<T>;
|
|
33
|
+
export type NodeMatch = p.ENodeMatch<Node>;
|
|
34
|
+
export type Ancestor = p.AncestorOf<PlateEditor>;
|
|
35
|
+
export type Descendant = p.DescendantOf<PlateEditor>;
|
|
36
|
+
export type Operation = p.TOperation<Descendant>;
|
|
37
|
+
export type Location = p.TLocation;
|
|
38
|
+
export type BaseRange = p.TRange;
|
|
39
|
+
export type ToggleNodeTypeOptions = p.ToggleNodeTypeOptions;
|
|
40
|
+
export type EditorNodesOptions = Omit<p.GetNodeEntriesOptions<Value>, 'match'>;
|
|
41
|
+
export type WithOverride<P = p.AnyObject> = p.WithOverride<P, Value, PlateEditor>;
|
|
42
|
+
export type SelectionMoveOptions = SlateSelectionMoveOptions;
|
|
43
|
+
export type TextInsertTextOptions = SlateTextInsertTextOptions;
|
|
44
|
+
export type SelectionCollapseOptions = SlateSelectionCollapseOptions;
|
|
45
|
+
export type HotkeyPlugin = p.HotkeyPlugin;
|
|
46
|
+
export type RenderLeafProps = sr.RenderLeafProps;
|
|
47
|
+
export type RenderElementProps = sr.RenderElementProps;
|
|
48
|
+
export type Span = p.TSpan;
|
|
49
|
+
export type BasePoint = s.BasePoint;
|
|
50
|
+
export type BaseSelection = s.BaseSelection;
|
|
51
|
+
export type PathRef = s.PathRef;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './editor';
|
|
2
|
-
export * from './plugins';
|
|
1
|
+
export * from './editor';
|
|
2
|
+
export * from './plugins';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { SoftBreakRule, ExitBreakRule } from '@udecode/plate-break';
|
|
2
|
-
import * as p from '@udecode/plate-core';
|
|
3
|
-
import { ResetNodePluginRule } from '@udecode/plate-reset-node';
|
|
4
|
-
import type { NormalizerRule } from '../../plugins/Normalizer';
|
|
5
|
-
import { Value, PlateEditor } from './editor';
|
|
6
|
-
export
|
|
7
|
-
export interface PlatePlugin extends p.PlatePlugin<p.AnyObject, Value, PlateEditor> {
|
|
8
|
-
softBreak?: SoftBreakRule[];
|
|
9
|
-
exitBreak?: ExitBreakRule[];
|
|
10
|
-
resetNode?: ResetNodePluginRule<Value, PlateEditor>[];
|
|
11
|
-
normalizer?: NormalizerRule[];
|
|
12
|
-
}
|
|
1
|
+
import { SoftBreakRule, ExitBreakRule } from '@udecode/plate-break';
|
|
2
|
+
import * as p from '@udecode/plate-core';
|
|
3
|
+
import { ResetNodePluginRule } from '@udecode/plate-reset-node';
|
|
4
|
+
import type { NormalizerRule } from '../../plugins/Normalizer';
|
|
5
|
+
import { Value, PlateEditor } from './editor';
|
|
6
|
+
export type KeyboardHandler<P = p.PluginOptions> = p.KeyboardHandler<P, Value, PlateEditor>;
|
|
7
|
+
export interface PlatePlugin extends p.PlatePlugin<p.AnyObject, Value, PlateEditor> {
|
|
8
|
+
softBreak?: SoftBreakRule[];
|
|
9
|
+
exitBreak?: ExitBreakRule[];
|
|
10
|
+
resetNode?: ResetNodePluginRule<Value, PlateEditor>[];
|
|
11
|
+
normalizer?: NormalizerRule[];
|
|
12
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PlatePlugin } from '../../internal/types';
|
|
2
|
-
export declare const createExitBreakPlugin: () => PlatePlugin;
|
|
1
|
+
import { PlatePlugin } from '../../internal/types';
|
|
2
|
+
export declare const createExitBreakPlugin: () => PlatePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PlatePlugin } from '../../internal/types';
|
|
2
|
-
export declare const createResetNodePlugin: () => PlatePlugin;
|
|
1
|
+
import { PlatePlugin } from '../../internal/types';
|
|
2
|
+
export declare const createResetNodePlugin: () => PlatePlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PlatePlugin } from '../../internal/types';
|
|
2
|
-
export declare const createSoftBreakPlugin: () => PlatePlugin;
|
|
1
|
+
import { PlatePlugin } from '../../internal/types';
|
|
2
|
+
export declare const createSoftBreakPlugin: () => PlatePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SoftBreakRule, ExitBreakRule } from '@udecode/plate-break';
|
|
2
|
-
export type { ResetNodePluginRule } from '@udecode/plate-reset-node';
|
|
3
|
-
export * from './createSoftBreakPlugin';
|
|
4
|
-
export * from './createExitBreakPlugin';
|
|
5
|
-
export * from './createResetNodePlugin';
|
|
1
|
+
export type { SoftBreakRule, ExitBreakRule } from '@udecode/plate-break';
|
|
2
|
+
export type { ResetNodePluginRule } from '@udecode/plate-reset-node';
|
|
3
|
+
export * from './createSoftBreakPlugin';
|
|
4
|
+
export * from './createExitBreakPlugin';
|
|
5
|
+
export * from './createResetNodePlugin';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PlateEditor } from '../../../internal/types';
|
|
3
|
+
export interface CommandListProps {
|
|
4
|
+
query: string;
|
|
5
|
+
editor: PlateEditor;
|
|
6
|
+
textContainer?: HTMLSpanElement;
|
|
7
|
+
}
|
|
8
|
+
export declare const CommandList: ({ query, editor, textContainer }: CommandListProps) => React.JSX.Element | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
declare const styles: {
|
|
2
|
-
container: string;
|
|
3
|
-
menuPoper: string;
|
|
4
|
-
menuContent: string;
|
|
5
|
-
menuList: string;
|
|
6
|
-
menuItem: string;
|
|
7
|
-
menuItemSelected: string;
|
|
8
|
-
menuDivider: string;
|
|
9
|
-
menuHeader: string;
|
|
10
|
-
menuFooter: string;
|
|
11
|
-
footerList: string;
|
|
12
|
-
thumbnail: string;
|
|
13
|
-
};
|
|
14
|
-
export default styles;
|
|
1
|
+
declare const styles: {
|
|
2
|
+
container: string;
|
|
3
|
+
menuPoper: string;
|
|
4
|
+
menuContent: string;
|
|
5
|
+
menuList: string;
|
|
6
|
+
menuItem: string;
|
|
7
|
+
menuItemSelected: string;
|
|
8
|
+
menuDivider: string;
|
|
9
|
+
menuHeader: string;
|
|
10
|
+
menuFooter: string;
|
|
11
|
+
footerList: string;
|
|
12
|
+
thumbnail: string;
|
|
13
|
+
};
|
|
14
|
+
export default styles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PlateEditor, RenderLeafProps } from '../../../internal/types';
|
|
3
|
+
export declare const CommandPrompt: (props: RenderLeafProps & {
|
|
4
|
+
editor: PlateEditor;
|
|
5
|
+
}) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const COMMAND_PROMPT = "command-prompt";
|
|
1
|
+
export declare const COMMAND_PROMPT = "command-prompt";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PlatePlugin } from '../../internal/types';
|
|
2
|
-
/**
|
|
3
|
-
* A command palette plugin (aka slash commands)
|
|
4
|
-
*
|
|
5
|
-
* How does it work?
|
|
6
|
-
* * When the user presses the slash key, the editor will show a command palette
|
|
7
|
-
* * When the user presses a key, the command palette will show the command suggestions
|
|
8
|
-
* * When the user presses enter, the command palette will execute the command
|
|
9
|
-
* * When the user presses escape, the command palette will hide
|
|
10
|
-
* * When the user presses a letter, number, or space, the command palette will show the command suggestions
|
|
11
|
-
* * When the user presses backspace, the command palette will remove the last character from the command string
|
|
12
|
-
*/
|
|
13
|
-
export declare const createCommandPalettePlugin: () => PlatePlugin;
|
|
1
|
+
import { PlatePlugin } from '../../internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* A command palette plugin (aka slash commands)
|
|
4
|
+
*
|
|
5
|
+
* How does it work?
|
|
6
|
+
* * When the user presses the slash key, the editor will show a command palette
|
|
7
|
+
* * When the user presses a key, the command palette will show the command suggestions
|
|
8
|
+
* * When the user presses enter, the command palette will execute the command
|
|
9
|
+
* * When the user presses escape, the command palette will hide
|
|
10
|
+
* * When the user presses a letter, number, or space, the command palette will show the command suggestions
|
|
11
|
+
* * When the user presses backspace, the command palette will remove the last character from the command string
|
|
12
|
+
*/
|
|
13
|
+
export declare const createCommandPalettePlugin: () => PlatePlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useCommandList: (commandItems: any, container: any) => {
|
|
2
|
-
selectedItem: string;
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
};
|
|
1
|
+
export declare const useCommandList: (commandItems: any, container: any) => {
|
|
2
|
+
selectedItem: string;
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createCommandPalettePlugin } from './createCommandPalettePlugin';
|
|
1
|
+
export { createCommandPalettePlugin } from './createCommandPalettePlugin';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { KeyboardHandler } from '../../internal/types';
|
|
2
|
-
export declare const createOnKeyDown: () => KeyboardHandler;
|
|
1
|
+
import { KeyboardHandler } from '../../internal/types';
|
|
2
|
+
export declare const createOnKeyDown: () => KeyboardHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
-
import { PlateEditor } from '../../internal/types';
|
|
3
|
-
export interface Command {
|
|
4
|
-
id: string;
|
|
5
|
-
thumbnail?: string;
|
|
6
|
-
label: string;
|
|
7
|
-
callback?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export interface CommandGroup {
|
|
10
|
-
group: string;
|
|
11
|
-
commands: Command[];
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
export declare function isCommandPromptPluginEnabled(sdk: FieldExtensionSDK): {
|
|
15
|
-
inlineAllowed: boolean;
|
|
16
|
-
entriesAllowed: boolean;
|
|
17
|
-
assetsAllowed: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare const useCommands: (sdk: FieldExtensionSDK, query: string, editor: PlateEditor) => CommandList;
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
import { PlateEditor } from '../../internal/types';
|
|
3
|
+
export interface Command {
|
|
4
|
+
id: string;
|
|
5
|
+
thumbnail?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
callback?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface CommandGroup {
|
|
10
|
+
group: string;
|
|
11
|
+
commands: Command[];
|
|
12
|
+
}
|
|
13
|
+
export type CommandList = (Command | CommandGroup)[];
|
|
14
|
+
export declare function isCommandPromptPluginEnabled(sdk: FieldExtensionSDK): {
|
|
15
|
+
inlineAllowed: boolean;
|
|
16
|
+
entriesAllowed: boolean;
|
|
17
|
+
assetsAllowed: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const useCommands: (sdk: FieldExtensionSDK, query: string, editor: PlateEditor) => CommandList;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { INLINES } from '@contentful/rich-text-types';
|
|
2
|
-
export declare function createInlineEntryNode(id: string): {
|
|
3
|
-
type: INLINES;
|
|
4
|
-
children: {
|
|
5
|
-
text: string;
|
|
6
|
-
}[];
|
|
7
|
-
data: {
|
|
8
|
-
target: {
|
|
9
|
-
sys: {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
linkType: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
1
|
+
import { INLINES } from '@contentful/rich-text-types';
|
|
2
|
+
export declare function createInlineEntryNode(id: string): {
|
|
3
|
+
type: INLINES;
|
|
4
|
+
children: {
|
|
5
|
+
text: string;
|
|
6
|
+
}[];
|
|
7
|
+
data: {
|
|
8
|
+
target: {
|
|
9
|
+
sys: {
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
linkType: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
-
export declare function fetchAssets(sdk: FieldExtensionSDK, query: string): Promise<{
|
|
3
|
-
contentTypeName: string;
|
|
4
|
-
displayTitle: string;
|
|
5
|
-
id: string;
|
|
6
|
-
entity: import("@contentful/app-sdk").Asset;
|
|
7
|
-
thumbnail: string;
|
|
8
|
-
}[]>;
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
export declare function fetchAssets(sdk: FieldExtensionSDK, query: string): Promise<{
|
|
3
|
+
contentTypeName: string;
|
|
4
|
+
displayTitle: string;
|
|
5
|
+
id: string;
|
|
6
|
+
entity: import("@contentful/app-sdk").Asset;
|
|
7
|
+
thumbnail: string;
|
|
8
|
+
}[]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
-
import { ContentTypeProps } from 'contentful-management/types';
|
|
3
|
-
export declare function fetchEntries(sdk: FieldExtensionSDK, contentType: ContentTypeProps, query: string): Promise<{
|
|
4
|
-
contentTypeName: string;
|
|
5
|
-
displayTitle: string;
|
|
6
|
-
id: string;
|
|
7
|
-
description: string;
|
|
8
|
-
entry: import("@contentful/app-sdk").Entry<unknown>;
|
|
9
|
-
}[]>;
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
import { ContentTypeProps } from 'contentful-management/types';
|
|
3
|
+
export declare function fetchEntries(sdk: FieldExtensionSDK, contentType: ContentTypeProps, query: string): Promise<{
|
|
4
|
+
contentTypeName: string;
|
|
5
|
+
displayTitle: string;
|
|
6
|
+
id: string;
|
|
7
|
+
description: string;
|
|
8
|
+
entry: import("@contentful/app-sdk").Entry<unknown>;
|
|
9
|
+
}[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function insertBlock(editor: any, nodeType: any, entity: any): void;
|
|
1
|
+
export declare function insertBlock(editor: any, nodeType: any, entity: any): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trim leading slash character if found. Bails otherwise.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* trimLeadingSlash("/my query") // --> "my query"
|
|
6
|
-
*/
|
|
7
|
-
export declare function trimLeadingSlash(text: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Trim leading slash character if found. Bails otherwise.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* trimLeadingSlash("/my query") // --> "my query"
|
|
6
|
+
*/
|
|
7
|
+
export declare function trimLeadingSlash(text: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PlatePlugin } from '../../internal/types';
|
|
2
|
-
export declare function createDragAndDropPlugin(): PlatePlugin;
|
|
1
|
+
import { PlatePlugin } from '../../internal/types';
|
|
2
|
+
export declare function createDragAndDropPlugin(): PlatePlugin;
|