From 7a7fdd7494a1b9a605c0784b77c554aa2585287e Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Tue, 5 Nov 2024 11:25:08 +0000 Subject: [PATCH] Conditionalise metaboxes based on Zoom Out (#66742) Co-authored-by: getdave Co-authored-by: kevin940726 Co-authored-by: MaggieCabrera Co-authored-by: t-hamano --- packages/edit-post/src/components/layout/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index ab8c393b8172f4..2f6127f89b9702 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -424,6 +424,9 @@ function Layout( { select( editPostStore ) ); const { canUser, getPostType } = select( coreStore ); + const { __unstableGetEditorMode } = unlock( + select( blockEditorStore ) + ); const supportsTemplateMode = settings.supportsTemplateMode; const isViewable = @@ -433,6 +436,8 @@ function Layout( { name: 'wp_template', } ); + const isZoomOut = __unstableGetEditorMode() === 'zoom-out'; + return { mode: select( editorStore ).getEditorMode(), isFullscreenActive: @@ -444,7 +449,8 @@ function Layout( { isDistractionFree: get( 'core', 'distractionFree' ), showMetaBoxes: ! DESIGN_POST_TYPES.includes( currentPostType ) && - select( editorStore ).getRenderingMode() === 'post-only', + select( editorStore ).getRenderingMode() === 'post-only' && + ! isZoomOut, isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ), templateId: supportsTemplateMode &&