-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split view with meta boxes even with legacy canvas #66706
Changes from all commits
2e97c95
dfe6935
be563d0
d008922
2fdda78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -148,11 +148,7 @@ function useEditorStyles( ...additionalStyles ) { | |||||||||||||||||||||
] ); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
* @param {Object} props | ||||||||||||||||||||||
* @param {boolean} props.isLegacy True when the editor canvas is not in an iframe. | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
function MetaBoxesMain( { isLegacy } ) { | ||||||||||||||||||||||
function MetaBoxesMain() { | ||||||||||||||||||||||
const [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => { | ||||||||||||||||||||||
const { get } = select( preferencesStore ); | ||||||||||||||||||||||
const { isMetaBoxLocationVisible } = select( editPostStore ); | ||||||||||||||||||||||
|
@@ -232,22 +228,15 @@ function MetaBoxesMain( { isLegacy } ) { | |||||||||||||||||||||
|
||||||||||||||||||||||
const contents = ( | ||||||||||||||||||||||
<div | ||||||||||||||||||||||
className={ clsx( | ||||||||||||||||||||||
// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it. | ||||||||||||||||||||||
'edit-post-layout__metaboxes', | ||||||||||||||||||||||
! isLegacy && 'edit-post-meta-boxes-main__liner' | ||||||||||||||||||||||
) } | ||||||||||||||||||||||
hidden={ ! isLegacy && isShort && ! isOpen } | ||||||||||||||||||||||
// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it. | ||||||||||||||||||||||
className="edit-post-layout__metaboxes edit-post-meta-boxes-main__liner" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we combine two CSS classes into one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I think since we have to keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right. I thought it would be nice to remove the gutenberg/packages/edit-post/src/components/layout/style.scss Lines 98 to 107 in d008922
|
||||||||||||||||||||||
hidden={ isShort && ! isOpen } | ||||||||||||||||||||||
> | ||||||||||||||||||||||
<MetaBoxes location="normal" /> | ||||||||||||||||||||||
<MetaBoxes location="advanced" /> | ||||||||||||||||||||||
</div> | ||||||||||||||||||||||
); | ||||||||||||||||||||||
|
||||||||||||||||||||||
if ( isLegacy ) { | ||||||||||||||||||||||
return contents; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
const isAutoHeight = openHeight === undefined; | ||||||||||||||||||||||
let usedMax = '50%'; // Approximation before max has a value. | ||||||||||||||||||||||
if ( max !== undefined ) { | ||||||||||||||||||||||
|
@@ -580,9 +569,7 @@ function Layout( { | |||||||||||||||||||||
} | ||||||||||||||||||||||
extraContent={ | ||||||||||||||||||||||
! isDistractionFree && | ||||||||||||||||||||||
showMetaBoxes && ( | ||||||||||||||||||||||
<MetaBoxesMain isLegacy={ ! shouldIframe } /> | ||||||||||||||||||||||
) | ||||||||||||||||||||||
showMetaBoxes && <MetaBoxesMain /> | ||||||||||||||||||||||
} | ||||||||||||||||||||||
> | ||||||||||||||||||||||
<PostLockedModal /> | ||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dates back to #19082 which introduced device previewing and it seems at the time the canvas was not iframed. Now device previews are always iframed and its document is the scrolling context so this rule has no purpose.