feat(richtext-lexical)!: initialize lexical during sanitization (#6119)

BREAKING:

- sanitizeFields is now an async function
- the richText adapters now return a function instead of returning the adapter directly
This commit is contained in:
Alessio Gravili
2024-04-30 15:09:32 -04:00
committed by GitHub
parent 9a636a3cfb
commit d9bb51fdc7
44 changed files with 829 additions and 795 deletions

View File

@@ -568,6 +568,9 @@ export const mapFields = (args: {
style: field.admin?.style,
width: field.admin?.width,
}
if (typeof field?.editor === 'function') {
throw new Error('Attempted to access unsanitized rich text editor.')
}
const RichTextFieldComponent = field.editor.FieldComponent
const RichTextCellComponent = field.editor.CellComponent