-
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
Redesign the main pattern inserter #44028
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
ed3374c
Redesign the main pattern inserter
youknowriad cbd9e97
Use navigation pattern on mobile
youknowriad d025a99
Keyboard navigation improvements
youknowriad 3685539
Add a shadow and a subtle animation to the patterns panel
youknowriad e735049
Polish
jasmussen cb1d14a
Restore gray bg.
jasmussen 879a12b
Add right border.
jasmussen f7474db
Add width animation
youknowriad d8a2f1e
Fix site editor patterns category selection
youknowriad 67c1012
Fix inserter width on mobile
youknowriad dde8af0
Move the explore patterns button to the bottom
youknowriad 6cdc47f
Reduce the transition duration
youknowriad 52c3964
Enhance keyboard navigation
youknowriad dc0edfa
Better nested constrained tabbing support
youknowriad fd3b86b
Add shadow to pattern items and remove title from structure.
mtias 274540e
Make drag chip read "Pattern" when dragging a pattern.
mtias d9bb800
Fix uncategorized patterns
youknowriad 670bd2c
Add scrollbar gutter
youknowriad 1c969fb
Try a stronger border outline for selecting patterns.
mtias 197cad0
Apply the new pattern preview style to the main inserter only
youknowriad c714960
Simplify border shape and use dark gray.
mtias 165d3f6
Use Heading component for category label.
mtias 3caa59a
Restrict hover effects to main inserter.
mtias cd4a7a5
Avoid animations and width changes for now
youknowriad 480fa44
Add label for the category patterns tab
youknowriad 7958119
Move the aria label for the list items to the correct element
youknowriad 0e845db
Try a different style for active navigation element.
mtias 45a295c
Implement roving tab order for the pattern categories and remove dialog
youknowriad 46b3936
Use nav + list
youknowriad 79908fa
Remove composite items
youknowriad 22bc21d
Add aria-current
youknowriad 321467a
Remove the heading component
youknowriad ae39524
Remove useless styles
youknowriad 1a702d6
revert unnecessary change
youknowriad 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,14 +22,14 @@ function BlockPattern( { isDraggable, pattern, onClick, composite } ) { | |
const descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`; | ||
|
||
return ( | ||
<InserterDraggableBlocks isEnabled={ isDraggable } blocks={ blocks }> | ||
<InserterDraggableBlocks | ||
isEnabled={ isDraggable } | ||
blocks={ blocks } | ||
isPattern={ !! pattern } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When would |
||
> | ||
{ ( { draggable, onDragStart, onDragEnd } ) => ( | ||
<div | ||
className="block-editor-block-patterns-list__list-item" | ||
aria-label={ pattern.title } | ||
aria-describedby={ | ||
pattern.description ? descriptionId : undefined | ||
} | ||
draggable={ draggable } | ||
onDragStart={ onDragStart } | ||
onDragEnd={ onDragEnd } | ||
|
@@ -40,6 +40,10 @@ function BlockPattern( { isDraggable, pattern, onClick, composite } ) { | |
{ ...composite } | ||
className="block-editor-block-patterns-list__item" | ||
onClick={ () => onClick( pattern, blocks ) } | ||
aria-label={ pattern.title } | ||
aria-describedby={ | ||
pattern.description ? descriptionId : undefined | ||
} | ||
> | ||
<BlockPreview | ||
blocks={ blocks } | ||
|
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
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.
Can we pass the
label
as a param here instead ofisPattern
. We will probably need it for the media tab too.