← All packages

API reference

@searsuite/sear-plugin-cell-editor

Sheet cell-edit sessions, text input, selection, and embedded-editor coordination.

57 exportsderived from source

enumSheetCellEditorExitReasonsource ↗
enum SheetCellEditorExitReason

Enumerates SheetCellEditorExitReason values.

enum memberCancel
Cancel: "cancel"
enum memberCommit
Commit: "commit"
enum memberOutsideClick
OutsideClick: "outside-click"
enumSheetCellEditorInteractionNamesource ↗
enum SheetCellEditorInteractionName

Enumerates SheetCellEditorInteractionName values.

enum memberSessionEnded
SessionEnded: "edit-session-ended"
enum memberSessionStarted
SessionStarted: "edit-session-started"
enumSheetCellEditorKindsource ↗
enum SheetCellEditorKind

Enumerates SheetCellEditorKind values.

enum memberCell
Cell: "cell"
enumSheetCellEditorPipelineNamesource ↗
enum SheetCellEditorPipelineName

Observable pipeline and step names owned by the Cell Editor module.

enum memberCancelEdit
CancelEdit: "cell-editor.cancel-edit"
enum memberCommitEdit
CommitEdit: "cell-editor.commit-edit"
enum memberEditExitAndSelect
EditExitAndSelect: "cell-editor.exit-and-select"
enum memberEndEditSession
EndEditSession: "cell-editor.end-edit-session"
enum memberEnterEditMode
EnterEditMode: "cell-editor.enter-edit-mode"
enum memberStartEditSession
StartEditSession: "cell-editor.start-edit-session"
enumSheetCellEditorPipelineStepNamesource ↗
enum SheetCellEditorPipelineStepName

Enumerates SheetCellEditorPipelineStepName values.

enum memberCommitValue
CommitValue: "cell-editor.commit-value"
enum memberEndEditSession
EndEditSession: "cell-editor.end-edit-session"
enum memberExitEditMode
ExitEditMode: "cell-editor.exit-edit-mode"
enum memberOpenEditor
OpenEditor: "cell-editor.open"
enum memberSelectCell
SelectCell: "cell-editor.select-cell"
enum memberStartEditSession
StartEditSession: "cell-editor.start-edit-session"
classFormulaReferenceHighlightersource ↗
class FormulaReferenceHighlighter extends Highlighter

Formula implementation of the editor's generic Highlighter contract.

constructorconstructor
FormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighter

Creates a FormulaReferenceHighlighter instance.

parser: IFormulaParser
configEngine: ConfigEngine
propertysymbolstatic
readonly symbol: symbol

DI token for resolving FormulaReferenceHighlighter.

methodclear
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

