@mocanvas/mocanvas · function

defaultHandleExternalFileContent

declare function defaultHandleExternalFileContent(editor: Editor, info: {
    files: File[];
} & AtPoint, opts: TLDefaultExternalContentHandlerOpts): Promise<void>

Files: turn each one into an asset through the util that claims its type, then create the shapes those assets call for.

Files that are refused (too large, or a type nothing claims) are dropped with a toast and the rest still land — a drop of ten photos and one video should not fail wholesale because the video was too big.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.