-
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
Transforms: add group unwrap #42685
Transforms: add group unwrap #42685
Conversation
Size Change: +124 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
@@ -490,8 +491,7 @@ export function switchToBlockType( blocks, name ) { | |||
transformationsTo, | |||
( t ) => | |||
t.type === 'block' && | |||
( isWildcardBlockTransform( t ) || |
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.
Wildcard to
transforms (a.k.a. unwrap transforms) don't make sense to be considered when looking for a specific block transform.
E.g. if the quote block registers an unwrap transform, it shouldn't be considered when you transform a quote to a particular other block like pull quote.
The wildcard transforms only make sense from "from" transforms, which means transforming from random mix of blocks to the block that registers it.
E.g. when a quote block registers a "from" wildcard transform, it should be considered when switching block type to quote.
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.
Should we add this to the transforms docs?
This doesn't make a lot of sense to me from a design perspective:
I think we should revert this and work a bit further on the presentation. |
What?
Since #25892 we now allow an unwrap transform (which is a "to"
*
transform). This means that the nested blocks will be unwrapped.This is also useful for the group block. Currently there's no way to ungroup from the block switcher, although there's a dedicated button in the block settings menu.
This PR also fixes an issue with the Quote unwrap where backgound color etc. of the quote would be transferred to the children.
Why?
It's easier to find the transform in the dedicated menu for transforms (the block switcher).
How?
Testing Instructions
Create a group blocks. Try unwrapping contents via the block switcher.
Screenshots or screencast