import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'; import type { ClientField, DefaultServerCellComponentProps, LabelFunction, RichTextAdapter, RichTextFieldClient, RichTextFieldClientProps, SanitizedConfig, ServerFieldBase, StaticLabel } from 'payload'; import type { BaseClientFeatureProps, FeatureProviderProviderClient } from './features/typesClient.js'; import type { FeatureProviderServer } from './features/typesServer.js'; import type { SanitizedServerEditorConfig } from './lexical/config/types.js'; import type { InitialLexicalFormState } from './utilities/buildInitialState.js'; export type LexicalFieldAdminProps = { /** * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false */ hideGutter?: boolean; /** * Controls if the insert paragraph at the end button should be hidden. @default false */ hideInsertParagraphAtEnd?: boolean; /** * Changes the placeholder text in the editor if no content is present. */ placeholder?: LabelFunction | StaticLabel; }; export type LexicalFieldAdminClientProps = { placeholder?: string; } & Omit; export type FeaturesInput = (({ defaultFeatures, rootFeatures, }: { /** * This opinionated array contains all "recommended" default features. * * @Example * * ```ts * editor: lexicalEditor({ * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()], * }) * ``` */ defaultFeatures: FeatureProviderServer[]; /** * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts). * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty. * * @Example * * ```ts * editor: lexicalEditor({ * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()], * }) * ``` */ rootFeatures: FeatureProviderServer[]; }) => FeatureProviderServer[]) | FeatureProviderServer[]; export type LexicalEditorProps = { admin?: LexicalFieldAdminProps; features?: FeaturesInput; lexical?: LexicalEditorConfig; }; export type LexicalRichTextAdapter = { editorConfig: SanitizedServerEditorConfig; features: FeatureProviderServer[]; } & RichTextAdapter; export type LexicalRichTextAdapterProvider = /** * This is being called during the payload sanitization process */ ({ config, isRoot, parentIsLocalized, }: { config: SanitizedConfig; isRoot?: boolean; parentIsLocalized: boolean; }) => Promise; export type SingleFeatureClientSchemaMap = { [key: string]: ClientField[]; }; export type FeatureClientSchemaMap = { [featureKey: string]: SingleFeatureClientSchemaMap; }; export type LexicalRichTextFieldProps = { admin?: LexicalFieldAdminClientProps; clientFeatures: { [featureKey: string]: { clientFeatureProps?: object; clientFeatureProvider?: FeatureProviderProviderClient; }; }; featureClientImportMap: Record; featureClientSchemaMap: FeatureClientSchemaMap; initialLexicalFormState: InitialLexicalFormState; lexicalEditorConfig: LexicalEditorConfig | undefined; } & Pick & RichTextFieldClientProps; export type LexicalRichTextCellProps = DefaultServerCellComponentProps, SerializedEditorState>; export type AdapterProps = { editorConfig: SanitizedServerEditorConfig; }; export type GeneratedFeatureProviderComponent = { clientFeature: FeatureProviderProviderClient; clientFeatureProps: BaseClientFeatureProps; }; //# sourceMappingURL=types.d.ts.map