-
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
[Mobile] - List V2 - List Style Type #42703
Conversation
- List Item - Add support for list type for both ordered and standard icon. - List - Avoid passing the start prop on Mobile
Size Change: +7 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
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.
Ok this is looking good! I tried my best to break the list style types, but couldn't. Summary of the test cases I tried:
Builds:
iOS: pr19116-1d883ed, iPhone SE
Android: pr16962-faca4cd, Galaxy S20
TC 1: Indentation
- Android 🟢
- iOS 🟢
TC 2: Indentation and Ordered Lists
- Indentation with ordered lists
- Android 🟢
- iOS 🟢
- List style type icon changes to number
- Android 🟢
- iOS 🟢
- Reverse order
- Android 🟢
- iOS 🟢
- Starting value
- Android 🟢
- iOS 🟢
TC 3: Font Size
- Android 🟢
- iOS 🟢
TC 4: Background and text colors
- Android 🟢
- iOS 🟢
I also verified the HTML changes in the web with each test. Code looks great as well.
Approving, LGTM! Nice work! 🚀
* Mobile - BlockList - Only render ListEmptyComponent at root level * Mobile - Register ListItem block * ListItem block - Export IdentUI to share it with Mobile * Mobile - Export useRefEffect * List V2 - Make it compatible with mobile by passing two props to their inner blocks and selecting a native TagName * Mobile - ListItem block - Add native variant * List V2 - Add style prop for mobile * Mobile - ListItem block - Add color customization support * Mobile - ListItem - Pass style instead of specific values to prevent other data like fontSize/lineHeight * Mobile - Add List V2 feature flag * [Mobile] - List V2 - List Style Type (#42703) * Mobile - List V2: - List Item - Add support for list type for both ordered and standard icon. - List - Avoid passing the start prop on Mobile * Mobile - ListStyleType - Fix default color * Mobile - ListItem - Add margin for parent list * Mobile - ListItem - Check if there's a default font size from the theme * Mobile - ListItem - Add deleteEnter for RichText * Mobile - ListItem - Remove unneeded theme fontSize parsing * Mobile - ListItem - Fix list margins * Mobile - ListItem - Fix margins * Mobile - Global styles - Parse font sizes * Mobile - List Style - Use theme.json font size as a default if its a block based theme * Mobile - Update CHANGELOG * Mobile - List Block V2 - Unit tests * Mobile - BlockList - Fix appender * Mobile - RichText - Add container width prop * Mobile - List V2 - Fix issue on Android where the font size / line-height updates weren't showing correctly due to issues with the views layout * List V2 - Move TagName to its own file with both web and native variant * Mobile - Update RichText snapshots
Follow up of #42702
Gutenberg Mobile
-> List V2 Support wordpress-mobile/gutenberg-mobile#5054WordPress iOS
-> Gutenberg - Add list block v2 flag wordpress-mobile/WordPress-iOS#19116WordPress Android
-> [Gutenberg] Add List Block V2 flag wordpress-mobile/WordPress-Android#16962What?
This PR adds the custom styling for the List V2 block, since we are not using Aztec's formatting for lists we are doing it on the React side.
Why?
Instead of changing Aztec to work with Lists using inner blocks, now the logic for displaying the list type, ordered lists, and indentation will be handled within the ListItem block.
How?
It introduces a new
ListStyleType
component that will handle the logic for the icon/ordered lists, as well as including three different icons for indentations, Circle, Circle outline, and Square.It supports setting a starting number for ordered lists and the reverse setting.
There's also a change where we parse the
theme.json
data and Global Styles, sometimes font sizes are not in pixels so we need to parse them so we don't have to do it every time we need one of those values.Testing Instructions
Precondition: A site with the Gutenberg 13.8 plugin.
NOTE: Once the flag is enabled sometimes the new List block won't be shown the first time the editor is opened, so if you still see the old version without inner blocks, close the editor and open it again.
Test case 1 - Test different levels of indentation
Test case 2 - Test different levels of indentation and ordered lists
reverse
optionTest case 3 - Set a different font size
Test case 4 - Set some background and text colors
Screenshots or screencast
Test case 1 - Test different levels of indentation
Test case 2 - Test different levels of indentation and ordered lists
Test case 3 - Set a different font size
Test case 4 - Set some background and text colors