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:
Philip Okugbe
2026-02-28 01:24:19 +00:00
committed by GitHub
parent df64de5306
commit fc0997fd90
15 changed files with 260 additions and 33 deletions
@@ -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,
});