-
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
Introduces PluginSettingsSidebar slotfill to the Document sidebar. #13361
Introduces PluginSettingsSidebar slotfill to the Document sidebar. #13361
Conversation
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.
LGTM! This is an elegant solution to a useful extension point.
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.
Referring to the related slack discussion. https://wordpress.slack.com/archives/C02QB2JS7/p1545318632348900
Let's wait a bit before introducing this as Phase 2 work could have an impact on backward compatibilty here.
Noting, that there is also a tutorial which explains how to create a sidebar for your plugin - - it would be an alternative supported as of today: There was also a related discussion on Twitter on that topic during the weekend: https://twitter.com/AlexStandiford/status/1086313778625593344 There was mention of the article by @ocean90: |
@youknowriad any new thoughts on this proposal? Code wise it looks solid. There is only the question related to the UI considerations and how does it fit in the wider picture of the block editor on other screens like the widget one. |
I think we can explore this a bit further now. The original reasons for delaying this are still valid (could become an inspector control in phase 2 if we ever introduce a "Document" or "Post" block) but it feels a bit too seen and this use-case is legit. Can we expaned the description of the PR with a plugin example to test it? I think we should rename this to Also, is there a way to display the plugin icon in the panel header (to clarify the origin of the panel). |
Yeah, this seems like something that is needed. I'm fine if it's a separate PR though. Whatever works best for you all. |
Tested this, it works great. A few questions:
|
@youknowriad I was able to remove the custom panels using removePanel and looking up the id in the markup. I have been thinking about the priority aspect as well, I was thinking that adding it to |
@gziolo @youknowriad I've updated the e2e test and everything is passing. Is there anything else that needs to be addressed on this? |
@youknowriad I have created #16384 as an approach to manage priority. Any feedback is apprectiated! |
@@ -88,6 +88,7 @@ export function initializeEditor( id, postType, postId, settings, initialEdits ) | |||
} | |||
|
|||
export { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item'; | |||
export { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel'; |
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.
@aduth any thougs on the naming?
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 fine to me as proposed.
Description
Introduce a new slotFill below Status & Availability panel in the Document sidebar.
Closes #13357
How has this been tested?
This has been testing locally and there are tests on the PR.
Screenshots
Types of changes
New feature that only affects the settings-sidebar component.
Checklist:
Basic Usage Example: