Skip to content
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

[RNMobile] Inner Block Navigate down through hierarchy #17547

Merged
merged 82 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
6da1bf4
WIP: navigate down in the hierarchy of InnerBlocks
jbinda Sep 18, 2019
6387115
WIP: Navigation Dwon in Inner Block
jbinda Oct 8, 2019
e010328
merge master
jbinda Oct 8, 2019
09359f6
adjust style
jbinda Oct 8, 2019
a424c63
fix after merge
jbinda Oct 8, 2019
2e7204b
fix after merge
jbinda Oct 8, 2019
5dce162
playing with borders
jbinda Oct 8, 2019
76340c0
working full border
jbinda Oct 9, 2019
3295957
refactor v1
jbinda Oct 10, 2019
a28b17d
refactor v2
jbinda Oct 10, 2019
f00ad33
merge master
jbinda Oct 10, 2019
5326d44
fixed dashed border android
jbinda Oct 10, 2019
c70697c
refactor v3
jbinda Oct 10, 2019
eb7bed0
adjust button-block-appender margin
jbinda Oct 10, 2019
2fdedb7
refactor v4
jbinda Oct 10, 2019
d602fff
reefactor v5
jbinda Oct 10, 2019
497dcbc
refactor v6
jbinda Oct 10, 2019
ca22502
adjust for media text
jbinda Oct 11, 2019
dd06cba
adjust focus for media text
jbinda Oct 11, 2019
ec97815
refactor apply styles
jbinda Oct 11, 2019
3bf893b
merge master
jbinda Oct 11, 2019
8b02aae
adjust media text media container
jbinda Oct 11, 2019
4c1e1b9
pass isParentSelected prop to BlockEdit
jbinda Oct 11, 2019
e5976c0
adjust dim style
jbinda Oct 11, 2019
b54fa56
Move FloatingToolbar logic to get shippable temporary version
lukewalczak Oct 15, 2019
a6dcf70
fix after merge floating-toolbr
jbinda Oct 16, 2019
63b163f
style media-text and fix jumping behaviour
jbinda Oct 15, 2019
d7434b0
merge master
jbinda Oct 30, 2019
ed9a435
add getPrefferedColorScheme for dashed border
jbinda Nov 4, 2019
aafa452
enable FloatingToolbar for MediaText
jbinda Nov 4, 2019
dffabf9
refactor rich text handler
jbinda Nov 4, 2019
4576c6a
change dark-mode block holder border to blue
jbinda Nov 4, 2019
90ae894
dark-mode for group appender and placeholder
jbinda Nov 5, 2019
d8d4e1d
adjust margin for group placeholder
jbinda Nov 5, 2019
677aade
adjust innerblock margin for media-text
jbinda Nov 5, 2019
168c3a2
adjust group placeholder border color
jbinda Nov 5, 2019
d8b05e2
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Nov 5, 2019
e8464a0
adjust appender button color
jbinda Nov 6, 2019
7a500e1
re-activate the stacking vertically on Media & Text
jbinda Nov 6, 2019
132fa7a
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Nov 6, 2019
f94c828
CR changes
jbinda Nov 8, 2019
845f920
CR changes for Android RichText focus
jbinda Nov 12, 2019
35d8c8b
CR changes for MediaText margins
jbinda Nov 13, 2019
7eba06d
CR changes for getTree selector
jbinda Nov 13, 2019
48a62f4
CR changes: fix selection loop
jbinda Nov 15, 2019
65b8400
clean passing props after seletion loop issue fix
jbinda Nov 15, 2019
bd2a9fc
merge master
jbinda Nov 15, 2019
c072555
replace block specific text
jbinda Nov 15, 2019
f06f6af
replace block specific style
jbinda Nov 15, 2019
f2be82d
fix getParent selectors
jbinda Nov 18, 2019
e47908d
adjust selection logic
jbinda Nov 18, 2019
e8ae8b2
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Nov 18, 2019
84d8dad
fix hasInnerBlocks
jbinda Nov 18, 2019
014e3a0
refactor selectors
jbinda Nov 19, 2019
fdb2fae
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Nov 19, 2019
3b94490
refactor navigate-down logic
jbinda Nov 22, 2019
941baef
fix dimed style aplied
jbinda Nov 22, 2019
df0f5a4
add unit test for selector
jbinda Nov 25, 2019
8ab7ebe
use getBlockCount to check if block has children
jbinda Nov 25, 2019
3ebc50c
fix group margins, placeholder and appender
jbinda Nov 25, 2019
a035030
Merge branch 'rnmobile/try/navigate-down' into rnmobile/navigate-down
jbinda Nov 25, 2019
cd5b608
adjustments
jbinda Nov 25, 2019
bd5a1f8
add parameters to style
jbinda Nov 26, 2019
3219ad0
refactor for removing isGroupType
jbinda Nov 26, 2019
e3b540a
refactor group placeholder
jbinda Nov 26, 2019
f47e6dc
adjust media-text
jbinda Nov 27, 2019
ca7e08f
finalise group appender logic
jbinda Nov 27, 2019
8de07ef
selection and dim adjustments
jbinda Nov 27, 2019
93ae250
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Nov 28, 2019
662008e
handle semi-bordered
jbinda Nov 28, 2019
6414b89
refactor after tug review
jbinda Nov 29, 2019
524e0ca
Update packages/block-editor/src/store/selectors.js
jbinda Dec 3, 2019
7cf3950
Update packages/block-editor/src/store/selectors.js
jbinda Dec 3, 2019
5a456c9
Update packages/block-library/src/media-text/edit.native.js
jbinda Dec 3, 2019
061257a
export styles for media-text to stylesheet
jbinda Dec 3, 2019
7fb084a
fix order in test case
jbinda Dec 3, 2019
583650b
merge master
jbinda Dec 3, 2019
4574daf
refactor stylesheet in mediatext
jbinda Dec 3, 2019
22d5904
group appender logic
jbinda Dec 4, 2019
75482c5
@dratwas CR refactor
jbinda Dec 6, 2019
0814bb8
@dratwas CR refactor on descendant
jbinda Dec 6, 2019
7cb1ddb
Merge remote-tracking branch 'origin/master' into rnmobile/navigate-down
jbinda Dec 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ _Parameters_

