From d312574cc0481b086539d077fbc5a9a6aa5e1959 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 7 May 2021 09:36:30 +0100 Subject: [PATCH] Mark the inserter slot as unstable (#31417) --- packages/block-directory/README.md | 2 +- .../inserter-menu-downloadable-blocks-panel/index.js | 6 +++--- packages/block-editor/src/components/index.js | 2 +- .../src/components/inserter-menu-extension/index.js | 8 ++++---- .../src/components/inserter/search-results.js | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/block-directory/README.md b/packages/block-directory/README.md index a0c5ea8cd7b0d2..26d26bb04ed924 100644 --- a/packages/block-directory/README.md +++ b/packages/block-directory/README.md @@ -18,7 +18,7 @@ _This package assumes that your code will run in an **ES2015+** environment. If This package builds a standalone JS file. When loaded on a page with the block editor, it extends the block inserter to search for blocks from WordPress.org. -To do this, it uses the `__experimentalInserterMenuExtension`, a slot-fill area hooked into the block types list. When the user runs a search and there are no results currently installed, it fires off a request to WordPress.org for matching blocks. These are listed for the user to install with a one-click process that [installs, activates, and injects the block into the post.](./src/store/actions.js#L49) When the post is saved, if the block was not used, it will be [silently uninstalled](./src/store/actions.js#L129) to avoid clutter. +To do this, it uses the `__unstableInserterMenuExtension`, a slot-fill area hooked into the block types list. When the user runs a search and there are no results currently installed, it fires off a request to WordPress.org for matching blocks. These are listed for the user to install with a one-click process that [installs, activates, and injects the block into the post.](./src/store/actions.js#L49) When the post is saved, if the block was not used, it will be [silently uninstalled](./src/store/actions.js#L129) to avoid clutter. See also the API endpoints for searching WordPress.org: `/wp/v2/block-directory/search`, and installing & activating plugins: `/wp/v2/plugins/`. diff --git a/packages/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js b/packages/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js index d6528715e03437..f6fb0505790d1f 100644 --- a/packages/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js +++ b/packages/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js @@ -6,7 +6,7 @@ import { debounce } from 'lodash'; /** * WordPress dependencies */ -import { __experimentalInserterMenuExtension } from '@wordpress/block-editor'; +import { __unstableInserterMenuExtension } from '@wordpress/block-editor'; import { useState } from '@wordpress/element'; /** @@ -19,7 +19,7 @@ function InserterMenuDownloadableBlocksPanel() { const debouncedSetFilterValue = debounce( setFilterValue, 400 ); return ( - <__experimentalInserterMenuExtension> + <__unstableInserterMenuExtension> { ( { onSelect, onHover, @@ -46,7 +46,7 @@ function InserterMenuDownloadableBlocksPanel() { /> ); } } - + ); } diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index c5fa4e766e6e43..17b324df56b50d 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -88,7 +88,7 @@ export { default as withColorContext } from './color-palette/with-color-context' */ export { default as __unstableBlockSettingsMenuFirstItem } from './block-settings-menu/block-settings-menu-first-item'; -export { default as __experimentalInserterMenuExtension } from './inserter-menu-extension'; +export { default as __unstableInserterMenuExtension } from './inserter-menu-extension'; export { default as __experimentalPreviewOptions } from './preview-options'; export { default as __experimentalUseResizeCanvas } from './use-resize-canvas'; export { default as BlockInspector } from './block-inspector'; diff --git a/packages/block-editor/src/components/inserter-menu-extension/index.js b/packages/block-editor/src/components/inserter-menu-extension/index.js index c93b6fda2850b9..fadc649a40a6e1 100644 --- a/packages/block-editor/src/components/inserter-menu-extension/index.js +++ b/packages/block-editor/src/components/inserter-menu-extension/index.js @@ -3,10 +3,10 @@ */ import { createSlotFill } from '@wordpress/components'; -const { Fill: __experimentalInserterMenuExtension, Slot } = createSlotFill( - '__experimentalInserterMenuExtension' +const { Fill: __unstableInserterMenuExtension, Slot } = createSlotFill( + '__unstableInserterMenuExtension' ); -__experimentalInserterMenuExtension.Slot = Slot; +__unstableInserterMenuExtension.Slot = Slot; -export default __experimentalInserterMenuExtension; +export default __unstableInserterMenuExtension; diff --git a/packages/block-editor/src/components/inserter/search-results.js b/packages/block-editor/src/components/inserter/search-results.js index b29015ee763dc2..c51519973561ee 100644 --- a/packages/block-editor/src/components/inserter/search-results.js +++ b/packages/block-editor/src/components/inserter/search-results.js @@ -17,7 +17,7 @@ import { speak } from '@wordpress/a11y'; */ import BlockTypesList from '../block-types-list'; import BlockPatternsList from '../block-patterns-list'; -import __experimentalInserterMenuExtension from '../inserter-menu-extension'; +import __unstableInserterMenuExtension from '../inserter-menu-extension'; import InserterPanel from './panel'; import InserterNoResults from './no-results'; import useInsertionPoint from './hooks/use-insertion-point'; @@ -151,7 +151,7 @@ function InserterSearchResults( { ) } { showBlockDirectory && ( - <__experimentalInserterMenuExtension.Slot + <__unstableInserterMenuExtension.Slot fillProps={ { onSelect: onSelectBlockType, onHover, @@ -169,7 +169,7 @@ function InserterSearchResults( { } return null; } } - + ) } );