-
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
Close button: extensibility in post editor #22323
Changes from all commits
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 |
---|---|---|
|
@@ -155,3 +155,4 @@ export { default as PluginPostStatusInfo } from './components/sidebar/plugin-pos | |
export { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel'; | ||
export { default as PluginSidebar } from './components/sidebar/plugin-sidebar'; | ||
export { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item'; | ||
export { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close'; | ||
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 this component be shared between 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. We considered that in #20989 (comment) but decided not to do it for now. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
__experimentalUseSlot as useSlot, | ||
createSlotFill, | ||
} from '@wordpress/components'; | ||
|
||
const slotName = '__experimentalMainDashboardButton'; | ||
|
||
const { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName ); | ||
|
||
const MainDashboardButton = Fill; | ||
|
||
const Slot = ( { children } ) => { | ||
const slot = useSlot( slotName ); | ||
const hasFills = Boolean( slot.fills && slot.fills.length ); | ||
|
||
if ( ! hasFills ) { | ||
return children; | ||
} | ||
|
||
return <MainDashboardButtonSlot bubblesVirtually />; | ||
}; | ||
|
||
MainDashboardButton.Slot = Slot; | ||
|
||
export default MainDashboardButton; |
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 great that there are docs here for this, just had a request for this!
Looks like the file just needs to be added to the toc.json file for it to show up in the block editor handbook.
I've made a PR to publish them - #27317 - if you get a chance to review, @vindl.
edit: don't worry about the review, decided to admin merge 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 was afk for a couple of days so just got to this now. Thanks for the update @talldan!