32 lines
600 B
TypeScript
32 lines
600 B
TypeScript
import type { Block } from '../../../../packages/payload/src/fields/config/types'
|
|
|
|
import { lexicalEditor } from '../../../../packages/richtext-lexical/src'
|
|
|
|
export const TextBlock: Block = {
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
],
|
|
slug: 'text',
|
|
}
|
|
|
|
export const UploadAndRichTextBlock: Block = {
|
|
fields: [
|
|
{
|
|
name: 'upload',
|
|
type: 'upload',
|
|
relationTo: 'uploads',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'richText',
|
|
type: 'richText',
|
|
editor: lexicalEditor({}),
|
|
},
|
|
],
|
|
slug: 'uploadAndRichText',
|
|
}
|