chore(richtext-lexical): updated lexical incoming config API
This commit is contained in:
@@ -24,7 +24,7 @@ export const UploadAndRichTextBlock: Block = {
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
editor: lexicalEditor({}),
|
||||
editor: lexicalEditor(),
|
||||
},
|
||||
],
|
||||
slug: 'uploadAndRichText',
|
||||
|
||||
@@ -31,59 +31,48 @@ const RichTextFields: CollectionConfig = {
|
||||
type: 'richText',
|
||||
required: true,
|
||||
editor: lexicalEditor({
|
||||
userConfig(defaultEditorConfig) {
|
||||
defaultEditorConfig.features.push(TreeviewFeature())
|
||||
defaultEditorConfig.features.push(
|
||||
LinkFeature({
|
||||
fields: [
|
||||
{
|
||||
name: 'rel',
|
||||
label: 'Rel Attribute',
|
||||
type: 'select',
|
||||
hasMany: true,
|
||||
options: ['noopener', 'noreferrer', 'nofollow'],
|
||||
admin: {
|
||||
description:
|
||||
'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
)
|
||||
|
||||
defaultEditorConfig.features.push(
|
||||
UploadFeature({
|
||||
collections: {
|
||||
uploads: {
|
||||
fields: [
|
||||
{
|
||||
name: 'caption',
|
||||
type: 'richText',
|
||||
editor: lexicalEditor({}),
|
||||
},
|
||||
],
|
||||
features: ({ defaultFeatures }) => [
|
||||
...defaultFeatures,
|
||||
TreeviewFeature(),
|
||||
LinkFeature({
|
||||
fields: [
|
||||
{
|
||||
name: 'rel',
|
||||
label: 'Rel Attribute',
|
||||
type: 'select',
|
||||
hasMany: true,
|
||||
options: ['noopener', 'noreferrer', 'nofollow'],
|
||||
admin: {
|
||||
description:
|
||||
'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
defaultEditorConfig.features.push(
|
||||
BlocksFeature({
|
||||
blocks: [TextBlock, UploadAndRichTextBlock],
|
||||
}),
|
||||
)
|
||||
return defaultEditorConfig
|
||||
},
|
||||
],
|
||||
}),
|
||||
UploadFeature({
|
||||
collections: {
|
||||
uploads: {
|
||||
fields: [
|
||||
{
|
||||
name: 'caption',
|
||||
type: 'richText',
|
||||
editor: lexicalEditor(),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlocksFeature({
|
||||
blocks: [TextBlock, UploadAndRichTextBlock],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: 'richTextLexical',
|
||||
type: 'richText',
|
||||
editor: lexicalEditor({
|
||||
userConfig(defaultEditorConfig) {
|
||||
defaultEditorConfig.features.push(TreeviewFeature())
|
||||
return defaultEditorConfig
|
||||
},
|
||||
features: ({ defaultFeatures }) => [...defaultFeatures, TreeviewFeature()],
|
||||
}),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user