Add a GlobalStylesScreenRootSlot slot in Global Styles root screen#49136
Add a GlobalStylesScreenRootSlot slot in Global Styles root screen#49136BogdanUngureanu wants to merge 3 commits intoWordPress:trunkfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
youknowriad
left a comment
There was a problem hiding this comment.
Thanks for your work here, that's a great start.
Like mentioned here #48068 (comment) I think we should start by protecting this API with the Gutenberg plugin check, can we introduce this check.
Also, there's a couple things that we should consider:
- Adding an e2e test for this extensibility API potentially.
- Documentation: Not entirely sure how we're documenting the editSite slots in the block editor handbook but we should be consistent. It doesn't have to be in this PR since this is still experimental but let's make sure to have a todo item in the issue at least.
|
|
||
| return ( | ||
| <Card size="small" className="edit-site-global-styles-screen-root"> | ||
| <ScreenRootSlot /> |
There was a problem hiding this comment.
This is a too prominent place to add a slot and plugins will compete too much for place. I think the preview and variations should stay at the top. Let's move this slot after the "browse styles" button
There was a problem hiding this comment.
I'd echo Riad on this one. After browse styles seems like a good position.
| import StylesPreview from './preview'; | ||
| import { unlock } from '../../private-apis'; | ||
|
|
||
| const { Slot: GlobalStylesScreenRootSlot } = createSlotFill( |
There was a problem hiding this comment.
Should we be exposing the API in edit-site/src/index like we do for all the slots?
ntsekouras
left a comment
There was a problem hiding this comment.
Thank you for the PR @BogdanUngureanu, this looks good in general!
Besides Riad's notes, I'd suggest to move the slot in its own file.
|
Hi @BogdanUngureanu This seems like a promising start to get this into the Gutenberg plugin for testing. Would you be available to adjust your PR to incorporate the comments you received from @ntsekouras and @youknowriad |
|
Hi, @BogdanUngureanu! Is there a plan to continue working on this? |
|
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. |
|
No, I’ve found a workaround for it. I’ll close it |
|
Thanks for the update, @BogdanUngureanu! Do you mind sharing your workaround in the issue? It could be helpful for other extenders. |
What?
Resolves: #48068
Add a
GlobalStylesScreenRootSlotslot in the Global Styles root screen.Why?
In order to allow integrators a way to add custom elements in the Global Styles Screen Root, a new slot is added at the top of the section.
How?
It creates a new slot that's called at the top of the GlobalStylesScreenRoot component.
Testing Instructions
It doesn't change the current behavior.
Open the Global Styles in site editor and make sure nothing changes.
Testing Instructions for Keyboard