Fixes https://github.com/payloadcms/payload/issues/9905, https://github.com/payloadcms/payload/issues/9660 Single lexical fields were represented file in the schema map (`path => field`). In the client schema map however, they were incorrectly represented like this: `path => { fields: [field] } `
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { BlocksFeature, lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
|
|
export const LexicalInBlock: CollectionConfig = {
|
|
slug: 'LexicalInBlock',
|
|
fields: [
|
|
{
|
|
name: 'content',
|
|
type: 'richText',
|
|
editor: lexicalEditor({
|
|
features: [
|
|
BlocksFeature({
|
|
blocks: [
|
|
{
|
|
slug: 'blockInLexical',
|
|
fields: [
|
|
{
|
|
name: 'lexicalInBlock',
|
|
label: 'My Label',
|
|
type: 'richText',
|
|
required: true,
|
|
editor: lexicalEditor(),
|
|
admin: {
|
|
description: 'Some Description',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
}),
|
|
},
|
|
{
|
|
name: 'blocks',
|
|
type: 'blocks',
|
|
blocks: [
|
|
{
|
|
slug: 'lexicalInBlock2',
|
|
fields: [
|
|
{
|
|
name: 'lexical',
|
|
type: 'richText',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|