@rendley/sdk - v1.16.1
    Preparing search index...

    Class TextEditSession

    A single interactive text-editing session on one text clip — the text counterpart of BoundsEditSession.

    The SDK owns what a host cannot reliably reproduce (the text frame geometry, the renderer's typography as CSS, the live sprite update, undo bookkeeping); the host owns the DOM element (focus, caret, IME, keyboard, mobile). The intended split is: the canvas keeps rendering the glyphs, the host overlays a transparent textarea that only supplies caret, selection and input.

    • Live updates record nothing: setText() updates the sprite through the normal setter (so CLIP_UPDATED_TEXT keeps flowing and host mirrors stay in sync) with undo paused.
    • One undo entry per session: commit() records the initial → final text as a single entry; a session that ends with the text it started with records nothing.
    • Cancel: cancel() restores the initial text and records nothing — Escape in one call.
    • Animation overrides are suspended for the clip's text property while a session is open, so the glyphs under the caret are always the stored text.

    Obtain via TextClip.beginTextEdit(). A session must be finished with exactly one of commit() or cancel(); beginning a new session on the same clip cancels an unfinished one, and destroying the clip cancels it too.

    Index

    Constructors

    Methods

    • Aborts the session: restores the initial text and records nothing.

      Returns void

    • Finishes the session, recording the whole initial -> final change as ONE undo entry, exactly the entry a single direct edit would have recorded. The clip already renders the final text, so nothing is re-applied and no event is emitted.

      Returns void

    • The text captured when the session began — what cancel() restores.

      Returns string

    • Current placement and typography of the text, fresh after every setText() (the sprite is re-measured synchronously) and after any style change on the clip.

      Returns TextEditOverlay

    • The text currently on the clip.

      Returns string

    • Returns boolean

    • Live update: renders text on the clip without recording undo. Emits CLIP_UPDATED_TEXT like a direct edit.

      Parameters

      • text: string

      Returns void