[MOOSE-398] FE: has-balanced-text class not applying to FE Paragraph blocks#359
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this do/fix?
This pull request improves the handling of custom controls and class names for WordPress core blocks in the
create-wp-controls.jsutility. The main focus is on ensuring that custom classes and attributes are correctly applied to both API v2 and v3 core blocks, addressing a previous issue where class names were not properly set on v3 blocks. The implementation is now more robust, modular, and supports multiple control configurations.Core block controls and class name handling:
configsarray) and dynamic lookup for each block, replacing the previous singlestate.settingsapproach.applySaveElementClasses) to ensure managed classes are applied to the saved block element for all block API versions, fixing the issue where v3 core blocks did not get the correct class names. [1] [2]normalizeClassSource,getBaseClassName) to robustly merge and normalize class sources from various attributes and props, ensuring consistent class name application.Block attribute and control management:
init) to support multiple configs, re-register block types with merged custom attributes, and ensure filters are only registered once.useEffectin the editor, ensuring attributes are set only when undefined.These changes collectively provide better support for custom block controls and styling, especially for modern (API v3) core blocks, and resolve previous issues with class name application.
QA
Links to relevant issues
Test Environment
Pull request checklist
I've captured a screenshot or screencast of the changes and linked it above.N/A