chore(richtext-slate): use normal exports for field and cell components
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user