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

Remove the spotlight mode from template parts #40652

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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