@liam-public/browser-vietnamese-ime
v0.1.0
Published
Browser Vietnamese IME engine and DOM controller for Telex and VNI input.
Readme
@liam-public/browser-vietnamese-ime
Browser Vietnamese IME engine and DOM controller for Telex and VNI input.
What it does
inHouseEngine— a pure, framework-agnostic transform that turns ASCII keystrokes (Telex or VNI) into composed Vietnamese characters with correct tone placement.attachIme(engine, getMethod)— a capture-phasekeydowncontroller that rewrites eligible text inputs/textareas in place and dispatches a syntheticinputevent so React/Vue/etc.onChangehandlers pick up the change. Returns a detach function.
Inputs are skipped when type is email/password/number/tel/url, when
inputMode is numeric/tel/decimal, when the element is read-only/disabled, or when it
is inside a [data-no-ime] subtree.
Usage
import { attachIme, inHouseEngine, type ImeMethod } from '@liam-public/browser-vietnamese-ime'
let method: ImeMethod = 'telex'
const detach = attachIme(inHouseEngine, () => method)
// ...later
detach()Exports
inHouseEngine: ImeEngineattachIme(engine: ImeEngine, getMethod: () => ImeMethod): () => void- types:
ImeEngine,ImeMethod,ImeTransformResult