- _state_ `Object`: Editor state.
- _clientId_ `string`: Block from which to find root client ID.
- _ascending_ `boolean`: Get parent hierarchy in top-most hierarchy first (false) or reversed (true).

_Returns_

Expand Down Expand Up @@ -390,6 +391,19 @@ _Returns_

- `?string`: Last block client ID in the multi-selection set.

<a name="getLowestCommonAncestorWithSelectedBlock" href="#getLowestCommonAncestorWithSelectedBlock">#</a> **getLowestCommonAncestorWithSelectedBlock**

Given a block client ID, returns the common ancestor with selected client ID.

_Parameters_

- _state_ `Object`: Editor state.
- _clientId_ `string`: Block from which to find common ancestor client ID.

_Returns_

- `string`: Common ancestor client ID or undefined

<a name="getMultiSelectedBlockClientIds" href="#getMultiSelectedBlockClientIds">#</a> **getMultiSelectedBlockClientIds**

Returns the current multi-selection set of block client IDs, or an empty
Expand Down
11 changes: 11 additions & 0 deletions packages/base-styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ $block-container-side-padding: $block-side-ui-width + $block-padding + 2 * $bloc
$block-bg-padding--v: $block-padding + $block-spacing + $block-side-ui-clearance; // padding for Blocks with a background color (eg: paragraph or group)
$block-bg-padding--h: $block-side-ui-width + $block-side-ui-clearance; // padding for Blocks with a background color (eg: paragraph or group)

