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

Restore the navigation menus in the site editor #47485

Merged
merged 3 commits into from
Jan 27, 2023
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
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' );
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-site-editor-navigation-menu-sidebar',
__( 'Global navigation menu sidebar ', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test a new global navigation menu sidebar in the site editor.', 'gutenberg' ),
'id' => 'gutenberg-site-editor-navigation-menu-sidebar',
)
);

register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import SidebarNavigationScreen from '../sidebar-navigation-screen';
import NavigationInspector from '../sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector';
import NavigationInspector from '../navigation-inspector';

export default function SidebarNavigationScreenNavigationMenus() {
return (
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