Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseAssignmentEditorOptions

    Options for the useAssignmentEditor hook.

    Configures the TipTap editor instance with assignment-specific extensions and behavior. The hook manages editor lifecycle including initialization, content updates, and cleanup.

    interface UseAssignmentEditorOptions {
        editable?: boolean;
        extensions?: {
            embeds?: boolean;
            highlight?: boolean;
            links?: boolean;
            tables?: boolean;
            taskLists?: boolean;
            textColor?: boolean;
        };
        initialContent?: JSONContent;
        onBlur?: () => void;
        onContentError?: (error: Error) => void;
        onFocus?: () => void;
        onUpdate?: (content: JSONContent) => void;
        placeholder?: string;
    }
    Index

    Properties

    editable?: boolean

    Whether the editor is editable

    extensions?: {
        embeds?: boolean;
        highlight?: boolean;
        links?: boolean;
        tables?: boolean;
        taskLists?: boolean;
        textColor?: boolean;
    }

    Extension options

    Type Declaration

    • Optionalembeds?: boolean

      Enable inline file embeds (image / pdf / audio / video / whiteboard / midi clip) via the assignment-embed node (default: true). When disabled the editor still parses existing embeds (so old documents round-trip) but the toolbar's insert action and the picker callback are no-ops.

    • Optionalhighlight?: boolean

      Enable highlighting (default: true)

    • Optionallinks?: boolean

      Enable hyperlinks (default: true). URLs are linked as they are typed or pasted; a click opens the link in a new tab, while editing too. Documents containing links require this to be on — with it off they cannot be loaded.

    • Optionaltables?: boolean

      Enable table support (default: true)

    • OptionaltaskLists?: boolean

      Enable task lists (default: true)

    • OptionaltextColor?: boolean

      Enable text color (default: true)

    initialContent?: JSONContent

    Initial content for the editor

    onBlur?: () => void

    Callback when editor is blurred

    onContentError?: (error: Error) => void

    Called when a document cannot be loaded because it contains a node or mark the editor does not support (for example content created with an extension that is now disabled). The editor falls back to an empty document in that case, so this is how a consumer distinguishes "empty" from "could not be shown".

    onFocus?: () => void

    Callback when editor is focused

    onUpdate?: (content: JSONContent) => void

    Callback when content updates

    placeholder?: string

    Placeholder text when empty