chore(richtext-slate): use normal exports for field and cell components

This commit is contained in:
Alessio Gravili
2024-03-06 18:54:36 -05:00
parent 140d5242cf
commit 11498dcc7f
3 changed files with 4 additions and 8 deletions

View File

@@ -3,11 +3,9 @@ import type { CellComponentProps } from 'payload/types'
import React from 'react'
const RichTextCell: React.FC<CellComponentProps<any[]>> = ({ cellData }) => {
export const RichTextCell: React.FC<CellComponentProps<any[]>> = ({ cellData }) => {
const flattenedText = cellData?.map((i) => i?.children?.map((c) => c.text)).join(' ')
// Limiting the number of characters shown is done in a CSS rule
return <span>{flattenedText}</span>
}
export default RichTextCell

View File

@@ -13,7 +13,7 @@ import { createFeatureMap } from './createFeatureMap.js'
const RichTextEditor = lazy(() => import('./RichText.js'))
const RichTextField: React.FC<
export const RichTextField: React.FC<
FormFieldBase & {
name: string
richTextComponentMap: Map<string, React.ReactNode>
@@ -70,5 +70,3 @@ const RichTextField: React.FC<
</Suspense>
)
}
export default RichTextField

View File

@@ -4,10 +4,10 @@ import { withNullableJSONSchemaType } from 'payload/utilities'
import type { AdapterArguments } from './types.d.ts'
import RichTextCell from './cell/index.js'
import { RichTextCell } from './cell/index.js'
import { richTextRelationshipPromise } from './data/richTextRelationshipPromise.js'
import { richTextValidate } from './data/validation.js'
import RichTextField from './field/index.js'
import { RichTextField } from './field/index.js'
import { getGenerateComponentMap } from './generateComponentMap.js'
import { getGenerateSchemaMap } from './generateSchemaMap.js'