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

@@ -412,6 +412,21 @@ export interface User {
*/
export interface LexicalInBlock {
id: string;
content?: {
root: {
type: string;
children: {
type: string;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
blocks?:
| {
lexical?: {
@@ -2041,6 +2056,7 @@ export interface UsersSelect<T extends boolean = true> {
* via the `definition` "LexicalInBlock_select".
*/
export interface LexicalInBlockSelect<T extends boolean = true> {
content?: T;
blocks?:
| T
| {