chore: rename editors
This commit is contained in:
@@ -12,7 +12,7 @@ import { sanitizeEditorConfig } from './field/lexical/config/sanitize'
|
||||
import { cloneDeep } from './field/lexical/utils/cloneDeep'
|
||||
import { richTextRelationshipPromise } from './populate/richTextRelationshipPromise'
|
||||
|
||||
export function createLexical({
|
||||
export function lexicalEditor({
|
||||
userConfig,
|
||||
}: {
|
||||
userConfig?: (defaultEditorConfig: EditorConfig) => EditorConfig
|
||||
|
||||
@@ -8,7 +8,7 @@ import RichTextCell from './cell'
|
||||
import { richTextRelationshipPromise } from './data/richTextRelationshipPromise'
|
||||
import RichTextField from './field'
|
||||
|
||||
export function createSlate(args: AdapterArguments): RichTextAdapter<AdapterArguments> {
|
||||
export function slateEditor(args: AdapterArguments): RichTextAdapter<AdapterArguments> {
|
||||
return {
|
||||
CellComponent: withMergedProps({
|
||||
Component: RichTextCell,
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from 'path'
|
||||
import { payloadCloud } from '@payloadcms/plugin-cloud'
|
||||
import { mongooseAdapter } from '@payloadcms/db-mongodb' // database-adapter-import
|
||||
import { webpackBundler } from '@payloadcms/bundler-webpack' // bundler-import
|
||||
import { createLexical } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import { buildConfig } from 'payload/config'
|
||||
|
||||
import Users from './collections/Users'
|
||||
@@ -12,7 +12,7 @@ export default buildConfig({
|
||||
admin: {
|
||||
user: Users.slug,
|
||||
},
|
||||
editor: createLexical({}), // editor-config
|
||||
editor: lexicalEditor({}), // editor-config
|
||||
collections: [Users],
|
||||
typescript: {
|
||||
outputFile: path.resolve(__dirname, 'payload-types.ts'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { payloadCloud } from '@payloadcms/plugin-cloud'
|
||||
import { mongooseAdapter } from '@payloadcms/db-mongodb' // database-adapter-import
|
||||
import { webpackBundler } from '@payloadcms/bundler-webpack' // bundler-import
|
||||
import { createLexical } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import nestedDocs from '@payloadcms/plugin-nested-docs'
|
||||
import seo from '@payloadcms/plugin-seo'
|
||||
import type { GenerateTitle } from '@payloadcms/plugin-seo/types'
|
||||
@@ -59,7 +59,7 @@ export default buildConfig({
|
||||
},
|
||||
}),
|
||||
},
|
||||
editor: createLexical({}), // editor-config
|
||||
editor: lexicalEditor({}), // editor-config
|
||||
serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL,
|
||||
collections: [Pages, Products, Orders, Media, Categories, Users],
|
||||
globals: [Settings, Header, Footer],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { payloadCloud } from '@payloadcms/plugin-cloud'
|
||||
import { mongooseAdapter } from '@payloadcms/db-mongodb' // database-adapter-import
|
||||
import { webpackBundler } from '@payloadcms/bundler-webpack' // bundler-import
|
||||
import { createLexical } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical' // editor-import
|
||||
import FormBuilder from '@payloadcms/plugin-form-builder'
|
||||
import nestedDocs from '@payloadcms/plugin-nested-docs'
|
||||
import redirects from '@payloadcms/plugin-redirects'
|
||||
@@ -44,7 +44,7 @@ export default buildConfig({
|
||||
},
|
||||
}),
|
||||
},
|
||||
editor: createLexical({}), // editor-config
|
||||
editor: lexicalEditor({}), // editor-config
|
||||
serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL,
|
||||
collections: [Users, Categories, Pages, Posts, Media],
|
||||
globals: [Header, Footer],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path'
|
||||
|
||||
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||
import { createSlate } from '../../packages/richtext-slate/src'
|
||||
import { slateEditor } from '../../packages/richtext-slate/src'
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||
import { devUser } from '../credentials'
|
||||
import AfterDashboard from './components/AfterDashboard'
|
||||
@@ -121,7 +121,7 @@ export default buildConfigWithDefaults({
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
editor: createSlate({
|
||||
editor: slateEditor({
|
||||
admin: {
|
||||
elements: ['relationship'],
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import { webpackBundler } from '../packages/bundler-webpack/src'
|
||||
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 { createSlate } from '../packages/richtext-slate/src'
|
||||
import { slateEditor } from '../packages/richtext-slate/src'
|
||||
|
||||
// process.env.PAYLOAD_DATABASE = 'postgres'
|
||||
|
||||
@@ -32,7 +32,7 @@ export function buildConfigWithDefaults(testConfig?: Partial<Config>): Promise<S
|
||||
const [name] = process.argv.slice(2)
|
||||
|
||||
const config: Config = {
|
||||
editor: createSlate({}),
|
||||
editor: slateEditor({}),
|
||||
telemetry: false,
|
||||
rateLimit: {
|
||||
window: 15 * 60 * 100, // 15min default,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Block } from '../../../../packages/payload/src/fields/config/types'
|
||||
|
||||
import { createLexical } from '../../../../packages/richtext-lexical/src'
|
||||
import { lexicalEditor } from '../../../../packages/richtext-lexical/src'
|
||||
|
||||
export const TextBlock: Block = {
|
||||
fields: [
|
||||
@@ -24,7 +24,7 @@ export const UploadAndRichTextBlock: Block = {
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
editor: createLexical({}),
|
||||
editor: lexicalEditor({}),
|
||||
},
|
||||
],
|
||||
slug: 'uploadAndRichText',
|
||||
|
||||
@@ -5,9 +5,9 @@ import {
|
||||
LinkFeature,
|
||||
TreeviewFeature,
|
||||
UploadFeature,
|
||||
createLexical,
|
||||
lexicalEditor,
|
||||
} from '../../../../packages/richtext-lexical/src'
|
||||
import { createSlate } from '../../../../packages/richtext-slate/src'
|
||||
import { slateEditor } from '../../../../packages/richtext-slate/src'
|
||||
import { TextBlock, UploadAndRichTextBlock } from './blocks'
|
||||
import { loremIpsum } from './loremIpsum'
|
||||
|
||||
@@ -28,7 +28,7 @@ const RichTextFields: CollectionConfig = {
|
||||
{
|
||||
name: 'richTextLexicalCustomFields',
|
||||
type: 'richText',
|
||||
editor: createLexical({
|
||||
editor: lexicalEditor({
|
||||
userConfig(defaultEditorConfig) {
|
||||
defaultEditorConfig.features.push(TreeviewFeature())
|
||||
defaultEditorConfig.features.push(
|
||||
@@ -57,7 +57,7 @@ const RichTextFields: CollectionConfig = {
|
||||
{
|
||||
name: 'caption',
|
||||
type: 'richText',
|
||||
editor: createLexical({}),
|
||||
editor: lexicalEditor({}),
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -77,7 +77,7 @@ const RichTextFields: CollectionConfig = {
|
||||
{
|
||||
name: 'richTextLexical',
|
||||
type: 'richText',
|
||||
editor: createLexical({
|
||||
editor: lexicalEditor({
|
||||
userConfig(defaultEditorConfig) {
|
||||
defaultEditorConfig.features.push(TreeviewFeature())
|
||||
return defaultEditorConfig
|
||||
@@ -122,7 +122,7 @@ const RichTextFields: CollectionConfig = {
|
||||
{
|
||||
name: 'richText',
|
||||
type: 'richText',
|
||||
editor: createSlate({
|
||||
editor: slateEditor({
|
||||
admin: {
|
||||
elements: [
|
||||
'h1',
|
||||
@@ -173,7 +173,7 @@ const RichTextFields: CollectionConfig = {
|
||||
{
|
||||
name: 'richTextCustomFields',
|
||||
type: 'richText',
|
||||
editor: createSlate({
|
||||
editor: slateEditor({
|
||||
admin: {
|
||||
elements: [
|
||||
'h1',
|
||||
@@ -222,7 +222,7 @@ const RichTextFields: CollectionConfig = {
|
||||
admin: {
|
||||
readOnly: true,
|
||||
},
|
||||
editor: createSlate({
|
||||
editor: slateEditor({
|
||||
admin: {
|
||||
elements: [
|
||||
'h1',
|
||||
|
||||
Reference in New Issue
Block a user