diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 6b9af74d03a3ab..00951fb94c4a77 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -730,10 +730,6 @@ _Returns_ - `JSX.Element`: A React element. -### ReusableBlocksRenameHint - -Undocumented declaration. - ### RichText _Related_ diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index 2a127feb3df1cc..29bb71b682e970 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -170,8 +170,3 @@ export { useBlockEditingMode } from './block-editing-mode'; export { default as BlockEditorProvider } from './provider'; export { useSettings, useSetting } from './use-settings'; export { useBlockCommands } from './use-block-commands'; - -/* - * The following rename hint component can be removed in 6.4. - */ -export { default as ReusableBlocksRenameHint } from './inserter/reusable-block-rename-hint'; diff --git a/packages/block-editor/src/components/inserter/reusable-block-rename-hint.js b/packages/block-editor/src/components/inserter/reusable-block-rename-hint.js deleted file mode 100644 index 6a3a3d1eec260b..00000000000000 --- a/packages/block-editor/src/components/inserter/reusable-block-rename-hint.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * WordPress dependencies - */ -import { Button } from '@wordpress/components'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { focus } from '@wordpress/dom'; -import { useRef } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import { close } from '@wordpress/icons'; -import { store as preferencesStore } from '@wordpress/preferences'; - -const PREFERENCE_NAME = 'isResuableBlocksrRenameHintVisible'; -/* - * This hook was added in 6.3 to help users with the transition from Reusable blocks to Patterns. - * It is only exported for use in the reusable-blocks package as well as block-editor. - * It will be removed in 6.4. and should not be used in any new code. - */ -export function useReusableBlocksRenameHint() { - return useSelect( - ( select ) => - select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true, - [] - ); -} - -/* - * This component was added in 6.3 to help users with the transition from Reusable blocks to Patterns. - * It is only exported for use in the reusable-blocks package as well as block-editor. - * It will be removed in 6.4. and should not be used in any new code. - */ -export default function ReusableBlocksRenameHint() { - const isReusableBlocksRenameHint = useSelect( - ( select ) => - select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true, - [] - ); - - const ref = useRef(); - - const { set: setPreference } = useDispatch( preferencesStore ); - if ( ! isReusableBlocksRenameHint ) { - return null; - } - - return ( -
-
- { __( - 'Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.' - ) } -
-
- ); -} diff --git a/packages/block-editor/src/components/inserter/style.scss b/packages/block-editor/src/components/inserter/style.scss index 35801c0e65e541..d446340939c30e 100644 --- a/packages/block-editor/src/components/inserter/style.scss +++ b/packages/block-editor/src/components/inserter/style.scss @@ -655,30 +655,6 @@ $block-inserter-tabs-height: 44px; margin: $grid-unit-20 $grid-unit-20 0; } -.reusable-blocks-menu-items__rename-hint { - align-items: top; - background: $gray-100; - border-radius: $radius-block-ui; - color: $gray-900; - display: flex; - flex-direction: row; - max-width: 380px; -} - -.reusable-blocks-menu-items__rename-hint-content { - margin: $grid-unit-15 0 $grid-unit-15 $grid-unit-15; -} - -.reusable-blocks-menu-items__rename-hint-dismiss { - // The dismiss button has a lot of empty space through its padding. - // Apply margin to visually align the icon with the top of the text to its left. - margin: $grid-unit-05 $grid-unit-05 $grid-unit-05 0; -} - -.components-menu-group .reusable-blocks-menu-items__rename-hint { - margin: 0; -} - .block-editor-patterns__sync-status-filter { .components-input-control__container { select.components-select-control__input { diff --git a/packages/block-editor/src/private-apis.js b/packages/block-editor/src/private-apis.js index c01d40d9d743b0..eaf699d5e69399 100644 --- a/packages/block-editor/src/private-apis.js +++ b/packages/block-editor/src/private-apis.js @@ -29,10 +29,6 @@ import { import DimensionsTool from './components/dimensions-tool'; import ResolutionTool from './components/resolution-tool'; import TextAlignmentControl from './components/text-alignment-control'; -import { - default as ReusableBlocksRenameHint, - useReusableBlocksRenameHint, -} from './components/inserter/reusable-block-rename-hint'; import { usesContextKey } from './components/rich-text/format-edit'; import { ExperimentalBlockCanvas } from './components/block-canvas'; import { getDuotoneFilter } from './components/duotone/utils'; @@ -82,8 +78,6 @@ lock( privateApis, { ResolutionTool, TabbedSidebar, TextAlignmentControl, - ReusableBlocksRenameHint, - useReusableBlocksRenameHint, usesContextKey, useFlashEditableBlocks, globalStylesDataKey, diff --git a/packages/edit-post/src/components/init-pattern-modal/index.js b/packages/edit-post/src/components/init-pattern-modal/index.js index e2aef9994fa0f2..a40ffc5dc58562 100644 --- a/packages/edit-post/src/components/init-pattern-modal/index.js +++ b/packages/edit-post/src/components/init-pattern-modal/index.js @@ -13,15 +13,6 @@ import { } from '@wordpress/components'; import { useEffect, useState } from '@wordpress/element'; import { store as editorStore } from '@wordpress/editor'; -import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; - -/** - * Internal dependencies - */ - -import { unlock } from '../../lock-unlock'; - -const { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis ); export default function InitPatternModal() { const { editPost } = useDispatch( editorStore ); @@ -82,7 +73,6 @@ export default function InitPatternModal() { __nextHasNoMarginBottom __next40pxDefaultSize /> - setIsModalOpen( true ) }> - { showRenameHint - ? __( 'Create pattern/reusable block' ) - : __( 'Create pattern' ) } + { __( 'Create pattern' ) } { isModalOpen && ( -