methodhighlight
highlight(formula: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

formula: string
context: HighlightContext
classFormulaReferencePickServicesource ↗
class FormulaReferencePickService

Optional workbook-owned bridge for references picked on another sheet.

constructorconstructor
FormulaReferencePickService(): FormulaReferencePickService
propertysymbolstatic
readonly symbol: typeof symbol
methodcancelPendingPick
cancelPendingPick(): void
methodhasPendingPick
hasPendingPick(): boolean
methodpick
pick(start: Point, end: Point): void
start: Point
end: Point
classHighlightersource ↗
class Highlighter

Extensible editor highlighting contract.

Implementations translate an editor's current text into generic text styles and optional sheet ranges. They must not mutate the editing document.

constructorconstructor
Highlighter(): Highlighter
propertysymbolstatic
readonly symbol: symbol

DI token for resolving Highlighter.

methodclear
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

methodhighlight
highlight(text: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

text: string
context: HighlightContext
classSheetCellEditorPluginsource ↗
class SheetCellEditorPlugin extends Plugin<SearCoreSheet, CellProperties, EditorState>

Coordinates Sheet cell edit sessions, text input, and embedded editors.

constructorconstructor
SheetCellEditorPlugin(mergePlugin: SheetCellMergePlugin, selectionPlugin: SheetSelectionPlugin, textInput: TextInput, keyboardRouter: KeyboardRouter, pointerCapture: PointerCapture, cursorRegistry: CursorRegistry, cursorEngine: CursorEngine, platform: Platform, commitStrategies: CellCommitStrategyRegistry, highlighter: Highlighter, coordinates: CoordinateTransformer, interactionReducers: SheetInteractionReducerRegistry, embeddedEditor?: unknown, commands?: SheetCommandBus, formulaSourceProvider?: IFormulaSourceProvider, textShaper?: TextShaper, cellFormatLocaleProvider?: ICellFormatLocaleProvider, queries?: SheetQueryRegistry, formulaParser?: IFormulaParser, inputValidation?: SheetCellInputValidationRegistry): SheetCellEditorPlugin

Creates a SheetCellEditorPlugin instance.

mergePlugin: SheetCellMergePlugin
selectionPlugin: SheetSelectionPlugin
textInput: TextInput
keyboardRouter: KeyboardRouter
pointerCapture: PointerCapture
cursorRegistry: CursorRegistry
cursorEngine: CursorEngine
platform: Platform
commitStrategies: CellCommitStrategyRegistry
highlighter: Highlighter
coordinates: CoordinateTransformer
interactionReducers: SheetInteractionReducerRegistry
embeddedEditor: unknown
commands: SheetCommandBus
formulaSourceProvider: IFormulaSourceProvider
textShaper: TextShaper
cellFormatLocaleProvider: ICellFormatLocaleProvider
queries: SheetQueryRegistry
formulaParser: IFormulaParser
inputValidation: SheetCellInputValidationRegistry
propertyinterestedIn
interestedIn: string[]

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
propertydefaultConfigstatic
readonly defaultConfig: SheetCellEditorConfig

Default visual configuration for the inline cell editor.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetCellEditorPlugin.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetCellEditorPlugin.

methodapply
apply(pluginState: EditorState, transaction: Transaction): EditorState | null

Applies a transaction to SheetCellEditorPlugin state.

pluginState: EditorState
transaction: Transaction
methodbindCore
bindCore(core: SearCoreSheet): void

Binds this plugin to the core owned by its editor-local container.

core: SearCoreSheet
methodbindFormulaRegistry
bindFormulaRegistry(registry: IFunctionRegistry): void

Binds the editor-local registry after formula services have been assembled.

registry: IFunctionRegistry
methodbindReferencePickService
bindReferencePickService(service: FormulaReferencePickService): void

Binds the optional parent-workbook reference picker.

service: FormulaReferencePickService
methodbindRuntimeServices
bindRuntimeServices(container: Container): void

Explicitly binds services for isolated plugin tests or custom local assembly.

container: Container
methodcancelEdit
cancelEdit(searCore: SearCoreSheet): void

Cancels the active cell edit session without committing its draft.

searCore: SearCoreSheet
methodcommitEdit
commitEdit(searCore: SearCoreSheet, fillSelection?: boolean): boolean

Commits the active cell edit session through its owning command.

searCore: SearCoreSheet
fillSelection: boolean
methodgetDocumentSelection
getDocumentSelection(): DocSelection

Returns the active document selection for host diagnostics and adapters.

methodgetPluginConfig
getPluginConfig(_searCore: SearCoreSheet): null

Returns the plugin config.

_searCore: SearCoreSheet
methodlockCommittedState
lockCommittedState(state: EditorState): void

Locks committed editor selection rectangles while staged clones stay writable.

state: EditorState
methodonDblClick
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean

Handles a double-click pointer event.

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

Handles the start of a pointer press sequence.

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

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

_searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Synchronizes document selection only after the editor rectangle transaction is committed, so a later failed pipeline step cannot alter the live editor session.

transaction: Transaction

Successfully committed transaction.

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

commands: SheetCommandBus
methodregisterConfig
registerConfig(): { config: ConfigUnit<SheetCellEditorConfig>; key: PluginKey }[]

Registers visual defaults for the inline cell editor.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Publishes formula authoring state through the editor's typed observation registry.

observations: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Registers the read-only draft projection used during workbook sheet switching.

queries: SheetQueryRegistry
methodregisterState
registerState(): { key: PluginKey; state: EditorState }

Registers one or more plugin-owned state records with the host manager.

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

Renders SheetCellEditorPlugin scene output.

searCore: SearCoreSheet
offset: { x: number; y: number }
methodregisterServicesstatic
registerServices(_context: { container: Container }): void

Registers rich-document node types used by the sheet cell editor.

_context: { container: Container }
Inherited members 22

Inherited from Plugin.

interfaceCellRangeHighlightsource ↗
interface CellRangeHighlight

A sheet rectangle rendered as part of an editor highlight.

propertycolor
color: templateLiteral
propertyend
end: [number, number]
propertyfill
fill?: string

Optional translucent fill rendered beneath the range outline.

propertykind
kind?: "cellRange"
propertystart
start: [number, number]
interfaceEditSessionEndedInteractionSignalsource ↗
interface EditSessionEndedInteractionSignal extends SheetInteractionSignal

Public contract for EditSessionEndedInteractionSignal.

propertyreason
reason: SheetCellEditorExitReason
propertytype
type: SessionEnded
interfaceEditSessionStartedInteractionSignalsource ↗
interface EditSessionStartedInteractionSignal extends SheetInteractionSignal

Public contract for EditSessionStartedInteractionSignal.

propertyeditor
editor: SheetCellEditorKind
propertytarget
target: Point
propertytype
type: SessionStarted
interfaceFormulaEditDraftsource ↗
interface FormulaEditDraft

Transient formula draft retained while a workbook mounts another sheet.

propertyautoClosingParentheses
readonly autoClosingParentheses?: readonly number[]
propertycell
readonly cell: Point
propertyselectionEnd
readonly selectionEnd: number
propertyselectionStart
readonly selectionStart: number
propertytext
readonly text: string
interfaceFormulaInputAssistStatesource ↗
interface FormulaInputAssistState

Current formula-authoring suggestions and caret position in the host view.

propertyanchor
readonly anchor: { x: number; y: number } | null
propertydiagnostic
readonly diagnostic: FormulaInputDiagnostic | null
propertyselectedIndex
readonly selectedIndex: number
propertysignature
readonly signature: FormulaSignature | null
propertysuggestions
readonly suggestions: readonly FormulaSuggestion[]
interfaceHighlightContextsource ↗
interface HighlightContext

Generic editor state that can influence a highlighter's presentation.

propertycursorOffset
cursorOffset?: number

Zero-based cursor position in the editor's plain-text content.

interfaceHighlightingsource ↗
interface Highlighting

Presentation-only output shared by all editor highlighters.

propertycellRanges
cellRanges: SheetReferenceHighlight[]
propertytextAttributes
textAttributes: TextAttributeRange<Readonly<Record<string, unknown>>>[]
interfaceSheetBeginCellEditInputsource ↗
interface SheetBeginCellEditInput

Public input used to enter cell edit mode.

propertyanchor
readonly anchor: Point
propertyeditor
readonly editor: SheetCellEditorKind
propertyfocus
readonly focus: Point
interfaceSheetCancelCellEditInputsource ↗
interface SheetCancelCellEditInput

Public input used to cancel the active edit session.

propertyrestoreOriginalDocument
readonly restoreOriginalDocument?: boolean
interfaceSheetCellEditorPointerInputsource ↗
interface SheetCellEditorPointerInput

Pointer selection update inside an active embedded editor.

propertypoint
readonly point: { x: number; y: number }
propertytype
readonly type: "pointerDown" | "pointerMove"
interfaceSheetCellEditSelectionInputsource ↗
interface SheetCellEditSelectionInput

Optional selection change applied while committing an edit session.

propertyanchor
readonly anchor: Point
propertyfocus
readonly focus: Point
interfaceSheetCommitCellEditInputsource ↗
interface SheetCommitCellEditInput

Public input used to commit the active edit session.

propertyfillSelection
readonly fillSelection?: boolean

Applies the entered value to every cell in the current selected rectangle.

propertynextSelection
readonly nextSelection?: SheetCellEditSelectionInput
propertypipelineName
readonly pipelineName?: SheetCellEditorPipelineName
propertyreason
readonly reason?: SheetCellEditorExitReason
interfaceSheetDocumentCursorPositionInputsource ↗
interface SheetDocumentCursorPositionInput

Document cursor position inside the active cell editor session.

propertyoffset
readonly offset: number
propertypath
readonly path: readonly number[]
interfaceSheetDocumentSelectionCommandInputsource ↗
interface SheetDocumentSelectionCommandInput

Document selection input expressed as anchor/head coordinates.

propertyanchor
readonly anchor: readonly [number, number]

Selection anchor as [paragraphIndex, textOffset].

propertyhead
readonly head: readonly [number, number]

Selection head as [paragraphIndex, textOffset].

interfaceSheetFormulaBarStatesource ↗
interface SheetFormulaBarState

Source text and transient edit selection for the active Sheet cell.

propertycell
readonly cell: Point | null
propertyediting
readonly editing: boolean
propertyrange
readonly range: { end: Point; start: Point } | null
propertyselectionEnd
readonly selectionEnd: number
propertyselectionStart
readonly selectionStart: number
propertytext
readonly text: string
interfaceSheetFormulaReferenceReplacementInputsource ↗
interface SheetFormulaReferenceReplacementInput

Formula reference replacement while an edit session is active.

propertyend
readonly end: number
propertypickStart
readonly pickStart?: Point

Present when the replacement begins a pointer-based reference pick.

propertyreference
readonly reference: string
propertystart
readonly start: number
interfaceSheetInlineStyleCommandInputsource ↗
interface SheetInlineStyleCommandInput

Inline text-style patch applied to the active embedded cell editor.

propertyattrs
readonly attrs: Readonly<Record<string, unknown>>
interfaceSheetOpenCellEditorInputsource ↗
interface SheetOpenCellEditorInput

Cell target for opening an embedded edit session.

propertycolumn
readonly column: number
propertyreplaceContent
readonly replaceContent?: boolean
propertyrow
readonly row: number
interfaceSheetRangeTextStyleInputsource ↗
interface SheetRangeTextStyleInput
propertyattrs
readonly attrs: Readonly<Record<string, unknown>>
typeSheetDocumentInputCommandInputsource ↗
type SheetDocumentInputCommandInput = TextInputEvent | { kind: "delete" } | { direction: DocCursorDirection; kind: "arrow"; shiftKey: boolean } | { kind: "selectAll" } | { kind: "softEnter" } | { ctrlKey?: boolean; key: string; kind: "keyDown"; metaKey?: boolean; shiftKey?: boolean } | { anchor: SheetDocumentCursorPositionInput; head: SheetDocumentCursorPositionInput; kind: "setSelection" }

Local document input action run inside the command boundary.

variableAcceptFormulaSuggestionCommandsource ↗
AcceptFormulaSuggestionCommand: SheetCommandDefinition<{ name: string }, SheetCommandResult>

Accepts a registered function suggestion without committing the cell edit.

variableBeginCellEditCommandsource ↗
BeginCellEditCommand: SheetCommandDefinition<SheetBeginCellEditInput, SheetCommandResult>

Command that enters cell edit mode.

variableBeginCellEditorDragSelectionCommandsource ↗
BeginCellEditorDragSelectionCommand: SheetCommandDefinition<void, SheetCommandResult>

Starts the local text-selection drag after the pointer command succeeds.

variableCancelCellEditCommandsource ↗
CancelCellEditCommand: SheetCommandDefinition<void | SheetCancelCellEditInput, SheetCommandResult>

Command that cancels the active cell edit session.

variableCommitCellEditCommandsource ↗
CommitCellEditCommand: SheetCommandDefinition<void | SheetCommitCellEditInput, SheetCommandResult>

Command that commits the active cell edit session.

variableCycleFormulaReferenceCommandsource ↗
CycleFormulaReferenceCommand: SheetCommandDefinition<void, SheetCommandResult>

Cycles the reference at the formula caret through relative and absolute modes.

variableEndCellEditorDragSelectionCommandsource ↗
EndCellEditorDragSelectionCommand: SheetCommandDefinition<{ disposeCapture: boolean }, SheetCommandResult>

Ends the local text-selection drag and optionally releases pointer capture.

variableEndFormulaReferencePickCommandsource ↗
EndFormulaReferencePickCommand: SheetCommandDefinition<void, SheetCommandResult>

Ends a pointer-based formula reference pick without changing the draft.

variableFormulaInputAssistObservationsource ↗
FormulaInputAssistObservation: StateObservationDefinition<FormulaInputAssistState>
variableHandleCellEditorPointerCommandsource ↗
HandleCellEditorPointerCommand: SheetCommandDefinition<SheetCellEditorPointerInput, SheetCommandResult>

Updates the embedded editor's cursor or drag selection.

variableHandleDocumentInputCommandsource ↗
HandleDocumentInputCommand: SheetCommandDefinition<SheetDocumentInputCommandInput, SheetCommandResult>

Command that executes local document input while editing a cell.

variableIsCellEditingQuerysource ↗
IsCellEditingQuery: SheetQueryDefinition<void, boolean>

Reports whether an active cell edit must be committed before a host formatting action.

variableMoveFormulaSuggestionCommandsource ↗
MoveFormulaSuggestionCommand: SheetCommandDefinition<{ direction: -1 | 1 }, SheetCommandResult>

Moves the highlighted function suggestion by one item.

variableOpenCellEditorCommandsource ↗
OpenCellEditorCommand: SheetCommandDefinition<SheetOpenCellEditorInput, SheetCommandResult>

Command that opens the embedded editor and enters cell edit mode atomically.

variableReadFormulaEditDraftQuerysource ↗
ReadFormulaEditDraftQuery: SheetQueryDefinition<void, FormulaEditDraft | null>

Reads the active formula draft without changing the edit session.

variableReplaceFormulaReferenceCommandsource ↗
ReplaceFormulaReferenceCommand: SheetCommandDefinition<SheetFormulaReferenceReplacementInput, SheetCommandResult>

Replaces the picked formula reference in the active edit session.

variableRequestCellEditorRenderCommandsource ↗
RequestCellEditorRenderCommand: SheetCommandDefinition<void, SheetCommandResult>

Command that requests a render pass for the cell editor overlay.

variableRestoreFormulaEditDraftCommandsource ↗
RestoreFormulaEditDraftCommand: SheetCommandDefinition<{ draft: FormulaEditDraft; reference?: string }, SheetCommandResult>

Restores a formula draft after a workbook sheet switch.

variableSetCellInlineStyleCommandsource ↗
SetCellInlineStyleCommand: SheetCommandDefinition<SheetInlineStyleCommandInput, SheetCommandResult>

Command used by toolbar integrations to update rich-text inline styles.

variableSetFormulaBarDraftCommandsource ↗
SetFormulaBarDraftCommand: SheetCommandDefinition<{ selectionEnd: number; selectionStart: number; text: string }, SheetCommandResult>

Replaces the active edit-session text and synchronizes its caret range.

variableSetRangeCellTextStyleCommandsource ↗
SetRangeCellTextStyleCommand: SheetCommandDefinition<SheetRangeTextStyleInput, SheetCommandResult>

Applies text styles to the complete content of selected text cells.

variableSheetFormulaBarObservationsource ↗
SheetFormulaBarObservation: StateObservationDefinition<SheetFormulaBarState>
variableStartFormulaBarEditCommandsource ↗
StartFormulaBarEditCommand: SheetCommandDefinition<void, SheetCommandResult>

Opens the current cell's edit session for an external formula input surface.

variableUpdateCellEditorDocumentSelectionCommandsource ↗
UpdateCellEditorDocumentSelectionCommand: SheetCommandDefinition<SheetDocumentSelectionCommandInput, SheetCommandResult>

Command that updates the rich-document selection inside the cell editor.

variableUpdateFormulaAssistAnchorCommandsource ↗
UpdateFormulaAssistAnchorCommand: SheetCommandDefinition<{ x: number; y: number }, SheetCommandResult>

Updates the formula-assist anchor after editor layout changes.

functionformatPickedReferencesource ↗
formatPickedReference(start: Point, end: Point, sheetName?: string): string

Formats a selected grid rectangle as an A1 reference.

start: Point
end: Point
sheetName: string
functiongetCellEditableValuesource ↗
getCellEditableValue(cell: CellMatrixElement | null | undefined, coordinate?: { col: number; row: number }, formulaSourceProvider?: IFormulaSourceProvider | null): unknown

Returns the persisted source value that belongs in the editor.

Formula results are derived, local cache data used only for display. Editing must always start from the synchronised formula source instead.

cell: CellMatrixElement | null | undefined
coordinate: { col: number; row: number }
formulaSourceProvider: IFormulaSourceProvider | null
functionregisterSheetCellEditorInteractionReducerssource ↗
registerSheetCellEditorInteractionReducers(registry: SheetInteractionReducerRegistry): void

Registers Cell Editor's local interaction projections once per DI container.

registry: SheetInteractionReducerRegistry