-
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
Add ability to transform between Image and Cover Image blocks #6475
Comments
Just realised this is probably slightly reduced in scope a bit by #5452, although I think you could still theoretically still do Image → Cover Image; just convert the image caption to a paragraph block inside Cover Image. |
I can see this as a good enhancement to make and add to the list for transforms, it makes sense and thanks for suggesting. |
We're thinking of adding nested support to the cover image block, which will make this transformation less "natural". Do you think it's fine to transform only the image and drop the citation/text? |
@youknowriad less natural in which direction? Here's what I'd envision: Image → Cover ImageSets Image as the Cover Image, and converts the caption to a nested Paragraph block inside Cover Image Cover Image → ImageThis one is a bit trickier but probably the most logical approach is that it actually converts to Image, and then any of the nested blocks are added below the image. To be honest I'm not sure it's actually possible to transform one block to many with the current API, but if it is, I think this approach makes sense. It's non-destructive and I think pretty natural. |
Sounds good to me @chrisvanpatten I didn't think about adding those as blocks following the image block, but it also means you can't go back. |
At the risk of blowing everything up, is there a world in which the image caption also supports nested blocks? I can imagine a world when someone might want a heading in a caption, e.g. a "Figure 1" and then the caption text below that. If image caption becomes a nested block, that obviously makes it possible to go seamlessly back and forth… although that could introduce other back-compat issues I have definitely not thought about. |
@chrisvanpatten This is already possible; the Gallery block does it when you convert it to Image blocks. Many to one works as well: if you select multiple Image blocks, you can transform them into a Gallery block via the More Options ellipsis menu. (On a side note, when the transforms are removed from More Options (see #6449), how will you be able to do this? Will the block toolbar be available in the multiple block selection?) |
Issue Overview
Currently, it's not possible to transform between the Image and Cover Image blocks.
These seem like natural candidates for a mutual transform because they're essentially both an image ID plus text, although one displays it over the top of the image, of course:
Image block:
Cover Image block:
Steps to Reproduce (for bugs)
Expected Behavior
You should be able to transform between the two!
Current Behavior
Currently, an Image block can only be transformed into a Gallery block, and a Cover Image block can only be transformed into a Heading block.
Possible Solution
Enable transformation between these two blocks, mapping…
Presumably, block alignment could also be carried over, along with the caption's formatting (excluding alignment, which is possible in the Cover Image Text but not in image captions).
Fixed background and dimness settings would be either discarded (if transforming to Image) or set to the defaults (if transforming to Cover Image).
Related Issues and/or PRs
This was inspired by #5683.
The text was updated successfully, but these errors were encountered: