This PR adds support for inserting images into the rich text editor via both **copy & paste** and **drag & drop**, whether from local files or image DOM nodes. It leverages the bulk uploads UI to provide a smooth workflow for: - Selecting the target collection - Filling in any required fields defined on the uploads collection - Uploading multiple images at once This significantly improves the UX for adding images to rich text, and also works seamlessly when pasting images from external editors like Google Docs or Microsoft Word. Test pre-release: `3.57.0-internal.801ab5a` ## Showcase - drag & drop images from computer https://github.com/user-attachments/assets/c558c034-d2e4-40d8-9035-c0681389fb7b ## Showcase - copy & paste images from computer https://github.com/user-attachments/assets/f36faf94-5274-4151-b141-00aff2b0efa4 ## Showcase - copy & paste image DOM nodes https://github.com/user-attachments/assets/2839ed0f-3f28-4e8d-8b47-01d0cb947edc --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1211217132290841
23 lines
476 B
TypeScript
23 lines
476 B
TypeScript
import type { AdminViewServerProps } from 'payload'
|
|
|
|
import React from 'react'
|
|
|
|
export const Image: React.FC<AdminViewServerProps> = async ({ payload }) => {
|
|
const images = await payload.find({
|
|
collection: 'uploads',
|
|
limit: 1,
|
|
})
|
|
|
|
if (!images?.docs?.length) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<h2>This is an image:</h2>
|
|
{/* eslint-disable-next-line jsx-a11y/alt-text */}
|
|
<img src={images?.docs?.[0]?.url as string} />
|
|
</div>
|
|
)
|
|
}
|