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

Block API: Introduce abstraction for better management of inspector controls #62439

Open
artemiomorales opened this issue Jun 10, 2024 · 2 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block bindings [Type] Enhancement A suggestion for improvement.

Comments

@artemiomorales
Copy link
Contributor

artemiomorales commented Jun 10, 2024

What problem does this address?

Currently, inspector controls are created inside of a block's Edit component. This means that any modification to those controls must also be done in each block's Edit component on a case-by-case basis, and it is difficult to introduce generic changes that affect a large number of block controls in a robust manner.

But, what if we were to devise a way to introduce a wrapper around each of these inspector controls, allowing us to more easily customize their behavior or appearance?

This impacts at least two potential enhancements:

  1. Allow for site builders and admins to granularly control which inspector controls appear or not in the editor based on their use case, which would allow for end users to have a more customized, tailored experience with less cognitive overload
  2. With Block Bindings, introduce logic to indicate whether attributes are connected or not in a single location rather than needing to create custom logic inside every Edit component (related issue: Block Bindings: Add indicator that an attribute is connected instead of hiding the controls #61406)

What is your proposed solution?

@ellatrix has already done an early exploration here: #60779

The idea is to move inspector controls to be an attribute of block settings, then render each control separately inside a wrapper, which, as mentioned above, could pave the way for toggling their display on or off, as well as creating robust logic for indicating whether a particular attribute is bound.

@artemiomorales artemiomorales added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. [Feature] Block bindings labels Jun 10, 2024
@Mamaduka
Copy link
Member

Here's also a proposal we drafted a while back - #51005.

@talldan
Copy link
Contributor

talldan commented Jun 11, 2024

Also related - #58233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block bindings [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants