fix(richtext-*): fix client features were not loaded properly, improve performance of LexicalProvider, slate cell component was non-functional, support richtext adapter Cell RSCs (#6573)

This commit is contained in:
Alessio Gravili
2024-05-30 16:26:06 -04:00
committed by GitHub
parent f41bb05c70
commit 5cb49c3307
13 changed files with 163 additions and 121 deletions

View File

@@ -1,9 +1,11 @@
'use client'
import type { DefaultCellComponentProps } from 'payload/types'
import { useTableCell } from '@payloadcms/ui/elements/Table'
import React from 'react'
export const RichTextCell: React.FC<DefaultCellComponentProps<any[]>> = ({ cellData }) => {
export const RichTextCell: React.FC<DefaultCellComponentProps<any[]>> = () => {
const { cellData } = useTableCell()
const flattenedText = cellData?.map((i) => i?.children?.map((c) => c.text)).join(' ')
// Limiting the number of characters shown is done in a CSS rule