New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.0.2

@eigenpal/docx-editor-core/layout-bridge/tableInsertHover

Table-insert "+" hover hit-test.

Pure DOM logic for the floating row/column insert button that shows when the mouse is near the left or top edge of a layout table. Lives in core so React + Vue + any future adapter can share the hit-test and just wire up their own UI rendering of the button.

The function is gated by `hfEditMode`: tables in inactive HF/body regions don't surface the affordance. A header table only matches when the user is editing the header; a body table only matches when not in any HF edit mode.

Functions(1)

Detect whether a mousemove should surface a row/column insert "+" button.

Returns the button anchor + target cell PM position, or `null` if the mouse isn't near a row's left edge or a column's top edge — or if the relevant table belongs to an inactive HF/body region.

declare function detectTableInsertHover(input: TableInsertHoverInput): TableInsertHoverHit | null;

Type aliases(2)

type TableInsertHoverHit = {
    type: 'row' | 'column';
    clientX: number;
    clientY: number;
    cellPmPos: number;
};
type TableInsertHoverInput = {
    mouseX: number;
    mouseY: number;
    pagesContainer: HTMLElement;
    target: HTMLElement;
    hfEditMode: 'header' | 'footer' | null;
    edgeProximity?: number;
};

Variables(2)

Table-insert "+" hover hit-test.

Pure DOM logic for the floating row/column insert button that shows when the mouse is near the left or top edge of a layout table. Lives in core so React + Vue + any future adapter can share the hit-test and just wire up their own UI rendering of the button.

The function is gated by `hfEditMode`: tables in inactive HF/body regions don't surface the affordance. A header table only matches when the user is editing the header; a body table only matches when not in any HF edit mode.

TABLE_INSERT_EDGE_PROXIMITY = 30
TABLE_INSERT_HIDE_DELAY_MS = 200