Skip to content
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
2 changes: 2 additions & 0 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
deviceTypeKey,
isIsolatedEditorKey,
isNavigationOverlayContextKey,
isNavigationPostEditorKey,
mediaUploadOnSuccessKey,
} from './store/private-keys';
import { requiresWrapperOnCopy } from './components/writing-flow/utils';
Expand Down Expand Up @@ -130,6 +131,7 @@ lock( privateApis, {
deviceTypeKey,
isIsolatedEditorKey,
isNavigationOverlayContextKey,
isNavigationPostEditorKey,
mediaUploadOnSuccessKey,
useBlockElement,
useBlockElementRef,
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/store/private-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export const deviceTypeKey = Symbol( 'deviceTypeKey' );
export const isNavigationOverlayContextKey = Symbol(
'isNavigationOverlayContext'
);
export const isNavigationPostEditorKey = Symbol( 'isNavigationPostEditor' );
export const mediaUploadOnSuccessKey = Symbol( 'mediaUploadOnSuccess' );
10 changes: 6 additions & 4 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import {
NAVIGATION_OVERLAY_TEMPLATE_PART_AREA,
} from '../constants';

const { isIsolatedEditorKey } = unlock( blockEditorPrivateApis );
const { isNavigationPostEditorKey } = unlock( blockEditorPrivateApis );

/**
* Component that renders the Add page button for the Navigation block.
Expand Down Expand Up @@ -330,15 +330,17 @@ function Navigation( {
} = useSelect( ( select ) => {
const { getSettings } = select( blockEditorStore );
const settings = getSettings();

return {
isPreviewMode: settings.isPreviewMode,
onNavigateToEntityRecord: settings?.onNavigateToEntityRecord,
// Needed to construct the template part ID for the overlay preview.
currentTheme: select( coreStore ).getCurrentTheme()?.stylesheet,
// In preview mode or isolated editor, always show navigation expanded (no hamburger)
// so users can see and interact with all menu items.
// When editing a navigation post directly in an isolated editor,
// always show navigation expanded (no hamburger) so users can see
// and interact with all menu items.
editorDisabledResponsive:
settings.isPreviewMode || !! settings?.[ isIsolatedEditorKey ],
!! settings?.[ isNavigationPostEditorKey ],
};
}, [] );
const hasAlreadyRendered = isPreviewMode ? false : recursionDetected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const {
isIsolatedEditorKey,
deviceTypeKey,
isNavigationOverlayContextKey,
isNavigationPostEditorKey,
mediaUploadOnSuccessKey,
} = unlock( privateApis );

Expand Down Expand Up @@ -391,6 +392,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
'wp_block',
'wp_navigation',
].includes( postType ),
[ isNavigationPostEditorKey ]: postType === 'wp_navigation',
// When in template-locked mode (e.g., "Show Template" in the post editor),
// don't treat template parts as contentOnly sections.
disableContentOnlyForTemplateParts:
Expand Down
Loading