@contentful/field-editor-rich-text 3.15.0 → 3.15.1
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 +8 -8
- package/dist/cjs/RichTextEditor.js +22 -20
- package/dist/cjs/RichTextEditor.styles.js +2 -1
- package/dist/cjs/SdkProvider.js +7 -5
- package/dist/cjs/SyncEditorChanges.js +15 -6
- package/dist/cjs/Toolbar/_tests_/toolbar.test.js +17 -15
- package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +14 -10
- package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +10 -8
- package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +2 -2
- package/dist/cjs/Toolbar/index.js +33 -30
- package/dist/cjs/__fixtures__/FakeSdk.js +3 -3
- package/dist/cjs/__fixtures__/asset/index.js +10 -10
- package/dist/cjs/__fixtures__/content-type/index.js +1 -1
- package/dist/cjs/__fixtures__/entry/index.js +7 -7
- package/dist/cjs/__fixtures__/fixtures.js +8 -6
- package/dist/cjs/__fixtures__/locale/index.js +2 -2
- package/dist/cjs/__fixtures__/space/index.js +1 -1
- package/dist/cjs/constants/Schema.js +1 -0
- package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +43 -38
- package/dist/cjs/dialogs/openRichTextDialog.js +6 -4
- package/dist/cjs/dialogs/renderRichTextDialog.js +6 -4
- package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +10 -10
- package/dist/cjs/helpers/callbacks.js +3 -3
- package/dist/cjs/helpers/config.js +2 -2
- package/dist/cjs/helpers/editor.js +53 -44
- package/dist/cjs/helpers/environment.js +3 -3
- package/dist/cjs/helpers/formatDateAndTime.js +5 -4
- package/dist/cjs/helpers/getAllowedResourcesForNodeType.js +22 -5
- package/dist/cjs/helpers/getLinkedContentTypeIdsForNodeType.js +29 -5
- package/dist/cjs/helpers/nodeFactory.js +6 -6
- package/dist/cjs/helpers/sdkNavigatorSlideIn.js +14 -6
- package/dist/cjs/helpers/sdkNavigatorSlideIn.spec.js +3 -2
- package/dist/cjs/helpers/toSlateValue.js +14 -3
- package/dist/cjs/helpers/transformers.js +5 -5
- package/dist/cjs/helpers/validations.js +12 -9
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/internal/constants.js +4 -2
- package/dist/cjs/internal/hooks.js +8 -6
- package/dist/cjs/internal/misc.js +15 -12
- package/dist/cjs/internal/queries.js +115 -108
- package/dist/cjs/internal/transforms.js +51 -48
- package/dist/cjs/internal/types/editor.js +3 -1
- package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +4 -3
- package/dist/cjs/plugins/Break/createResetNodePlugin.js +1 -0
- package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +3 -3
- package/dist/cjs/plugins/CommandPalette/components/CommandList.js +35 -33
- package/dist/cjs/plugins/CommandPalette/components/CommandList.styles.js +1 -1
- package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +7 -5
- package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +7 -3
- package/dist/cjs/plugins/CommandPalette/onKeyDown.js +6 -1
- package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +6 -4
- package/dist/cjs/plugins/CommandPalette/useCommands.js +3 -3
- package/dist/cjs/plugins/CommandPalette/utils/fetchEntries.js +2 -0
- package/dist/cjs/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -1
- package/dist/cjs/plugins/DragAndDrop/index.js +9 -1
- package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +10 -8
- package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +3 -3
- package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +19 -17
- package/dist/cjs/plugins/EmbeddedEntityInline/LinkedEntityInline.js +9 -7
- package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +5 -5
- package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +13 -11
- package/dist/cjs/plugins/EmbeddedResourceInline/LinkedResourceInline.js +5 -5
- package/dist/cjs/plugins/Heading/__tests__/createHeadingPlugin.test.js +32 -32
- package/dist/cjs/plugins/Heading/components/Heading.js +13 -10
- package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +19 -11
- package/dist/cjs/plugins/Heading/createHeadingPlugin.js +7 -2
- package/dist/cjs/plugins/Hr/index.js +19 -14
- package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +32 -28
- package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
- package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +8 -6
- package/dist/cjs/plugins/Hyperlink/components/ResourceHyperlink.js +8 -6
- package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +6 -4
- package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +7 -5
- package/dist/cjs/plugins/Hyperlink/components/styles.js +1 -1
- package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +10 -4
- package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +6 -3
- package/dist/cjs/plugins/Hyperlink/useResourceEntityInfo.js +6 -4
- package/dist/cjs/plugins/Hyperlink/utils.js +4 -4
- package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +13 -13
- package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +29 -25
- package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +22 -22
- package/dist/cjs/plugins/List/components/List.js +9 -7
- package/dist/cjs/plugins/List/components/ListItem.js +6 -4
- package/dist/cjs/plugins/List/components/ToolbarListButton.js +7 -5
- package/dist/cjs/plugins/List/createListPlugin.js +4 -0
- package/dist/cjs/plugins/List/insertListBreak.js +13 -4
- package/dist/cjs/plugins/List/insertListFragment.js +18 -5
- package/dist/cjs/plugins/List/onKeyDownList.js +7 -4
- package/dist/cjs/plugins/List/transforms/insertListItem.js +17 -2
- package/dist/cjs/plugins/List/transforms/moveListItemDown.js +8 -2
- package/dist/cjs/plugins/List/transforms/moveListItems.js +7 -2
- package/dist/cjs/plugins/List/transforms/moveListItems.test.js +15 -14
- package/dist/cjs/plugins/List/transforms/toggleList.js +8 -3
- package/dist/cjs/plugins/List/transforms/toggleList.spec.js +28 -28
- package/dist/cjs/plugins/List/transforms/unwrapList.js +7 -2
- package/dist/cjs/plugins/List/utils.js +12 -11
- package/dist/cjs/plugins/List/withList.js +6 -2
- package/dist/cjs/plugins/Marks/Bold.js +9 -7
- package/dist/cjs/plugins/Marks/Code.js +15 -7
- package/dist/cjs/plugins/Marks/Italic.js +9 -7
- package/dist/cjs/plugins/Marks/Subscript.js +10 -8
- package/dist/cjs/plugins/Marks/Superscript.js +10 -8
- package/dist/cjs/plugins/Marks/Underline.js +6 -4
- package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +9 -7
- package/dist/cjs/plugins/Marks/helpers.js +5 -5
- package/dist/cjs/plugins/Normalizer/baseRules.js +2 -0
- package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
- package/dist/cjs/plugins/Normalizer/utils.js +4 -3
- package/dist/cjs/plugins/Normalizer/withNormalizer.js +23 -3
- package/dist/cjs/plugins/Paragraph/Paragraph.js +6 -4
- package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
- package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +3 -2
- package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +9 -6
- package/dist/cjs/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +2 -0
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeAnchors.js +9 -0
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeHTML.js +17 -2
- package/dist/cjs/plugins/PasteHTML/utils/sanitizeSheets.js +13 -1
- package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
- package/dist/cjs/plugins/Quote/components/Quote.js +6 -4
- package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +6 -4
- package/dist/cjs/plugins/Quote/createQuotePlugin.js +1 -0
- package/dist/cjs/plugins/Quote/toggleQuote.js +5 -5
- package/dist/cjs/plugins/Quote/withQuote.js +4 -2
- package/dist/cjs/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +1 -0
- package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
- package/dist/cjs/plugins/Table/__tests__/helpers.test.js +4 -4
- package/dist/cjs/plugins/Table/actions/addColumn.js +5 -4
- package/dist/cjs/plugins/Table/actions/addRow.js +6 -3
- package/dist/cjs/plugins/Table/components/Cell.js +7 -5
- package/dist/cjs/plugins/Table/components/HeaderCell.js +7 -5
- package/dist/cjs/plugins/Table/components/Row.js +6 -4
- package/dist/cjs/plugins/Table/components/Table.js +8 -6
- package/dist/cjs/plugins/Table/components/TableActions.js +19 -16
- package/dist/cjs/plugins/Table/components/ToolbarButton.js +7 -4
- package/dist/cjs/plugins/Table/createTablePlugin.js +11 -1
- package/dist/cjs/plugins/Table/helpers.js +16 -12
- package/dist/cjs/plugins/Table/insertTableFragment.js +15 -2
- package/dist/cjs/plugins/Table/onKeyDownTable.js +10 -2
- package/dist/cjs/plugins/Table/tableTracking.js +6 -6
- package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +19 -17
- package/dist/cjs/plugins/Text/createTextPlugin.js +22 -5
- package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +5 -4
- package/dist/cjs/plugins/Tracking/utils.js +6 -3
- package/dist/cjs/plugins/Voids/createVoidsPlugin.js +5 -0
- package/dist/cjs/plugins/Voids/transformVoid.js +1 -0
- package/dist/cjs/plugins/index.js +15 -3
- package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +12 -10
- package/dist/cjs/plugins/shared/EmbeddedBlockUtil.js +16 -6
- package/dist/cjs/plugins/shared/EmbeddedInlineToolbarIcon.js +10 -8
- package/dist/cjs/plugins/shared/EmbeddedInlineUtil.js +9 -5
- package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +13 -11
- package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +14 -12
- package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +14 -11
- package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +8 -4
- package/dist/cjs/plugins/shared/LinkedInlineWrapper.js +10 -6
- package/dist/cjs/plugins/shared/ResourceNewBadge.js +5 -3
- package/dist/cjs/plugins/shared/ToolbarButton.js +8 -6
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +10 -5
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +11 -6
- package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +15 -13
- package/dist/cjs/plugins/shared/utils.js +4 -1
- package/dist/cjs/test-utils/assertOutput.js +1 -0
- package/dist/cjs/test-utils/hyperscript.d.js +1 -0
- package/dist/cjs/test-utils/randomId.js +3 -1
- package/dist/cjs/test-utils/validation.js +8 -5
- package/dist/esm/ContentfulEditorProvider.js +4 -1
- package/dist/esm/RichTextEditor.js +13 -13
- package/dist/esm/RichTextEditor.styles.js +1 -0
- package/dist/esm/SdkProvider.js +2 -2
- package/dist/esm/SyncEditorChanges.js +18 -3
- package/dist/esm/Toolbar/_tests_/toolbar.test.js +12 -12
- package/dist/esm/Toolbar/components/EmbedEntityWidget.js +10 -8
- package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +6 -6
- package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +1 -1
- package/dist/esm/Toolbar/index.js +28 -27
- package/dist/esm/__fixtures__/FakeSdk.js +3 -3
- package/dist/esm/constants/Schema.js +1 -0
- package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +34 -31
- package/dist/esm/dialogs/openRichTextDialog.js +2 -2
- package/dist/esm/dialogs/renderRichTextDialog.js +2 -2
- package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +10 -10
- package/dist/esm/helpers/callbacks.js +1 -1
- package/dist/esm/helpers/config.js +9 -1
- package/dist/esm/helpers/editor.js +22 -6
- package/dist/esm/helpers/extractNodes.js +3 -1
- package/dist/esm/helpers/formatDateAndTime.js +11 -2
- package/dist/esm/helpers/getAllowedResourcesForNodeType.js +19 -2
- package/dist/esm/helpers/getLinkedContentTypeIdsForNodeType.js +26 -2
- package/dist/esm/helpers/sdkNavigatorSlideIn.js +20 -6
- package/dist/esm/helpers/sdkNavigatorSlideIn.spec.js +1 -0
- package/dist/esm/helpers/toSlateValue.js +17 -3
- package/dist/esm/helpers/validations.js +5 -1
- package/dist/esm/internal/misc.js +23 -2
- package/dist/esm/internal/queries.js +11 -2
- package/dist/esm/internal/transforms.js +14 -3
- package/dist/esm/internal/types/editor.js +3 -1
- package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +4 -3
- package/dist/esm/plugins/Break/createResetNodePlugin.js +1 -0
- package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +3 -3
- package/dist/esm/plugins/CommandPalette/components/CommandList.js +30 -30
- package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +2 -2
- package/dist/esm/plugins/CommandPalette/createCommandPalettePlugin.js +11 -1
- package/dist/esm/plugins/CommandPalette/hooks/useCommandList.js +2 -0
- package/dist/esm/plugins/CommandPalette/onKeyDown.js +5 -0
- package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +2 -2
- package/dist/esm/plugins/CommandPalette/useCommands.js +3 -3
- package/dist/esm/plugins/CommandPalette/utils/fetchEntries.js +2 -0
- package/dist/esm/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -1
- package/dist/esm/plugins/DragAndDrop/index.js +9 -1
- package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +6 -6
- package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +14 -14
- package/dist/esm/plugins/EmbeddedEntityInline/LinkedEntityInline.js +5 -5
- package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +4 -4
- package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +9 -9
- package/dist/esm/plugins/EmbeddedResourceInline/LinkedResourceInline.js +4 -4
- package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +32 -32
- package/dist/esm/plugins/Heading/components/Heading.js +8 -7
- package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +14 -8
- package/dist/esm/plugins/Heading/createHeadingPlugin.js +6 -1
- package/dist/esm/plugins/Hr/index.js +8 -5
- package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +25 -23
- package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
- package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +4 -4
- package/dist/esm/plugins/Hyperlink/components/ResourceHyperlink.js +4 -4
- package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +2 -2
- package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +3 -3
- package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +5 -1
- package/dist/esm/plugins/Hyperlink/useEntityInfo.js +6 -3
- package/dist/esm/plugins/Hyperlink/useResourceEntityInfo.js +2 -2
- package/dist/esm/plugins/Hyperlink/utils.js +1 -1
- package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +13 -13
- package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +29 -25
- package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +22 -22
- package/dist/esm/plugins/List/components/List.js +1 -1
- package/dist/esm/plugins/List/components/ListItem.js +1 -1
- package/dist/esm/plugins/List/components/ToolbarListButton.js +3 -3
- package/dist/esm/plugins/List/createListPlugin.js +4 -0
- package/dist/esm/plugins/List/insertListBreak.js +13 -4
- package/dist/esm/plugins/List/insertListFragment.js +18 -5
- package/dist/esm/plugins/List/onKeyDownList.js +5 -2
- package/dist/esm/plugins/List/transforms/insertListItem.js +20 -3
- package/dist/esm/plugins/List/transforms/moveListItemDown.js +8 -2
- package/dist/esm/plugins/List/transforms/moveListItems.js +7 -2
- package/dist/esm/plugins/List/transforms/moveListItems.test.js +15 -14
- package/dist/esm/plugins/List/transforms/toggleList.js +8 -3
- package/dist/esm/plugins/List/transforms/toggleList.spec.js +28 -28
- package/dist/esm/plugins/List/transforms/unwrapList.js +7 -2
- package/dist/esm/plugins/List/utils.js +7 -2
- package/dist/esm/plugins/List/withList.js +6 -2
- package/dist/esm/plugins/Marks/Bold.js +2 -2
- package/dist/esm/plugins/Marks/Code.js +8 -2
- package/dist/esm/plugins/Marks/Italic.js +2 -2
- package/dist/esm/plugins/Marks/Subscript.js +2 -2
- package/dist/esm/plugins/Marks/Superscript.js +2 -2
- package/dist/esm/plugins/Marks/Underline.js +2 -2
- package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +4 -4
- package/dist/esm/plugins/Marks/helpers.js +1 -1
- package/dist/esm/plugins/Normalizer/baseRules.js +4 -0
- package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
- package/dist/esm/plugins/Normalizer/utils.js +1 -0
- package/dist/esm/plugins/Normalizer/withNormalizer.js +22 -2
- package/dist/esm/plugins/Paragraph/Paragraph.js +1 -1
- package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
- package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +2 -1
- package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +9 -3
- package/dist/esm/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +2 -0
- package/dist/esm/plugins/PasteHTML/utils/sanitizeAnchors.js +27 -1
- package/dist/esm/plugins/PasteHTML/utils/sanitizeHTML.js +17 -2
- package/dist/esm/plugins/PasteHTML/utils/sanitizeSheets.js +13 -1
- package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
- package/dist/esm/plugins/Quote/components/Quote.js +1 -1
- package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +2 -2
- package/dist/esm/plugins/Quote/createQuotePlugin.js +1 -0
- package/dist/esm/plugins/Quote/shouldResetQuote.js +6 -1
- package/dist/esm/plugins/Quote/toggleQuote.js +1 -1
- package/dist/esm/plugins/Quote/withQuote.js +4 -2
- package/dist/esm/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +1 -0
- package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
- package/dist/esm/plugins/Table/__tests__/helpers.test.js +4 -4
- package/dist/esm/plugins/Table/actions/addColumn.js +2 -1
- package/dist/esm/plugins/Table/actions/addRow.js +3 -0
- package/dist/esm/plugins/Table/components/Cell.js +2 -2
- package/dist/esm/plugins/Table/components/HeaderCell.js +2 -2
- package/dist/esm/plugins/Table/components/Row.js +1 -1
- package/dist/esm/plugins/Table/components/Table.js +3 -3
- package/dist/esm/plugins/Table/components/TableActions.js +12 -11
- package/dist/esm/plugins/Table/components/ToolbarButton.js +3 -2
- package/dist/esm/plugins/Table/createTablePlugin.js +11 -1
- package/dist/esm/plugins/Table/helpers.js +10 -1
- package/dist/esm/plugins/Table/insertTableFragment.js +15 -2
- package/dist/esm/plugins/Table/onKeyDownTable.js +10 -2
- package/dist/esm/plugins/Table/tableTracking.js +6 -6
- package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +19 -17
- package/dist/esm/plugins/Text/createTextPlugin.js +22 -5
- package/dist/esm/plugins/Tracking/createTrackingPlugin.js +2 -1
- package/dist/esm/plugins/Tracking/utils.js +1 -0
- package/dist/esm/plugins/Voids/createVoidsPlugin.js +5 -0
- package/dist/esm/plugins/Voids/transformVoid.js +4 -1
- package/dist/esm/plugins/index.js +12 -0
- package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +5 -5
- package/dist/esm/plugins/shared/EmbeddedBlockUtil.js +15 -5
- package/dist/esm/plugins/shared/EmbeddedInlineToolbarIcon.js +5 -5
- package/dist/esm/plugins/shared/EmbeddedInlineUtil.js +8 -4
- package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +8 -8
- package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +9 -9
- package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +9 -8
- package/dist/esm/plugins/shared/LinkedBlockWrapper.js +7 -3
- package/dist/esm/plugins/shared/LinkedInlineWrapper.js +5 -3
- package/dist/esm/plugins/shared/ResourceNewBadge.js +1 -1
- package/dist/esm/plugins/shared/ToolbarButton.js +3 -3
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +5 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +5 -2
- package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +8 -8
- package/dist/esm/plugins/shared/utils.js +4 -1
- package/dist/esm/test-utils/assertOutput.js +1 -0
- package/dist/esm/test-utils/hyperscript.d.js +1 -0
- package/dist/esm/test-utils/jsx.js +5 -1
- package/dist/esm/test-utils/randomId.js +3 -1
- package/dist/esm/test-utils/setEmptyDataAttribute.js +4 -1
- package/dist/esm/test-utils/validation.js +7 -4
- package/package.json +2 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exporting Plate/Slate queries (aka selectors) to reduce
|
|
3
|
+
* the blast radius of version upgrades
|
|
4
|
+
*/ "use strict";
|
|
2
5
|
Object.defineProperty(exports, "__esModule", {
|
|
3
6
|
value: true
|
|
4
7
|
});
|
|
@@ -9,65 +12,83 @@ function _export(target, all) {
|
|
|
9
12
|
});
|
|
10
13
|
}
|
|
11
14
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
15
|
+
createPathRef: function() {
|
|
16
|
+
return createPathRef;
|
|
14
17
|
},
|
|
15
|
-
|
|
16
|
-
return
|
|
18
|
+
findNode: function() {
|
|
19
|
+
return findNode;
|
|
20
|
+
},
|
|
21
|
+
findNodePath: function() {
|
|
22
|
+
return findNodePath;
|
|
23
|
+
},
|
|
24
|
+
getAboveNode: function() {
|
|
25
|
+
return getAboveNode;
|
|
26
|
+
},
|
|
27
|
+
getBlockAbove: function() {
|
|
28
|
+
return getBlockAbove;
|
|
29
|
+
},
|
|
30
|
+
getChildren: function() {
|
|
31
|
+
return getChildren;
|
|
32
|
+
},
|
|
33
|
+
getCommonNode: function() {
|
|
34
|
+
return getCommonNode;
|
|
35
|
+
},
|
|
36
|
+
getDescendantNodeByPath: function() {
|
|
37
|
+
return getDescendantNodeByPath;
|
|
17
38
|
},
|
|
18
39
|
getEndPoint: function() {
|
|
19
40
|
return getEndPoint;
|
|
20
41
|
},
|
|
21
|
-
|
|
22
|
-
return
|
|
42
|
+
getLastChildPath: function() {
|
|
43
|
+
return getLastChildPath;
|
|
23
44
|
},
|
|
24
|
-
|
|
25
|
-
return
|
|
45
|
+
getLastNodeByLevel: function() {
|
|
46
|
+
return getLastNodeByLevel;
|
|
26
47
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
48
|
+
getMarks: function() {
|
|
49
|
+
return getMarks;
|
|
29
50
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
51
|
+
getNextNode: function() {
|
|
52
|
+
return getNextNode;
|
|
32
53
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
54
|
+
getNextPath: function() {
|
|
55
|
+
return getNextPath;
|
|
35
56
|
},
|
|
36
|
-
|
|
37
|
-
return
|
|
57
|
+
getNodeChildren: function() {
|
|
58
|
+
return getNodeChildren;
|
|
59
|
+
},
|
|
60
|
+
getNodeDescendants: function() {
|
|
61
|
+
return getNodeDescendants;
|
|
38
62
|
},
|
|
39
63
|
getNodeEntries: function() {
|
|
40
64
|
return getNodeEntries;
|
|
41
65
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
66
|
+
getNodeEntry: function() {
|
|
67
|
+
return getNodeEntry;
|
|
68
|
+
},
|
|
69
|
+
getNodeTexts: function() {
|
|
70
|
+
return getNodeTexts;
|
|
44
71
|
},
|
|
45
72
|
getParentNode: function() {
|
|
46
73
|
return getParentNode;
|
|
47
74
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
},
|
|
51
|
-
getChildren: function() {
|
|
52
|
-
return getChildren;
|
|
53
|
-
},
|
|
54
|
-
isFirstChild: function() {
|
|
55
|
-
return isFirstChild;
|
|
75
|
+
getParentPath: function() {
|
|
76
|
+
return getParentPath;
|
|
56
77
|
},
|
|
57
|
-
|
|
58
|
-
return
|
|
78
|
+
getPathLevels: function() {
|
|
79
|
+
return getPathLevels;
|
|
59
80
|
},
|
|
60
|
-
|
|
61
|
-
return
|
|
81
|
+
getPluginType: function() {
|
|
82
|
+
return getPluginType;
|
|
62
83
|
},
|
|
63
|
-
|
|
64
|
-
return
|
|
84
|
+
getPointAfter: function() {
|
|
85
|
+
return getPointAfter;
|
|
65
86
|
},
|
|
66
|
-
|
|
67
|
-
return
|
|
87
|
+
getPointBefore: function() {
|
|
88
|
+
return getPointBefore;
|
|
68
89
|
},
|
|
69
|
-
|
|
70
|
-
return
|
|
90
|
+
getPreviousPath: function() {
|
|
91
|
+
return getPreviousPath;
|
|
71
92
|
},
|
|
72
93
|
getRange: function() {
|
|
73
94
|
return getRange;
|
|
@@ -75,32 +96,32 @@ _export(exports, {
|
|
|
75
96
|
getRangeEdges: function() {
|
|
76
97
|
return getRangeEdges;
|
|
77
98
|
},
|
|
78
|
-
getRangeStart: function() {
|
|
79
|
-
return getRangeStart;
|
|
80
|
-
},
|
|
81
99
|
getRangeEnd: function() {
|
|
82
100
|
return getRangeEnd;
|
|
83
101
|
},
|
|
84
|
-
|
|
85
|
-
return
|
|
102
|
+
getRangeStart: function() {
|
|
103
|
+
return getRangeStart;
|
|
86
104
|
},
|
|
87
|
-
|
|
88
|
-
return
|
|
105
|
+
getStartPoint: function() {
|
|
106
|
+
return getStartPoint;
|
|
89
107
|
},
|
|
90
|
-
|
|
91
|
-
return
|
|
108
|
+
getText: function() {
|
|
109
|
+
return getText;
|
|
92
110
|
},
|
|
93
|
-
|
|
94
|
-
return
|
|
111
|
+
isAncestorEmpty: function() {
|
|
112
|
+
return isAncestorEmpty;
|
|
95
113
|
},
|
|
96
|
-
|
|
97
|
-
return
|
|
114
|
+
isAncestorPath: function() {
|
|
115
|
+
return isAncestorPath;
|
|
98
116
|
},
|
|
99
|
-
|
|
100
|
-
return
|
|
117
|
+
isBlockNode: function() {
|
|
118
|
+
return isBlockNode;
|
|
101
119
|
},
|
|
102
|
-
|
|
103
|
-
return
|
|
120
|
+
isChildPath: function() {
|
|
121
|
+
return isChildPath;
|
|
122
|
+
},
|
|
123
|
+
isCommonPath: function() {
|
|
124
|
+
return isCommonPath;
|
|
104
125
|
},
|
|
105
126
|
isEditor: function() {
|
|
106
127
|
return isEditor;
|
|
@@ -111,81 +132,63 @@ _export(exports, {
|
|
|
111
132
|
isElement: function() {
|
|
112
133
|
return isElement;
|
|
113
134
|
},
|
|
114
|
-
|
|
115
|
-
return
|
|
135
|
+
isEndPoint: function() {
|
|
136
|
+
return isEndPoint;
|
|
116
137
|
},
|
|
117
|
-
|
|
118
|
-
return
|
|
138
|
+
isFirstChild: function() {
|
|
139
|
+
return isFirstChild;
|
|
119
140
|
},
|
|
120
|
-
|
|
121
|
-
return
|
|
141
|
+
isFirstChildPath: function() {
|
|
142
|
+
return isFirstChildPath;
|
|
122
143
|
},
|
|
123
|
-
|
|
124
|
-
return
|
|
144
|
+
isInline: function() {
|
|
145
|
+
return isInline;
|
|
125
146
|
},
|
|
126
|
-
|
|
127
|
-
return
|
|
147
|
+
isLastChildPath: function() {
|
|
148
|
+
return isLastChildPath;
|
|
128
149
|
},
|
|
129
|
-
|
|
130
|
-
return
|
|
150
|
+
isMarkActive: function() {
|
|
151
|
+
return isMarkActive;
|
|
131
152
|
},
|
|
132
|
-
|
|
133
|
-
return
|
|
153
|
+
isNode: function() {
|
|
154
|
+
return isNode;
|
|
134
155
|
},
|
|
135
|
-
|
|
136
|
-
return
|
|
156
|
+
isRangeAcrossBlocks: function() {
|
|
157
|
+
return isRangeAcrossBlocks;
|
|
137
158
|
},
|
|
138
|
-
|
|
139
|
-
return
|
|
159
|
+
isRangeCollapsed: function() {
|
|
160
|
+
return isRangeCollapsed;
|
|
140
161
|
},
|
|
141
|
-
|
|
142
|
-
return
|
|
162
|
+
isRangeExpanded: function() {
|
|
163
|
+
return isRangeExpanded;
|
|
143
164
|
},
|
|
144
|
-
|
|
145
|
-
return
|
|
165
|
+
isSelectionAtBlockEnd: function() {
|
|
166
|
+
return isSelectionAtBlockEnd;
|
|
146
167
|
},
|
|
147
|
-
|
|
148
|
-
return
|
|
168
|
+
isSelectionAtBlockStart: function() {
|
|
169
|
+
return isSelectionAtBlockStart;
|
|
149
170
|
},
|
|
150
|
-
|
|
151
|
-
return
|
|
171
|
+
isText: function() {
|
|
172
|
+
return isText;
|
|
173
|
+
},
|
|
174
|
+
match: function() {
|
|
175
|
+
return match;
|
|
152
176
|
},
|
|
153
177
|
matchNode: function() {
|
|
154
178
|
return matchNode;
|
|
155
179
|
},
|
|
156
|
-
someHtmlElement: function() {
|
|
157
|
-
return someHtmlElement;
|
|
158
|
-
},
|
|
159
|
-
getPointBefore: function() {
|
|
160
|
-
return getPointBefore;
|
|
161
|
-
},
|
|
162
|
-
getPointAfter: function() {
|
|
163
|
-
return getPointAfter;
|
|
164
|
-
},
|
|
165
|
-
isEndPoint: function() {
|
|
166
|
-
return isEndPoint;
|
|
167
|
-
},
|
|
168
|
-
isInline: function() {
|
|
169
|
-
return isInline;
|
|
170
|
-
},
|
|
171
180
|
queryNode: function() {
|
|
172
181
|
return queryNode;
|
|
173
182
|
},
|
|
174
|
-
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
createPathRef: function() {
|
|
178
|
-
return createPathRef;
|
|
179
|
-
},
|
|
180
|
-
match: function() {
|
|
181
|
-
return match;
|
|
183
|
+
someHtmlElement: function() {
|
|
184
|
+
return someHtmlElement;
|
|
182
185
|
},
|
|
183
|
-
|
|
184
|
-
return
|
|
186
|
+
someNode: function() {
|
|
187
|
+
return someNode;
|
|
185
188
|
}
|
|
186
189
|
});
|
|
187
|
-
const _platecommon = _interop_require_wildcard(require("@udecode/plate-common"));
|
|
188
|
-
const _slate = _interop_require_wildcard(require("slate"));
|
|
190
|
+
const _platecommon = /*#__PURE__*/ _interop_require_wildcard(require("@udecode/plate-common"));
|
|
191
|
+
const _slate = /*#__PURE__*/ _interop_require_wildcard(require("slate"));
|
|
189
192
|
function _getRequireWildcardCache(nodeInterop) {
|
|
190
193
|
if (typeof WeakMap !== "function") return null;
|
|
191
194
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -207,7 +210,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
207
210
|
if (cache && cache.has(obj)) {
|
|
208
211
|
return cache.get(obj);
|
|
209
212
|
}
|
|
210
|
-
var newObj = {
|
|
213
|
+
var newObj = {
|
|
214
|
+
__proto__: null
|
|
215
|
+
};
|
|
211
216
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
212
217
|
for(var key in obj){
|
|
213
218
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -265,6 +270,7 @@ const someNode = (editor, options)=>{
|
|
|
265
270
|
return _platecommon.someNode(editor, options);
|
|
266
271
|
};
|
|
267
272
|
const getChildren = (entry)=>{
|
|
273
|
+
// Node.children crashes when given a text node
|
|
268
274
|
if (_slate.Text.isText(entry[0])) {
|
|
269
275
|
return [];
|
|
270
276
|
}
|
|
@@ -274,6 +280,7 @@ const isFirstChild = (path)=>{
|
|
|
274
280
|
return _platecommon.isFirstChild(path);
|
|
275
281
|
};
|
|
276
282
|
const getDescendantNodeByPath = (root, path)=>{
|
|
283
|
+
// @ts-expect-error
|
|
277
284
|
return _slate.Node.get(root, path);
|
|
278
285
|
};
|
|
279
286
|
const getNodeDescendants = (root, options)=>{
|
|
@@ -9,83 +9,83 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
withoutNormalizing: function() {
|
|
16
|
-
return withoutNormalizing;
|
|
17
|
-
},
|
|
18
|
-
setSelection: function() {
|
|
19
|
-
return setSelection;
|
|
20
|
-
},
|
|
21
|
-
select: function() {
|
|
22
|
-
return select;
|
|
23
|
-
},
|
|
24
|
-
moveSelection: function() {
|
|
25
|
-
return moveSelection;
|
|
26
|
-
},
|
|
27
|
-
moveChildren: function() {
|
|
28
|
-
return moveChildren;
|
|
12
|
+
addMark: function() {
|
|
13
|
+
return addMark;
|
|
29
14
|
},
|
|
30
15
|
collapseSelection: function() {
|
|
31
16
|
return collapseSelection;
|
|
32
17
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
18
|
+
deleteFragment: function() {
|
|
19
|
+
return deleteFragment;
|
|
35
20
|
},
|
|
36
|
-
|
|
37
|
-
return
|
|
21
|
+
deleteText: function() {
|
|
22
|
+
return deleteText;
|
|
38
23
|
},
|
|
39
24
|
insertNodes: function() {
|
|
40
25
|
return insertNodes;
|
|
41
26
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
27
|
+
insertText: function() {
|
|
28
|
+
return insertText;
|
|
44
29
|
},
|
|
45
30
|
liftNodes: function() {
|
|
46
31
|
return liftNodes;
|
|
47
32
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
33
|
+
moveChildren: function() {
|
|
34
|
+
return moveChildren;
|
|
50
35
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
36
|
+
moveNodes: function() {
|
|
37
|
+
return moveNodes;
|
|
53
38
|
},
|
|
54
|
-
|
|
55
|
-
return
|
|
39
|
+
moveSelection: function() {
|
|
40
|
+
return moveSelection;
|
|
41
|
+
},
|
|
42
|
+
normalize: function() {
|
|
43
|
+
return normalize;
|
|
56
44
|
},
|
|
57
45
|
removeMark: function() {
|
|
58
46
|
return removeMark;
|
|
59
47
|
},
|
|
60
|
-
|
|
61
|
-
return
|
|
48
|
+
removeNodes: function() {
|
|
49
|
+
return removeNodes;
|
|
50
|
+
},
|
|
51
|
+
select: function() {
|
|
52
|
+
return select;
|
|
53
|
+
},
|
|
54
|
+
setEditorValue: function() {
|
|
55
|
+
return setEditorValue;
|
|
56
|
+
},
|
|
57
|
+
setNodes: function() {
|
|
58
|
+
return setNodes;
|
|
59
|
+
},
|
|
60
|
+
setSelection: function() {
|
|
61
|
+
return setSelection;
|
|
62
|
+
},
|
|
63
|
+
splitNodes: function() {
|
|
64
|
+
return splitNodes;
|
|
62
65
|
},
|
|
63
66
|
toggleMark: function() {
|
|
64
67
|
return toggleMark;
|
|
65
68
|
},
|
|
66
|
-
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
insertText: function() {
|
|
70
|
-
return insertText;
|
|
69
|
+
toggleNodeType: function() {
|
|
70
|
+
return toggleNodeType;
|
|
71
71
|
},
|
|
72
|
-
|
|
73
|
-
return
|
|
72
|
+
unhangRange: function() {
|
|
73
|
+
return unhangRange;
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
return
|
|
75
|
+
unsetNodes: function() {
|
|
76
|
+
return unsetNodes;
|
|
77
77
|
},
|
|
78
|
-
|
|
79
|
-
return
|
|
78
|
+
unwrapNodes: function() {
|
|
79
|
+
return unwrapNodes;
|
|
80
80
|
},
|
|
81
|
-
|
|
82
|
-
return
|
|
81
|
+
withoutNormalizing: function() {
|
|
82
|
+
return withoutNormalizing;
|
|
83
83
|
},
|
|
84
|
-
|
|
85
|
-
return
|
|
84
|
+
wrapNodes: function() {
|
|
85
|
+
return wrapNodes;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
const _platecommon = _interop_require_wildcard(require("@udecode/plate-common"));
|
|
88
|
+
const _platecommon = /*#__PURE__*/ _interop_require_wildcard(require("@udecode/plate-common"));
|
|
89
89
|
const _queries = require("./queries");
|
|
90
90
|
function _getRequireWildcardCache(nodeInterop) {
|
|
91
91
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -108,7 +108,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
108
108
|
if (cache && cache.has(obj)) {
|
|
109
109
|
return cache.get(obj);
|
|
110
110
|
}
|
|
111
|
-
var newObj = {
|
|
111
|
+
var newObj = {
|
|
112
|
+
__proto__: null
|
|
113
|
+
};
|
|
112
114
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
113
115
|
for(var key in obj){
|
|
114
116
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -204,6 +206,7 @@ const deleteFragment = (editor, options)=>{
|
|
|
204
206
|
return _platecommon.deleteFragment(editor, options);
|
|
205
207
|
};
|
|
206
208
|
const setEditorValue = (editor, nodes)=>{
|
|
209
|
+
// Replaces editor content while keeping change history
|
|
207
210
|
withoutNormalizing(editor, ()=>{
|
|
208
211
|
const children = [
|
|
209
212
|
...editor.children
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
/** @jsx jsx */ "use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
@@ -6,8 +6,9 @@ const _platebreak = require("@udecode/plate-break");
|
|
|
6
6
|
const _testutils = require("../../test-utils");
|
|
7
7
|
const _createExitBreakPlugin = require("./createExitBreakPlugin");
|
|
8
8
|
describe('Exit Break', ()=>{
|
|
9
|
+
// https://slate-js.slack.com/archives/C013QHXSCG1/p1640853996467300
|
|
9
10
|
it('derives its config from other plugins', ()=>{
|
|
10
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
11
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
11
12
|
const rules = [
|
|
12
13
|
{
|
|
13
14
|
hotkey: 'enter',
|
|
@@ -18,7 +19,7 @@ describe('Exit Break', ()=>{
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
];
|
|
21
|
-
const { editor
|
|
22
|
+
const { editor } = (0, _testutils.createTestEditor)({
|
|
22
23
|
input,
|
|
23
24
|
plugins: [
|
|
24
25
|
(0, _testutils.mockPlugin)({}),
|
|
@@ -18,6 +18,7 @@ const createResetNodePlugin = ()=>(0, _plateresetnode.createResetNodePlugin)({
|
|
|
18
18
|
const rules = editor.plugins.flatMap((p)=>{
|
|
19
19
|
return p.resetNode || [];
|
|
20
20
|
});
|
|
21
|
+
// set defaultType to Paragraph if not set
|
|
21
22
|
for (const rule of rules){
|
|
22
23
|
if (!rule.defaultType) {
|
|
23
24
|
rule.defaultType = _richtexttypes.BLOCKS.PARAGRAPH;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
/** @jsx jsx */ "use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
@@ -7,7 +7,7 @@ const _testutils = require("../../test-utils");
|
|
|
7
7
|
const _createSoftBreakPlugin = require("./createSoftBreakPlugin");
|
|
8
8
|
describe('Soft Break', ()=>{
|
|
9
9
|
it('derives its config from other plugins', ()=>{
|
|
10
|
-
const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
|
|
10
|
+
const input = /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)));
|
|
11
11
|
const rules = [
|
|
12
12
|
{
|
|
13
13
|
hotkey: 'ctrl+enter',
|
|
@@ -22,7 +22,7 @@ describe('Soft Break', ()=>{
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
];
|
|
25
|
-
const { editor
|
|
25
|
+
const { editor } = (0, _testutils.createTestEditor)({
|
|
26
26
|
input,
|
|
27
27
|
plugins: [
|
|
28
28
|
(0, _testutils.mockPlugin)({
|