-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor: Move the InterfaceSkeleton to the editor package #62118
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
variants={ slideX } | ||
transition={ { type: 'tween', delay: 0.8 } } | ||
> | ||
<FullscreenModeClose showTooltip initialPost={ initialPost } /> |
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.
I'm using a Slot to inject the "W" back button to the post editor. In fact the Slot already exited before for third-party usage, I moved it to the Header component in this PR to be able to inject a different button there in the site editor (different behavior there to exit edit mode)
/** | ||
* Show icon label overrides. | ||
*/ | ||
.show-icon-labels .editor-header { |
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 is just copied from another CSS file. I didn't touch this CSS at all.
! DESIGN_POST_TYPES.includes( postType ) | ||
) { | ||
baseStyles.push( { | ||
css: 'body{padding-bottom: 40vh}', |
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 style was already applied in the custom "VisualEditor" component that existed in the post editor. But I removed that component (it was mostly useless).
That said, this particular style might need to move to the editor package at some point to apply to "posts" when they load in the site editor context as well.
<MetaBoxes location="advanced" /> | ||
</div> | ||
) } | ||
</EditorCanvas> |
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.
I wish we didn't need all these props (forceIsDirty, children, disableIframe, autoFocus...) but I think there's no way around them for now (mostly to inject metaboxes UI...)
return; | ||
} | ||
titleRef?.current?.focus(); | ||
}, [ autoFocus ] ); |
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 actually existed before, but I removed it inadvertently in one of the previous PRs.
Size Change: +460 B (+0.03%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
b027005
to
9a9e93b
Compare
9eb6c2b
to
9eec8aa
Compare
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.
Given the size of the code being moved around all I did was use the product. In my testing everything seems in place. Tests passing means 🚢 it!
9a9e93b
to
da569a9
Compare
9eec8aa
to
ddf142f
Compare
ddf142f
to
845e82d
Compare
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.
Do excuse/ignore my bikeshedding but EditorCanvas
seems odd to me. Is it a terrible idea to simply call it Editor
? Other ideas: EditorShell
, EditorEasel
, Editorscape
.
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.
Is it a terrible idea to simply call it Editor?
Well we already have an editor which is the underlying system implementing a block editor specific for WP, upon which the post and the site editors are built.
@youknowriad why not preserve Interface and name it EditorInterface?
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.
So I agree that Editor
would be the best name but I didn't use it yet because I plan for Editor
to be the only component one would use to render an "postType/postId" editor.
The component here requires an EditorProvider
to work still, so it corresponds more to the UI of the editor only.
I think any of the ideas shared above can work: Canvas is already heavily used in the code base but I'm actually not opinionated EditorInterface
sound good to me as well. But worth noting it's just an internal component (and may stay that way forever so the naming is not that important). I may go with EditorInterface
for now.
The Editor
component will come later.
…2118) Co-authored-by: youknowriad <[email protected]> Co-authored-by: draganescu <[email protected]>
…2118) Co-authored-by: youknowriad <[email protected]> Co-authored-by: draganescu <[email protected]>
Related #52632
What?
This is one of the latest pieces of the puzzle of the unification between post and site editors. This PR moves the "InterfaceSkeleton" (the whole UI basically) of the editor to the editor package (from the edit-post package) under the EditorInterface component. To ease with review and avoid breakage and regressions, I chose not to update the site editor to use this component yet, it will require some more changes there, so for now I just focused on the post editor..
Testing Instructions
1- There should be no functional change or UI change at all but smoke testing the post editor is necessary to check for potential unintended regressions.