Nutrient Web SDK

v0.0.0-dev

ReferenceContentEditingTextBlockSlotParams

Interface TextBlockSlotParams

Per-block rendering state handed to the UI.ContentEditorSlots#textBlock slot. The SDK still owns gesture recognition, text input / IME, and layout — the slot owns the visual representation.

The slot is invoked once per visible text block. Its render function returns a DOM node that the SDK positions as an overlay aligned to the block's bounding box. The customer can render decorations (a selection ring, custom handles, a styled caret) and use CSS to hide the bundled chrome they want to replace.

Interface

Properties

{ x: number; y: number }

Anchor in page coordinates.

PropertyDescription
x
y
{ height: number; left: number; top: number; width: number }

Bounding box in page coordinates.

PropertyDescription
height
left
top
width
{ height: number; x: number; y: number } | null

Cursor (insertion point). Present only when interactionState === "active" and the selection is collapsed.

PropertyDescription
height

Caret height in page coordinates.

x

Pixel x within the block (page coordinates, before zoom).

y

Pixel y within the block (page coordinates, before zoom).

string

Opaque block identifier. Do not parse; use pageIndex / textBlockId for structured data.

"selected" | "idle" | "active" | "moving"

Whether the block is idle, selected (clicked), active (editing), or being moved.

boolean
{ … }

Paragraph-level layout.

PropertyDescription
alignment
lineSpacingFactor
maxWidth
number
readonly { … }[]

Text broken into runs of uniform style — what a renderer needs to draw mixed-styled content (e.g. half a sentence bold, half italic).

{ begin: number; end: number } | null

Text selection inside this block. Present only when interactionState === "active" and a non-empty range is selected.

PropertyDescription
begin
end
string

Plain text content of the block.