From d6bdcc3afd3140743c49e2d51714b36fad11bbec Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 27 Apr 2022 13:19:19 +0100 Subject: [PATCH] Remove the spotlight mode from template parts --- .../src/components/block-list/style.scss | 16 ---------------- .../use-block-props/use-block-class-names.js | 12 +----------- packages/block-editor/src/store/defaults.js | 1 - packages/edit-site/src/index.js | 1 - 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/block-editor/src/components/block-list/style.scss b/packages/block-editor/src/components/block-list/style.scss index 73f1579de94d4a..6d8a21cd059a45 100644 --- a/packages/block-editor/src/components/block-list/style.scss +++ b/packages/block-editor/src/components/block-list/style.scss @@ -303,22 +303,6 @@ } } -// Active entity spotlight. -// Disable if focus mode is active. -.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity { - opacity: 0.5; - transition: opacity 0.1s linear; - @include reduce-motion("transition"); - - &.is-active-entity, - &.has-child-selected, - &:not(.has-child-selected) .block-editor-block-list__block, - &.is-active-entity .block-editor-block-list__block, - .is-active-entity .block-editor-block-list__block { - opacity: 1; - } -} - .wp-block[data-align="left"] > *, .wp-block[data-align="right"] > *, .wp-block.alignleft, diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-block-class-names.js b/packages/block-editor/src/components/block-list/use-block-props/use-block-class-names.js index 22ced260bff07f..31369c7a3591c0 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-block-class-names.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-block-class-names.js @@ -33,12 +33,8 @@ export function useBlockClassNames( clientId ) { getSettings, hasSelectedInnerBlock, isTyping, - __experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames, } = select( blockEditorStore ); - const { - __experimentalSpotlightEntityBlocks: spotlightEntityBlocks, - outlineMode, - } = getSettings(); + const { outlineMode } = getSettings(); const isDragging = isBlockBeingDragged( clientId ); const isSelected = isBlockSelected( clientId ); const name = getBlockName( clientId ); @@ -48,9 +44,6 @@ export function useBlockClassNames( clientId ) { clientId, checkDeep ); - const activeEntityBlockId = getActiveBlockIdByBlockNames( - spotlightEntityBlocks - ); return classnames( { 'is-selected': isSelected, 'is-highlighted': isBlockHighlighted( clientId ), @@ -58,9 +51,6 @@ export function useBlockClassNames( clientId ) { 'is-reusable': isReusableBlock( getBlockType( name ) ), 'is-dragging': isDragging, 'has-child-selected': isAncestorOfSelectedBlock, - 'has-active-entity': activeEntityBlockId, - // Determine if there is an active entity area to spotlight. - 'is-active-entity': activeEntityBlockId === clientId, 'remove-outline': isSelected && outlineMode && isTyping(), } ); }, diff --git a/packages/block-editor/src/store/defaults.js b/packages/block-editor/src/store/defaults.js index 551f65146b4c98..6958a6184617a9 100644 --- a/packages/block-editor/src/store/defaults.js +++ b/packages/block-editor/src/store/defaults.js @@ -160,7 +160,6 @@ export const SETTINGS_DEFAULTS = { __mobileEnablePageTemplates: false, __experimentalBlockPatterns: [], __experimentalBlockPatternCategories: [], - __experimentalSpotlightEntityBlocks: [], __unstableGalleryWithImageBlocks: false, generateAnchors: false, diff --git a/packages/edit-site/src/index.js b/packages/edit-site/src/index.js index 139a2f7a096a75..51045481291df4 100644 --- a/packages/edit-site/src/index.js +++ b/packages/edit-site/src/index.js @@ -103,7 +103,6 @@ export function initializeEditor( id, settings ) { settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) => fetchLinkSuggestions( search, searchOptions, settings ); settings.__experimentalFetchRichUrlData = fetchUrlData; - settings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ]; const target = document.getElementById( id );