feat(next): improved lexical richText diffing in version view (#11760)
This replaces our JSON-based richtext diffing with HTML-based richtext diffing for lexical. It uses [this HTML diff library](https://github.com/Arman19941113/html-diff) that I then modified to handle diffing more complex elements like links, uploads and relationships. This makes it way easier to spot changes, replacing the lengthy Lexical JSON with a clean visual diff that shows exactly what's different. ## Before  ## After  
This commit is contained in:
@@ -78,6 +78,7 @@ export interface Config {
|
||||
'version-posts': VersionPost;
|
||||
'custom-ids': CustomId;
|
||||
diff: Diff;
|
||||
text: Text;
|
||||
media: Media;
|
||||
users: User;
|
||||
'payload-jobs': PayloadJob;
|
||||
@@ -98,6 +99,7 @@ export interface Config {
|
||||
'version-posts': VersionPostsSelect<false> | VersionPostsSelect<true>;
|
||||
'custom-ids': CustomIdsSelect<false> | CustomIdsSelect<true>;
|
||||
diff: DiffSelect<false> | DiffSelect<true>;
|
||||
text: TextSelect<false> | TextSelect<true>;
|
||||
media: MediaSelect<false> | MediaSelect<true>;
|
||||
users: UsersSelect<false> | UsersSelect<true>;
|
||||
'payload-jobs': PayloadJobsSelect<false> | PayloadJobsSelect<true>;
|
||||
@@ -414,6 +416,16 @@ export interface Media {
|
||||
focalX?: number | null;
|
||||
focalY?: number | null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "text".
|
||||
*/
|
||||
export interface Text {
|
||||
id: string;
|
||||
text: string;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "users".
|
||||
@@ -574,6 +586,10 @@ export interface PayloadLockedDocument {
|
||||
relationTo: 'diff';
|
||||
value: string | Diff;
|
||||
} | null)
|
||||
| ({
|
||||
relationTo: 'text';
|
||||
value: string | Text;
|
||||
} | null)
|
||||
| ({
|
||||
relationTo: 'media';
|
||||
value: string | Media;
|
||||
@@ -842,6 +858,15 @@ export interface DiffSelect<T extends boolean = true> {
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "text_select".
|
||||
*/
|
||||
export interface TextSelect<T extends boolean = true> {
|
||||
text?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "media_select".
|
||||
|
||||
Reference in New Issue
Block a user