mirror of
https://github.com/docmost/docmost.git
synced 2026-07-24 11:12:50 +10:00
feat: editor attachment paste handling (#1975)
* reupload attachments if uploaded to a different page * use image dimensions on paste/DnD * tooltips withinPortal:false * isolating attribute
This commit is contained in:
@@ -61,7 +61,9 @@ const handleVideoUpload =
|
||||
const objectUrl = URL.createObjectURL(file);
|
||||
const videoDimensions = await getVideoDimensions(objectUrl);
|
||||
const placeholderId = generateNodeId();
|
||||
const aspectRatio = videoDimensions.aspectRatio;
|
||||
const width = videoDimensions?.width ?? undefined;
|
||||
const height = videoDimensions?.height ?? undefined;
|
||||
const aspectRatio = videoDimensions?.aspectRatio;
|
||||
|
||||
let placeholderInserted = false;
|
||||
|
||||
@@ -76,6 +78,8 @@ const handleVideoUpload =
|
||||
id: placeholderId,
|
||||
name: file.name,
|
||||
},
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
});
|
||||
|
||||
@@ -108,6 +112,8 @@ const handleVideoUpload =
|
||||
attachmentId: attachment.id,
|
||||
title: attachment.fileName,
|
||||
size: attachment.fileSize,
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user