feat(richtext-lexical): initial working BlocksFeature
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
import {
|
||||
AlignFeature,
|
||||
BlockQuoteFeature,
|
||||
BlocksFeature,
|
||||
LinkFeature,
|
||||
lexicalEditor,
|
||||
} from '@payloadcms/richtext-lexical'
|
||||
import path from 'path'
|
||||
|
||||
import type { Config, SanitizedConfig } from '../packages/payload/src/config/types'
|
||||
@@ -5,7 +12,6 @@ import type { Config, SanitizedConfig } from '../packages/payload/src/config/typ
|
||||
import { mongooseAdapter } from '../packages/db-mongodb/src'
|
||||
import { postgresAdapter } from '../packages/db-postgres/src'
|
||||
import { buildConfig as buildPayloadConfig } from '../packages/payload/src/config/build'
|
||||
import { AlignFeature, LinkFeature, lexicalEditor } from '../packages/richtext-lexical/src'
|
||||
//import { slateEditor } from '../packages/richtext-slate/src'
|
||||
|
||||
// process.env.PAYLOAD_DATABASE = 'postgres'
|
||||
@@ -73,7 +79,28 @@ export function buildConfigWithDefaults(testConfig?: Partial<Config>): Promise<S
|
||||
},
|
||||
}),*/
|
||||
editor: lexicalEditor({
|
||||
features: [LinkFeature({}), AlignFeature()],
|
||||
features: [
|
||||
LinkFeature({}),
|
||||
AlignFeature(),
|
||||
BlockQuoteFeature(),
|
||||
BlocksFeature({
|
||||
blocks: [
|
||||
{
|
||||
slug: 'myBlock',
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
type: 'textarea',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
rateLimit: {
|
||||
max: 9999999999,
|
||||
|
||||
Reference in New Issue
Block a user