fix(web): allow to set default keyboard to 'off'
The parameters for setKeyboardForControl basically have three different modes: - an id of a keyboard/language to set that keyboard, enabling independent keyboard mode - empty string to set the system keyboard, enabling independent keyboard mode - null to disable independent keyboard mode.
Our previous code didn't properly handle the last two modes. This change fixes the problems and also clarifies and updates the documentation.
Also included is an improvement to the guide-examples e2e tests that now wait until all keyboards are loaded (which may fix#16167).
Partially drafted by kilo.ai.
User tests will follow in an upcoming PR for #16522.
Fixes: #16080
The parameters for `setKeyboardForControl` basically have three
different modes:
- an id of a keyboard/language to set that keyboard, enabling independent
keyboard mode
- empty string to set the system keyboard, enabling independent keyboard
mode
- `null` to disable independent keyboard mode.
Our previous code didn't properly handle the last two modes. This change
fixes the problems and also clarifies and updates the documentation.
Also included is an improvement to the guide-examples e2e tests that now
wait until all keyboards are loaded (which may fix#16167).
Partially drafted by kilo.ai.
Fixes: #16080
Build-bot: skip release:web
This is a legacy behaviour from pre KeymanWeb 2.0 days, probably to deal
with buggy rendering in older browsers. Removing as an unwanted
side-effect.
Fixes: #16503
Test-bot: skip
chore(web): tweak error message
Previously the browser component and web engine had the same error message which made it harder to know where the exception happened if a call stack or source map were missing. This change modifies the message in engine.
Related-to: #16190
The `onunload` event is deprecated. The only thing we do is cleanup,
which is not necessary if the page is being unloaded anyway.
Fixes: #16477
Test-bot: skip
Previously the browser component and web engine had the same error message
which made it harder to know where the exception happened if a call stack
or source map were missing. This change modifies the message in engine.
Related-to: $#16190
Build-bot: skip release:android,ios,web
Test-bot: skip
Deprecate the following obsolete functions and properties:
* `keyman.helpURL`
* `keyman.util.rgba`
* `keyman.util.toFloat`
* `keyman.util.toNumber`
* `keyman.util.toNzString`
Use correct language for code blocks in Keyman Engine for Web
documentation.
Test-bot: skip
The `loaduserinterface` and `unloaduserinterface` events were
incompletely implemented, and the documentation was incomplete. This
change:
1. ensures `loaduserinterface` is called any time a UI is set, either
during initialization or when the property is set later.
2. ensures `unloaduserinterface` is called immediately before a UI is
shutdown.
3. updates documentation
4. removes misleading commented code in kmwuifloat.ts
Test-bot: skip
refactor(web): improve naming of `_SetTargetDir` function
`_SetTargetDir` deals with setting the text direction of the target, not the target directory. This change mainly renames the private function to `setTargetTextDirection`.
`currentKeyboardSrcTextStore` can return `null` if the global
`textStore` should be used. This change reflects this in the return
type.
Build-bot: skip build:web
Test-bot: skip
`_SetTargetDir` deals with setting the text direction of the target,
not the target directory. This change mainly renames the private function
to `setTargetTextDirection`.
Build-bot: skip build:web
Test-bot: skip
The variable name `keymanweb` used in the UI modules is confusing
because `KeymanWeb` also exists and points to something else. Rename to
`keyman` which just mirrors `window.keyman`.
Also fixup type declaration for toolbar `lastDismissalCallback`, which
did not match the assigned type.
Fixes: #16168
Test-bot: skip
Ensure that the IME interface methods are all defined for both browser
and webview modes. Deprecate 'Element' methods and replace with
'TextStore' to clarify return type. Add deprecation flags where needed
and update documentation accordingly.
Fixes: #16144
chore(web): improve the KeymanWeb integration documentation
- replace use of `kmw` with `keyman`
- unify pattern to load keyboards: do it in `keyman.init().then()` instead of in the document `onload`
Part-of: keymanapp/keyman.com#449