diff --git a/packages/block-editor/src/components/iframe/content.scss b/packages/block-editor/src/components/iframe/content.scss index 62a57030f1be11..165cf70d24a710 100644 --- a/packages/block-editor/src/components/iframe/content.scss +++ b/packages/block-editor/src/components/iframe/content.scss @@ -1,3 +1,7 @@ +.block-editor-iframe__body { + position: relative; +} + .block-editor-iframe__container { width: 100%; height: 100%; diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index 3bb50999c2a929..4200c83335293f 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -25,6 +25,12 @@ import { usePaddingAppender } from './use-padding-appender'; const { EditorCanvas } = unlock( editorPrivateApis ); const isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false; +const DESIGN_POST_TYPES = [ + 'wp_template', + 'wp_template_part', + 'wp_block', + 'wp_navigation', +]; export default function VisualEditor( { styles } ) { const { @@ -34,12 +40,15 @@ export default function VisualEditor( { styles } ) { hasV3BlocksOnly, isEditingTemplate, isZoomedOutView, + postType, } = useSelect( ( select ) => { const { isFeatureActive } = select( editPostStore ); - const { getEditorSettings, getRenderingMode } = select( editorStore ); + const { getEditorSettings, getRenderingMode, getCurrentPostType } = + select( editorStore ); const { getBlockTypes } = select( blocksStore ); const { __unstableGetEditorMode } = select( blockEditorStore ); const editorSettings = getEditorSettings(); + const _postType = getCurrentPostType(); return { isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ), renderingMode: getRenderingMode(), @@ -47,9 +56,9 @@ export default function VisualEditor( { styles } ) { hasV3BlocksOnly: getBlockTypes().every( ( type ) => { return type.apiVersion >= 3; } ), - isEditingTemplate: - select( editorStore ).getCurrentPostType() === 'wp_template', + isEditingTemplate: _postType === 'wp_template', isZoomedOutView: __unstableGetEditorMode() === 'zoom-out', + postType: _postType, }; }, [] ); const hasMetaBoxes = useSelect( @@ -66,7 +75,8 @@ export default function VisualEditor( { styles } ) { if ( ! isZoomedOutView && ! hasMetaBoxes && - renderingMode === 'post-only' + renderingMode === 'post-only' && + ! DESIGN_POST_TYPES.includes( postType ) ) { paddingBottom = '40vh'; } diff --git a/packages/edit-site/src/components/block-editor/editor-canvas.js b/packages/edit-site/src/components/block-editor/editor-canvas.js index fda722de8e6e31..39a96db09899db 100644 --- a/packages/edit-site/src/components/block-editor/editor-canvas.js +++ b/packages/edit-site/src/components/block-editor/editor-canvas.js @@ -113,7 +113,7 @@ function EditorCanvas( { settings, children, onClick } ) { // Forming a "block formatting context" to prevent margin collapsing. // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context - css: `body{position:relative; ${ + css: `body{${ canvasMode === 'view' ? `min-height: 100vh; ${ currentPostIsTrashed ? '' : 'cursor: pointer;'