-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Extract the pattern overrides toolbar indicator from the block-editor
package
#62514
Extract the pattern overrides toolbar indicator from the block-editor
package
#62514
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
9d15ee3
to
4859d0d
Compare
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.
Moved to packages/patterns/src/components/pattern-overrides-block-controls.js
.
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.
Moved to packages/patterns/src/components/style.scss
.
Size Change: +474 B (+0.03%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
@@ -43,6 +44,7 @@ const withPatternOverrideControls = createHigherOrderComponent( | |||
{ props.isSelected && isSupportedBlock && ( | |||
<ControlsWithStoreSubscription { ...props } /> | |||
) } | |||
{ isSupportedBlock && <PatternOverridesBlockControls /> } |
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.
It's a shame there's no way to add a condition like ( props.isSelected || props.isMultiselected )
here
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.
We should probably add a comment there to avoid accidental regression.
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.
Code looks good and it tests well, thanks for addressing this.
…r` package (WordPress#62514) Co-authored-by: kevin940726 <[email protected]> Co-authored-by: talldan <[email protected]> * Extract pattern overrides toolbar indicator from the block-editor package * Fix error
…r` package (#62514) Co-authored-by: kevin940726 <[email protected]> Co-authored-by: talldan <[email protected]> * Extract pattern overrides toolbar indicator from the block-editor package * Fix error
…r` package (#62514) Co-authored-by: kevin940726 <[email protected]> Co-authored-by: talldan <[email protected]> * Extract pattern overrides toolbar indicator from the block-editor package * Fix error
I just cherry-picked this PR to the wp/6.6-beta-3 branch to get it included in the next release: 8d8f681 |
…r` package (#62514) Co-authored-by: kevin940726 <[email protected]> Co-authored-by: talldan <[email protected]> * Extract pattern overrides toolbar indicator from the block-editor package * Fix error
hasPatternOverrides: _hasPatternOverrides, | ||
hasParentPattern: _hasParentPattern, |
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.
I am unsure if this affects anything substantial, but these values will be true
when selectedClientIds
is an empty array. Do to how Array.every
works in JS.
What?
Part of #60619. Address the issue discussed in #62317 (comment).
Extract out pattern overrides related code from the
block-editor
package to thepatterns
package, specifically the toolbar indicator.Why?
Pattern Overrides is a WP-only feature so ideally it doesn't belong in the
block-editor
package.How?
Create a
PatternOverridesBlockControls
component and conditionally render it using the pattern-overrides hook.Testing Instructions
Screenshots or screencast
Select a single pattern overrides block:
Select multiple pattern overrides blocks:
Select a block inside the pattern focus mode: