← All packages

API reference

@searsuite/sear-plugin-sheet-doc-adapter

The default Doc-backed rich-text editor adapter for Sheet cells.

17 exportsderived from source

classSearCoreEditorAdaptersource ↗
class SearCoreEditorAdapter extends SheetEmbeddedEditor

Sheet adapter that owns one lightweight SearCoreDoc for all embedded cells.

constructorconstructor
SearCoreEditorAdapter(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapter
options: SearCoreEditorAdapterOptions
propertyformatting
readonly formatting: { apply: (document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]; capture: (document: readonly Schema[]): Readonly<Record<string, unknown>> }

Pure formatting projection; applying it returns a new snapshot without changing editor state.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

methodbindTeardownToken
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

token: object
methodcreateEditSession
createEditSession(context: SheetEmbeddedEditorContext): SheetEditSession
context: SheetEmbeddedEditorContext
methodcreateRenderSession
createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSession
context: SheetEmbeddedEditorContext
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodinitialize
initialize(context: SheetEmbeddedEditorContext): void
context: SheetEmbeddedEditorContext
classSheetCellContextPluginsource ↗
class SheetCellContextPlugin extends SheetEmbeddedEditorPlugin

Adapts Sheet cell geometry and pointer coordinates for embedded sessions.

constructorconstructor
SheetCellContextPlugin(): SheetCellContextPlugin
propertykey
readonly key: "sheet.cell-context"

Stable identity used to reject duplicate registrations.

methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodtoLocalPoint
toLocalPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPoint
context: SheetEmbeddedEditorContext
point: SheetEditorPoint
methodtoSheetPoint
toSheetPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPoint
context: SheetEmbeddedEditorContext
point: SheetEditorPoint
classSheetClipboardPluginsource ↗
class SheetClipboardPlugin extends SheetEmbeddedEditorPlugin

Sheet clipboard codec for the shared rich-document snapshot protocol.

constructorconstructor
SheetClipboardPlugin(): SheetClipboardPlugin
propertykey
readonly key: "sheet.clipboard"

Stable identity used to reject duplicate registrations.

methoddeserialize
deserialize(value: string): SheetDocument
value: string
methodserialize
serialize(document: SheetDocument): string
document: SheetDocument
classSheetDocIntegrationPluginsource ↗
class SheetDocIntegrationPlugin extends SheetEmbeddedEditorPlugin

Extension point for Sheet-to-Doc integration policies.

constructorconstructor
SheetDocIntegrationPlugin(): SheetDocIntegrationPlugin
propertykey
readonly key: "sheet.doc-integration"

Stable identity used to reject duplicate registrations.

classSheetEmbeddedEditorPluginRegistrysource ↗
class SheetEmbeddedEditorPluginRegistry

Ordered registry used by the lightweight Sheet embedded editor.

constructorconstructor
SheetEmbeddedEditorPluginRegistry(): SheetEmbeddedEditorPluginRegistry
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Restricts plugin changes after the embedded editor joins a Sheet command bus.

assertWrite: (): void
teardownToken: object
methodget
get(key: string): SheetEmbeddedEditorPlugin | undefined
key: string
methodgetAll
getAll(): readonly SheetEmbeddedEditorPlugin[]
methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void
context: SheetEmbeddedEditorPluginContext
methodnotifyCancel
notifyCancel(context: SheetEmbeddedEditorPluginContext): void
context: SheetEmbeddedEditorPluginContext
methodnotifyCommit
notifyCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void
document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodnotifyRender
notifyRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void
update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
methodregister
register(plugin: SheetEmbeddedEditorPlugin): void
plugin: SheetEmbeddedEditorPlugin
methodtransformCommit
transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): SheetDocument | null
document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle
transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): SheetInlineStyleUpdate | null
update: SheetInlineStyleUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformInput
transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): SheetEditInput | null
input: SheetEditInput
context: SheetEmbeddedEditorPluginContext
methodunregister
unregister(key: string): void
key: string
classSheetFormulaReferencePluginsource ↗
class SheetFormulaReferencePlugin extends SheetEmbeddedEditorPlugin

Finds formula-like references for Sheet overlays without changing document data.

