-
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
feat: Enable setting HTML anchor IDs for all supported block types #59802
Conversation
Size Change: -49 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Allow blocks displaying "advanced" controls within a separate inspector section.
Expand anchor support to include all blocks, not just the Heading block.
Swap the Image block for the Shortcode block for the subject of a block with no settings now that anchor support is present for an empty Image block.
f6a206e
to
c34e3bb
Compare
There is no reason to retain this unused code in the native-specific file.
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @iamthomasbishop, @jbinda. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
The changes look good, nice work!
I tested it on a local build of Gutenberg and Android, and everything worked as expected.
…ordPress#59802) * feat: Support inspector advanced controls Allow blocks displaying "advanced" controls within a separate inspector section. * feat: Enable block anchor support Expand anchor support to include all blocks, not just the Heading block. * docs: Add change log entry * test: Fix hidden block setting button Swap the Image block for the Shortcode block for the subject of a block with no settings now that anchor support is present for an empty Image block. * test: Assert setting anchor HTML ID * refactor: Remove web-specific properties There is no reason to retain this unused code in the native-specific file. Unlinked contributors: iamthomasbishop, jbinda. Co-authored-by: dcalhoun <[email protected]> Co-authored-by: jhnstn <[email protected]> Co-authored-by: derekblank <[email protected]> Co-authored-by: pinarol <[email protected]>
What?
Enable the ability to set an anchor for any block, not just Heading blocks.
Why?
Fixes #28363. Improve web and native mobile editor feature alignment by removing temporary scoping of anchor ID support to Heading blocks.
Fixes wordpress-mobile/gutenberg-mobile#1385. Although, we are unable to simplify the conditional display of the block settings button referenced in the quote above, as there are, in fact, blocks without Advanced Settings like additional CSS class names — e.g., Shortcode. There would need to be an ever-present UI for every block setting before we could remove the conditional block settings button display.
How?
Add a bottom sheet slot for displaying advanced settings beneath a separate section. Refactor the existing anchor hook, removing mobile-specific limiting anchor support to Heading blocks only.
Testing Instructions
The following should be performed for both the web and native mobile editor.
block.json
attribute.attribute.
Testing Instructions for Keyboard
Perform the aforementioned testing instructions using a screen reader.
Screenshots or screencast
N/A, no visual changes.