Skip to content

Commit

Permalink
Restore the navigation menus in the site editor
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 27, 2023
1 parent a535560 commit 19915af
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 84 deletions.
3 changes: 0 additions & 3 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-color-randomizer', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableColorRandomizer = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-site-editor-navigation-menu-sidebar', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableSiteEditorNavigationMenuSidebar = true', 'before' );
}
}

add_action( 'admin_init', 'gutenberg_enable_experiments' );
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,3 @@
.edit-site-navigation-inspector__empty-msg {
padding: 0 $grid-unit-10;
}

.edit-site-navigation-menu-sidebar__panel {
padding: $grid-unit-20;
}

.edit-site-navigation-sidebar__beta {
display: inline-flex;
margin-left: $grid-unit-10;
padding: 0 $grid-unit-10;
height: $grid-unit-30;
border-radius: $radius-block-ui;
background-color: $gray-900;
color: $white;
align-items: center;
font-size: $helptext-font-size;
line-height: 1;
}
13 changes: 0 additions & 13 deletions packages/edit-site/src/components/sidebar-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
*/
import DefaultSidebar from './default-sidebar';
import GlobalStylesSidebar from './global-styles-sidebar';
import NavigationMenuSidebar from './navigation-menu-sidebar';
import { STORE_NAME } from '../../store/constants';
import SettingsHeader from './settings-header';
import TemplateCard from './template-card';
Expand Down Expand Up @@ -64,17 +63,6 @@ export function SidebarComplementaryAreaFills() {
sidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;
}

// Conditionally include NavMenu sidebar in Plugin only.
// Optimise for dead code elimination.
// See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
let MaybeNavigationMenuSidebar = Fragment;

if (
window?.__experimentalEnableSiteEditorNavigationMenuSidebar === true
) {
MaybeNavigationMenuSidebar = NavigationMenuSidebar;
}

return (
<>
<DefaultSidebar
Expand All @@ -95,7 +83,6 @@ export function SidebarComplementaryAreaFills() {
) }
</DefaultSidebar>
{ supportsGlobalStyles && <GlobalStylesSidebar /> }
<MaybeNavigationMenuSidebar />
</>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,23 @@ export default function SidebarNavigationScreenMain() {
} ),
};
} );

return (
<SidebarNavigationScreen
path="/"
title={ __( 'Design' ) }
content={
<ItemGroup>
{ !! window?.__experimentalEnableOffCanvasNavigationEditor &&
!! navigationMenus &&
navigationMenus.length > 0 && (
<NavigatorButton
as={ SidebarNavigationItem }
path="/navigation"
withChevron
icon={ navigation }
>
{ __( 'Navigation' ) }
</NavigatorButton>
) }
{ !! navigationMenus && navigationMenus.length > 0 && (
<NavigatorButton
as={ SidebarNavigationItem }
path="/navigation"
withChevron
icon={ navigation }
>
{ __( 'Navigation' ) }
</NavigatorButton>
) }
<NavigatorButton
as={ SidebarNavigationItem }
path="/templates"
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@import "../../interface/src/style.scss";

@import "./components/add-new-template/style.scss";
@import "./components/block-editor/style.scss";
@import "./components/canvas-spinner/style.scss";
@import "./components/code-editor/style.scss";
@import "./components/global-styles/style.scss";
@import "./components/header-edit-mode/style.scss";
@import "./components/header-edit-mode/document-actions/style.scss";
@import "./components/list/style.scss";
@import "./components/add-new-template/style.scss";
@import "./components/navigation-inspector/style.scss";
@import "./components/sidebar-edit-mode/style.scss";
@import "./components/sidebar-edit-mode/settings-header/style.scss";
@import "./components/sidebar-edit-mode/navigation-menu-sidebar/style.scss";
@import "./components/sidebar-edit-mode/template-card/style.scss";
@import "./components/editor/style.scss";
@import "./components/template-details/style.scss";
Expand Down

0 comments on commit 19915af

Please sign in to comment.