From 23493b7b13ba957ab5a92b8c8a4f9d20925c2029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Fri, 24 Jan 2020 22:03:16 +0200 Subject: [PATCH] Move is-navigate-mode class to WritingFlow (#19868) --- packages/block-editor/src/components/block-list/block.js | 1 - packages/block-editor/src/components/block-list/style.scss | 4 ++-- packages/block-editor/src/components/writing-flow/index.js | 7 ++++++- packages/block-library/src/block/edit-panel/editor.scss | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js index 0d674919bc4df..a0ebc634abb52 100644 --- a/packages/block-editor/src/components/block-list/block.js +++ b/packages/block-editor/src/components/block-list/block.js @@ -241,7 +241,6 @@ function BlockListBlock( { 'has-selected-ui': hasSelectedUI, 'has-warning': ! isValid || !! hasError || isUnregisteredBlock, 'is-selected': shouldAppearSelected && hasSelectedUI, - 'is-navigate-mode': isNavigationMode, 'is-multi-selected': isMultiSelected, 'is-reusable': isReusableBlock( blockType ), 'is-dragging': isDragging, diff --git a/packages/block-editor/src/components/block-list/style.scss b/packages/block-editor/src/components/block-list/style.scss index 8124ca1beb4cd..173225ceab1ec 100644 --- a/packages/block-editor/src/components/block-list/style.scss +++ b/packages/block-editor/src/components/block-list/style.scss @@ -127,7 +127,7 @@ } } - &.is-navigate-mode::before { + .is-navigate-mode &::before { border-color: $blue-medium-focus; box-shadow: inset $block-left-border-width 0 0 0 $blue-medium-focus; @@ -277,7 +277,7 @@ } // Select tool/navigation mode shows the default cursor until an additional click edits. - &.is-navigate-mode { + .is-navigate-mode & { cursor: default; } diff --git a/packages/block-editor/src/components/writing-flow/index.js b/packages/block-editor/src/components/writing-flow/index.js index 170199a8f679f..475be097c9132 100644 --- a/packages/block-editor/src/components/writing-flow/index.js +++ b/packages/block-editor/src/components/writing-flow/index.js @@ -2,6 +2,7 @@ * External dependencies */ import { overEvery, find, findLast, reverse, first, last } from 'lodash'; +import classnames from 'classnames'; /** * WordPress dependencies @@ -505,11 +506,15 @@ export default function WritingFlow( { children } ) { } }, [ hasMultiSelection, isMultiSelecting ] ); + const className = classnames( 'block-editor-writing-flow', { + 'is-navigate-mode': isNavigationMode, + } ); + // Disable reason: Wrapper itself is non-interactive, but must capture // bubbling events from children to determine focus transition intents. /* eslint-disable jsx-a11y/no-static-element-interactions */ return ( -
+