import React from "react"; import { type PersistedEditorDocument, type ClipboardDiagnosticReport } from "smartrte-core/foundation"; import type { MediaProvider } from "../mediaProvider.js"; import type { VersionProvider } from "../versionProvider.js"; import type { CommentProvider } from "../commentProvider.js"; import type { SuggestionProvider } from "../suggestionProvider.js"; import { type MediaPickerComponent } from "./MediaPicker.js"; import type { EditorCapabilityPreset } from "../capabilityPresets.js"; import { type ToolbarTools } from "../toolbarTools.js"; import { CanonicalEditorRuntime, type SmartEditorChange, type SmartEditorHandle } from "../canonicalEditorRuntime.js"; export interface CanonicalAuthorityEditorProps { /** Initial value only. Later replacements must use SmartEditorHandle.replaceValue. */ defaultValue?: string | PersistedEditorDocument; /** * Which built-in plugins this instance is constructed with - see * capabilityPresets.ts. Construction-time only, matching `defaultValue`'s * own uncontrolled-after-mount contract (the underlying runtime is * created once and retained; changing this prop on an already-mounted * instance has no effect). Defaults to "full" - every existing consumer * that never sets this is unaffected. */ preset?: EditorCapabilityPreset; onChange?: (change: SmartEditorChange) => void; /** Transitional serialization callback for hosts that still persist HTML. */ onHtmlChange?: (html: string) => void; /** * Bakes real KaTeX-rendered HTML into onHtmlChange's formula elements * instead of leaving them as empty placeholders - see * canonicalEditorRuntime.ts's CanonicalEditorRuntimeOptions for the full * rationale. Construction-time only, same contract as `preset`. */ renderFormulaHtml?: boolean; onClipboardDiagnostic?: (report: ClipboardDiagnosticReport) => void; /** Host-owned upload/search/remove boundary for canonical media insertion. */ mediaProvider?: MediaProvider; /** Replaceable picker; the default only selects a local file. Used for video/audio, and for images when mediaManager is false. */ mediaPicker?: MediaPickerComponent; /** * Phase 11.5 ยง2.1: a library/search/duplicate-detection picker for * images, replacing the bare file-input default. Defaults to true * (MediaManager, adapted via mediaManagerAdapterFrom) whenever * mediaProvider is supplied; set to false to keep the simple mediaPicker * for images too. */ mediaManager?: boolean; /** * Per-tool toolbar visibility - "developers should be able to hide tools * which are not for their use" (docs/bugs/per-tool-toolbar-visibility.md). * Every tool defaults to visible; a host only needs to name the ones they * want off (`tools={{ video: false, versionHistory: false }}`). Composes * with, never overrides, the deeper existing gates: a tool whose required * provider is absent (`versionProvider`/`commentProvider`/ * `suggestionProvider`/`mediaProvider`) or whose plugin was excluded via * `preset` (e.g. `insertTable` under `preset="simple"`) still won't * render even if explicitly set to `true` here - see ToolbarTools.ts's * own doc comment for the full contract and scoping decisions. */ tools?: Partial; /** Host-owned save/list/load/remove boundary for document version history. */ versionProvider?: VersionProvider; /** Host-owned save/list/remove boundary for comment threads. Absent hides the comment toolbar buttons and markers entirely, mirroring versionProvider's absent-disables-the-feature contract. */ commentProvider?: CommentProvider; /** * Host-owned save/list/remove boundary for *structural* suggestions only * (see suggestionProvider.ts) - inline suggestions need no provider since * they are marks embedded in the document itself. Absent hides the * suggestion toolbar buttons, markers, and panel entirely. */ suggestionProvider?: SuggestionProvider; /** Attributed to new comment replies and suggestions. Defaults to "anonymous" when absent. */ authorId?: string; placeholder?: string; minHeight?: number | string; maxHeight?: number | string; readOnly?: boolean; className?: string; /** Test/diagnostic hook; not part of the editing contract. */ onRuntime?: (runtime: CanonicalEditorRuntime) => void; } export declare const CanonicalAuthorityEditor: React.ForwardRefExoticComponent>;