@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 member Cell: "cell" - classSheetCellEditorPlugin
-
class SheetCellEditorPlugin extends Plugin<SearCoreSheet, CellProperties, EditorState>Coordinates Sheet cell edit sessions, text input, and embedded editors.
constructor 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): SheetCellEditorPluginproperty interestedIn: string[]Declares which Sheet OT action names this plugin is interested in. The engine will only call
applywhen a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.['uc', 'rr', 'rc']— only called for UpdateCell, ResizeRow, ResizeCol['*']— called for any transaction (wildcard)[]— only called for this plugin's own transactions
property readonly defaultConfig: SheetCellEditorConfigstaticDefault visual configuration for the inline cell editor.
property readonly pluginKey: PluginKeystaticStable plugin key for SheetCellEditorPlugin.
property readonly symbol: symbolstaticDI token for resolving SheetCellEditorPlugin.
method apply(pluginState: EditorState, transaction: Transaction): EditorState | nullApplies a transaction to SheetCellEditorPlugin state.
method bindCore(core: SearCoreSheet): voidBinds this plugin to the core owned by its editor-local container.
method bindFormulaRegistry(registry: IFunctionRegistry): voidBinds the editor-local registry after formula services have been assembled.
method bindReferencePickService(service: FormulaReferencePickService): voidBinds the optional parent-workbook reference picker.
method bindRuntimeServices(container: Container): voidExplicitly binds services for isolated plugin tests or custom local assembly.
method cancelEdit(searCore: SearCoreSheet): voidCancels the active cell edit session without committing its draft.
method commitEdit(searCore: SearCoreSheet, fillSelection?: boolean): booleanCommits the active cell edit session through its owning command.
method getDocumentSelection(): DocSelectionReturns the active document selection for host diagnostics and adapters.
method getPluginConfig(_searCore: SearCoreSheet): nullReturns the plugin config.
method lockCommittedState(state: EditorState): voidLocks committed editor selection rectangles while staged clones stay writable.
method onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): booleanHandles a double-click pointer event.
method onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
method onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
method onMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
method onTransactionCommitted(transaction: Transaction): voidSynchronizes document selection only after the editor rectangle transaction is committed, so a later failed pipeline step cannot alter the live editor session.
transactionSuccessfully committed transaction.
method registerCommands(commands: SheetCommandBus): voidRegisters the commands.
method registerConfig(): { config: ConfigUnit<SheetCellEditorConfig>; key: PluginKey }[]Registers visual defaults for the inline cell editor.
method registerObservations(observations: ObservationRegistry): voidPublishes formula authoring state through the editor's typed observation registry.
method registerQueries(queries: SheetQueryRegistry): voidRegisters the read-only draft projection used during workbook sheet switching.
method registerState(): { key: PluginKey; state: EditorState }Registers one or more plugin-owned state records with the host manager.
method render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]Renders SheetCellEditorPlugin scene output.
method registerServices(_context: { container: Container }): voidstaticRegisters rich-document node types used by the sheet cell editor.
Inherited members 21
Inherited from Plugin.
- depth
- documentState
- transactionHistory
- transactionOT
- warnOnDuplicateDepth
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- onClick
- onInitialDataCell
- onInitialDataComplete
- onResize
- onScroll
- projectTransaction
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceSheetBeginCellEditInput
-
Public input used to enter cell edit mode.
property readonly anchor: Pointproperty readonly editor: SheetCellEditorKindproperty readonly focus: Point - interfaceSheetCancelCellEditInput
-
Public input used to cancel the active edit session.
- interfaceSheetCommitCellEditInput
-
Public input used to commit the active edit session.
property readonly fillSelection?: booleanApplies the entered value to every cell in the current selected rectangle.
property readonly nextSelection?: SheetCellEditSelectionInputproperty readonly pipelineName?: SheetCellEditorPipelineNameproperty readonly reason?: SheetCellEditorExitReason - interfaceSheetOpenCellEditorInput
-
Cell target for opening an embedded edit session.
property readonly column: numberproperty readonly replaceContent?: booleanproperty readonly row: number - 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): unknownReturns 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.
property readonly anchor: Pointproperty readonly focus: Point - interfaceSheetDocumentCursorPositionInput
-
Document cursor position inside the active cell editor session.
property readonly offset: numberproperty readonly path: readonly number[] - interfaceSheetDocumentSelectionCommandInput
-
Document selection input expressed as anchor/head coordinates.
property readonly anchor: readonly [number, number]Selection anchor as [paragraphIndex, textOffset].
property readonly 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 HighlighterFormula implementation of the editor's generic Highlighter contract.
constructor FormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighterproperty readonly symbol: symbolstaticDI token for resolving FormulaReferenceHighlighter.
method clear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
method highlight(formula: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
- classFormulaReferencePickService
-
Optional workbook-owned bridge for references picked on another sheet.
constructor FormulaReferencePickService(): FormulaReferencePickServiceproperty readonly symbol: typeof symbolstaticmethod cancelPendingPick(): voidmethod hasPendingPick(): booleanmethod pick(start: Point, end: Point): void - 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.
constructor Highlighter(): Highlighterproperty readonly symbol: symbolstaticDI token for resolving Highlighter.
method clear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
method highlight(text: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
- interfaceCellRangeHighlight
-
A sheet rectangle rendered as part of an editor highlight.
property color: templateLiteralproperty end: [number, number]property fill?: stringOptional translucent fill rendered beneath the range outline.
property kind?: "cellRange"property start: [number, number] - interfaceFormulaEditDraft
-
Transient formula draft retained while a workbook mounts another sheet.
property readonly autoClosingParentheses?: readonly number[]property readonly cell: Pointproperty readonly selectionEnd: numberproperty readonly selectionStart: numberproperty readonly text: string - interfaceFormulaInputAssistState
-
Current formula-authoring suggestions and caret position in the host view.
- interfaceHighlightContext
-
Generic editor state that can influence a highlighter's presentation.
property cursorOffset?: numberZero-based cursor position in the editor's plain-text content.
- interfaceHighlighting
-
Presentation-only output shared by all editor highlighters.
- interfaceSheetFormulaBarState
-
Source text and transient edit selection for the active Sheet cell.
property readonly cell: Point | nullproperty readonly editing: booleanproperty readonly range: { end: Point; start: Point } | nullproperty readonly selectionEnd: numberproperty readonly selectionStart: numberproperty readonly text: string - interfaceSheetFormulaReferenceReplacementInput
-
Formula reference replacement while an edit session is active.
property readonly end: numberproperty readonly pickStart?: PointPresent when the replacement begins a pointer-based reference pick.
property readonly reference: stringproperty readonly 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): stringFormats 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.
enum member SessionEnded: "edit-session-ended"enum member SessionStarted: "edit-session-started" - enumSheetCellEditorPipelineName
-
Observable pipeline and step names owned by the Cell Editor module.
enum member CancelEdit: "cell-editor.cancel-edit"enum member CommitEdit: "cell-editor.commit-edit"enum member EditExitAndSelect: "cell-editor.exit-and-select"enum member EndEditSession: "cell-editor.end-edit-session"enum member EnterEditMode: "cell-editor.enter-edit-mode"enum member StartEditSession: "cell-editor.start-edit-session" - enumSheetCellEditorPipelineStepName
-
Enumerates SheetCellEditorPipelineStepName values.
enum member CommitValue: "cell-editor.commit-value"enum member EndEditSession: "cell-editor.end-edit-session"enum member ExitEditMode: "cell-editor.exit-edit-mode"enum member OpenEditor: "cell-editor.open"enum member SelectCell: "cell-editor.select-cell"enum member StartEditSession: "cell-editor.start-edit-session" - interfaceEditSessionEndedInteractionSignal
-
interface EditSessionEndedInteractionSignal extends SheetInteractionSignalproperty reason: SheetCellEditorExitReasonproperty type: SessionEnded - 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): voidRegisters Cell Editor's local interaction projections once per DI container.
No matching API entries.