-
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
Behaviors: Extend Global Styles API to read/write behaviors config. #52370
Conversation
Flaky tests detected in 5ea4b13. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5599151879
|
Size Change: +874 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
f7e1ce4
to
2ed3596
Compare
d898205
to
289a084
Compare
I've been taking a quick look at it and it looks great so far 👏 I have a couple of comments:
Behaviors.-.Global.Styles.mp4
|
That's weird, as I've been developing it with the case it doesn't work on your side. Not the first one 😅 |
I think the error is that if you set it up on block settings, it doesn't work on styles after and viceversa. |
I have the default option in the block settings and still doesn't work in the global styles 🤔 |
445453e
to
75f9411
Compare
I just added 3 tasks more regarding the |
All tests are 🟢 . Time to add some more and refactor. Feel free to comment on them! |
b1bb22c
to
f51abe5
Compare
ff34b74
to
70bf5ee
Compare
612b2e3
to
9480be5
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.
Just a couple of small comments but otherwise this is ready 👍
Awesome work, I'll push out a new PR today adding a few e2e tests for this.
lib/compat/wordpress-6.3/class-gutenberg-rest-global-styles-revisions-controller-6-3.php
Show resolved
Hide resolved
…ding-strategy * origin/trunk: (59 commits) Promisify action creator return type for WP data dispatch (#52530) [RNMobile] Add WP hook for registering non-core blocks (#52791) removes check for active preview device type to enable the fixed toolbar preference (#52770) Enforce checks against redeclaration for functions and classes (#52696) update appearance tools, (#52785) Behaviors: Extend Global Styles API to read/write behaviors config. (#52370) HeaderToolbar - Update inserterMethod meta data (#52735) add options for debugging php unit tests (#52778) Docs: Interactivity API > Getting Started Guide - minor adjustments (#52786) Footnotes: Use static closures when not using '' (#52781) Improve slug generation & matching in request utils (#52414) Open "docs" folder for the Interactivity API package and Getting Started Guide (#52462) Global Styles: Don't use named arguments for 'sprintf' (#52782) E2E utils - Update locator to hide the keyboard on iOS to pick the first element, on iPad two buttons are available and the second one makes the floating keyboard to show up (#52771) Patterns: Reinstate template parts mode spec (#52780) chore(release): publish Update changelog files Patterns: Fix empty general template parts category (#52747) Add id to pattern inserted notice to stop multiple notices stacking (#52746) Site Editor: Fix site link accessibility issues (#52744) ...
- removes tests that have been ported to Core already as part of WP 6.3 - Adds tests for #52370 - Changes a private method to protected so it can be used in inherited classes
Hello friends! I got the test running over in #52819 |
- removes tests that have been ported to Core already as part of WP 6.3 - Adds tests for #52370 - Changes a private method to protected so it can be used in inherited classes
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 know this is old, but I just stumbled upon this code, so I wanted to leave some comments for a potential follow-up.
useGlobalSetting, | ||
useSettingsForBlockElement, | ||
useHasColorPanel, | ||
useHasEffectsPanel, | ||
useHasFiltersPanel, | ||
useGlobalStyle, | ||
__experimentalUseGlobalBehaviors: useGlobalBehaviors, | ||
__experimentalBehaviorsPanel: StylesBehaviorsPanel, |
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.
Why are these prefixed with __experimental
knowing that they are already private APIs
const blockType = getBlockType( name ); | ||
const blockVariations = useBlockVariations( name ); | ||
const hasTypographyPanel = useHasTypographyPanel( settings ); | ||
const hasColorPanel = useHasColorPanel( settings ); | ||
const hasBehaviorsPanel = useHasBehaviorsPanel( rawSettings, name ); |
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.
Why is this using rawSettings instead of settings (like the other hooks).
onChange={ setBehavior } | ||
behaviors={ inheritedBehaviors } | ||
blockName={ name } | ||
></StylesBehaviorsPanel> |
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.
Nit: The element could have been autoclosed.
What?
Include a Behaviors selector in the Site Editor.
Why?
Without this PR, the only way to set behaviors globally for all images was by editing
theme.json
. This PR enables a selector on the site editor, understyles -> blocks -> image -> advanced
that uses Global Styles API to apply the behavior to all the images in the site.To-do list
undo
option is working correctly.