← All packages

@searsuite/sear-plugin-header-highlight

Header highlight behavior derived from Sheet selections.

classSheetHeaderHighlightPlugin
class SheetHeaderHighlightPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetHeaderHighlight>

Row-header / column-header selection highlight plugin.

The plugin reads selection from DataEngine during render and uses AffixCell nodes with explicit depths so highlights stay between header backgrounds, header text and the primary selection box.

constructorSheetHeaderHighlightPlugin(sheetSelectionPlugin: SheetSelectionPlugin, sheetCornerPlugin: SheetCornerPlugin): SheetHeaderHighlightPlugin
propertydepth: number

Base render depth for plugin-generated nodes.

The plugin places highlight background at depth + 1.5 and emphasis bars at depth + 3 to guarantee stable stacking relative to default header nodes.

propertyinterestedIn: MatrixOTActionName | RectOTActionName[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertyreadonly pluginKey: PluginKeystatic

Stable plugin key for SheetHeaderHighlightPlugin.

propertyreadonly symbol: symbolstatic

DI token for resolving SheetHeaderHighlightPlugin.

methodapply(pluginState: ISheetHeaderHighlight, _transaction: Transaction): ISheetHeaderHighlight

Applies a transaction to SheetHeaderHighlightPlugin state.

methodgetPluginConfig(searCore: SearCoreSheet): null

Returns plugin-specific configuration.

This plugin currently reads config directly from configEngine during render.

methodregisterConfig(): { config: ConfigUnit<{ columnHeaderHeight: number; headerHighlightActiveBarThickness: number; headerHighlightActiveBorderColor: string; headerHighlightBackgroundColor: string; headerHighlightBorderColor: string; mode: SheetHeaderHighlightMode }>; key: PluginKey }[]

Registers default configuration for this plugin.

methodregisterState(): { key: PluginKey; state: ISheetHeaderHighlight }

Registers plugin state into the host state store.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Builds highlight nodes for row and column headers based on current selection and mode.

Rendering flow:

  1. Resolve selection state from SheetSelectionPlugin.
  2. Early-return when selection is empty.
  3. Resolve table dimensions and plugin config.
  4. Compose offsets to match header layout around the corner region.
  5. Delegate to range/cross mode builders.

ReturnsFlat list of nodes to add into the stage for this frame.

searCore

Active core sheet instance.

offset

World-space offset propagated by the render pipeline.

Inherited members 26

Inherited from Plugin.

typeSheetHeaderHighlightMode
type SheetHeaderHighlightMode = "selection-range" | "cross-active"

Controls how header highlighting is computed.

  • selection-range: highlight all row/column headers covered by the selection bounding box.
  • cross-active: highlight only the active row and active column around the selection anchor.