-
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
Edit Site: Add package with barebones site editor screen. #19054
Conversation
$screen->is_block_editor() || | ||
'gutenberg_page_gutenberg-widgets' === $screen->id || | ||
'gutenberg_page_gutenberg-edit-site' === $screen->id | ||
); |
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.
Maybe this means this function should move out of lib/widgets.php
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.
Not yet, it's still only needed for widget blocks.
to { | ||
opacity: 1; | ||
} | ||
} |
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.
One of the reasons of the introduction of the EditorRegions component was to abstract the layout of the editor page to use it elsewhere instead of duplicating all these stylesheets. It could be an opportunity to use it.
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.
Yes, I thought/tried that. The problem is that it's still very specific to edit-post
, we would have to move it to block-editor
and make it a bit more abstract maybe?
I think that it won't take long before the edit-post
and edit-site
layouts diverge so much that it will become impractical to share something like EditorRegions
.
I do see potential for something similar to EditorRegions
, but specific to edit-site
, later down the road when the desired layout is clearer.
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.
What's specific to edit-post
in that package is just the aria regions labels. Other than that I think it's generic enough. Tbh, I feel we should do the refactoring now rather than after the fact.
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.
Move EditorRegions
to editor
and use it here? I don't think that will be harder to do later, but we could do it.
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 not sure yet which package, could be block-editor
maybe? I don't know yet since it's basically just a UI component but maybe not generic enough for @wordpress/components
?
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.
Seems more like an editor
thing since it deals with the area that surrounds the block-editor
.
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.
It's still not clear to me whether this new edit-site package should be a complete new React tree or just reuse wp.editPost.initializeEditor and just enable/disable some plugins/hooks.
I guess this comes down to the size of the differences between the two screens. It will become obvious over time, so happy to start with the proposed approach here.
I think that they will be very different and we would end up polluting |
0abc8dd
to
9590317
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.
I'm approving but I'd like us to try extracting the EditorRegions component to reduce the boilerplate.
Description
This PR starts work on an experimental block based full site editing screen as part of the full site editing experiment.
The idea is for this to serve as a specialized UI for customizing block based themes, basically what the customizer is now to classic themes.
This PR takes care of adding the new module, linking all necessary dependencies, bootstrapping PHP logic, etc. It's already pretty big as is, so it'd be good to merge this before starting to work on the actual full site editing logic.
How has this been tested?
It was verified that enabling the full site editing experiment in the Gutenberg experiments screen enabled a "Site editor (beta)" sub-menu item in the Gutenberg menu, and clicking on it rendered a basic block editor without persistence.
Screenshots
Types of Changes
New Feature: The full site editing experiment now has an experimental site editor screen that will be developed for customizing block based themes.
Checklist: