import type { Provider } from '@lexical/yjs'; import type { EditorState, LexicalEditor, SerializedEditorState } from 'lexical'; import type { Doc } from 'yjs'; import type { RichTextEditor as RichTextEditorConfig } from '../../richtext/index.js'; export interface RichTextEditorProps { /** Editor configuration from lexicalEditor() */ editorConfig?: RichTextEditorConfig; /** Initial content (JSON serialized state) */ initialValue?: SerializedEditorState | string | null; /** Callback when content changes */ onChange?: (state: EditorState, editor: LexicalEditor) => void; /** Callback with serialized JSON on change */ onSerializedChange?: (json: SerializedEditorState) => void; /** Placeholder text */ placeholder?: string; /** Additional CSS class */ className?: string; /** Whether editor is editable */ editable?: boolean; /** Auto-focus on mount */ autoFocus?: boolean; /** Custom error handler */ onError?: (error: Error, editor: LexicalEditor) => void; /** Editor namespace (unique identifier) */ namespace?: string; /** Enable collaborative editing mode */ collaborative?: boolean; /** Document ID for collaboration */ documentId?: string; /** Provider factory for Yjs collaboration */ providerFactory?: (id: string, yjsDocMap: Map) => Provider; /** Whether to bootstrap initial state (only for first user) */ shouldBootstrap?: boolean; /** Username for cursor display */ username?: string; /** Cursor color for this user */ cursorColor?: string; /** Client type for collaborative cursor display */ clientType?: 'human' | 'agent'; /** Agent model identifier for cursor labeling */ agentModel?: string; } export { FloatingToolbarPlugin } from './plugins/FloatingToolbarPlugin.js'; export { ToolbarPlugin } from './plugins/ToolbarPlugin.js'; export declare function RichTextEditor({ editorConfig, initialValue, onChange, onSerializedChange, placeholder, className, editable, autoFocus, onError, namespace, collaborative, documentId, providerFactory, shouldBootstrap, username, cursorColor, clientType, agentModel, }: RichTextEditorProps): import("react").JSX.Element; export declare const richTextEditorStyles = "\n.revealui-rich-text-editor {\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n font-family: system-ui, -apple-system, sans-serif;\n}\n\n.editor-toolbar {\n display: flex;\n gap: 4px;\n padding: 8px;\n border-bottom: 1px solid #e2e8f0;\n background: #f8fafc;\n}\n\n.editor-toolbar--floating {\n border-bottom: none;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n background: white;\n padding: 6px;\n transition: opacity 0.2s ease;\n}\n\n.toolbar-btn {\n padding: 6px 10px;\n border: 1px solid #e2e8f0;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 14px;\n transition: all 0.15s ease;\n}\n\n.toolbar-btn:hover {\n background: #f1f5f9;\n}\n\n.toolbar-btn.active {\n background: #3b82f6;\n color: white;\n border-color: #3b82f6;\n}\n\n.editor-container {\n position: relative;\n min-height: 150px;\n}\n\n.editor-input {\n padding: 16px;\n outline: none;\n min-height: 150px;\n}\n\n.editor-placeholder {\n position: absolute;\n top: 16px;\n left: 16px;\n color: #94a3b8;\n pointer-events: none;\n user-select: none;\n}\n\n.editor-paragraph {\n margin: 0 0 8px 0;\n}\n\n.editor-heading-h1 { font-size: 2em; font-weight: bold; margin: 0 0 12px 0; }\n.editor-heading-h2 { font-size: 1.5em; font-weight: bold; margin: 0 0 10px 0; }\n.editor-heading-h3 { font-size: 1.25em; font-weight: bold; margin: 0 0 8px 0; }\n.editor-heading-h4 { font-size: 1em; font-weight: bold; margin: 0 0 8px 0; }\n.editor-heading-h5 { font-size: 0.875em; font-weight: bold; margin: 0 0 8px 0; }\n.editor-heading-h6 { font-size: 0.75em; font-weight: bold; margin: 0 0 8px 0; }\n\n.editor-quote {\n border-left: 4px solid #e2e8f0;\n padding-left: 16px;\n margin: 0 0 8px 0;\n color: #64748b;\n}\n\n.editor-list-ol { list-style: decimal; padding-left: 24px; margin: 0 0 8px 0; }\n.editor-list-ul { list-style: disc; padding-left: 24px; margin: 0 0 8px 0; }\n.editor-listitem { margin: 4px 0; }\n\n.editor-link { color: #3b82f6; text-decoration: underline; }\n\n.editor-text-bold { font-weight: bold; }\n.editor-text-italic { font-style: italic; }\n.editor-text-underline { text-decoration: underline; }\n.editor-text-strikethrough { text-decoration: line-through; }\n.editor-text-code {\n background: #f1f5f9;\n padding: 2px 4px;\n border-radius: 4px;\n font-family: monospace;\n}\n.editor-text-subscript { vertical-align: sub; font-size: smaller; }\n.editor-text-superscript { vertical-align: super; font-size: smaller; }\n\n.editor-code {\n background: #1e293b;\n color: #e2e8f0;\n padding: 16px;\n border-radius: 4px;\n font-family: monospace;\n overflow-x: auto;\n margin: 8px 0;\n}\n\n.collab-cursors-container {\n position: relative;\n pointer-events: none;\n}\n\n.cursor-agent {\n animation: cursor-agent-pulse 2s ease-in-out infinite;\n}\n\n@keyframes cursor-agent-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n}\n\n.cursor-inactive {\n opacity: 0.2;\n transition: opacity 1s ease-out;\n}\n"; export default RichTextEditor; //# sourceMappingURL=RichTextEditor.d.ts.map