-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] Block bindings[Package] Block editor/packages/block-editor/packages/block-editor[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
- Part of Block API #41236.
What's the problem?
Several features require a way to manage specific block attributes and the UI controls for those attributes in a way that's difficult currently:
- Block bindings (e.g. bindings to Custom fields) - At the time of writing a requirement is locking the editing of specific bound attributes and their UI controls, but in the future it's easy to see this evolving. Users may be able to directly update custom field values from a block control, and potentially create and see the status of bindings.
- Pattern overrides - Currently the pattern block is making use of
useBlockEditingMode( 'contentOnly' )
to manage the visibility of block controls. This hides the majority of block controls that are considered unrelated to content. The waycontentOnly
works is very inflexible—it completely hides the block inspector, even if there are content controls there (like the image block alt/title fields). It also doesn't do a great job of managing toolbar controls—lots of blocks have internal conditional logic for handling the visibility of controls based on the block editing mode, which becomes hard to manage. There's a problem in that the controls displayed or hidden are a fixed list that has no relation to the pattern overrides supported attributes. Changing the visibility of UI controls will also affect other usages ofuseBlockEditingMode( 'contentOnly' )
outside of patterns.
Offering better management over block attributes and controls might also tie into future initiatives around workflows and extensibility.
My feeling is that these problems are closely related, and this is an area that needs some exploration.
Metadata
Metadata
Assignees
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] Block bindings[Package] Block editor/packages/block-editor/packages/block-editor[Type] EnhancementA suggestion for improvement.A suggestion for improvement.