@searsuite/sear-plugin-alignment
Sheet horizontal and vertical alignment state, commands, rendering projections, and persistence.
Horizontal alignment
- classAlignmentMatrix
-
class AlignmentMatrix extends CSRMatrix<string>Sparse horizontal-alignment matrix whose absent cells resolve to left alignment.
Only non-left values are persisted. This keeps alignment state proportional to user overrides, while retaining a stable left-aligned default for every cell in the declared sheet shape. Explicit default values in serialized input are compacted while materializing the sparse matrix.
constructor AlignmentMatrix(data?: AlignmentMatrixData, shape?: [number, number]): AlignmentMatrixCreates an alignment matrix and compacts explicit left-alignment entries.
dataOptional serialized CSR entries from persisted state.
shapeDeclared row and column count; empty cells resolve to left alignment.
property readonly defaultAlignment: LeftstaticDefault horizontal alignment returned for cells without an explicit override.
method addItem(row: number, col: number, value: string): thisStores an explicit non-default override, or removes the entry when left alignment is requested.
ReturnsThis matrix after the sparse update.
rowZero-based row receiving the override.
colZero-based column receiving the override.
valueRequested horizontal alignment.
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetAlignmentPlugin
-
class SheetAlignmentPlugin extends Plugin<unknown, CellProperties, SheetAlignmentPluginState>Plugin that owns cell alignment data.
Alignment state accepts direct alignment transactions owned by this plugin and also tracks sheet-data cell type changes to maintain built-in default alignment projections.
constructor SheetAlignmentPlugin(state: SheetAlignmentPluginState, readCellData?: (): SheetMatrix): SheetAlignmentPluginConstructs the alignment plugin.
stateShared alignment state.
property readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>SheetAlignmentPlugin owns the persisted alignment export module.
property interestedIn: string[]Alignment reacts to direct cell updates and sheet-structure changes.
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Alignment transactions share the registered MatrixOT algebra.
property readonly warnOnDuplicateDepth: falseAlignment data is state-only; duplicate render/event depth diagnostics do not apply.
property readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>staticDocument-state export contribution for persisted cell alignments.
property readonly pluginKey: PluginKeystaticStable plugin key shared by all alignment plugin instances.
property readonly symbol: symbolstaticDI token for resolving the alignment plugin.
method apply(pluginState: SheetAlignmentPluginState, transaction: Transaction): SheetAlignmentPluginState | nullApplies alignment operations to the alignment matrix.
ReturnsUpdated plugin state, or null when the transaction has no relevant operations.
pluginStateCurrent alignment state.
transactionTransaction containing direct or derived MatrixOT-compatible operations.
method getPluginConfig(): nullAlignment data has no render-time configuration.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes horizontal alignment to the shared Sheet cell visual pipeline.
method registerCommands(commands: SheetCommandBus): voidRegisters the horizontal alignment command owned by this plugin.
method registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
method registerRangeMoves(registry: SheetRangeMoveRegistry): voidmethod registerRangeReorders(registry: SheetRangeReorderRegistry): voidmethod registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): AlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetAlignmentPluginState }Registers alignment state for commands, projections, and collaboration.
method render(): Node<CellProperties>[]Alignment data does not render scene nodes directly.
ReturnsAn empty node list.
Inherited members 25
Inherited from Plugin.
- depth
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceAlignmentMatrixData
-
Serialized sparse entries accepted by AlignmentMatrix.
property data: string[]Explicit non-default alignment values.
property indices: number[]CSR row pointers.
property indptr: number[]CSR column indices.
- interfaceSheetAlignmentPluginState
-
State owned by SheetAlignmentPlugin.
property cellAlignments: AlignmentMatrixSparse matrix containing non-left or cell-type-derived horizontal alignment overrides.
- interfaceSheetHorizontalAlignmentCommandDataSource
-
interface SheetHorizontalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the horizontal alignment command.
property readonly target: PluginKeymethod readCellAlignment(row: number, column: number): SheetHorizontalAlignment | nullInherited members 2
- getColumnCount
- getRowCount
- typeSheetSetRangeAlignmentInput
-
type SheetSetRangeAlignmentInput = SheetRangeInput & { alignment: SheetHorizontalAlignment } | { alignment: SheetHorizontalAlignment; ranges: readonly SheetRangeInput[] }Public input for setting horizontal alignment in one or more ranges.
- variableSetRangeAlignmentCommand
-
SetRangeAlignmentCommand: SheetCommandDefinition<SheetSetRangeAlignmentInput, SheetCommandResult>Public command for setting horizontal alignment in a range.
- variableSheetHorizontalAlignmentFieldKey
-
SheetHorizontalAlignmentFieldKey: "sheet.alignment.horizontal"DataEngine field owned by SheetAlignmentPlugin.
- functioncreateSetRangeAlignmentOperations
-
createSetRangeAlignmentOperations(input: SheetSetRangeAlignmentInput, dataSource: SheetHorizontalAlignmentReader): UpdateCellOTOperation<SheetHorizontalAlignment>[]Creates sparse UpdateCell operations for horizontal alignment.
- functionreadSheetCellAlignments
-
readSheetCellAlignments(dataEngine: DataEngine): AlignmentMatrix | nullReads horizontal cell alignment published by SheetAlignmentPlugin.
- functionregisterSheetHorizontalAlignmentCommand
-
registerSheetHorizontalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetHorizontalAlignmentCommandDataSource): voidRegisters the horizontal alignment command owned by SheetAlignmentPlugin.
- functionassertSheetHorizontalAlignment
-
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
- functionisSheetHorizontalAlignment
-
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
- enumSheetHorizontalAlignment
-
Horizontal alignment values supported by the built-in Sheet alignment feature.
Vertical alignment
- classSheetVerticalAlignmentPlugin
-
class SheetVerticalAlignmentPlugin extends Plugin<unknown, CellProperties, SheetVerticalAlignmentPluginState>Plugin that owns vertical cell alignment data, commands, and structural projections.
constructor SheetVerticalAlignmentPlugin(state: SheetVerticalAlignmentPluginState): SheetVerticalAlignmentPluginConstructs the vertical alignment plugin around a shared sparse matrix.
property readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>SheetVerticalAlignmentPlugin owns its persisted export module.
property interestedIn: string[]Vertical alignment follows direct updates and all sheet structure changes.
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Vertical alignment transactions share the registered MatrixOT algebra.
property readonly warnOnDuplicateDepth: falseAlignment state is data-only and does not use render-depth diagnostics.
property readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>staticDocument-state export contribution for persisted vertical alignments.
property readonly pluginKey: PluginKeystaticStable plugin key shared by all vertical alignment plugin instances.
property readonly symbol: symbolstaticDI token for resolving the vertical alignment plugin.
method apply(pluginState: SheetVerticalAlignmentPluginState, transaction: Transaction): SheetVerticalAlignmentPluginState | nullApplies direct vertical alignment and structural matrix operations.
method getPluginConfig(): nullVertical alignment data has no render-time configuration.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes vertical alignment to the shared Sheet cell visual pipeline.
method registerCommands(commands: SheetCommandBus): voidRegisters the vertical alignment command owned by this plugin.
method registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
method registerRangeMoves(registry: SheetRangeMoveRegistry): voidmethod registerRangeReorders(registry: SheetRangeReorderRegistry): voidmethod registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): VerticalAlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetVerticalAlignmentPluginState }Registers vertical alignment state for commands, projections, and collaboration.
method render(): Node<CellProperties>[]Vertical alignment data does not render scene nodes directly.
Inherited members 25
Inherited from Plugin.
- depth
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- classVerticalAlignmentMatrix
-
class VerticalAlignmentMatrix extends CSRMatrix<string>Sparse vertical-alignment matrix whose absent cells resolve to centered alignment.
constructor VerticalAlignmentMatrix(data?: VerticalAlignmentMatrixData, shape?: [number, number]): VerticalAlignmentMatrixCreates a matrix and compacts explicit default-alignment entries.
property readonly defaultAlignment: CenterstaticDefault vertical alignment returned for cells without an explicit override.
method addItem(row: number, col: number, value: string): thisStores an explicit non-default override, or removes it for centered alignment.
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- interfaceSheetSetRangeVerticalAlignmentInput
-
interface SheetSetRangeVerticalAlignmentInput extends SheetRangeInputPublic input for setting vertical alignment in a range.
- interfaceSheetVerticalAlignmentCommandDataSource
-
interface SheetVerticalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the vertical alignment command.
property readonly target: PluginKeymethod readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | nullInherited members 2
- getColumnCount
- getRowCount
- interfaceSheetVerticalAlignmentPluginState
-
State owned by SheetVerticalAlignmentPlugin.
property cellVerticalAlignments: VerticalAlignmentMatrixSparse matrix containing non-centered vertical alignment overrides.
- interfaceVerticalAlignmentMatrixData
-
Serialized sparse entries accepted by VerticalAlignmentMatrix.
property data: string[]Explicit non-default alignment values.
property indices: number[]CSR row pointers.
property indptr: number[]CSR column indices.
- variableSetRangeVerticalAlignmentCommand
-
SetRangeVerticalAlignmentCommand: SheetCommandDefinition<SheetSetRangeVerticalAlignmentInput, SheetCommandResult>Public command for setting vertical alignment in a range.
- variableSheetVerticalAlignmentFieldKey
-
SheetVerticalAlignmentFieldKey: "sheet.alignment.vertical"DataEngine field owned by SheetVerticalAlignmentPlugin.
- functioncreateSetRangeVerticalAlignmentOperations
-
createSetRangeVerticalAlignmentOperations(input: SheetSetRangeVerticalAlignmentInput, dataSource: SheetVerticalAlignmentReader): UpdateCellOTOperation<SheetVerticalAlignment>[]Creates sparse UpdateCell operations for vertical alignment.
- functionreadSheetCellVerticalAlignments
-
readSheetCellVerticalAlignments(dataEngine: DataEngine): VerticalAlignmentMatrix | nullReads vertical cell alignment published by SheetVerticalAlignmentPlugin.
- functionregisterSheetVerticalAlignmentCommand
-
registerSheetVerticalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetVerticalAlignmentCommandDataSource): voidRegisters the vertical alignment command owned by SheetVerticalAlignmentPlugin.
- functionassertSheetVerticalAlignment
-
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
- functionisSheetVerticalAlignment
-
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
- enumSheetVerticalAlignment
-
Vertical alignment values supported by the built-in Sheet alignment feature.
No matching API entries.