@umbraco-cms/backoffice
    Preparing search index...

    Interface EditorEvents

    interface EditorEvents {
        beforeCreate: { editor: Editor };
        beforeTransaction: {
            editor: Editor;
            nextState: EditorState;
            transaction: Transaction;
        };
        blur: { editor: Editor; event: FocusEvent; transaction: Transaction };
        contentError: {
            disableCollaboration: () => void;
            editor: Editor;
            error: Error;
        };
        create: { editor: Editor };
        delete: {
            combinedTransform: Transform;
            deletedRange: Range;
            editor: Editor;
            from: number;
            newRange: Range;
            partial: boolean;
            to: number;
            transaction: Transaction;
        } & (
            | { newFrom: number; newTo: number; node: Node; type: "node" }
            | { mark: Mark; type: "mark" }
        );
        destroy: void;
        drop: { editor: Editor; event: DragEvent; moved: boolean; slice: Slice };
        focus: { editor: Editor; event: FocusEvent; transaction: Transaction };
        mount: { editor: Editor };
        paste: { editor: Editor; event: ClipboardEvent; slice: Slice };
        selectionUpdate: { editor: Editor; transaction: Transaction };
        transaction: {
            appendedTransactions: Transaction[];
            editor: Editor;
            transaction: Transaction;
        };
        unmount: { editor: Editor };
        update: {
            appendedTransactions: Transaction[];
            editor: Editor;
            transaction: Transaction;
        };
    }
    Index

    Properties

    beforeCreate: { editor: Editor }

    Type Declaration

    • editor: Editor

      The editor instance

    beforeTransaction: {
        editor: Editor;
        nextState: EditorState;
        transaction: Transaction;
    }

    Type Declaration

    • editor: Editor

      The editor instance

    • nextState: EditorState

      The next state of the editor after the transaction is applied

    • transaction: Transaction

      The transaction that will be applied

    blur: { editor: Editor; event: FocusEvent; transaction: Transaction }

    Type Declaration

    • editor: Editor

      The editor instance

    • event: FocusEvent

      The focus event

    • transaction: Transaction

      The transaction that caused the blur

    contentError: { disableCollaboration: () => void; editor: Editor; error: Error }

    Type Declaration

    • disableCollaboration: () => void

      If called, will re-initialize the editor with the collaboration extension removed. This will prevent syncing back deletions of content not present in the current schema.

    • editor: Editor

      The editor instance

    • error: Error

      The error that occurred while parsing the content

    create: { editor: Editor }

    Type Declaration

    • editor: Editor

      The editor instance

    delete: {
        combinedTransform: Transform;
        deletedRange: Range;
        editor: Editor;
        from: number;
        newRange: Range;
        partial: boolean;
        to: number;
        transaction: Transaction;
    } & (
        | { newFrom: number; newTo: number; node: Node; type: "node" }
        | { mark: Mark; type: "mark" }
    )

    Type Declaration

    • combinedTransform: Transform

      The combined transform (including all appended transactions) that caused the deletion

    • deletedRange: Range

      The range of the deleted content (before the deletion)

    • editor: Editor

      The editor instance

    • from: number

      This is the start position of the mark in the document (before the deletion)

    • newRange: Range

      The new range of positions of where the deleted content was in the new document (after the deletion)

    • partial: boolean

      Whether the deletion was partial (only a part of this content was deleted)

    • to: number

      This is the end position of the mark in the document (before the deletion)

    • transaction: Transaction

      The transaction that caused the deletion

    • { newFrom: number; newTo: number; node: Node; type: "node" }
      • newFrom: number

        The new start position of the node in the document (after the deletion)

      • newTo: number

        The new end position of the node in the document (after the deletion)

      • node: Node

        The node which the deletion occurred in

        This can be a parent node of the deleted content

      • type: "node"

        The content that was deleted

    • { mark: Mark; type: "mark" }
      • mark: Mark

        The mark that was deleted

      • type: "mark"

        The content that was deleted

    destroy: void
    drop: { editor: Editor; event: DragEvent; moved: boolean; slice: Slice }

    Type Declaration

    • editor: Editor

      The editor instance

    • event: DragEvent

      The drag event

    • moved: boolean

      Whether the content was moved (true) or copied (false)

    • slice: Slice

      The slice that was dropped

    focus: { editor: Editor; event: FocusEvent; transaction: Transaction }

    Type Declaration

    • editor: Editor

      The editor instance

    • event: FocusEvent

      The focus event

    • transaction: Transaction

      The transaction that caused the focus

    mount: { editor: Editor }

    Type Declaration

    • editor: Editor

      The editor instance

    paste: { editor: Editor; event: ClipboardEvent; slice: Slice }

    Type Declaration

    • editor: Editor

      The editor instance

    • event: ClipboardEvent

      The clipboard event

    • slice: Slice

      The slice that was pasted

    selectionUpdate: { editor: Editor; transaction: Transaction }

    Type Declaration

    • editor: Editor

      The editor instance

    • transaction: Transaction

      The transaction that caused the selection update

    transaction: {
        appendedTransactions: Transaction[];
        editor: Editor;
        transaction: Transaction;
    }

    Type Declaration

    • appendedTransactions: Transaction[]

      Appended transactions that were added to the initial transaction by plugins

    • editor: Editor

      The editor instance

    • transaction: Transaction

      The initial transaction

    unmount: { editor: Editor }

    Type Declaration

    • editor: Editor

      The editor instance

    update: {
        appendedTransactions: Transaction[];
        editor: Editor;
        transaction: Transaction;
    }

    Type Declaration

    • appendedTransactions: Transaction[]

      Appended transactions that were added to the initial transaction by plugins

    • editor: Editor

      The editor instance

    • transaction: Transaction

      The transaction that caused the update