diff --git a/packages/block-editor/src/components/block-settings-menu-controls/index.js b/packages/block-editor/src/components/block-settings-menu-controls/index.js index 39063db4f52e02..bdc2502ab7e7d2 100644 --- a/packages/block-editor/src/components/block-settings-menu-controls/index.js +++ b/packages/block-editor/src/components/block-settings-menu-controls/index.js @@ -58,7 +58,8 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => { const convertToGroupButtonProps = useConvertToGroupButtonProps( selectedClientIds ); const { isGroupable, isUngroupable } = convertToGroupButtonProps; - const showConvertToGroupButton = isGroupable || isUngroupable; + const showConvertToGroupButton = + ( isGroupable || isUngroupable ) && ! isContentOnly; return ( { + const { __unstableGetEditorMode } = unlock( + select( blockEditorStore ) + ); + + return __unstableGetEditorMode() === 'zoom-out'; + } ); + const { firstParentClientId, onlyBlock, @@ -235,7 +244,7 @@ export function BlockSettingsDropdown( { clientId={ firstBlockClientId } /> ) } - { ! isContentOnly && ( + { ( ! isContentOnly || isZoomOut ) && ( ) } - { isDefaultEditingMode && ( - - ) } + ); diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index 87fea30e31cdb9..e266ac83226dab 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -13,6 +13,7 @@ import { BlockEditorProvider, BlockContextProvider, privateApis as blockEditorPrivateApis, + store as blockEditorStore, } from '@wordpress/block-editor'; import { store as noticesStore } from '@wordpress/notices'; import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns'; @@ -188,6 +189,15 @@ export const ExperimentalEditorProvider = withRegistryProvider( }, [ post.type ] ); + + const isZoomOut = useSelect( ( select ) => { + const { __unstableGetEditorMode } = unlock( + select( blockEditorStore ) + ); + + return __unstableGetEditorMode() === 'zoom-out'; + } ); + const shouldRenderTemplate = !! template && mode !== 'post-only'; const rootLevelPost = shouldRenderTemplate ? template : post; const defaultBlockContext = useMemo( () => { @@ -332,9 +342,13 @@ export const ExperimentalEditorProvider = withRegistryProvider( { children } { ! settings.__unstableIsPreviewMode && ( <> - - - + { ! isZoomOut && ( + <> + + + + + ) } { mode === 'template-locked' && ( ) }