Skip to content

Commit

Permalink
Zoom Out: Remove zoom-out toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 15, 2024
1 parent 9671329 commit 5b21f5c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 208 deletions.
15 changes: 2 additions & 13 deletions packages/block-editor/src/components/block-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
default as InsertionPoint,
} from './insertion-point';
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';
Expand Down Expand Up @@ -75,11 +74,8 @@ export default function BlockTools( {
isGroupable,
} = useSelect( blockEditorStore );
const { getGroupingBlockName } = useSelect( blocksStore );
const {
showEmptyBlockSideInserter,
showBlockToolbarPopover,
showZoomOutToolbar,
} = useShowBlockTools();
const { showEmptyBlockSideInserter, showBlockToolbarPopover } =
useShowBlockTools();

const {
duplicateBlocks,
Expand Down Expand Up @@ -211,13 +207,6 @@ export default function BlockTools( {
/>
) }

{ showZoomOutToolbar && (
<ZoomOutPopover
__unstableContentRef={ __unstableContentRef }
clientId={ clientId }
/>
) }

{ /* Used for the inline rich text toolbar. Until this toolbar is combined into BlockToolbar, someone implementing their own BlockToolbar will also need to use this to see the image caption toolbar. */ }
{ ! isZoomOutMode && ! hasFixedToolbar && (
<Popover.Slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export function useShowBlockTools() {
getSettings,
__unstableGetEditorMode,
isTyping,
getBlockOrder,
getSectionRootClientId,
} = unlock( select( blockEditorStore ) );

const clientId =
Expand All @@ -44,17 +42,7 @@ export function useShowBlockTools() {
! isTyping() &&
editorMode === 'edit' &&
isEmptyDefaultBlock;
const isZoomOut = editorMode === 'zoom-out';
const isSectionSelected = getBlockOrder(
getSectionRootClientId()
).includes( clientId );
const _showZoomOutToolbar =
clientId &&
isZoomOut &&
! _showEmptyBlockSideInserter &&
isSectionSelected;
const _showBlockToolbarPopover =
! _showZoomOutToolbar &&
! getSettings().hasFixedToolbar &&
! _showEmptyBlockSideInserter &&
hasSelectedBlock &&
Expand All @@ -63,7 +51,6 @@ export function useShowBlockTools() {
return {
showEmptyBlockSideInserter: _showEmptyBlockSideInserter,
showBlockToolbarPopover: _showBlockToolbarPopover,
showZoomOutToolbar: _showZoomOutToolbar,
};
}, [] );
}

This file was deleted.

135 changes: 0 additions & 135 deletions packages/block-editor/src/components/block-tools/zoom-out-toolbar.js

This file was deleted.

0 comments on commit 5b21f5c

Please sign in to comment.