Skip to main content

@lexical/dragon

Interfaces

DragonConfig

Defined in: packages/lexical-dragon/src/index.ts:215

Properties

disabled

disabled: boolean

Defined in: packages/lexical-dragon/src/index.ts:216

Variables

DragonExtension

const DragonExtension: LexicalExtension<DragonConfig, "@lexical/dragon", NamedSignalsOutput<DragonConfig>, unknown>

Defined in: packages/lexical-dragon/src/index.ts:223

Add Dragon speech to text input support to the editor, via the @lexical/dragon module.

Functions

installDragonSupport()

installDragonSupport(): () => void

Defined in: packages/lexical-dragon/src/index.ts:52

Install the shared window listener that handles Dragon NaturallySpeaking's web extension messages for every registered editor.

Browsers invoke a window's message listeners in registration order, and the extension's content script registers its own listener at document_end of the initial page load. registerDragonSupport installs this listener lazily, when the first editor is registered, which loses that race whenever editors mount after the initial load (a navigation in a single page app, a dialog, any lazily rendered field). The extension then edits the DOM directly before Lexical can stopImmediatePropagation, and the edit is applied twice.

Call this synchronously from every entrypoint that may render an editor lazily, before document_end, so the listener is ahead of the extension's and editors win the race no matter when they mount. Returns a teardown function; the listener is removed once every teardown (including the ones returned by registerDragonSupport) has been called.

Returns

() => void


registerDragonSupport()

registerDragonSupport(editor): () => void

Defined in: packages/lexical-dragon/src/index.ts:76

Parameters

editor

LexicalEditor

Returns

() => void