-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Implement list block in React Native #14636
Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
bd83d8f
Make sure multiline property is filtered out of props on save.
SergioEstevao 8ed9cc0
Send block edit parameters using the context.
SergioEstevao e0d7cf6
Add multiline variables to allow proper parsing and saving of propert…
SergioEstevao eb33f84
Add list edit toolbar options
SergioEstevao c64dd5a
Add multiline property.
SergioEstevao f0a1e21
Add list block to mobile gb.
SergioEstevao 73aaa4f
Move list-edit.native.js to new location.
SergioEstevao b6938aa
Make block edit send down the onFocus property.
SergioEstevao 74f77cf
Handle case where unstableSplit is passed has prop.
SergioEstevao 79f408c
Pass multiline tags to serialiser.
SergioEstevao 1f12a9f
Use the format-lib for handling "Enter" in lists
hypest cc8a4e8
Merge branch 'master' into rnmobile/lists2
SergioEstevao ca338c2
Force selection reset on split
hypest 076936f
Add multiline wrapper tags to formatToValue.
SergioEstevao 6ff97b8
Merge branch 'rnmobile/lists2' of https://github.com/WordPress/gutenb…
SergioEstevao 73fbd38
Remove unnecessary code.
SergioEstevao e07498e
Force rich-text text update on list type change
hypest f40852c
Merge branch 'master' into rnmobile/lists2
SergioEstevao 7fb36f6
Merge branch 'master' into rnmobile/lists2
SergioEstevao 9145a6d
Merge branch 'master' into rnmobile/lists2
SergioEstevao 58eae26
Disable indent and outdent.
SergioEstevao 08318ca
Enable toggling list type of nested lists
hypest 9dcd23b
Update list type toolbar button on native mobile
hypest fd62f01
Include diff missed by previous commit
hypest 66e971d
Rename to denote that it's about lines
hypest da0e1a7
Split into separate functions and mark unstable
hypest eb009e8
Add missing JSDoc param
Tug cc5666e
Update snapshot for BlockControls
Tug 91f790c
Merge branch 'master' into rnmobile/lists2
SergioEstevao 4451cb3
Move isActiveListType, isListRootSelected to rich-text package
hypest 97ac0fb
Remove excess empty line
hypest 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
|
||
import { getLineIndex } from './get-line-index'; | ||
|
||
/** | ||
* Returns the nesting level of the list at the selection start position. | ||
* | ||
* @param {Object} value The rich-text value | ||
* | ||
* @return {number} The nesting level, starting from 0. | ||
*/ | ||
export function getStartNestingLevel( value ) { | ||
hypest marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { text, replacements, start, end } = value; | ||
const startingLineIndex = getLineIndex( value, start ); | ||
const startLineFormats = replacements[ startingLineIndex ] || []; | ||
return startLineFormats.length; | ||
} |
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.
Why not replace
getStartListFormat
with bothisListRootSelected
andisActiveListType
? This seems weird to me.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 , not sure I follow. Do you mean to completely remove getStartListFormat and implement its pieces inside
isListRootSelected
andisActiveListType
?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.
Yes, export
isListRootSelected
andisActiveListType
fromrich-text
as unstable.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.
Done with 4451cb3.