-
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
Add NumberControl
to support min/max font size for Tag Cloud Block
#37311
Merged
ntsekouras
merged 35 commits into
WordPress:trunk
from
amustaque97:feature/add-min-max-font-size-tag-cloud
Mar 23, 2022
Merged
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
38a48ed
Add `NumberControl` to support min/max font size for `Tag Cloud Block`
amustaque97 09c1447
Regenerate fixtures for `tag-cloud` block
amustaque97 13bb226
address review comment
amustaque97 a02a212
Remove space in label
amustaque97 c54a671
Remove space from label of smallest size input field
amustaque97 e130109
add smallestFontSize and largestFontSize in core blocks docs
amustaque97 d552757
fix NumberControl typecasting issue
amustaque97 476b9b5
change font size units from `pt` to `px`
amustaque97 9258ba4
fix php lint error replace tabs with spaces during mid-line alignment
amustaque97 cbc3f2d
replace `NumberControl` with `InputControl`
amustaque97 b48db09
add new attribute `fontSizeUnit`
amustaque97 f99b43b
replace `InputControl` with `UnitControl`
amustaque97 231433e
update `wp_tag_cloud` args to handle `fontSizeUnit`
amustaque97 795a080
fix unit test
amustaque97 fb7b01f
change `smallestFontSize` and `largestFontSize` attribute to string
amustaque97 d646f06
add condition to update font unit
amustaque97 e50e654
extract font unit from integer fontSize attribute
amustaque97 4f442ad
remove `fontSizeUnit` attribute
amustaque97 ec927f3
fix test cases after removing `fontSizeUnit` and str (smallest/larges…
amustaque97 aaa245a
fix php lint errors
amustaque97 b0a8504
implement `useCustomUnits` hooks to support different units
amustaque97 7d25c13
add `addFontChange` common function for `(smallest/largest)FontSize`
amustaque97 9832036
use `preg_replace` to handle font unit and pass integer font size `wp…
amustaque97 22cc30e
refactor `onFontChange` function to `onFontSizeChange` function
amustaque97 27e4591
`tag-cloud` block php handle decimal values `unit` property
amustaque97 a74ec71
write descriptive variables names
amustaque97 aff4e19
rename `parseUnit` to `parseQuantityAndUnitFromRawValue`
amustaque97 39b4fef
rename `parseUnit` import name
amustaque97 31fb6b5
rename `parseUnit` to `parseQuantityAndUnitFromRawValue`
amustaque97 95f6a19
Apply suggestions from code review
ciampo 02c11b7
fix: security vulnerability add validate unit method for `wp_tag_clou…
amustaque97 db24fd3
fix php lint error using `composer format` command
amustaque97 b821645
update regex for unit attribute in `wp_tag_cloud` function
amustaque97 faef8d8
Update UnitControl to have min/max check
amustaque97 059357a
change `MIN_FONT_SIZE` to 0.1
amustaque97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
With #39186 merged, would you be able to rebase on on top of latest
trunk
and see if the manualquantity < 0 || quantity > 100
check can now swapped withevent.target?.validity.valid
(see docs)?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.
Oooh, I believe this is not required. In one of the review comment I was asked to use
UnitControl
instead ofNumberControl
. Thank you for sharing it 😄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.
UnitControl
usesNumberControl
under the hood — what I'm trying to say is that we should now able to usemin
/max
instead of this manual check:Click to expand
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.
sorry I misunderstood your point. Let me try this ☝️