feat(richtext-lexical): export serialized inline blocks and table node types
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
import type {
|
||||
SerializedTableCellNode as _SerializedTableCellNode,
|
||||
SerializedTableNode as _SerializedTableNode,
|
||||
SerializedTableRowNode as _SerializedTableRowNode,
|
||||
} from '@lexical/table'
|
||||
import type { Spread } from 'lexical'
|
||||
import type { Config, Field } from 'payload'
|
||||
|
||||
import { TableCellNode, TableNode, TableRowNode } from '@lexical/table'
|
||||
@@ -23,6 +29,27 @@ const fields: Field[] = [
|
||||
required: true,
|
||||
},
|
||||
]
|
||||
|
||||
export type SerializedTableCellNode = Spread<
|
||||
{
|
||||
type: 'tablecell'
|
||||
},
|
||||
_SerializedTableCellNode
|
||||
>
|
||||
|
||||
export type SerializedTableNode = Spread<
|
||||
{
|
||||
type: 'table'
|
||||
},
|
||||
_SerializedTableNode
|
||||
>
|
||||
|
||||
export type SerializedTableRowNode = Spread<
|
||||
{
|
||||
type: 'tablerow'
|
||||
},
|
||||
_SerializedTableRowNode
|
||||
>
|
||||
export const EXPERIMENTAL_TableFeature = createServerFeature({
|
||||
feature: async ({ config, isRoot }) => {
|
||||
const validRelationships = config.collections.map((c) => c.slug) || []
|
||||
|
||||
@@ -9,6 +9,12 @@ import type {
|
||||
|
||||
import type { SerializedQuoteNode } from './features/blockquote/feature.server.js'
|
||||
import type { SerializedBlockNode } from './features/blocks/nodes/BlocksNode.js'
|
||||
import type { SerializedInlineBlockNode } from './features/blocks/nodes/InlineBlocksNode.js'
|
||||
import type {
|
||||
SerializedTableCellNode,
|
||||
SerializedTableNode,
|
||||
SerializedTableRowNode,
|
||||
} from './features/experimental_table/feature.server.js'
|
||||
import type { SerializedHeadingNode } from './features/heading/feature.server.js'
|
||||
import type { SerializedHorizontalRuleNode } from './features/horizontalRule/nodes/HorizontalRuleNode.js'
|
||||
import type { SerializedAutoLinkNode, SerializedLinkNode } from './features/link/nodes/types.js'
|
||||
@@ -21,11 +27,15 @@ export type {
|
||||
SerializedBlockNode,
|
||||
SerializedHeadingNode,
|
||||
SerializedHorizontalRuleNode,
|
||||
SerializedInlineBlockNode,
|
||||
SerializedLinkNode,
|
||||
SerializedListItemNode,
|
||||
SerializedListNode,
|
||||
SerializedQuoteNode,
|
||||
SerializedRelationshipNode,
|
||||
SerializedTableCellNode,
|
||||
SerializedTableNode,
|
||||
SerializedTableRowNode,
|
||||
SerializedUploadNode,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user