constructorconstructor
SheetFormulaReferencePlugin(): SheetFormulaReferencePlugin
propertykey
readonly key: "sheet.formula-reference"

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodgetReferences
getReferences(): readonly string[]
methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(_update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

_update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
classSheetOverflowPluginsource ↗
class SheetOverflowPlugin extends SheetEmbeddedEditorPlugin

Keeps overflow sizing as a Sheet concern and requests geometry redraws.

constructorconstructor
SheetOverflowPlugin(): SheetOverflowPlugin
propertykey
readonly key: "sheet.overflow"

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodgetContentSize
getContentSize(): { height: number; width: number } | null
methodonCommit
onCommit(_document: SheetDocument, _context: SheetEmbeddedEditorPluginContext): void

Called after Sheet has committed the edited document.

_document: SheetDocument
_context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
classSheetShortcutPluginsource ↗
class SheetShortcutPlugin extends SheetEmbeddedEditorPlugin

Optional key mapping hook for Sheet hosts that add cell-navigation shortcuts.

constructorconstructor
SheetShortcutPlugin(shortcuts?: Readonly<Record<string, SheetEditInput>>): SheetShortcutPlugin
shortcuts: Readonly<Record<string, SheetEditInput>>
propertykey
readonly key: "sheet.shortcuts"

Stable identity used to reject duplicate registrations.

methodtransformInput
transformInput(input: SheetEditInput, _context: SheetEmbeddedEditorPluginContext): SheetEditInput

Allows a plugin to normalize or consume Sheet keyboard/text input.

input: SheetEditInput
_context: SheetEmbeddedEditorPluginContext
interfaceEmbeddedDocConfigsource ↗
interface EmbeddedDocConfig

Configuration for the Doc instance embedded inside a Sheet cell.

propertyfontFamily
readonly fontFamily: string

Default font family and fallback list used by the active embedded document editor.

propertyfontSize
readonly fontSize: number

Default font size used by the active embedded document editor.

propertypadding
readonly padding: number

Padding between the cell edge and embedded document text.

interfaceSearCoreEditorAdapterOptionssource ↗
interface SearCoreEditorAdapterOptions

Configuration for the Sheet-specific SearCore document adapter.

propertyembeddedDocConfig
readonly embeddedDocConfig?: Partial<EmbeddedDocConfig>

Configuration scoped to the Doc embedded inside a Sheet cell.

propertyplugins
readonly plugins?: readonly SheetEmbeddedEditorPlugin | SheetEmbeddedEditorPluginImplementation[]

Optional Sheet-only plugins. Defaults to the built-in adapter plugins.

interfaceSheetEmbeddedEditorPluginsource ↗
interface SheetEmbeddedEditorPlugin

Extension point for behavior that belongs to the Sheet embedding rather than the reusable Doc runtime. Plugins are deliberately expressed in contract types so they can be replaced without changing Sheet or Doc packages.

propertykey
readonly key: string

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodonCancel
onCancel(context: SheetEmbeddedEditorPluginContext): void

Called after an edit is cancelled.

context: SheetEmbeddedEditorPluginContext
methodonCommit
onCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void

Called after Sheet has committed the edited document.

document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformCommit
transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void | SheetDocument | null

Allows a Sheet plugin to normalize the snapshot at the commit boundary.

document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle
transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): void | SheetInlineStyleUpdate | null

Allows a plugin to normalize an inline style update before Doc input runs.

update: SheetInlineStyleUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformInput
transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): void | SheetEditInput | null

Allows a plugin to normalize or consume Sheet keyboard/text input.

input: SheetEditInput
context: SheetEmbeddedEditorPluginContext
interfaceSheetEmbeddedEditorPluginContextsource ↗
interface SheetEmbeddedEditorPluginContext

Context delivered to Sheet-specific embedded-editor plugins.

propertydocument
readonly document: SheetDocument
propertyeditor
readonly editor: SheetEmbeddedEditorContext
interfaceSheetEmbeddedEditorPluginImplementationsource ↗
interface SheetEmbeddedEditorPluginImplementation

Constructor form accepted by adapter configuration for stateless plugins.

constructorconstructor
SheetEmbeddedEditorPluginImplementation(): SheetEmbeddedEditorPlugin
interfaceSheetEmbeddedInlineStyleObservationControllersource ↗
interface SheetEmbeddedInlineStyleObservationController
propertysource
readonly source: StateObservationSource<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>
methodnotify
notify(): void
variabledefaultEmbeddedDocConfigsource ↗
defaultEmbeddedDocConfig: EmbeddedDocConfig

Built-in defaults for a Doc instance embedded inside a Sheet cell.

functioncreateSheetEmbeddedSearCoreEditorsource ↗
createSheetEmbeddedSearCoreEditor(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapter

Creates the lightweight SearCore editor used by Sheet embedded cells.

options: SearCoreEditorAdapterOptions
functionregisterSheetEmbeddedInlineStyleObservationsource ↗
registerSheetEmbeddedInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry, isEditing: (): boolean, readTypingStyle?: (): Readonly<Record<string, unknown>>): SheetEmbeddedInlineStyleObservationController

Registers the selection-derived inline-style state with an embedded editor.

observations: ObservationRegistry
input: DocInputPlugin
inlineStyles: RichTextInlineStyleRegistry
isEditing: (): boolean
readTypingStyle: (): Readonly<Record<string, unknown>>