Skip to content
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

Block Transforms #8

Open
mrwweb opened this issue Nov 23, 2021 · 1 comment
Open

Block Transforms #8

mrwweb opened this issue Nov 23, 2021 · 1 comment

Comments

@mrwweb
Copy link
Owner

mrwweb commented Nov 23, 2021

It would be great to support both transforming from and to other blocks. I'd love to hear what people expect for this.

Transform From

My initial thought for this is that a Heading and Paragraph could both be transformed to become the accordion title.

A more advanced transform would involve a multi-block selection that starts with a heading being transformed into the accordion title and contents.

Transform To

I'm less certain on the best approach here. In some ways, an accordion best maps to a Group block containing both the Accordion title as a heading followed by all the contents. Alternately, I could just see the accordion "releasing" all its contents to a Heading (from the title) and all the contents into the editor body or accordion's parent container. However, I don't think WordPress really has a paradigm for this except for "Ungroup". I don't know if it's possible to match that behavior or not.

@mrwweb
Copy link
Owner Author

mrwweb commented Dec 3, 2021

During user testing, one person suggested their expected behavior would be akin to ungrouping a group block where the heading becomes a heading and the content is "released" into the body.

They added that they would love the ability to select multiple blocks starting with a heading to convert it into an accordion. Being able to convert a heading to an accordion would be a helpful enough first step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant