platform-bible-react
    Preparing search index...

    Interface FootnoteEditorProps

    Interface containing the types of the properties that are passed to the FootnoteEditor

    interface FootnoteEditorProps {
        classNameForEditor?: string;
        defaultMarkerMenuTrigger: string;
        editorOptions: EditorOptions;
        initialCaretPosition?: FootnoteCaretPosition;
        inline?: boolean;
        localizedStrings: FootnoteEditorLocalizedStrings;
        markerPalette?: FootnoteEditorMarkerPalette;
        noteKey: undefined | string;
        noteOps: undefined | DeltaOpInsertNoteEmbed[];
        onChange?: (noteOps: DeltaOpInsertNoteEmbed[]) => void;
        onClose: () => void;
        onNoteEdit?: () => void;
        parentEditorRef?: RefObject<null | EditorRef>;
        ref?: Ref<FootnoteEditorHandle>;
        scrRef: SerializedVerseRef;
    }
    Index

    Properties

    classNameForEditor?: string

    Class name for styling the Editor this component embeds for the note's text

    defaultMarkerMenuTrigger: string

    Trigger key to open the footnote editor marker menu

    editorOptions: EditorOptions

    View options of the parent editor

    initialCaretPosition?: FootnoteCaretPosition

    Where to place the caret in the note text after the note loads. 'end' matches PT9's caller-click behavior; a utf16Offset supports caret-where-you-clicked from a pane row. Omitting it is the same as 'end' — the editor always places a caret, so a note opened from any surface is ready to type in.

    inline?: boolean

    When true, renders for in-place embedding (e.g. inside a footnotes pane row) instead of a popover: fluid width (no width-lock), no Save/Cancel buttons, and edits apply live to the parent editor (debounced) rather than on explicit save. This mode is fixed for the component's lifetime - toggling it on a mounted instance is unsupported (e.g. the popover width-lock effect never clears a previously-locked style.width when inline flips to true, so the container stays stuck at its old fixed width instead of going fluid).

    false
    

    Localized strings to be passed to the footnote editor component

    markerPalette?: FootnoteEditorMarkerPalette

    Optional marker-palette driver (standard-view host wiring for PT9 parity). When provided in editable marker mode, a typed \ inside this component's own note text opens the same palette the main editor uses instead of the built-in inline markers menu below; when absent, editable mode falls back to pass-through-only behavior (literal typing works, no menu) — a graceful degradation for hosts that haven't wired one up. Never consulted outside editable marker mode — the built-in MarkerMenu popup below owns that path unconditionally.

    noteKey: undefined | string

    The unique note key to identify the note being edited used to apply changes to the note.

    Read at apply time, not at load time: a new key on its own does NOT reload the editor's document, because an inline session's own live-apply re-keys the note it is editing on every apply and reloading there would discard the caret and anything still inside the apply debounce. To load a different note, hand over a new noteOps ARRAY IDENTITY (alongside its key).

    noteOps: undefined | DeltaOpInsertNoteEmbed[]

    Delta ops for the current note being edited that are applied to the note editorial

    onChange?: (noteOps: DeltaOpInsertNoteEmbed[]) => void

    Called on every change to the footnote with the updated note ops. An implementation of this function is required only if the parent does not supply parentEditorRef or if some additional logic is needed to handle the changes. The note ops passed in this function are the full ops for the note, not just the changes since the last call.

    onClose: () => void

    Called when the editing session ends, which is the host's cue to stop rendering this component. Edits are KEPT on every path but popover Cancel:

    • Popover Save: the note is applied to the parent first.
    • Popover Cancel: nothing is applied.
    • A book or chapter change: saved as Save saves (popover), or flushed (inline).
    • Escape in the inline editor (from its text or its own controls): whatever is still inside the live-apply debounce is applied first. An Escape that a layer inside the editor claims to close itself (the marker palette, the editor's right-click menu, a tooltip) does not end the session.
    onNoteEdit?: () => void

    Called whenever the user edits the note in this editor: a content change (the auto-save path), a caller-type change, or a custom-caller change. NOT called for programmatic initialization (mount / initial content load). Carries no data — onChange is the data path — so hosts can use it as a pure liveness signal for the editing session (e.g. refreshing a staleness clock so a long live edit is never treated as an abandoned session).

    parentEditorRef?: RefObject<null | EditorRef>

    Ref to the parent editor. When provided, the footnote editor will apply changes directly to the parent editor, so the client does not need to handle this in the onChange callback.

    Imperative handle for an inline-mode host. See FootnoteEditorHandle.

    This property is unstable and may change shape or disappear without notice

    scrRef: SerializedVerseRef

    The scripture reference for the parent editor