Add loading project from `.tldr` file and loading `.json` files.
Depends on
- #496
Closes
- #491
If the user drags and drops a .tldr file into the editor. The Open Project flow is initiated.
Todo:
- [x] Add JSON drag-and-drop
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
tldraw β ./
π Inspect: https://vercel.com/tldraw/tldraw/BsJkMXTZrYVHLUtaYC1AvuhezT1y
β
Preview: https://tldraw-git-fork-farazzshaikh-feature-load-file-tldraw.vercel.app
core β ./
π Inspect: https://vercel.com/tldraw/core/BHgEAA56j3qp6cvryXggrhdbGTcX
β
Preview: https://core-git-fork-farazzshaikh-feature-load-file-tldraw.vercel.app
@steveruizok We need to make it so that the asset table is not deleted from until some garbage clearing event. Currently, copyJson (which is also used in exportShapesAs) simply serializes the shape. Meaning it relies on there already being an asset table entry for the given shape's asset.
This means, we cannot seamlessly copy/export a shape as JSON from one project to another.
That's a good point. The clipboard should include any relevant assets, right? Is that a blocker for this PR?
Yes, and nope itβs not a blocker, however it will break if you do the following:
- copy image
- Delete that image
- Paste
So I think we should Hold off on this till we have the fix in place
it affects this PR as draggin in JSON will often result in broken asset shapes