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

Zoom Out: Remove unlock() from getSettings #64141

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useEffect, useState } from '@wordpress/element';
import BlockPopoverInbetween from '../block-popover/inbetween';
import ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';
import { store as blockEditorStore } from '../../store';
import { unlock } from '../../lock-unlock';

function ZoomOutModeInserters() {
const [ isReady, setIsReady ] = useState( false );
Expand All @@ -33,7 +32,7 @@ function ZoomOutModeInserters() {
getHoveredBlockClientId,
isBlockInsertionPointVisible,
} = select( blockEditorStore );
const { sectionRootClientId: root } = unlock( getSettings() );
const { sectionRootClientId: root } = getSettings();
return {
hasSelection: !! getSelectionStart().clientId,
blockInsertionPoint: getBlockInsertionPoint(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export function useInnerBlocksProps( props = {}, options = {} ) {
// The inner blocks belonging to the section drop zone is
// already disabled by the blocks themselves being disabled.
if ( __unstableGetEditorMode() === 'zoom-out' ) {
const { sectionRootClientId } = unlock( getSettings() );
const { sectionRootClientId } = getSettings();
_isDropZoneDisabled = clientId !== sectionRootClientId;
}
if ( ! clientId ) {
Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,7 @@ export function __unstableHasActiveBlockOverlayActive( state, clientId ) {

// In zoom-out mode, the block overlay is always active for section level blocks.
if ( editorMode === 'zoom-out' ) {
const { sectionRootClientId } = unlock( getSettings( state ) );
const { sectionRootClientId } = getSettings( state );
if ( sectionRootClientId ) {
const sectionClientIds = getBlockOrder(
state,
Expand Down Expand Up @@ -2951,7 +2951,7 @@ export const getBlockEditingMode = createRegistrySelector(
// sections.
const editorMode = __unstableGetEditorMode( state );
if ( editorMode === 'zoom-out' ) {
const { sectionRootClientId } = unlock( getSettings( state ) );
const { sectionRootClientId } = getSettings( state );
if ( clientId === '' /* ROOT_CONTAINER_CLIENT_ID */ ) {
return sectionRootClientId ? 'disabled' : 'contentOnly';
}
Expand Down
Loading