fix(richtext-lexical): various issues for lexical sub-fields due to incorrectly generated client field schema map (#10276)

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] } `
This commit is contained in:
Alessio Gravili
2024-12-30 23:33:43 -07:00
committed by GitHub
parent 5188a9b2a0
commit 35df899547
6 changed files with 105 additions and 4 deletions

View File

@@ -481,6 +481,28 @@ export const seed = async (_payload: Payload) => {
await _payload.create({
collection: 'LexicalInBlock',
data: {
content: {
root: {
children: [
{
format: '',
type: 'block',
version: 2,
fields: {
id: '6773773284be8978db7a498d',
lexicalInBlock: textToLexicalJSON({ text: 'text' }),
blockName: '',
blockType: 'blockInLexical',
},
},
],
direction: null,
format: '',
indent: 0,
type: 'root',
version: 1,
},
},
blocks: [
{
blockType: 'lexicalInBlock2',