Skip to content

Commit

Permalink
Zoom Out: Hide slots and grouping buttons (#66243)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: ajlende <[email protected]>
Co-authored-by: draganescu <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: richtabor <[email protected]>
  • Loading branch information
8 people committed Oct 18, 2024
1 parent 619ae4f commit f1fb8cf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export function PrivateBlockToolbar( {
hasParentPattern,
hasContentOnlyLocking,
showShuffleButton,
showSlots,
showGroupButtons,
showLockButtons,
} = useSelect( ( select ) => {
const {
getBlockName,
Expand Down Expand Up @@ -134,6 +137,9 @@ export function PrivateBlockToolbar( {
hasParentPattern: _hasParentPattern,
hasContentOnlyLocking: _hasTemplateLock,
showShuffleButton: isZoomOutMode(),
showSlots: ! isZoomOutMode(),
showGroupButtons: ! isZoomOutMode(),
showLockButtons: ! isZoomOutMode(),
};
}, [] );

Expand Down Expand Up @@ -198,7 +204,7 @@ export function PrivateBlockToolbar( {
disabled={ ! isDefaultEditingMode }
isUsingBindings={ isUsingBindings }
/>
{ ! isMultiToolbar && (
{ ! isMultiToolbar && showLockButtons && (
<BlockLockToolbar
clientId={ blockClientId }
/>
Expand All @@ -212,7 +218,8 @@ export function PrivateBlockToolbar( {
) }
{ ! hasContentOnlyLocking &&
shouldShowVisualToolbar &&
isMultiToolbar && <BlockGroupToolbar /> }
isMultiToolbar &&
showGroupButtons && <BlockGroupToolbar /> }
{ showShuffleButton && (
<ToolbarGroup>
<Shuffle
Expand All @@ -221,7 +228,7 @@ export function PrivateBlockToolbar( {
/>
</ToolbarGroup>
) }
{ shouldShowVisualToolbar && (
{ shouldShowVisualToolbar && showSlots && (
<>
<BlockControls.Slot
group="parent"
Expand Down

0 comments on commit f1fb8cf

Please sign in to comment.