-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Mobile Release v1.82.1 #43906
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
Merged
Merged
Mobile Release v1.82.1 #43906
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a64ecd8
Release script: Update react-native-editor version to 1.81.0
derekblank 29d06a6
Release script: Update with changes from 'npm run core preios'
derekblank 4d1ca7e
Release script: Update react-native-editor version to 1.81.1
dcalhoun 78fc8f4
Release script: Update with changes from 'npm run core preios'
dcalhoun 9edbebe
[Mobile] - Add BlockListCompact (#43431)
201e83a
[RNMobile] List block v2: Fix text color inconsistencies with list it…
derekblank f41577e
Mobile - Disable FastImage on Android (#43322)
a439a53
[Mobile] - Fix dynamic React Native version (#43058)
94b8447
[RNMobile] Use default placeholder text color for native List Item (#…
derekblank 8599e8c
Mobile - Update CHANGELOG
10fef38
Release script: Update react-native-editor version to 1.82.0
SiobhyB 4e2512c
Release script: Update with changes from 'npm run core preios'
SiobhyB 60199dc
[RNMobile] Set tintColor for ActionSheetIOS (#42996)
SiobhyB 7fe980b
Update picker's .scss to follow BEM convention (#43036)
SiobhyB 5157b3d
Update CHANGELOG with 1.82.0 changes
SiobhyB 570fd2d
Release script: Update react-native-editor version to 1.82.1
SiobhyB 059e5c1
Release script: Update with changes from 'npm run core preios'
SiobhyB 59dd5de
Mobile - List V2 - Prevent error when list is empty (#43861)
f761037
[Mobile] List V2 - Fixes split issues (#43949)
0ef2c30
Update CHANGELOG to include 1.82.1 changes
SiobhyB b32d772
Merge branch into trunk
SiobhyB 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
[Mobile] List V2 - Fixes split issues (#43949)
* Mobile - List V2 - Add useEnter to fix splitting issue * Merging blocks: allow x to be merged into wrapper blocks (quote, list, group...) (#42780) * Add test for the group block (#42801) Co-authored-by: Ella van Durpe <[email protected]> Co-authored-by: Justin Ahinon <[email protected]>
- Loading branch information
There are no files selected for viewing
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
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
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
77 changes: 77 additions & 0 deletions
77
packages/block-library/src/list-item/hooks/use-enter.native.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { | ||
| createBlock, | ||
| getDefaultBlockName, | ||
| cloneBlock, | ||
| } from '@wordpress/blocks'; | ||
| import { useRef } from '@wordpress/element'; | ||
| import { useSelect, useDispatch } from '@wordpress/data'; | ||
| import { store as blockEditorStore } from '@wordpress/block-editor'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import useOutdentListItem from './use-outdent-list-item'; | ||
|
|
||
| export default function useEnter( props, preventDefault ) { | ||
| const { replaceBlocks, selectionChange } = useDispatch( blockEditorStore ); | ||
| const { getBlock, getBlockRootClientId, getBlockIndex } = | ||
| useSelect( blockEditorStore ); | ||
| const propsRef = useRef( props ); | ||
| propsRef.current = props; | ||
| const [ canOutdent, outdentListItem ] = useOutdentListItem( | ||
| propsRef.current.clientId | ||
| ); | ||
|
|
||
| return { | ||
| onEnter() { | ||
| const { content, clientId } = propsRef.current; | ||
| if ( content.length ) { | ||
| return; | ||
| } | ||
| preventDefault.current = true; | ||
| if ( canOutdent ) { | ||
| outdentListItem(); | ||
| return; | ||
| } | ||
| // Here we are in top level list so we need to split. | ||
| const topParentListBlock = getBlock( | ||
| getBlockRootClientId( clientId ) | ||
| ); | ||
| const blockIndex = getBlockIndex( clientId ); | ||
| const head = cloneBlock( { | ||
| ...topParentListBlock, | ||
| innerBlocks: topParentListBlock.innerBlocks.slice( | ||
| 0, | ||
| blockIndex | ||
| ), | ||
| } ); | ||
| const middle = createBlock( getDefaultBlockName() ); | ||
| // Last list item might contain a `list` block innerBlock | ||
| // In that case append remaining innerBlocks blocks. | ||
| const after = [ | ||
| ...( topParentListBlock.innerBlocks[ blockIndex ] | ||
| .innerBlocks[ 0 ]?.innerBlocks || [] ), | ||
| ...topParentListBlock.innerBlocks.slice( blockIndex + 1 ), | ||
| ]; | ||
| const tail = after.length | ||
| ? [ | ||
| cloneBlock( { | ||
| ...topParentListBlock, | ||
| innerBlocks: after, | ||
| } ), | ||
| ] | ||
| : []; | ||
| replaceBlocks( | ||
| topParentListBlock.clientId, | ||
| [ head, middle, ...tail ], | ||
| 1 | ||
| ); | ||
| // We manually change the selection here because we are replacing | ||
| // a different block than the selected one. | ||
| selectionChange( middle.clientId ); | ||
| }, | ||
| }; | ||
| } |
21 changes: 0 additions & 21 deletions
21
packages/e2e-tests/specs/editor/blocks/__snapshots__/group.test.js.snap
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
.../editor/blocks/__snapshots__/Group-can-be-created-using-the-block-inserter-1-chromium.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <!-- wp:group --> | ||
| <div class="wp-block-group"></div> | ||
| <!-- /wp:group --> |
3 changes: 3 additions & 0 deletions
3
.../editor/blocks/__snapshots__/Group-can-be-created-using-the-slash-inserter-1-chromium.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <!-- wp:group --> | ||
| <div class="wp-block-group"></div> | ||
| <!-- /wp:group --> |
5 changes: 5 additions & 0 deletions
5
...ots__/Group-can-have-other-blocks-appended-to-it-using-the-button-appender-1-chromium.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <!-- wp:group --> | ||
| <div class="wp-block-group"><!-- wp:paragraph --> | ||
| <p>Group Block with a Paragraph</p> | ||
| <!-- /wp:paragraph --></div> | ||
| <!-- /wp:group --> |
9 changes: 9 additions & 0 deletions
9
...pecs/editor/blocks/__snapshots__/Group-can-merge-into-group-with-Backspace-1-chromium.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <!-- wp:group --> | ||
| <div class="wp-block-group"><!-- wp:paragraph --> | ||
| <p>1</p> | ||
| <!-- /wp:paragraph --></div> | ||
| <!-- /wp:group --> | ||
|
|
||
| <!-- wp:paragraph --> | ||
| <p>2</p> | ||
| <!-- /wp:paragraph --> |
9 changes: 9 additions & 0 deletions
9
...pecs/editor/blocks/__snapshots__/Group-can-merge-into-group-with-Backspace-2-chromium.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <!-- wp:group --> | ||
| <div class="wp-block-group"><!-- wp:paragraph --> | ||
| <p>1</p> | ||
| <!-- /wp:paragraph --> | ||
|
|
||
| <!-- wp:paragraph --> | ||
| <p>2</p> | ||
| <!-- /wp:paragraph --></div> | ||
| <!-- /wp:group --> |
Oops, something went wrong.
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.
What does this do? Why is it different from web?
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.
👋🏻 @ellatrix. It looks like this was introduced in #43949. That may have additional details or be a good location for discussion. Personally, I am not familiar with the details currently. cc/ @geriux
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.
We have a different logic when handling "Enter" events on native for RichText components, I remember we had to diverge with our own
useEnterhook to allow splitting Lists in the middle. I can check the code further to provide more information since we introduced this a little over a year ago.Is there something that's affecting this code @ellatrix or is it just have more context on this different behavior? Let us know if you want more information about it. Thanks!