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

I hope I can have different state for advance Block like Image/File #869

Open
wenerme opened this issue Jun 26, 2024 · 2 comments
Open

I hope I can have different state for advance Block like Image/File #869

wenerme opened this issue Jun 26, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation prio:high High priority

Comments

@wenerme
Copy link

wenerme commented Jun 26, 2024

Is your feature request related to a problem? Please describe.

When pasting or uploading a file, I hope I can return the dataurl/URL.createObjectUrl to user after they paste, then uploading to server in the background, after uploaded I can give the real url to image/file.

This may introduce the pending state to editor, e.g. notify user there are background running process, they should not just submit the form & exit.

Describe the solution you'd like

Maybe expose current ImageBlock to extension, I don't want to build this from ground, but this require the builtin blocks has the extendibility.

Describe alternatives you've considered

Replace the block ?

Additional context

Bonus
[ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

@wenerme wenerme added the enhancement New feature or request label Jun 26, 2024
@matthewlipski
Copy link
Collaborator

I think this is already partially documented with the resolveFileUrl editor option, which lets you use the string that you have stored on the file block's url prop as an identifier to fetch the file URL async from a backend on render. However, the documentation for this is missing atm so we definitely need to fix that.

@matthewlipski matthewlipski added documentation Improvements or additions to documentation prio:high High priority and removed enhancement New feature or request labels Jun 26, 2024
@wenerme
Copy link
Author

wenerme commented Jun 29, 2024

resolveFileUrl solve the paste url problem, but seems unable to solve the pending load problem. e.g. the upload need seconds, the image block is unable to notify the user they already pasted the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation prio:high High priority
Projects
None yet
Development

No branches or pull requests

2 participants