/** * RevealUI Rich Text Editor - Lexical Integration * * Uses vanilla Lexical npm packages for rich text editing. * Provides an admin-compatible API for configuring the editor. */ export type { EditorState, LexicalEditor, LexicalNode, SerializedEditorState, SerializedLexicalNode, } from 'lexical'; export { $createParagraphNode, $createTextNode, $getRoot, $getSelection, $isRangeSelection, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, createEditor, FORMAT_TEXT_COMMAND, } from 'lexical'; export type { RichTextContent, RscEntryLexicalCell, RscEntryLexicalField, } from './exports/server/rsc.js'; export { serializeLexicalState } from './exports/server/rsc.js'; export interface RichTextFeature { name: string; key: string; type: 'mark' | 'block' | 'inline' | 'toolbar' | 'utility'; tag?: string; position?: string; options?: Record; } export interface RichTextEditor { editorType: 'lexical'; features: RichTextFeature[]; outputFormat?: 'html' | 'json'; sanitize?: boolean; validate?: boolean; } export declare const BoldFeature: () => RichTextFeature; export declare const ItalicFeature: () => RichTextFeature; export declare const UnderlineFeature: () => RichTextFeature; export declare const StrikethroughFeature: () => RichTextFeature; export declare const CodeFeature: () => RichTextFeature; export declare const SubscriptFeature: () => RichTextFeature; export declare const SuperscriptFeature: () => RichTextFeature; export declare const FixedToolbarFeature: () => RichTextFeature; export declare const InlineToolbarFeature: () => RichTextFeature; export declare const FloatingToolbarFeature: () => RichTextFeature; export declare const HeadingFeature: (options?: { enabledHeadingSizes?: string[]; }) => RichTextFeature; export declare const ParagraphFeature: () => RichTextFeature; export declare const ListFeature: (options?: { ordered?: boolean; unordered?: boolean; }) => RichTextFeature; export declare const QuoteFeature: () => RichTextFeature; export declare const BlockquoteFeature: () => RichTextFeature; export declare const CodeBlockFeature: () => RichTextFeature; export declare const LinkFeature: (options?: { enabledCollections?: string[]; fields?: unknown[]; allowExternalLinks?: boolean; }) => RichTextFeature; export declare const UploadFeature: (options?: { collections?: Record; }) => RichTextFeature; export declare const TreeViewFeature: () => RichTextFeature; export declare const HistoryFeature: () => RichTextFeature; export declare const RelationshipFeature: (options?: { enabledCollections?: string[]; allowMultiple?: boolean; }) => RichTextFeature; export declare const BlocksFeature: (options?: { blocks?: unknown[]; }) => RichTextFeature; export declare const HorizontalRuleFeature: () => RichTextFeature; export declare const ChecklistFeature: () => RichTextFeature; export declare const OrderedListFeature: () => RichTextFeature; export declare const UnorderedListFeature: () => RichTextFeature; export declare const IndentFeature: () => RichTextFeature; export declare const AlignFeature: () => RichTextFeature; export declare const InlineCodeFeature: () => RichTextFeature; /** * Creates a Lexical editor configuration */ export declare const lexicalEditor: (config?: { features?: ((args: { defaultFeatures: RichTextFeature[]; rootFeatures: RichTextFeature[]; }) => RichTextFeature[]) | RichTextFeature[]; }) => RichTextEditor; export interface SerializedBlockNode> { type: string; blockType?: string; version: number; fields?: T; } export interface SerializedTextNode { type: 'text'; text: string; format: number; version: number; } export interface SerializedParagraphNode { type: 'paragraph'; children: SerializedTextNode[]; version: number; } export interface SerializedHeadingNode { type: 'heading'; tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; children: SerializedTextNode[]; version: number; } export interface SerializedListNode { type: 'list'; listType: 'bullet' | 'number' | 'check'; children: SerializedListItemNode[]; version: number; } export interface SerializedListItemNode { type: 'listitem'; children: SerializedTextNode[]; version: number; } export interface SerializedQuoteNode { type: 'quote'; children: SerializedTextNode[]; version: number; } export interface SerializedCodeNode { type: 'code'; children: SerializedTextNode[]; version: number; } export interface SerializedLinkNode { type: 'link'; url: string; children: SerializedTextNode[]; version: number; fields?: { url?: string; newTab?: boolean; linkType?: 'internal' | 'external'; doc?: { value: string; relationTo: string; }; }; } export interface SerializedLinebreakNode { type: 'linebreak'; version: number; } export interface SerializedUploadNode { type: 'upload'; relationTo: string; value: unknown; version: number; } export type DefaultNodeTypes = SerializedTextNode | SerializedParagraphNode | SerializedHeadingNode | SerializedListNode | SerializedListItemNode | SerializedQuoteNode | SerializedCodeNode | SerializedLinkNode | SerializedLinebreakNode | SerializedUploadNode; export interface ServerFeatureConfig { feature: { ClientFeature?: string | React.ComponentType; nodes?: Array<{ node: unknown; }>; generateSchemaMap?: () => Map; }; key: string; } export declare const createServerFeature: (config: ServerFeatureConfig) => ServerFeatureConfig; //# sourceMappingURL=index.d.ts.map