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  
18 lines
311 B
TypeScript
18 lines
311 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { textCollectionSlug } from '../slugs.js'
|
|
|
|
export const TextCollection: CollectionConfig = {
|
|
slug: textCollectionSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
],
|
|
}
|