Skip to content

Commit

Permalink
Quality: Remove "reusable block name hint" code (#63514)
Browse files Browse the repository at this point in the history
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Jul 18, 2024
1 parent 289516c commit ce80338
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 132 deletions.
4 changes: 0 additions & 4 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,6 @@ _Returns_

- `JSX.Element`: A React element.

### ReusableBlocksRenameHint

Undocumented declaration.

### RichText

_Related_
Expand Down
5 changes: 0 additions & 5 deletions packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

This file was deleted.

24 changes: 0 additions & 24 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -82,8 +78,6 @@ lock( privateApis, {
ResolutionTool,
TabbedSidebar,
TextAlignmentControl,
ReusableBlocksRenameHint,
useReusableBlocksRenameHint,
usesContextKey,
useFlashEditableBlocks,
globalStylesDataKey,
Expand Down
10 changes: 0 additions & 10 deletions packages/edit-post/src/components/init-pattern-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -82,7 +73,6 @@ export default function InitPatternModal() {
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
<ReusableBlocksRenameHint />
<ToggleControl
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ __(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
* WordPress dependencies
*/
import { hasBlockSupport, isReusableBlock } from '@wordpress/blocks';
import {
store as blockEditorStore,
privateApis as blockEditorPrivateApis,
} from '@wordpress/block-editor';
import { store as blockEditorStore } from '@wordpress/block-editor';
import { useCallback, useState } from '@wordpress/element';
import {
MenuItem,
Expand All @@ -26,11 +23,6 @@ import { store as coreStore } from '@wordpress/core-data';
* Internal dependencies
*/
import { store } from '../../store';
import { unlock } from '../../lock-unlock';

const { useReusableBlocksRenameHint, ReusableBlocksRenameHint } = unlock(
blockEditorPrivateApis
);

/**
* Menu control to convert block(s) to reusable block.
Expand All @@ -46,7 +38,6 @@ export default function ReusableBlockConvertButton( {
rootClientId,
onClose,
} ) {
const showRenameHint = useReusableBlocksRenameHint();
const [ syncType, setSyncType ] = useState( undefined );
const [ isModalOpen, setIsModalOpen ] = useState( false );
const [ title, setTitle ] = useState( '' );
Expand Down Expand Up @@ -156,9 +147,7 @@ export default function ReusableBlockConvertButton( {
return (
<>
<MenuItem icon={ symbol } onClick={ () => setIsModalOpen( true ) }>
{ showRenameHint
? __( 'Create pattern/reusable block' )
: __( 'Create pattern' ) }
{ __( 'Create pattern' ) }
</MenuItem>
{ isModalOpen && (
<Modal
Expand All @@ -179,7 +168,6 @@ export default function ReusableBlockConvertButton( {
} }
>
<VStack spacing="5">
<ReusableBlocksRenameHint />
<TextControl
__nextHasNoMarginBottom
label={ __( 'Name' ) }
Expand Down

0 comments on commit ce80338

Please sign in to comment.