mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
* Fix right-click paste command for images (Issue #8826) * Fix clipboard logic for multiple paste types * fix: remove unused code * refactor & robustness * fix: creating paste event with image files --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
9b401f6ea3
commit
2af3221974
3 changed files with 78 additions and 38 deletions
|
@ -106,11 +106,15 @@ export const isImageFileHandle = (handle: FileSystemHandle | null) => {
|
|||
return type === "png" || type === "svg";
|
||||
};
|
||||
|
||||
export const isSupportedImageFileType = (type: string | null | undefined) => {
|
||||
return !!type && (Object.values(IMAGE_MIME_TYPES) as string[]).includes(type);
|
||||
};
|
||||
|
||||
export const isSupportedImageFile = (
|
||||
blob: Blob | null | undefined,
|
||||
): blob is Blob & { type: ValueOf<typeof IMAGE_MIME_TYPES> } => {
|
||||
const { type } = blob || {};
|
||||
return !!type && (Object.values(IMAGE_MIME_TYPES) as string[]).includes(type);
|
||||
return isSupportedImageFileType(type);
|
||||
};
|
||||
|
||||
export const loadSceneOrLibraryFromBlob = async (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue