← All packages

@searsuite/sear-plugin-cell-editor

Open and commit an edit

BeginCellEditCommand opens an edit session. CommitCellEditCommand applies the result; CancelCellEditCommand closes the session without committing.

enumSheetCellEditorExitReason

Enumerates SheetCellEditorExitReason values.

enumSheetCellEditorKind

Enumerates SheetCellEditorKind values.

enum memberCell: "cell"
classSheetCellEditorPlugin
class SheetCellEditorPlugin extends Plugin<SearCoreSheet, CellProperties, EditorState>

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

constructorSheetCellEditorPlugin(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
propertyinterestedIn: 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
propertyreadonly defaultConfig: SheetCellEditorConfigstatic

Default visual configuration for the inline cell editor.

propertyreadonly pluginKey: PluginKeystatic

Stable plugin key for SheetCellEditorPlugin.

propertyreadonly symbol: symbolstatic

DI token for resolving SheetCellEditorPlugin.

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

Applies a transaction to SheetCellEditorPlugin state.

methodbindCore(core: SearCoreSheet): void

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

methodbindFormulaRegistry(registry: IFunctionRegistry): void

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

methodbindReferencePickService(service: FormulaReferencePickService): void

Binds the optional parent-workbook reference picker.

methodbindRuntimeServices(container: Container): void

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

methodcancelEdit(searCore: SearCoreSheet): void

Cancels the active cell edit session without committing its draft.

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

Commits the active cell edit session through its owning command.

methodgetDocumentSelection(): DocSelection

Returns the active document selection for host diagnostics and adapters.

methodgetPluginConfig(_searCore: SearCoreSheet): null

Returns the plugin config.

methodlockCommittedState(state: EditorState): void

Locks committed editor selection rectangles while staged clones stay writable.

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

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>): boolean | void

Handles the end of a pointer press sequence.

methodonTransactionCommitted(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

Successfully committed transaction.

methodregisterCommands(commands: SheetCommandBus): void

Registers the commands.

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

Registers visual defaults for the inline cell editor.

methodregisterObservations(observations: ObservationRegistry): void

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

methodregisterQueries(queries: SheetQueryRegistry): void

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

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

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

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

Renders SheetCellEditorPlugin scene output.

methodregisterServices(_context: { container: Container }): voidstatic

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

Inherited members 21

Inherited from Plugin.

interfaceSheetBeginCellEditInput

Public input used to enter cell edit mode.

interfaceSheetCancelCellEditInput

Public input used to cancel the active edit session.

interfaceSheetCommitCellEditInput

Public input used to commit the active edit session.

interfaceSheetOpenCellEditorInput

Cell target for opening an embedded edit session.

variableBeginCellEditCommand
BeginCellEditCommand: SheetCommandDefinition<SheetBeginCellEditInput, SheetCommandResult>

Command that enters cell edit mode.

variableCancelCellEditCommand
CancelCellEditCommand: SheetCommandDefinition<void | SheetCancelCellEditInput, SheetCommandResult>

Command that cancels the active cell edit session.

variableCommitCellEditCommand
CommitCellEditCommand: SheetCommandDefinition<void | SheetCommitCellEditInput, SheetCommandResult>

Command that commits the active cell edit session.

variableIsCellEditingQuery
IsCellEditingQuery: SheetQueryDefinition<void, boolean>

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

variableOpenCellEditorCommand
OpenCellEditorCommand: SheetCommandDefinition<SheetOpenCellEditorInput, SheetCommandResult>

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

functiongetCellEditableValue
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.

Embedded document input

interfaceSheetCellEditSelectionInput

Optional selection change applied while committing an edit session.

interfaceSheetDocumentCursorPositionInput

Document cursor position inside the active cell editor session.

interfaceSheetDocumentSelectionCommandInput

Document selection input expressed as anchor/head coordinates.

propertyreadonly anchor: readonly [number, number]

Selection anchor as [paragraphIndex, textOffset].

propertyreadonly head: readonly [number, number]

Selection head as [paragraphIndex, textOffset].

interfaceSheetInlineStyleCommandInput

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

typeSheetDocumentInputCommandInput
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.

variableHandleDocumentInputCommand
HandleDocumentInputCommand: SheetCommandDefinition<SheetDocumentInputCommandInput, SheetCommandResult>

Command that executes local document input while editing a cell.

variableRequestCellEditorRenderCommand
RequestCellEditorRenderCommand: SheetCommandDefinition<void, SheetCommandResult>

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

variableSetCellInlineStyleCommand
SetCellInlineStyleCommand: SheetCommandDefinition<SheetInlineStyleCommandInput, SheetCommandResult>

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

variableSetRangeCellTextStyleCommand
SetRangeCellTextStyleCommand: SheetCommandDefinition<SheetRangeTextStyleInput, SheetCommandResult>

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

variableUpdateCellEditorDocumentSelectionCommand
UpdateCellEditorDocumentSelectionCommand: SheetCommandDefinition<SheetDocumentSelectionCommandInput, SheetCommandResult>

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

Formula input and references

Formula drafts and reference-picking commands keep the formula being typed separate from the committed cell value.

classFormulaReferenceHighlighter
class FormulaReferenceHighlighter extends Highlighter

Formula implementation of the editor's generic Highlighter contract.

constructorFormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighter
propertyreadonly symbol: symbolstatic

DI token for resolving FormulaReferenceHighlighter.

methodclear(): void

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

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

Returns highlighted segments for the supplied source range.

classHighlighter

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.

constructorHighlighter(): Highlighter
propertyreadonly symbol: symbolstatic

DI token for resolving Highlighter.

methodclear(): void

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

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

Returns highlighted segments for the supplied source range.

interfaceCellRangeHighlight

A sheet rectangle rendered as part of an editor highlight.

propertycolor: templateLiteral
propertyend: [number, number]
propertyfill?: string

Optional translucent fill rendered beneath the range outline.

propertykind?: "cellRange"
propertystart: [number, number]
interfaceFormulaEditDraft

Transient formula draft retained while a workbook mounts another sheet.

interfaceHighlightContext

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

propertycursorOffset?: number

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

interfaceHighlighting

Presentation-only output shared by all editor highlighters.

interfaceSheetFormulaReferenceReplacementInput

Formula reference replacement while an edit session is active.

propertyreadonly end: number
propertyreadonly pickStart?: Point

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

propertyreadonly reference: string
propertyreadonly start: number
variableAcceptFormulaSuggestionCommand
AcceptFormulaSuggestionCommand: SheetCommandDefinition<{ name: string }, SheetCommandResult>

Accepts a registered function suggestion without committing the cell edit.

variableCycleFormulaReferenceCommand
CycleFormulaReferenceCommand: SheetCommandDefinition<void, SheetCommandResult>

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

variableEndFormulaReferencePickCommand
EndFormulaReferencePickCommand: SheetCommandDefinition<void, SheetCommandResult>

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

variableFormulaInputAssistObservation
FormulaInputAssistObservation: StateObservationDefinition<FormulaInputAssistState>
variableMoveFormulaSuggestionCommand
MoveFormulaSuggestionCommand: SheetCommandDefinition<{ direction: -1 | 1 }, SheetCommandResult>

Moves the highlighted function suggestion by one item.

variableReadFormulaEditDraftQuery
ReadFormulaEditDraftQuery: SheetQueryDefinition<void, FormulaEditDraft | null>

Reads the active formula draft without changing the edit session.

variableReplaceFormulaReferenceCommand
ReplaceFormulaReferenceCommand: SheetCommandDefinition<SheetFormulaReferenceReplacementInput, SheetCommandResult>

Replaces the picked formula reference in the active edit session.

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

Restores a formula draft after a workbook sheet switch.

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

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

variableSheetFormulaBarObservation
SheetFormulaBarObservation: StateObservationDefinition<SheetFormulaBarState>
variableStartFormulaBarEditCommand
StartFormulaBarEditCommand: SheetCommandDefinition<void, SheetCommandResult>

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

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

Updates the formula-assist anchor after editor layout changes.

functionformatPickedReference
formatPickedReference(start: Point, end: Point, sheetName?: string): string

Formats a selected grid rectangle as an A1 reference.

Editor interaction

Pointer and document-input commands route host events into the active embedded editor.

enumSheetCellEditorInteractionName

Enumerates SheetCellEditorInteractionName values.

interfaceEditSessionEndedInteractionSignal
interface EditSessionEndedInteractionSignal extends SheetInteractionSignal
interfaceEditSessionStartedInteractionSignal
interface EditSessionStartedInteractionSignal extends SheetInteractionSignal
interfaceSheetCellEditorPointerInput

Pointer selection update inside an active embedded editor.

variableBeginCellEditorDragSelectionCommand
BeginCellEditorDragSelectionCommand: SheetCommandDefinition<void, SheetCommandResult>

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

variableEndCellEditorDragSelectionCommand
EndCellEditorDragSelectionCommand: SheetCommandDefinition<{ disposeCapture: boolean }, SheetCommandResult>

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

variableHandleCellEditorPointerCommand
HandleCellEditorPointerCommand: SheetCommandDefinition<SheetCellEditorPointerInput, SheetCommandResult>

Updates the embedded editor's cursor or drag selection.

functionregisterSheetCellEditorInteractionReducers
registerSheetCellEditorInteractionReducers(registry: SheetInteractionReducerRegistry): void

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