-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation: add dedicated sidebar for managing layout of navigation menus #39290
Merged
+425
−80
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ed22dae
Navigation: try adding dedicated sidebar for managing layout of navig…
getdave acf8a27
Fix table width to avoid overflow
getdave 8636579
Iterate on var naming and code comments
getdave 9d86b1c
Further naming refinement
getdave cf58055
More var renaming
getdave bcf4e91
Rename panel title for clarity
getdave 6b9171a
Improve a11y of component
getdave 4514663
Revert addition of fixed table layout.
getdave 4050b49
Wrap items to avoid off screen movers where possible
getdave d57531b
Move additional padding
getdave f4c4aad
Revert id on ListView
getdave 9578250
Use standard getEntityRecords and remove custom entity selector
getdave f84d09a
Add handling for no data or limited data
getdave d714ed0
Collapse all Nav nodes by default
getdave fa27d0a
Only show empty message when there are no menus
getdave 7efa14f
Guard against editing unpublished Menus
getdave 2198e9d
Select Gallery block in list view correctly
getdave 782602f
Remove rebase artifact
getdave 9a59e6e
Add empty message in case of empty menu
getdave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to provide a toggle to open the Navigation sidebar for the currently selected Navigation block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a picture for folks too. In trunk clicking this opens a list-view modal, but on this branch it should open the new sidebar.