-
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
Implement list block in React Native #14636
Changes from 1 commit
bd83d8f
8ed9cc0
e0d7cf6
eb33f84
c64dd5a
f0a1e21
73aaa4f
b6938aa
74f77cf
79f408c
1f12a9f
cc8a4e8
ca338c2
076936f
6ff97b8
73fbd38
e07498e
f40852c
7fb36f6
9145a6d
58eae26
08318ca
9dcd23b
fd62f01
66e971d
da0e1a7
eb009e8
cc5666e
91f790c
4451cb3
97ac0fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { Toolbar } from '@wordpress/components'; | |
import { __ } from '@wordpress/i18n'; | ||
import { | ||
changeListType, | ||
getStartListFormat, | ||
getLineListFormat, | ||
} from '@wordpress/rich-text'; | ||
|
||
/** | ||
|
@@ -22,7 +22,7 @@ import BlockFormatControls from '../block-format-controls'; | |
* inner list is selected. | ||
*/ | ||
function isListRootSelected( value ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not replace There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, export There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done with 4451cb3. |
||
return getStartListFormat( value ).nestingLevel < 1; | ||
return getLineListFormat( value ).nestingLevel < 1; | ||
} | ||
|
||
/** | ||
|
@@ -35,7 +35,7 @@ function isListRootSelected( value ) { | |
* @return {boolean} [description] | ||
*/ | ||
function isActiveListType( tagName, rootTagName, value ) { | ||
const listFormat = getStartListFormat( value ); | ||
const listFormat = getLineListFormat( value ); | ||
|
||
if ( ! listFormat || ! listFormat.type ) { | ||
return tagName === rootTagName; | ||
|
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.
I meant to rename it as getLineNestingLevel, back when it was only about the nesting. I think it's better to export two functions instead of overloading one for multiple purposes. 66e971d#r272474533
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.
Aha, I see. I will work on that.
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.
I pushed da0e1a7, splitting the function into separate ones and marking them as unstable. Let me know what you think @ellatrix , thanks!