Sanity Library Reference Docs
    Preparing search index...

    Type Alias EditorChangeBeta

    EditorChange:
        | { event: ReactFocusEvent<HTMLDivElement>; type: "blur" }
        | {
            data?: unknown;
            description: string;
            level: "warning" | "error";
            name: string;
            type: "error";
        }
        | { event: ReactFocusEvent<HTMLDivElement>; type: "focus" }
        | {
            resolution: InvalidValueResolution | null;
            type: "invalidValue";
            value: PortableTextBlock[] | undefined;
        }
        | { isLoading: boolean; type: "loading" }
        | {
            patches: Patch[];
            snapshot: PortableTextBlock[] | undefined;
            type: "mutation";
        }
        | { patch: Patch; type: "patch" }
        | { type: "ready" }
        | { type: "connection"; value: "online" | "offline" }
        | {
            patches: Patch[];
            snapshot: PortableTextBlock[] | undefined;
            type: "redo";
        }
        | { selection: EditorSelection; type: "selection" }
        | {
            patches: Patch[];
            snapshot: PortableTextBlock[] | undefined;
            type: "undo";
        }
        | { previousValue: PortableTextBlock[]; type: "unset" }
        | { type: "value"; value: PortableTextBlock[] | undefined }

    Studio-owned change types emitted by the Portable Text editor.

    These types mirror the editor's internal event types but are owned by Studio to decouple Studio's public callback interface from the editor's internals. The EditorChangePlugin in PortableTextInput.tsx translates EditorEmittedEvents into these change types.

    error and loading stay in the union for compatibility. @portabletext/editor v8 no longer emits the events that produced them.