$block-edge-to-content: 16px;
$block-selected-margin: 3px;
$block-selected-border-width: 1px;
$block-selected-padding: 0;
$block-selected-child-margin: 5px;
$block-selected-child-border-width: 1px;
$block-selected-child-padding: 0;
$block-selected-to-content: $block-edge-to-content - $block-selected-margin - $block-selected-border-width;
$block-selected-child-to-content: $block-selected-to-content - $block-selected-child-margin - $block-selected-child-border-width;
$block-custom-appender-to-content: $block-edge-to-content - $block-selected-margin - $block-selected-child-margin + $block-selected-border-width;

// Buttons & UI Widgets
$radius-round-rectangle: 4px;
$radius-round: 50%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,16 @@ import { View, TouchableWithoutFeedback } from 'react-native';
* Internal dependencies
*/
import styles from './block-mobile-floating-toolbar.scss';
/**
* WordPress dependencies
*/
import { compose, withPreferredColorScheme } from '@wordpress/compose';
import { createSlotFill } from '@wordpress/components';

const { Fill, Slot } = createSlotFill( 'FloatingToolbar' );

const FloatingToolbarFill = ( { children, getStylesFromColorScheme } ) => {
const FloatingToolbar = ( { children } ) => {
return (
<Fill>
{ ( { innerFloatingToolbar } ) => {
const fillStyle = getStylesFromColorScheme( styles.floatingToolbarFillColor, styles.floatingToolbarFillColorDark );
return (
<TouchableWithoutFeedback>
<View
// Issue: `FloatingToolbar` placed above the first item in group is not touchable on Android.
// Temporary solution: Use `innerFloatingToolbar` to place `FloatingToolbar` over the first item in group.
// TODO: `{ top: innerFloatingToolbar ? 0 : -44 }` along with `innerFloatingToolbar` should be removed once issue is fixed.
style={ [ fillStyle, styles.floatingToolbarFill, { top: innerFloatingToolbar ? 0 : -44 } ] }
>{ children }
</View>
</TouchableWithoutFeedback>
);
} }

</Fill>
<TouchableWithoutFeedback>
<View
style={ styles.floatingToolbar }
>{ children }
</View>
</TouchableWithoutFeedback>
);
};

const FloatingToolbar = compose( withPreferredColorScheme )( FloatingToolbarFill );
FloatingToolbar.Slot = Slot;

export default FloatingToolbar;
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.floatingToolbarFill {
.floatingToolbar {
background-color: $dark-gray-500;
margin: auto;
min-width: 100;
max-height: $floating-toolbar-height;
border-radius: 22px;
flex-direction: row;
z-index: 100;
top: -$floating-toolbar-height;
height: $floating-toolbar-height;
position: absolute;
align-items: center;
justify-content: center;
align-self: center;
margin-bottom: 8px;
}

.floatingToolbarFillColor {
Expand Down
163 changes: 129 additions & 34 deletions packages/block-editor/src/components/block-list/block.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { Component } from '@wordpress/element';
import { ToolbarButton, Toolbar } from '@wordpress/components';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { compose, withPreferredColorScheme } from '@wordpress/compose';
import { getBlockType } from '@wordpress/blocks';
import { __, sprintf } from '@wordpress/i18n';

Expand All @@ -34,15 +34,12 @@ class BlockListBlock extends Component {

this.insertBlocksAfter = this.insertBlocksAfter.bind( this );
this.onFocus = this.onFocus.bind( this );

this.state = {
isFullyBordered: false,
};
}

onFocus() {
if ( ! this.props.isSelected ) {
this.props.onSelect();
const { firstToSelectId, isSelected, onSelect } = this.props;
if ( ! isSelected ) {
onSelect( firstToSelectId );
}
}

Expand Down Expand Up @@ -105,28 +102,97 @@ class BlockListBlock extends Component {
return blockName;
}

applySelectedBlockStyle() {
const {
hasChildren,
getStylesFromColorScheme,
isSmallScreen,
selectionIsNested,
isInnerBlockHolder,
} = this.props;

const fullSolidBorderStyle = {
...styles.fullSolidBordered,
...getStylesFromColorScheme( styles.solidBorderColor, styles.solidBorderColorDark ),
};

if ( hasChildren ) {
return { ...styles.selectedParent, ...fullSolidBorderStyle };
}

if ( isSmallScreen && ! selectionIsNested && ! isInnerBlockHolder ) {
jbinda marked this conversation as resolved.
Show resolved Hide resolved
return {
...styles.selectedRootLeaf,
...styles.semiSolidBordered,
...{ borderColor: fullSolidBorderStyle.borderColor },
};
}

return { ...styles.selectedLeaf, ...fullSolidBorderStyle };
jbinda marked this conversation as resolved.
Show resolved Hide resolved
}

applyUnSelectedBlockStyle() {
const {
hasChildren,
isParentSelected,
isAncestorSelected,
hasParent,
getStylesFromColorScheme,
} = this.props;

if ( ! hasParent ) {
return hasChildren ? styles.neutral : styles.full;
}

if ( isParentSelected ) {
const dashedBorderStyle = {
...styles.dashedBordered,
...getStylesFromColorScheme( styles.dashedBorderColor, styles.dashedBorderColorDark ),
};

return hasChildren ?
{ ...styles.childOfSelected, ...dashedBorderStyle } :
{ ...styles.childOfSelectedLeaf, ...dashedBorderStyle };
}

if ( isAncestorSelected ) {
return {
...styles.descendantOfSelectedLeaf,
...( hasChildren && styles.marginHorizontalNone ),
};
}

return hasChildren ? styles.neutral : styles.full;
}

applyBlockStyle() {
const {
isSelected,
isDimmed,
} = this.props;

return [
isSelected ? this.applySelectedBlockStyle() : this.applyUnSelectedBlockStyle(),
isDimmed && styles.dimmed,
];
}

render() {
const {
borderStyle,
clientId,
focusedBorderColor,
icon,
isSelected,
isValid,
showTitle,
title,
showFloatingToolbar,
parentId,
isFirstBlock,
isTouchable,
} = this.props;

const borderColor = isSelected ? focusedBorderColor : 'transparent';

const accessibilityLabel = this.getAccessibilityLabel();

return (
<>
{ showFloatingToolbar && ( ! isFirstBlock || parentId === '' ) && <FloatingToolbar.Slot /> }
{ showFloatingToolbar &&
( <FloatingToolbar>
<Toolbar passedStyle={ styles.toolbar }>
Expand All @@ -145,17 +211,15 @@ class BlockListBlock extends Component {
accessible={ ! isSelected }
accessibilityRole={ 'button' }
>
<View style={ [ styles.blockHolder, borderStyle, { borderColor } ] }>
{ showTitle && this.renderBlockTitle() }
<View
accessibilityLabel={ accessibilityLabel }
style={ [ ! isSelected && styles.blockContainer, isSelected && styles.blockContainerFocused ] }
>
{ isValid && this.getBlockForType() }
{ ! isValid &&
<View
pointerEvents={ isTouchable ? 'auto' : 'box-only' }
accessibilityLabel={ accessibilityLabel }
style={ this.applyBlockStyle() }
jbinda marked this conversation as resolved.
Show resolved Hide resolved
>
{ isValid && this.getBlockForType() }
{ ! isValid &&
jbinda marked this conversation as resolved.
Show resolved Hide resolved
<BlockInvalidWarning blockTitle={ title } icon={ icon } />
}
</View>
}
{ isSelected && <BlockMobileToolbar clientId={ clientId } /> }
</View>
</TouchableWithoutFeedback>
Expand All @@ -172,13 +236,20 @@ export default compose( [
isBlockSelected,
__unstableGetBlockWithoutInnerBlocks,
getBlockHierarchyRootClientId,
getSelectedBlockClientId,
getBlock,
getBlockRootClientId,
getSelectedBlock,
getLowestCommonAncestorWithSelectedBlock,
getBlockParents,
getBlockCount,
} = select( 'core/block-editor' );

const {
getGroupingBlockName,
} = select( 'core/blocks' );

const order = getBlockIndex( clientId, rootClientId );
const isSelected = isBlockSelected( clientId );
const isFirstBlock = order === 0;
const isLastBlock = order === getBlocks().length - 1;
const block = __unstableGetBlockWithoutInnerBlocks( clientId );
const { name, attributes, isValid } = block || {};
Expand All @@ -187,18 +258,33 @@ export default compose( [
const icon = blockType.icon;
const getAccessibilityLabelExtra = blockType.__experimentalGetAccessibilityLabel;

const selectedBlock = getSelectedBlock();
const parentId = getBlockRootClientId( clientId );
const parentBlock = getBlock( parentId );

const isMediaText = selectedBlock && selectedBlock.name === 'core/media-text';
const isMediaTextParent = parentBlock && parentBlock.name === 'core/media-text';
const parents = getBlockParents( clientId, true );
const parentId = parents[ 0 ] || '';
dratwas marked this conversation as resolved.
Show resolved Hide resolved

const rootBlockId = getBlockHierarchyRootClientId( clientId );
const rootBlock = getBlock( rootBlockId );
const hasRootInnerBlocks = rootBlock.innerBlocks.length !== 0;

const showFloatingToolbar = isSelected && hasRootInnerBlocks && ! isMediaText && ! isMediaTextParent;
const showFloatingToolbar = isSelected && hasRootInnerBlocks;

const selectedBlockClientId = getSelectedBlockClientId();

const commonAncestor = getLowestCommonAncestorWithSelectedBlock( clientId );
const commonAncestorIndex = parents.indexOf( commonAncestor ) - 1;
const firstToSelectId = commonAncestor ? parents[ commonAncestorIndex ] : parents[ parents.length - 1 ];

const hasChildren = !! getBlockCount( clientId );
const hasParent = !! parents[ 0 ];
jbinda marked this conversation as resolved.
Show resolved Hide resolved
const isParentSelected = selectedBlockClientId && selectedBlockClientId === parents[ 0 ];
jbinda marked this conversation as resolved.
Show resolved Hide resolved
const isAncestorSelected = selectedBlockClientId && parents.includes( selectedBlockClientId );
const selectionIsNested = !! getBlockRootClientId( selectedBlockClientId );
jbinda marked this conversation as resolved.
Show resolved Hide resolved

const isDescendantSelected = selectedBlockClientId && getBlockParents( selectedBlockClientId ).includes( clientId );
const isDescendantOfParentSelected = selectedBlockClientId && getBlockParents( selectedBlockClientId ).includes( parentId );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about create const with getBlockParents( selectedBlockClientId ) and use it instead of calling it 2 times?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading this comment, it did look a bit related to the firstToSelect search, so I think we could have the equivalent (please double check my logic here 😉):

  • isDescendantSelected: if the selection is one of the descendants, then this must be a parent of the selection, which also means it will be the lowest common ancestor. So isDescendantSelected = commonAncestor === clientId
  • isDescendantOfParentSelected: similar to the previous one, if the parent of this block is an ancestor of the selection, but the selection is not one of this block's descendants, then the lowest common ancestor if this block's parent: isDescendantOfParentSelected = commonAncestor === parentId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koke I temporary go with @dratwas suggest.

However I agree with this one isDescendantSelected = commonAncestor === clientId

but not sure about this
isDescendantOfParentSelected = commonAncestor === parentId

Shouldn't we check the common ancestor with parent of selected block ?

Then it will look like this:
const commonAncestorParent = getLowestCommonAncestorWithSelectedBlock( parentId );
const isDescendantOfParentSelected = commonAncestorParent === parentId;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think that would change the behavior a bit. The commonAncestor == parentId would not include the case where isDescendantSelected == true. It would be more accurate to say isDescendantOfSiblingSelected, which might not be what you had in mind when doing the calculations. I think we can combine both:

const isDescendantSelected = commonAncestor === clientId;
const isDescendantOfParentSelected = isDescendantSelected || commonAncestor === parentId;

But at this stage, this feels more like nitpicking, so I'm happy with either approach, we shouldn't block on this one to merge.

const isTouchable = isSelected || isDescendantSelected || isDescendantOfParentSelected || isParentSelected || parentId === '';
const isDimmed = ! isSelected && selectionIsNested && ! isAncestorSelected && ! isDescendantSelected && ( isDescendantOfParentSelected || rootBlockId === clientId );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those conditions looks quite hard to understand! Could we try to make them more readable? I haven't spent that much time trying to understand it yet so I might have omitted some edge cases, but from the few cases I can think of, the following conditions would be more readable imo:

const isBlockHighlighted = selectionIsNested && ( isSelected || isParentSelected );
const isDimmed =  ! isBlockHighlighted;

I'm not sure how isDescendantOfParentSelected could play a role here, is there a case where a component is highlighted when a "sibling" is selected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand, isDimmed should only be true for blocks that are outside the selection and its descendants, right? There was a suggestion to do a different think, but as far as I understand we didn't decide to go that way. It's not clear to me if we want to dim other blocks when a top level one is selected (even if it has children), or just when we start going 1+ level deep into nested blocks.

There are some redundant checks:

  • If isDescendantSelectedisDescendantOfParentSelected. So isDescendantSelected || isDescendantOfParentSelected == isDescendantSelected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how isDescendantOfParentSelected could play a role here, is there a case where a component is highlighted when a "sibling" is selected?

In my version it's the case when you select first child of root block. Without this check the rest of the components stays highlighted.

Next thing is that I need to dim only the bottom most descendant in each branch which should be dimmed to avoid multiplication of opacity applied to block in hierarchy. In other words if I apply opacity to block parent which fits criteria to be dimmed and them apply opacity for the block itself the block will have opacity 0.4 instead of desire 0.2. This opacity increased depending of nesting level. I hope that make sense

There is also edge case that do not dim when RootList block is selected as well.

I gave a shot for what you proposed and it does not works as expected but I will try to refactor original checks to increase clarity and write some comments in the code

Copy link
Contributor Author

@jbinda jbinda Nov 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koke I have noticed your comment now so I want to refer to what you wrote as well

There are some redundant checks:
If isDescendantSelected ⇒ isDescendantOfParentSelected. So isDescendantSelected || isDescendantOfParentSelected == isDescendantSelected

That's true according to same branch.

The case for check 'isDescendantOfParentSelected' according to below image is when we have 1-4 selected (red) and isTouchable should be set to true for 1-2, 1-5. Also 1-4-5 ,1-4-3 should be touchable(green). The blue one circle represents block that should be dimmed.

I agree that we can simplify this:
const isTouchable = isSelected || isDescendantSelected || isDescendantOfParentSelected || isParentSelected || parentId === '';
to this:
const isTouchable = isSelected || isDescendantOfParentSelected || isParentSelected || parentId === '';

1-5 should have isDescendantOfParentSelected true and isDescendantSelected false because 1-4 is not descendant of 1-5 but is descendant of 1-5 parent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, I knew one of them was redundant but I got my logic backwards 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure about isDimmed and try to check if we can simplify


const isInnerBlockHolder = name === getGroupingBlockName();
jbinda marked this conversation as resolved.
Show resolved Hide resolved

return {
icon,
Expand All @@ -207,13 +293,21 @@ export default compose( [
title,
attributes,
blockType,
isFirstBlock,
isLastBlock,
isSelected,
isValid,
getAccessibilityLabelExtra,
showFloatingToolbar,
parentId,
isParentSelected,
firstToSelectId,
hasChildren,
hasParent,
isAncestorSelected,
isTouchable,
isDimmed,
selectionIsNested,
isInnerBlockHolder,
};
} ),
withDispatch( ( dispatch, ownProps, { select } ) => {
Expand Down Expand Up @@ -259,4 +353,5 @@ export default compose( [
},
};
} ),
withPreferredColorScheme,
] )( BlockListBlock );
Loading