mirror of
https://github.com/docmost/docmost.git
synced 2026-06-11 02:36:56 +08: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:
@@ -40,6 +40,8 @@ const handleImageUpload =
|
||||
);
|
||||
|
||||
const placeholderId = generateNodeId();
|
||||
const width = imageDimensions?.width ?? undefined;
|
||||
const height = imageDimensions?.height ?? undefined;
|
||||
const aspectRatio = imageDimensions
|
||||
? imageDimensions.width / imageDimensions.height
|
||||
: undefined;
|
||||
@@ -57,6 +59,8 @@ const handleImageUpload =
|
||||
id: placeholderId,
|
||||
name: file.name,
|
||||
},
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
});
|
||||
|
||||
@@ -88,6 +92,8 @@ const handleImageUpload =
|
||||
src: `/api/files/${attachment.id}/${attachment.fileName}`,
|
||||
attachmentId: attachment.id,
|
||||
size: attachment.fileSize,
|
||||
width,
|
||||
height,
|
||||
aspectRatio,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user