Skip to content
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

Make BlockPopover component public #61529

Merged
merged 5 commits into from
May 13, 2024

Conversation

gigitux
Copy link
Contributor

@gigitux gigitux commented May 9, 2024

What?

Note

This PR is just a draft to get feedback. If making sense to make the BlockPopover component public, I would suggest marking it as an unstable API and improving the documentation.

This PR makes the BlockPopover component public.

Why?

Currently, a consumer can add the Gutenberg toolbar block with the BlockToolbar component. Hoverwer, the BlockToolbar isn't flexible, and it is complex to hide/show different buttons and text.

Making BlockPopover public allows a consumer to create a custom BlockToolbar and customize it according to application needs.

This PR could be part of #53874.

You can check woocommerce/woocommerce#47323 and woocommerce/woocommerce#47322 for a real-use case.

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@gigitux gigitux changed the title make BlockPopover component public May 9, 2024
@youknowriad
Copy link
Contributor

Hi there!, Thanks for opening this PR.

I would love more opinions on the PR (maybe @ellatrix) but I think making this component a public one is fine. But I'd probably make the two unstable props "private" before opening the component. (have a private version of the component and a public one)

@youknowriad youknowriad added the [Feature] Extensibility The ability to extend blocks or the editing experience label May 9, 2024
@@ -207,6 +207,10 @@ _Related_

Undocumented declaration.

### BlockPopover

Undocumented declaration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a JSDoc to the component helps with this. Also the component already has a README, so you might be able to reuse the README content.

@gigitux
Copy link
Contributor Author

gigitux commented May 10, 2024

I updated the PR, and I'm opening it to be reviewed. I:

  • updated the documentation.
  • created a public and a private version of the BlockPopover component.
  • updated all the imports to ensure that the private version is used.

Let me know if I missed something! Thanks for the help!

@gigitux gigitux marked this pull request as ready for review May 10, 2024 09:03
@gigitux gigitux requested a review from ellatrix as a code owner May 10, 2024 09:03
Copy link

github-actions bot commented May 10, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: gigitux <gigitux@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@youknowriad
Copy link
Contributor

That looks good to me. I'd appreciate a second opinion @WordPress/gutenberg-core

@noisysocks
Copy link
Member

It's a useful component that I reach for a lot e.g. when building UIs for block supports. I imagine making it public might make it possible to build more advanced design tooling in plugins which is great. So I'm a 👍.

Before making it public let's be sure to check that there are no APIs (props, etc.) that we want to clean up first.

@youknowriad youknowriad added the [Type] New API New API to be used by plugin developers or package users. label May 13, 2024
@youknowriad youknowriad merged commit 363d375 into WordPress:trunk May 13, 2024
64 of 66 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.4 milestone May 13, 2024
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Jun 6, 2024
@jennydupuy jennydupuy mentioned this pull request Jun 6, 2024
49 tasks
@gigitux
Copy link
Contributor Author

gigitux commented Jun 6, 2024

Dev Note: BlockPopover Component Public

The BlockPopover component is now publicly accessible. For more details, you can check the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience Needs Dev Note Requires a developer note for a major WordPress release cycle [Type] New API New API to be used by plugin developers or package users.
4 participants