← All packages

@searsuite/sear-plugin-resize

Drag to resize

Begin, update, and end commands keep a drag interaction separate from the final size change.

interfaceSheetResizeDragInitialSize

One captured size at the start of a resize drag.

interfaceSheetUpdateResizeDragInput

Public input for moving an active resize drag session.

variableBeginSheetResizeDragCommand
BeginSheetResizeDragCommand: SheetCommandDefinition<SheetBeginResizeDragInput, SheetCommandResult>

Command that starts resize drag-session state through the command bus.

variableEndSheetResizeDragCommand
EndSheetResizeDragCommand: SheetCommandDefinition<void, SheetCommandResult>

Command that clears resize drag-session state through the command bus.

variableUpdateSheetResizeDragCommand
UpdateSheetResizeDragCommand: SheetCommandDefinition<SheetUpdateResizeDragInput, SheetCommandResult>

Command that updates resize drag-session state through the command bus.

functionregisterSheetResizeDragCommands
registerSheetResizeDragCommands(commands: SheetCommandBus, controller: SheetResizeDragCommandController): void

Registers resize drag-session command factories on one editor command bus.

commands

Command bus owned by the current sheet editor.

controller

Resize plugin controller that owns local drag-session state.

Hide and unhide rows or columns

Hide commands retain the original dimensions so an unhide operation can restore them.

interfaceSheetHideColumnsInput

Public input for hiding columns starting at index.

interfaceSheetHideRowsInput

Public input for hiding rows starting at index.

interfaceSheetUnhideColumnsInput

Public input for unhiding columns starting at index.

interfaceSheetUnhideRowsInput

Public input for unhiding rows starting at index.

variableHideSheetColumnsCommand
HideSheetColumnsCommand: SheetCommandDefinition<SheetHideColumnsInput, SheetCommandResult>

Hides one or more columns by resizing them to zero.

variableHideSheetRowsCommand
HideSheetRowsCommand: SheetCommandDefinition<SheetHideRowsInput, SheetCommandResult>

Hides one or more rows by resizing them to zero.

variableSheetColumnHiddenOriginalSizesFieldKey
SheetColumnHiddenOriginalSizesFieldKey: "sheet.resize.columnHiddenOriginalSizes"

DataEngine field for original dimensions of hidden columns owned by SheetResizePlugin.

variableSheetRowHiddenOriginalSizesFieldKey
SheetRowHiddenOriginalSizesFieldKey: "sheet.resize.rowHiddenOriginalSizes"

DataEngine field for original dimensions of hidden rows owned by SheetResizePlugin.

variableUnhideSheetColumnsCommand
UnhideSheetColumnsCommand: SheetCommandDefinition<SheetUnhideColumnsInput, SheetCommandResult>

Restores one or more hidden columns from resize-owned hidden-size state.

variableUnhideSheetRowsCommand
UnhideSheetRowsCommand: SheetCommandDefinition<SheetUnhideRowsInput, SheetCommandResult>

Restores one or more hidden rows from resize-owned hidden-size state.

functioncreateHideColumnOperations
createHideColumnOperations(input: SheetHideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column hide operations from public command input.

functioncreateHideRowOperations
createHideRowOperations(input: SheetHideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row hide operations from public command input.

functioncreateUnhideColumnOperations
createUnhideColumnOperations(input: SheetUnhideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "getDefaultColumnSize" | "readColumnHiddenOriginalSize" | "readColumnSize">): Operation[]

Creates column unhide operations from public command input.

functioncreateUnhideRowOperations
createUnhideRowOperations(input: SheetUnhideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">): Operation[]

Creates row unhide operations from public command input.

functionreadSheetColumnHiddenOriginalSizes
readSheetColumnHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original column sizes captured while columns are hidden.

functionreadSheetRowHiddenOriginalSizes
readSheetRowHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original row sizes captured while rows are hidden.

Set row and column sizes

Resize commands write row or column dimensions; read helpers expose the values used by rendering.

classSheetResizePlugin
class SheetResizePlugin extends Plugin<SearCoreSheet, CellProperties, ResizeState>

Owns row and column resize state, interaction, and visual feedback.

constructorSheetResizePlugin(coordEngine: CoordinateEngine, cursorEngine: CursorEngine, textShaper: TextShaper, displayTextRegistry: CellDisplayTextReader, pointerCapture: PointerCapture, commands?: SheetCommandBus, platform?: Platform, cursorRegistry?: CursorRegistry, dimensions?: SheetResizeDimensions | null, commandDataEngine?: DataEngine): SheetResizePlugin
propertydepth: number

Draw and event ordering hint; lower values run earlier.

propertyreadonly documentState: { capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix }; key: string; serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number> }; key: string } | { capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix }; key: string; serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number> }; key: string } | { capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string }[]

SheetResizePlugin owns persisted dimension export modules.

propertyinterestedIn: string[]

Resize owns dimension OT and tracks sheet-structure shifts.

propertyreadonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Resize transactions share the registered MatrixOT algebra.

propertyreadonly documentState: { capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix }; key: string; serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number> }; key: string } | { capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix }; key: string; serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number> }; key: string } | { capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string }[]static

Document-state export contributions for resize-owned dimensions.

propertyreadonly pluginKey: PluginKeystatic

Stable plugin key shared by all resize plugin instances.

propertyreadonly symbol: symbolstatic

DI token for resolving SheetResizePlugin.

