@lexical/extension/IMEExtension
Variables
IMEExtension
constIMEExtension:LexicalExtension<ExtensionConfigBase,"@lexical/extension/IME", {composingTextNode:Signal<TextNode|null>;compositionKey:Signal<string|null>; },unknown>
Defined in: packages/lexical-extension/src/IMEExtension.ts:52
Centralizes IME composition state so extensions that react to composition lifecycle don't each re-implement the COMPOSITION_START_COMMAND + compositionend listener dance.
Exposes two signals (both always-active for the editor's lifetime —
listeners are wired up by register, not lazily on subscription, so
consumers can read .value from anywhere without holding a
subscription themselves):
-
compositionKeyis the raw mirror — the value Lexical's own$handleCompositionStartwrites to its internal_compositionKey, i.e. theselection.anchor.keyat the moment composition starts. This can be a non-TextNode key when composition begins on an element-anchor selection (e.g. empty paragraph). Cleared oncompositionend. -
composingTextNodeis the resolved view — the actual TextNode being composed on, ornullwhile there is no TextNode-level composition. For an element-anchor start it staysnulluntil theCOMPOSITION_START_TAG-tagged update fires with the post-ZWSP-heuristic selection, at which point it updates to the new TextNode.