gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Allow direct transform between Quote and Pullquote

Open mcsf opened this issue 8 years ago • 9 comments

Transforms being an important bridge between blocks, we should make it easier to bump from Quote to Pullquote (and vice-versa), especially since there is currently no direct path from Paragraph to Pullquote (only to Quote).

I'm fine not adding Paragraph -> Pullquote if we're concerned about overcrowding the block switcher, as long as we have Paragraph -> Quote -> Pullquote.

Marking as bug, as we should address this soon.

mcsf avatar Oct 12 '18 11:10 mcsf

I'll work on this for my first issue.

DanielLaubacher avatar Oct 14 '18 18:10 DanielLaubacher

@mcsf Where are a block's transformation options set? I've looked through the code base and have the general idea. But I can't find anything specifying the transformations for a given block.

DanielLaubacher avatar Oct 14 '18 23:10 DanielLaubacher

You add this to the settings of the block. See for example the cover Image block: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/cover-image/index.js#L78

Soean avatar Oct 15 '18 08:10 Soean

@dlaub3: thanks for looking at this! Soean beat me to the answer.

The transformation API currently lacks documentation, but a lot can be learnt by example. Looking at transforms: in the index files for Cover Image, Quote, etc. should help you get started.

mcsf avatar Oct 15 '18 10:10 mcsf

@mcsf Just an idea: conversions such as "Paragraph -> Quote -> Pullquote" could be detected automatically and applied in a row. There should be no need to provide all these. Anyway, this is out of scope of this issue. :)

ellatrix avatar Oct 16 '18 10:10 ellatrix

Yeah. I believe we chatted about this long ago. I could see it as part of refractors in 5.1. :)

@dlaub3: let me know if you need anything else, and how soon you’re planning on tackling this!

mcsf avatar Oct 16 '18 10:10 mcsf

I'll be able to work on this tomorrow evening. If that's not soon enough someone else may work on it and I'll find another issue.

On Tue, Oct 16, 2018 at 7:00 AM Miguel Fonseca [email protected] wrote:

Yeah. I believe we chatted about this long ago. I could see it as part of refractors in 5.1. :)

@dlaub3 https://github.com/dlaub3: let me know if you need anything else, and how soon you’re planning on tackling this!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WordPress/gutenberg/issues/10548#issuecomment-430194326, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtSdsytQEILq3FSJOopk2bzXrBWrh3Fks5ulbw_gaJpZM4XZSsl .

DanielLaubacher avatar Oct 17 '18 10:10 DanielLaubacher

https://github.com/WordPress/gutenberg/pull/10683 addresses this issue

oandregal avatar Oct 17 '18 11:10 oandregal

@dlaub3: Even though this got addressed separately, thank you for your involvement. I'll keep an eye out for things that can be labeled Good First Issue. :)

mcsf avatar Oct 17 '18 12:10 mcsf