From de834c8435be81fd9e61ee430cd443e8e1efce7d Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Wed, 7 Aug 2024 10:22:18 +0900 Subject: [PATCH] Post Editor: Force iframe editor when zoom-out mode --- .../edit-post/src/components/layout/use-should-iframe.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/use-should-iframe.js b/packages/edit-post/src/components/layout/use-should-iframe.js index 03efae92c72f7d..248ea53109f250 100644 --- a/packages/edit-post/src/components/layout/use-should-iframe.js +++ b/packages/edit-post/src/components/layout/use-should-iframe.js @@ -4,6 +4,7 @@ import { store as editorStore } from '@wordpress/editor'; import { useSelect } from '@wordpress/data'; import { store as blocksStore } from '@wordpress/blocks'; +import { store as blockEditorStore } from '@wordpress/block-editor'; /** * Internal dependencies @@ -18,8 +19,10 @@ export function useShouldIframe() { hasV3BlocksOnly, isEditingTemplate, hasMetaBoxes, + isZoomOutMode, } = useSelect( ( select ) => { const { getEditorSettings, getCurrentPostType } = select( editorStore ); + const { __unstableGetEditorMode } = select( blockEditorStore ); const { getBlockTypes } = select( blocksStore ); const editorSettings = getEditorSettings(); return { @@ -29,12 +32,14 @@ export function useShouldIframe() { } ), isEditingTemplate: getCurrentPostType() === 'wp_template', hasMetaBoxes: select( editPostStore ).hasMetaBoxes(), + isZoomOutMode: __unstableGetEditorMode() === 'zoom-out', }; }, [] ); return ( ( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) && ! hasMetaBoxes ) || - isEditingTemplate + isEditingTemplate || + isZoomOutMode ); }