← All packages

API reference

@searsuite/sear-plugin-header-highlight

Header highlight behavior derived from Sheet selections.

2 exportsderived from source

classSheetHeaderHighlightPluginsource ↗
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.

constructorconstructor
SheetHeaderHighlightPlugin(sheetSelectionPlugin: SheetSelectionPlugin, sheetCornerPlugin: SheetCornerPlugin): SheetHeaderHighlightPlugin

Creates a SheetHeaderHighlightPlugin instance.

sheetSelectionPlugin: SheetSelectionPlugin
sheetCornerPlugin: SheetCornerPlugin
propertydepth
depth: 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
interestedIn: 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
propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetHeaderHighlightPlugin.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetHeaderHighlightPlugin.

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

Applies a transaction to SheetHeaderHighlightPlugin state.

pluginState: ISheetHeaderHighlight
_transaction: Transaction
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): null

Returns plugin-specific configuration.

This plugin currently reads config directly from configEngine during render.

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

Registers default configuration for this plugin.

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

Registers plugin state into the host state store.

methodrender
render(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: SearCoreSheet

Active core sheet instance.

offset: { x: number; y: number }

World-space offset propagated by the render pipeline.

Inherited members 27

Inherited from Plugin.

typeSheetHeaderHighlightModesource ↗
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.