diff --git a/packages/block-editor/src/components/block-list/index.js b/packages/block-editor/src/components/block-list/index.js index e2e019d4a9bf69..8a20b1ac0e0db6 100644 --- a/packages/block-editor/src/components/block-list/index.js +++ b/packages/block-editor/src/components/block-list/index.js @@ -233,7 +233,6 @@ function Items( { ) } ) } diff --git a/packages/block-editor/src/components/block-list/zoom-out-separator.js b/packages/block-editor/src/components/block-list/zoom-out-separator.js index be5af549630607..5bdc83f5d27743 100644 --- a/packages/block-editor/src/components/block-list/zoom-out-separator.js +++ b/packages/block-editor/src/components/block-list/zoom-out-separator.js @@ -20,15 +20,12 @@ import { useState } from '@wordpress/element'; import { store as blockEditorStore } from '../../store'; import { unlock } from '../../lock-unlock'; -export function ZoomOutSeparator( { - clientId, - rootClientId = '', - position = 'top', -} ) { +export function ZoomOutSeparator( { clientId, rootClientId = '' } ) { const [ isDraggedOver, setIsDraggedOver ] = useState( false ); const { sectionRootClientId, sectionClientIds, + isBlockSelected, blockInsertionPoint, blockInsertionPointVisible, } = useSelect( ( select ) => { @@ -37,11 +34,13 @@ export function ZoomOutSeparator( { getBlockOrder, isBlockInsertionPointVisible, getSectionRootClientId, + isBlockSelected: _isBlockSelected, } = unlock( select( blockEditorStore ) ); const root = getSectionRootClientId(); const sectionRootClientIds = getBlockOrder( root ); return { + isBlockSelected: _isBlockSelected, sectionRootClientId: root, sectionClientIds: sectionRootClientIds, blockOrder: getBlockOrder( root ), @@ -67,18 +66,10 @@ export function ZoomOutSeparator( { return null; } - if ( position === 'top' ) { - isVisible = - blockInsertionPointVisible && - blockInsertionPoint.index === 0 && - clientId === sectionClientIds[ blockInsertionPoint.index ]; - } - - if ( position === 'bottom' ) { - isVisible = - blockInsertionPointVisible && - clientId === sectionClientIds[ blockInsertionPoint.index - 1 ]; - } + isVisible = + isBlockSelected( clientId ) || + ( blockInsertionPointVisible && + clientId === sectionClientIds[ blockInsertionPoint.index ] ); return ( diff --git a/packages/block-editor/src/components/block-tools/index.js b/packages/block-editor/src/components/block-tools/index.js index 099323925384b8..a29f3f60152fde 100644 --- a/packages/block-editor/src/components/block-tools/index.js +++ b/packages/block-editor/src/components/block-tools/index.js @@ -22,7 +22,6 @@ import BlockToolbarPopover from './block-toolbar-popover'; import ZoomOutPopover from './zoom-out-popover'; import { store as blockEditorStore } from '../../store'; import usePopoverScroll from '../block-popover/use-popover-scroll'; -import ZoomOutModeInserters from './zoom-out-mode-inserters'; import { useShowBlockTools } from './use-show-block-tools'; import { unlock } from '../../lock-unlock'; import getEditorRegion from '../../utils/get-editor-region'; @@ -241,11 +240,6 @@ export default function BlockTools( { name="__unstable-block-tools-after" ref={ blockToolbarAfterRef } /> - { isZoomOutMode && ( - - ) } ); diff --git a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js b/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js deleted file mode 100644 index 8ea80a53830135..00000000000000 --- a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * External dependencies - */ -import clsx from 'clsx'; - -/** - * WordPress dependencies - */ -import { useState } from '@wordpress/element'; -import { Button } from '@wordpress/components'; -import { plus } from '@wordpress/icons'; -import { _x } from '@wordpress/i18n'; - -function ZoomOutModeInserterButton( { isVisible, onClick } ) { - const [ - zoomOutModeInserterButtonHovered, - setZoomOutModeInserterButtonHovered, - ] = useState( false ); - - return ( -