Commit graph

548 commits

Author SHA1 Message Date
Marc Durdin
1f82507730 docs(web): deprecate unused and obsolete API endpoints and docs cleanup
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
2026-08-12 16:07:22 +02:00
Marc Durdin
b40c4b376b fix(web): cleanup loaduserinterface and unloaduserinterface events
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
2026-08-12 15:51:55 +02:00
Eberhard Beilharz
e772775461
Merge pull request #16311 from keymanapp/refactor/web/setTargetDir
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`.
2026-08-10 13:53:56 +02:00
Eberhard Beilharz
870903dccb
refactor(web): fix return type of currentKeyboardSrcTextStore
`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
2026-08-07 09:37:14 +02:00
Eberhard Beilharz
363f71e9de
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`.

Build-bot: skip build:web
Test-bot: skip
2026-08-07 08:54:22 +02:00
Eberhard Beilharz
21f744f44a
Merge pull request #16286 from keymanapp/refactor/web/contextManager
refactor(web): adjust function visibility and variable names
2026-07-30 15:51:50 +02:00
Eberhard Beilharz
d9f572f92d
refactor(web): adjust function visibility and variable names
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
The functions are only used inside of the class, so this change makes
them private. Also update some variable names.

Test-bot: skip
2026-07-27 14:17:33 +02:00
Eberhard Beilharz
76058bcc52
chore(web): update help links to use latest version
This updates three in-code help links to point to `current-version`
instead of an outdated version page.

Build-bot: skip
Test-bot: skip
2026-07-27 13:22:04 +02:00
Marc Durdin
07daf94555
Merge pull request #16170 from keymanapp/fix/web/16144-define-interfaces-for-imes-in-base
fix(web): define IME interfaces in `KeyboardInterfaceBase`
2026-07-11 00:25:31 +10:00
Marc Durdin
e6d86d7e04 refactor(web): rename keymanweb to keyman in UI modules
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
2026-07-01 09:18:11 +02:00
Marc Durdin
0fc869faa4 fix(web): define IME interfaces in KeyboardInterfaceBase
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
2026-07-01 07:43:08 +02:00
Eberhard Beilharz
517e9d26f3
Merge pull request #16064 from keymanapp/chore/web/449_rm_kmw
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
2026-06-09 18:08:15 +02:00
Eberhard Beilharz
c31cbecce1
Merge pull request #16066 from keymanapp/refactor/web/reformatting
refactor(web): reformatting of files
2026-06-09 14:38:32 +02:00
Eberhard Beilharz
c1113ac21d
chore(web): address code review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Also change a few places that I missed.
2026-06-08 19:27:12 +02:00
Eberhard Beilharz
57a0d63e47
refactor(web): address code review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-06-08 17:47:45 +02:00
Eberhard Beilharz
f218aa92db
refactor(web): reformatting of files
Test-bot: skip
2026-06-03 19:51:44 +02:00
Eberhard Beilharz
43398df243
refactor(web): extract function, rename variables
Test-bot: skip
2026-06-03 18:40:18 +02:00
Eberhard Beilharz
a7b9d5da5a
fix(web): fix displaying of keyboard menu
The recent partial merge of epic/web-core missed some code that causes
the keyboard menu to work. This change re-applies those changes.

Test-bot: skip
2026-06-02 18:29:03 +02:00
Eberhard Beilharz
e21f2020d0
Merge pull request #16042 from keymanapp/fix/web/16041_displaymenu
fix(web): fix race displaying active keyboard in menu
2026-06-02 15:28:19 +02:00
Eberhard Beilharz
f827936362
fix(web): fix race in kmwuifloat.ts as well 2026-06-02 12:15:12 +02:00
Eberhard Beilharz
3cb59e3cf9
fix(web): fix race displaying active keyboard in menu
Fixes: #16041
Build-bot: skip release:web
Test-bot: skip
2026-06-01 17:51:42 +02:00
Marc Durdin
439bdce6b5
Merge branch 'chore/web-core-preflight' into chore/web-core-strip-core 2026-06-02 00:52:28 +10:00
Marc Durdin
fc82f28b2d chore(web): web-core preflight - strip core references
In order to maintain roughly the current build artifact size, strip out
the unfinished core integration from what we merge with preflight.

Test-bot: skip
Build-bot: release:android,ios,developer,web
2026-06-01 14:44:45 +02:00
Eberhard Beilharz
9423ee504f chore(web): cleanup web/src/app/browser/src/test-index.ts exports
The export of `test-index.ts` were intended to be used by tests only,
but over time they contained also exports that were consumed else where,
e.g. in UI classes like `kmwuibutton.ts`. This change removes unused
exports, moves test-only classes to a `unitTestEndPoints` container and
marks test-only types with `@internal`.

Build-bot: skip build:web
Test-bot: skip
2026-05-29 12:02:19 +02:00
Eberhard Beilharz
d2f9e39c3e refactor(web): use KeyboardDetails type 🧼
PR #15856 introduced the `KeyboardDetails` type but overlooked the use in
one file.

Follow-up-of: #15856
Follows: #15887
Build-bot: skip build:web
Test-bot: skip
2026-05-29 12:00:17 +02:00
Eberhard Beilharz
904fa97198 refactor(web): address code review comment
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-05-29 11:59:56 +02:00
Eberhard Beilharz
689f664ea0 refactor(web): rename variables and parameter names in KeymanEngine 🧼
Build-bot: skip build:web
Test-bot: skip
2026-05-29 11:59:55 +02:00
Eberhard Beilharz
b5be1d45f0 chore(web): address code review comments 2026-05-29 11:59:33 +02:00
Eberhard Beilharz
bc8a4b6f43 refactor(web): cleanup return types in KeymanEngine
This change explicitly specifies the return types and access for the
functions in KeymanEngine. Also introduce `KeyboardDetails` instead of
`ReturnType<>`.

Test-bot: skip
2026-05-29 11:59:32 +02:00
Eberhard Beilharz
115ab18d71
refactor(web): add abstract Keyboard base class
Also rename `JSKeyboardData` → `KeyboardData`.

Test-bot: skip
2026-04-16 22:18:08 +02:00
Joshua Horton
b7975973af maint(web): ensure Web build scripts handle paths with spaces properly
The command shortcuts that were used by Web
scripts to create bundles via `esbuild` were not
properly handling the $KEYMAN_ROOT path when it
contained a space.  These changes will rectify
this behavior and permit builds for such cases.

Build-bot: skip build:web
Test-bot: skip
2026-02-18 09:14:30 +07:00
Eberhard Beilharz
4992268b77
feat(web): add unit test for RTL
This change stubs out `KMXKeyboard.isRTL` and adds a unit test for RTL
with .js and  .kmx (currently skipped) keyboards. Also change some code
to use `Keyboard` instead of `JSKeyboard` and stub out additional methods.

The RTL functionality will have to be completed when the necessary
extensions to the Core API are implemented (#15482).

Fixes: #15288
Test-bot: skip
2026-01-29 14:52:55 +01:00
Eberhard Beilharz
40ce71a63f
refactor(web): address code review comments
The definition of `DEFAULT_PROCESSOR_INIT_OPTIONS` got lost in
last PR.

Test-bot: skip
2026-01-21 13:07:43 +01:00
Eberhard Beilharz
ad10627e1c
chore(web): Merge branch 'refactor/web/defaultRules' into refactor/web/ProcessorInitOptions 2026-01-20 12:12:22 +01:00
Eberhard Beilharz
8ecaae5f21
refactor(web): address code review comments
- remove confusing comment
- move default ProcessorInitOptions to tests folder
- add jsdoc comments to ProcessorInitOptions

Test-bot: skip
2026-01-20 12:10:25 +01:00
Eberhard Beilharz
2641681f89
chore(web): Merge branch 'epic/web-core' into refactor/web/defaultRules 2026-01-20 11:45:09 +01:00
Eberhard Beilharz
77b4bd8037
refactor(web): options parameter mandatory in JSKeyboardProcessor c'tor
This makes the `options` parameter in the `JSKeyboardProcessor`
constructor no longer optional.
Also `baseLayout` and `defaultOutputRules` are now required in
`ProcessorInitOptions`.

For testing purposes we export `DEFAULT_OPTIONS` in a testing endpoint.

Test-bot: skip
2026-01-16 17:48:40 +01:00
Eberhard Beilharz
f22faa1c04
refactor(web): rename DefaultRules → DefaultOutputRules
Test-bot: skip
2026-01-16 17:11:28 +01:00
Eberhard Beilharz
9930a8cbae
refactor(web): remove web-utils exports from keyboard
Types defined in keyman/common/web-utils were re-exported in
keyman/engine/keyboard. This change removes the re-export.

Part-of: #15292
Test-bot: skip
2026-01-16 16:25:32 +01:00
Eberhard Beilharz
050d18aa94
refactor(web): Rename (Default)Worker to WebWorker and NodeWorker
Addresses code review comment: `Worker` is a generic and semi-reserved
name that we should not be stepping on.

This renames it to `WebWorker` instead of the suggested `LMWorker` or
`PredictiveTextWorker`. `WebWorker` is a name that was already used
in a few places and seems to better match: there is a corresponding
class for running with node. Naming it `WebWorker` makes it clearer
that this is the corresponding class when running in the browser.

The corresponding class for running under node was renamed to `NodeWorker`.

Test-bot: skip
2026-01-12 10:52:05 +01:00
Eberhard Beilharz
f9f804c190
feat(web): remove 'export default' to eliminate more aliases
Fixes: #15292
Test-bot: skip
2026-01-07 15:36:33 +01:00
Eberhard Beilharz
f276c672c0
Merge pull request #15344 from keymanapp/refactor/web/constants
chore(web): remove default from hardware keyboard 

Also some other refactorings like use constants instead of hard coded values.
2025-12-22 14:33:53 +01:00
Eberhard Beilharz
878b8ab2f0
chore(web): remove default from hardware keyboard
Test-bot: skip
2025-12-11 19:27:04 +01:00
Eberhard Beilharz
dbb05e3fcc
refactor(web): use constants instead of hard coded values
And some other refactorings.

Test-bot: skip
2025-12-11 19:27:03 +01:00
Eberhard Beilharz
79ad53f9cf
refactor(web): document and cleanup parameters of Keyboard.notify()
Document what values are possible for the `eventCode` parameter and what
these values mean. Also change `data` parameter to a `boolean`.

Test-bot: skip
2025-12-09 20:14:14 +01:00
Eberhard Beilharz
133f46330d
chore(web): add issue# for some todos
Also use const instead of let in `renderer_core.ts`.

Test-bot: skip
2025-12-04 15:57:08 +01:00
Eberhard Beilharz
62a566cc6b
Merge pull request #15190 from keymanapp/refactor/web/gettingTextStore
refactor(web): simplify `insertText`

Getting the textStore was done twice, without the second time changing the result. Additionally, `insertText` in the super class also gets the active text store and returns false if it is not set. This change removes those additional code lines that are not needed.

Also adds unit tests for `ContextManager.insertText`, and introduces new type `KeymanInfoPair`.

Follow-up-of: #15092
2025-11-21 12:14:44 +01:00
Eberhard Beilharz
a35bd2b6f6
Merge pull request #15189 from keymanapp/refactor/web/mockvars
refactor(web): rename target and mock variables and functions

This change renames `target` and `mock` variables that identify a text store. Similarly it renames functions with `Target` in the name.

Follow-up-of: #15092
2025-11-21 12:09:24 +01:00
Eberhard Beilharz
4d63a25878
Merge pull request #15170 from keymanapp/refactor/web/preinput
refactor(web): change `preInput` to `SyntheticTextStore`

`preInput` always contains a `SyntheticTextStore`, so this change modifies the type of the property so that we don't have to always cast it.

Follow-up-of: #15092
2025-11-21 11:16:52 +01:00
Eberhard Beilharz
5320865f6c
Merge pull request #15169 from keymanapp/docs/web/todos 2025-11-21 11:16:06 +01:00