Open ezhil56x opened 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
blocknote | ❌ Failed (Inspect) | Jul 3, 2024 3:40pm |
@ezhil56x is attempting to deploy a commit to the TypeCell Team on Vercel.
A member of the Team first needs to authorize it.
@YousefED
This looks great already. I've left some comments inline but also have one main architectural request:
I don't think we want to add the uppy dependencies by default - otherwise users who don't need uppy will end up adding a lot of dependencies. This means all Uppy related code should live in the Example (or in a separate package (
blocknote-uppy
or sth), but I don't think that's necessary for now). The way to do this would be to in the example use aFilePanelController
and pass in the Uppy tab as part of it's props. (the uppy tab should then also live in the configuration).Secondly, I don't think we then need
uploadFileUppy
anymore in the configuration. We do need (see original requirements) to make sure thatuploadFile
uploads via Uppy. The reason for this is that while at this moment, it's true thatuploadFile
is only called from the upload tab (which we'll replace by the dashboard), but at a later point it's likely we'll calluploadFile
from other places (like dropping files into the editor) as well.
@ezhil56x I have already made changes related to this. If needed any reference you can view my closed pr. https://github.com/TypeCellOS/BlockNote/pull/843
Will update my PR soon and let you know
@YousefED If we need uploadFile then we should create a similar uploadFileUppy for handing uppy uploads. Will that be fine?
@YousefED If we need uploadFile then we should create a similar uploadFileUppy for handing uppy uploads. Will that be fine?
I think we just need something like this?
async function uploadFileViaUppy(file: File) {
uppy.addFile(file);
await uppy.upload();
}
...
uploadfile: uploadFileViaUppy
pseudo code, but I hope this clarifies the intended behavior for you
@YousefED If we need uploadFile then we should create a similar uploadFileUppy for handing uppy uploads. Will that be fine?
I think we just need something like this?
async function uploadFileViaUppy(file: File) { uppy.addFile(file); await uppy.upload(); } ... uploadfile: uploadFileViaUppy
pseudo code, but I hope this clarifies the intended behavior for you
I tried this though, uppy.addFile() needs the file as blob type rather than file type. Creating a new uploadFileUppy like uploadFile will be a good option, but uppy packages should be added for that which increases the size. I am confused about what to do. What do you suggest?
@YousefED If we need uploadFile then we should create a similar uploadFileUppy for handing uppy uploads. Will that be fine?
I think we just need something like this?
async function uploadFileViaUppy(file: File) { uppy.addFile(file); await uppy.upload(); } ... uploadfile: uploadFileViaUppy
pseudo code, but I hope this clarifies the intended behavior for you
I tried this though, uppy.addFile() needs the file as blob type rather than file type. Creating a new uploadFileUppy like uploadFile will be a good option, but uppy packages should be added for that which increases the size. I am confused about what to do. What do you suggest?
Added support for uppy with an example
Closes #807 /claim #807