-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Selecting Parent Blocks: Try clickthrough (#15537)
* Selecting parents: Try clickthrough. Clickthrough has you select the parent before you can select the child. This is already in place on the mobile breakpoints, this just expands it to desktop as well. It is a work in progress, right now it is not working as intended: once you have "unlocked" the deepest level, it becomes immediately locked and you have to click through the layers again to unlock it again. The deepest layer should always be unlocked until you deselect all blocks again. * Render overlay on top of inner block only when none of the nested blocks is selected * Fix overlay, fix breadcrumb, polish. * Remove click-overlay. * Fix the selection of inner blocks for reusable blocks template * Disable async mode for parent blocks when nested block selected * Refactor BlockListBlock to use AsyncModeProvider * Make the reusable blocks save button clickable. i At least this means you can edit and save reusable blocks. * Fix so reusable blocks with nesting are editable. * Fix movers. The z-index was too low. It had to be higher to accommodate the other z-index changes. * Bring the behavior closer to what we have as of today
- Loading branch information
Showing
10 changed files
with
86 additions
and
45 deletions.
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
23 changes: 23 additions & 0 deletions
23
packages/block-editor/src/components/block-list/block-async-mode-provider.js
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,23 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
__experimentalAsyncModeProvider as AsyncModeProvider, | ||
useSelect, | ||
} from '@wordpress/data'; | ||
|
||
const BlockAsyncModeProvider = ( { children, clientId, isBlockInSelection } ) => { | ||
const isParentOfSelectedBlock = useSelect( ( select ) => { | ||
return select( 'core/block-editor' ).hasSelectedInnerBlock( clientId, true ); | ||
} ); | ||
|
||
const isSyncModeForced = isBlockInSelection || isParentOfSelectedBlock; | ||
|
||
return ( | ||
<AsyncModeProvider value={ ! isSyncModeForced }> | ||
{ children } | ||
</AsyncModeProvider> | ||
); | ||
}; | ||
|
||
export default BlockAsyncModeProvider; |
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
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
18 changes: 10 additions & 8 deletions
18
packages/block-editor/src/components/inner-blocks/style.scss
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.block-editor-inner-blocks.has-overlay::after { | ||
content: ""; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
z-index: z-index(".block-editor-inner-blocks__small-screen-overlay:after"); | ||
.block-editor-inner-blocks.has-overlay { | ||
&::after { | ||
content: ""; | ||
position: absolute; | ||
top: -$block-padding; | ||
right: -$block-padding; | ||
bottom: -$block-padding; | ||
left: -$block-padding; | ||
z-index: z-index(".block-editor-inner-blocks.has-overlay::after"); | ||
} | ||
} |
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
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