@eigenpal/docx-editor-core/prosemirror/tableResize
Functions(6)
commitColumnResize
Bake a column-resize into the PM doc: update the table's `columnWidths` attr and every cell at `colIdx` / `colIdx + 1` in every row.
declare function commitColumnResize(view: EditorView, opts: {
pmStart: number;
colIdx: number;
newLeft: number;
newRight: number;
}): void;commitRightEdgeResize
Bake a right-edge resize into the PM doc: grow only the last column. Updates `columnWidths[colIdx]` and the cell at `colIdx` in every row.
declare function commitRightEdgeResize(view: EditorView, opts: {
pmStart: number;
colIdx: number;
newWidth: number;
}): void;commitRowResize
Bake a row-resize into the PM doc: update the target row's `height` + `heightRule`.
declare function commitRowResize(view: EditorView, opts: {
pmStart: number;
rowIdx: number;
newHeight: number;
}): void;readColumnWidthAt
Read the last-column width (the one being resized from the table's right edge).
declare function readColumnWidthAt(view: EditorView, pmStart: number, colIndex: number): number | null;readColumnWidths
Read the [left, right] column widths at `colIndex` in the table starting at `pmStart`.
declare function readColumnWidths(view: EditorView, pmStart: number, colIndex: number): {
left: number;
right: number;
} | null;readRowHeight
Read the row height (in twips) for `rowIndex` in the table starting at `pmStart`. Returns null if the row has no explicit height — the caller can fall back to measuring the rendered DOM cell.
declare function readRowHeight(view: EditorView, pmStart: number, rowIndex: number): number | null;Variables(3)
MIN_CELL_WIDTH_TWIPS
Minimum column width (~0.2").
MIN_CELL_WIDTH_TWIPS = 300MIN_ROW_HEIGHT_TWIPS
Minimum row height (~0.14").
MIN_ROW_HEIGHT_TWIPS = 200TWIPS_PER_PIXEL
1px ≈ 15 twips at 96dpi (20 twips/pt × 72pt/in ÷ 96px/in).
TWIPS_PER_PIXEL = 15