import { JSX } from 'react'; /** * RichTextEditor — a controlled WYSIWYG editor built on tiptap v3. * * Renders an optional formatting toolbar (bold, italic, strike, code, headings, * lists, blockquote, undo/redo) above a ProseMirror-backed editable area. The * document is controlled via the `value` (HTML) / `onChange` pair: external * changes to `value` are synced into the editor without re-emitting updates. * * The toolbar's pressed states and the undo/redo `disabled` flags come from * `useEditorState`, which subscribes to exactly those values. `useEditor` does * not re-render on transactions (the tiptap v3 default), so reading `isActive` * and `can()` directly in the render body left every button stale — toggling * bold with a collapsed cursor arms the mark without changing the document, so no * update event ever brought React back to recompute the state. Subscribing * re-renders only when one of the tracked values actually flips, which is also * cheaper than re-rendering on every keystroke. * * Two effects keep the instance aligned with the props: one pushes an external * `value` change into the document with `emitUpdate: false` (so syncing never * re-emits `onChange`), the other mirrors the `editable` flag. */ export declare function RichTextEditor({ value, onChange, placeholder, editable, toolbar, className, }: RichTextEditorProps): JSX.Element | null; export declare interface RichTextEditorProps { /** Current editor content as an HTML string (controlled). */ value: string; /** Called with the updated HTML whenever the document changes. */ onChange: (html: string) => void; /** Placeholder text shown when the editor is empty. */ placeholder?: string; /** Whether the content is editable. Defaults to `true`. */ editable?: boolean; /** Whether to render the formatting toolbar. Defaults to `true`. */ toolbar?: boolean; /** Extra class names applied to the wrapper element. */ className?: string; } export { }