methodapply(pluginState: ResizeState, transaction: Transaction): ResizeState | null

Applies dimension and hidden-size operations owned by the resize plugin.

ReturnsUpdated plugin state, or null when the transaction does not affect dimensions.

pluginState

Current resize plugin state.

transaction

Transaction containing resize or sheet-structure operations.

methodbeginResizeDrag(input: SheetBeginResizeDragInput): void

Applies a command-owned resize drag start to local interaction state.

methoddirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null

Marks the visible viewport dirty after row or column resize operations.

ReturnsViewport dirty rectangle when a resize occurred, otherwise null.

searCore

Sheet core containing render and scroll services.

transaction

Transaction to inspect for resize operations.

methodendResizeDrag(): void

Clears command-owned resize drag state.

methodgetPluginConfig(): unknown

Returns the plugin config.

methodgetResizeState(): ResizeDragState

Returns a detached view of the local drag session.

methodonDblClick(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

methodonMouseDown(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

methodonMouseMove(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

methodonMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Handles the end of a pointer press sequence.

methodregisterCommands(commands: SheetCommandBus): void

Registers the commands.

methodregisterState(): { dataEngine: { dataView: { fieldKey: string; select: (resizeState: unknown): unknown; viewKey: string }[] }; key: PluginKey; state: ResizeState }[]

Registers the state.

methodrender(searCore: SearCoreSheet): Node<CellProperties>[] | null

Renders SheetResizePlugin scene output.

methodsetResizeDimensions(dimensions: SheetResizeDimensions): void

Installs the dimension matrices owned by this resize plugin instance.

dimensions

Shared row, column, and hidden-size matrices for the sheet.

methodupdateResizeDrag(input: SheetUpdateResizeDragInput): void

Applies a command-owned resize drag move to local interaction state.

Inherited members 20

Inherited from Plugin.

interfaceSheetDimensionResizeInput

One explicit dimension change used by batch resize commands.

interfaceSheetResizeColumnsBatchInput

Public input for resizing arbitrary columns to explicit sizes.

interfaceSheetResizeColumnsRangeInput

Public input for resizing columns starting at index to a shared size.

interfaceSheetResizeDimensionCommandDataSource

Resize-owned data required to create invertible row and column dimension operations.

propertyreadonly target: PluginKey

Plugin key that owns row and column dimension state.

methodgetColumnCount(): number

Current column dimension count.

methodgetDefaultColumnSize(): number

Default column width used when no sparse override is stored.

methodgetDefaultRowSize(): number

Default row height used when no sparse override is stored.

methodgetRowCount(): number

Current row dimension count.

methodreadColumnHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden column, if one exists.

methodreadColumnSize(index: number): number

Reads the current column width at index.

methodreadRowHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden row, if one exists.

methodreadRowSize(index: number): number

Reads the current row height at index.

interfaceSheetResizeDimensions

Resize-owned dimension matrices accepted by SheetResizePlugin during setup.

propertycolumnHiddenOriginalSizes: CSRMatrix<number>

Original column sizes captured while columns are hidden.

propertycolumnSizes: DimensionsCSRMatrix

Column dimension matrix used for column width state.

propertyrowHiddenOriginalSizes: CSRMatrix<number>

Original row sizes captured while rows are hidden.

propertyrowSizes: DimensionsCSRMatrix

Row dimension matrix used for row height state.

interfaceSheetResizeRowsBatchInput

Public input for resizing arbitrary rows to explicit sizes.

interfaceSheetResizeRowsRangeInput

Public input for resizing rows starting at index to a shared size.

typeSheetResizeAxis
type SheetResizeAxis = "row" | "col"

Supported resize interaction axis.

typeSheetResizeColumnsInput
type SheetResizeColumnsInput = SheetResizeColumnsRangeInput | SheetResizeColumnsBatchInput

Public input for resizing columns.

typeSheetResizeRowsInput
type SheetResizeRowsInput = SheetResizeRowsRangeInput | SheetResizeRowsBatchInput

Public input for resizing rows.

variableResizeSheetColumnsCommand
ResizeSheetColumnsCommand: SheetCommandDefinition<SheetResizeColumnsInput, SheetCommandResult>

Resizes one or more column widths.

variableResizeSheetRowsCommand
ResizeSheetRowsCommand: SheetCommandDefinition<SheetResizeRowsInput, SheetCommandResult>

Resizes one or more row heights.

variableSheetColumnSizesFieldKey
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"

DataEngine field for column dimensions owned by SheetResizePlugin.

variableSheetRowSizesFieldKey
SheetRowSizesFieldKey: "sheet.resize.rowSizes"

DataEngine field for row dimensions owned by SheetResizePlugin.

functioncreateResizeColumnOperations
createResizeColumnOperations(input: SheetResizeColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column resize operations from public command input.

functioncreateResizeRowOperations
createResizeRowOperations(input: SheetResizeRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row resize operations from public command input.

functionreadSheetColumnSizes
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads column dimensions published by SheetResizePlugin.

functionreadSheetRowSizes
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads row dimensions published by SheetResizePlugin.

functionregisterSheetResizeCommands
registerSheetResizeCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource, controller: SheetResizeDragCommandController): void

Registers the complete command surface owned by SheetResizePlugin.

commands

Command bus owned by the current sheet editor.

dataSource

Resize state reader used by semantic dimension commands.

functionregisterSheetResizeDimensionCommands
registerSheetResizeDimensionCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource): void

Registers row and column dimension commands on one sheet command bus.