feat(richtext-lexical)!: link node: change doc data format to be consistent with relationship field (#4504)

BREAKING: An unpopulated, internal link node no longer saves the doc id under fields.doc.value.id. Now, it saves it under fields.doc.value.

Migration inside of payload is automatic. If you are reading from the link node inside of your frontend, though, you will have to adjust it.

The version property of the link and autoLink node has been changed from 1 to 2.
This commit is contained in:
Alessio Gravili
2023-12-13 22:57:08 +01:00
committed by GitHub
parent 9e7a8c7206
commit cc0ba89518
9 changed files with 49 additions and 29 deletions

View File

@@ -54,7 +54,7 @@ export function generateLexicalRichText() {
format: '',
indent: 0,
type: 'link',
version: 1,
version: 2,
fields: {
url: 'https://payloadcms.com',
newTab: true,
@@ -86,13 +86,11 @@ export function generateLexicalRichText() {
format: '',
indent: 0,
type: 'link',
version: 1,
version: 2,
fields: {
url: 'https://',
doc: {
value: {
id: '{{ARRAY_DOC_ID}}',
},
value: '{{ARRAY_DOC_ID}}',
relationTo: 'array-fields',
},
newTab: false,