fix(ui): significantly more predictable autosave form state (#13460)

This commit is contained in:
jacobsfletch
2025-08-14 19:36:02 -04:00
committed by GitHub
parent 46699ec314
commit 0b60bf2eff
20 changed files with 278 additions and 77 deletions

View File

@@ -61,6 +61,14 @@ const AutosavePosts: CollectionConfig = {
beforeChange: [({ data }) => data?.title],
},
},
{
name: 'richText',
type: 'richText',
},
{
name: 'json',
type: 'json',
},
{
name: 'description',
label: 'Description',

View File

@@ -198,6 +198,30 @@ export interface AutosavePost {
id: string;
title: string;
computedTitle?: string | null;
richText?: {
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;
json?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
description: string;
array?:
| {
@@ -793,6 +817,8 @@ export interface PostsSelect<T extends boolean = true> {
export interface AutosavePostsSelect<T extends boolean = true> {
title?: T;
computedTitle?: T;
richText?: T;
json?: T;
description?: T;
array?:
| T