-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation: add dedicated sidebar for managing layout of navigation m…
…enus (#39290) * Navigation: try adding dedicated sidebar for managing layout of navigation menus * Fix table width to avoid overflow * Iterate on var naming and code comments * Further naming refinement * More var renaming * Rename panel title for clarity * Improve a11y of component * Revert addition of fixed table layout. Introduces too many visual bugs * Wrap items to avoid off screen movers where possible * Move additional padding * Revert id on ListView This is now handled in #39494 * Use standard getEntityRecords and remove custom entity selector Now moved to #39498 * Add handling for no data or limited data * Collapse all Nav nodes by default * Only show empty message when there are no menus * Guard against editing unpublished Menus * Select Gallery block in list view correctly * Remove rebase artifact * Add empty message in case of empty menu Co-authored-by: Dave Smith <getdavemail@gmail.com>
- Loading branch information
Showing
14 changed files
with
425 additions
and
80 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
packages/block-editor/src/components/block-toolbar/block-name-context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createContext } from '@wordpress/element'; | ||
|
||
const __unstableBlockNameContext = createContext( '' ); | ||
|
||
export default __unstableBlockNameContext; |
12 changes: 12 additions & 0 deletions
12
packages/block-editor/src/components/block-toolbar/block-toolbar-last-item.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createSlotFill } from '@wordpress/components'; | ||
|
||
const { Fill: __unstableBlockToolbarLastItem, Slot } = createSlotFill( | ||
'__unstableBlockToolbarLastItem' | ||
); | ||
|
||
__unstableBlockToolbarLastItem.Slot = Slot; | ||
|
||
export default __unstableBlockToolbarLastItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
packages/block-library/src/navigation/edit/use-list-view-modal.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/edit-site/src/components/sidebar/navigation-menu-sidebar/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { FlexBlock, Flex } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { navigation } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import DefaultSidebar from '../default-sidebar'; | ||
import NavigationInspector from './navigation-inspector'; | ||
|
||
export default function NavigationMenuSidebar() { | ||
return ( | ||
<DefaultSidebar | ||
className="edit-site-navigation-menu-sidebar" | ||
identifier="edit-site/navigation-menu" | ||
title={ __( 'Navigation Menus' ) } | ||
icon={ navigation } | ||
closeLabel={ __( 'Close navigation menu sidebar' ) } | ||
panelClassName="edit-site-navigation-menu-sidebar__panel" | ||
header={ | ||
<Flex> | ||
<FlexBlock> | ||
<strong>{ __( 'Navigation Menus' ) }</strong> | ||
</FlexBlock> | ||
</Flex> | ||
} | ||
> | ||
<NavigationInspector /> | ||
</DefaultSidebar> | ||
); | ||
} |
Oops, something went wrong.