Skip to content

Commit

Permalink
Remove the spotlight mode from template parts (#40652)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Apr 27, 2022
1 parent 0b37b3b commit 05ba249
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
16 changes: 0 additions & 16 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -48,19 +44,13 @@ export function useBlockClassNames( clientId ) {
clientId,
checkDeep
);
const activeEntityBlockId = getActiveBlockIdByBlockNames(
spotlightEntityBlocks
);
return classnames( {
'is-selected': isSelected,
'is-highlighted': isBlockHighlighted( clientId ),
'is-multi-selected': isBlockMultiSelected( 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(),
} );
},
Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export const SETTINGS_DEFAULTS = {
__mobileEnablePageTemplates: false,
__experimentalBlockPatterns: [],
__experimentalBlockPatternCategories: [],
__experimentalSpotlightEntityBlocks: [],
__unstableGalleryWithImageBlocks: false,

generateAnchors: false,
Expand Down
1 change: 0 additions & 1 deletion packages/edit-site/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 05ba249

Please sign in to comment.