From 27796107e17e1b53152b2ef5f72d9de623e08457 Mon Sep 17 00:00:00 2001 From: ramon Date: Tue, 16 May 2023 15:26:37 +1000 Subject: [PATCH 1/3] Testing out zoom mode in the revisions view Also making the resizable iframe optional --- .../src/components/block-editor/index.js | 5 +- .../editor-canvas-container/index.js | 47 +++++++++++-------- .../editor-canvas-container/style.scss | 1 - .../src/components/revisions/index.js | 3 ++ .../src/components/style-book/index.js | 5 +- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/packages/edit-site/src/components/block-editor/index.js b/packages/edit-site/src/components/block-editor/index.js index 4957beee030f2b..cc5e7c8d9254df 100644 --- a/packages/edit-site/src/components/block-editor/index.js +++ b/packages/edit-site/src/components/block-editor/index.js @@ -143,6 +143,7 @@ export default function BlockEditor() { const [ resizeObserver, sizes ] = useResizeObserver(); const isTemplatePart = templateType === 'wp_template_part'; + const hasBlocks = blocks.length !== 0; const enableResizing = isTemplatePart && @@ -169,9 +170,7 @@ export default function BlockEditor() { { ( [ editorCanvasView ] ) => editorCanvasView ? (
- - { editorCanvasView } - + { editorCanvasView }
) : ( unlock( select( editSiteStore ) ).getEditorCanvasContainerView(), @@ -62,6 +68,7 @@ function EditorCanvasContainer( { children, closeButtonLabel, onClose } ) { () => getEditorCanvasContainerTitle( editorCanvasContainerView ), [ editorCanvasContainerView ] ); + function onCloseContainer() { if ( typeof onClose === 'function' ) { onClose(); @@ -97,24 +104,26 @@ function EditorCanvasContainer( { children, closeButtonLabel, onClose } ) { return ( - { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ } -
- { shouldShowCloseButton && ( -
+ + { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ } +
+ { shouldShowCloseButton && ( +
+
); } diff --git a/packages/edit-site/src/components/editor-canvas-container/style.scss b/packages/edit-site/src/components/editor-canvas-container/style.scss index acc0e0872f0b42..452b778f406829 100644 --- a/packages/edit-site/src/components/editor-canvas-container/style.scss +++ b/packages/edit-site/src/components/editor-canvas-container/style.scss @@ -1,5 +1,4 @@ .edit-site-editor-canvas-container { - background: $white; // Fallback color, overridden by JavaScript. border-radius: $radius-block-ui; bottom: 0; left: 0; diff --git a/packages/edit-site/src/components/revisions/index.js b/packages/edit-site/src/components/revisions/index.js index 347d05094ef376..d94de777aff45b 100644 --- a/packages/edit-site/src/components/revisions/index.js +++ b/packages/edit-site/src/components/revisions/index.js @@ -79,6 +79,9 @@ function Revisions( { onClose, userConfig, blocks } ) { className="edit-site-revisions__iframe" name="revisions" tabIndex={ 0 } + expand={ true } + scale={ 0.75 } + frameSize={ 100 } >