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

[Feature Request] Image block inside markdown editor #156

Open
dallyh opened this issue Jun 6, 2024 · 9 comments
Open

[Feature Request] Image block inside markdown editor #156

dallyh opened this issue Jun 6, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request P2

Comments

@dallyh
Copy link

dallyh commented Jun 6, 2024

Currently if I want to use an uploaded asset inside markdown editor, then from editing an entry I have to go back to assets, upload the asset, copy its URL and then go back to editing and insert it manually by writing pure markdown. Having an entry with multiple images can get pretty time consuming. Also doing this then does not update the "Used in" field inside metadata of an uploaded asset.

Are there any plans to implement the image block before 1.0 and or before Svelte 5 migration?

Thanks!

@kyoshino
Copy link
Member

kyoshino commented Jun 6, 2024

Hi there 👋🏼 Not sure if it happens before or after the Svelte 5 migration, but I do have a plan to do it before 1.0 as mentioned in the README:

Editor components, including built-in image and code-block as well as custom components, are not yet supported.

Well, I’ll try to work on it later this month! (I have 2 other new features in my queue now)

@kyoshino kyoshino self-assigned this Jun 6, 2024
@kyoshino kyoshino added the enhancement New feature or request label Jun 6, 2024
@onweru
Copy link

onweru commented Jun 13, 2024

Editor components, including built-in image and code-block as well as custom components, are not yet supported.

Well, I’ll try to work on it later this month! (I have 2 other new features in my queue now)

Assuming this is why I cannot add or preview images inside markdown blocks, I have to say this has caught me off guard. I kinda assumed this was immediately available.

@kyoshino
Copy link
Member

@onweru You should still be able to add images when switching to raw Markdown editor, but the current status is what the README says. Anyway, I’ll bump the priority of this issue by pushing back other tasks.

@kyoshino kyoshino added the P2 label Jun 13, 2024
@kyoshino
Copy link
Member

Sorry for the delay here. Just wanted to let you know that I have made progress. Still have some work to do, but the functionality is basically working now. Hopefully I can ship it soon. 🤞🏼

image

@CarloBu
Copy link

CarloBu commented Aug 10, 2024

That's super awesome news!

Will the insert have more options than the image? Would it be better for the image component to use the image icon? This is so frequently used that it's hard to understand why Decap hides the image option in the dropdown.
Technically speaking image tool is a separate component, that's why from dev point of view it's in the "add component block" but the average Joe does not care about this technicality. The user wants to add the image right away.
What I am trying to say, is that the Decap does not have the best UX :)

@kyoshino
Copy link
Member

The Insert menu would have the Image, Code Block and custom editor components, but you’re right, Image should be just a button next to Insert for faster access 😄

@CarloBu
Copy link

CarloBu commented Aug 10, 2024

Nice! 👍
Will custom editor components be react or svelte?
Edit. I just read in another topic that you want to make React components work.

@kyoshino
Copy link
Member

Yeah, the CMS.registerEditorComponent document says the toPreview option can be either a vanilla JS template literal or a React component, so I have to eventually support the latter case.

@CarloBu
Copy link

CarloBu commented Aug 12, 2024

I see. You are still committed to 100% decap support. It will be interesting to see how you glue the react component to the svelte project 👍
Godspeed! I can't wait to be able to add my custom components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2
Projects
None yet
Development

No branches or pull requests

4 participants