Commit graph

1254 commits

Author SHA1 Message Date
Eberhard Beilharz
43ec5c28fa
Merge pull request #15220 from keymanapp/refactor/web/corekbdproctests
refactor(web): make core adapter and processor tests headless

Also improve Core Adapter to detect if we're running in a browser or on node.js and load the appropriate km-core module.

Follow-up-of: #13993
2025-11-27 13:09:41 +01:00
Eberhard Beilharz
cc12161d84
refactor(web): make core adapter and processor tests headless
Also improve Core Adapter to detect if we're running in a browser or on
node.js and load the appropriate km-core module.

Follow-up-of: #13993
Test-bot: skip
2025-11-24 17:27:44 +01:00
Eberhard Beilharz
0cd87ba898
docs(web): add comment why output() is on keyboard interface
Follow-up-of: #15190
Build-bot: skip
Test-bot: skip
2025-11-24 16:16:42 +01:00
Eberhard Beilharz
1e53d7413b
Merge pull request #15210 from keymanapp/refactor/web/testexports 2025-11-24 12:17:46 +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
f8404a82e4
Merge pull request #15211 from keymanapp/test/web/nestedInstanceOf
test(web): add unit tests for `nestedInstanceOf`

Also rename file `utils.ts` to `nestedInstanceOf.ts`.
2025-11-21 12:11:25 +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
7882573095
Update web/src/engine/src/element-text-stores/inputTextStore.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-11-21 11:29:06 +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
Eberhard Beilharz
23dbbc88f6
Merge pull request #13993 from keymanapp/feat/web/13926_kbdprocessing 2025-11-21 11:15:31 +01:00
Eberhard Beilharz
597e433a0f
test(web): add unit tests for nestedInstanceOf
Also rename file `utils.ts` to `nestedInstanceOf.ts`.

Test-bot: skip
2025-11-20 16:46:08 +01:00
Eberhard Beilharz
35c2507c3e
refactor(web): remove duplicate exports
Previously we re-exported the exports of `element-text-stores` in
`attachment` because it was needed in unit tests. This change removes
this re-export - should be solved differently, but it turns out that
all current tests pass even without the re-export.

This comes out of
[a review comment in #15092](https://github.com/keymanapp/keyman/pull/15092#discussion_r2493048032).

Follow-up-of: #15092
Test-bot: skip
2025-11-20 16:41:37 +01:00
Marc Durdin
c2204e4dfc chore: Merge remote-tracking branch 'origin/epic/web-core' into auto/A19S16-merge-master-into-web-core
Test-bot: skip
Build-bot: skip build:web
2025-11-20 15:06:01 +01:00
Eberhard Beilharz
bd0ba61a68
refactor(web): introduce type KeyboardInfoPair 2025-11-19 19:49:53 +01:00
Eberhard Beilharz
6975bf383e
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
Test-bot: skip
2025-11-19 15:17:34 +01:00
Eberhard Beilharz
bb2e6e6466
chore(web): Merge branch 'epic/web-core' into feat/web/13926_kbdprocessing 2025-11-18 15:31:02 +01:00
Eberhard Beilharz
e75327dc44
feat(web): properly treat SMP characters in context
Addresses code review comments.
2025-11-18 15:21:37 +01:00
Eberhard Beilharz
e970cb7fdf
Update web/src/engine/src/core-processor/coreKeyboardProcessor.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-11-17 19:28:22 +01:00
Eberhard Beilharz
b0ea7e58c8
Update web/src/engine/src/core-processor/coreKeyboardProcessor.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-11-17 19:28:06 +01:00
Eberhard Beilharz
97a624dc50
docs(web): add jsdoc documentation
This addresses code review comments. Also change the order of some
functions to put them in a more logical order.
2025-11-17 18:54:37 +01:00
Eberhard Beilharz
8fd825e252
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
Test-bot: skip
2025-11-14 15:44:34 +01:00
Marc Durdin
274d0f836a
docs(web): update TODO-web-core after code review
Reviewed work remaining on web-core and updated TODOs accordingly; some
have been moved to epic/embed-osk-in-kmx.

Test-bot: skip
2025-11-14 15:23:56 +01:00
Eberhard Beilharz
51b05c9661
feat(web): implement CoreKeyboardProcessor context functions
This implements and uses`CoreKeyboardProcessor.applyContextFromTextStore`
and `CoreKeyboardProcessor.saveMarkersToTextStore`, and also adds unit
tests.

Fixes: #13926
Test-bot: skip
2025-11-14 15:16:40 +01:00
Eberhard Beilharz
a76c148742
feat(web): add KeyboardProcessor interface and CoreKeyboardProcessor class
Basic key events are working with this change, and it is possible to type
on a hardware keyboard.

Part-of: #13926
Test-bot: skip
2025-11-14 15:15:28 +01:00
Eberhard Beilharz
a7083e7960
feat(web): move/add core-adapter module
This change moves the core adapter to core-adapter module which contains
the code to bind to the the WASM core binaries and adds additional type
definitions for Core.

Part-of: #13926
Test-bot: skip
2025-11-14 15:10:20 +01:00
Eberhard Beilharz
8191c6910f
feat(web): add Deadkey.toString function
This allows to use `console.log(deadkey.toString())` to get the values
of a deadkey.

Test-bot: skip
2025-11-12 19:45:00 +01:00
Eberhard Beilharz
98fa9e3003
fix(web): add unit tests for DeadkeyTracker and fix a few bugs
- initialize `Deadkey.matched` in c'tor
- fix `Deadkey.equal` method
- verify deadkey exists before removing it in `DeadkeyTracker.remove`
- add unit tests for DeadkeyTracker

Test-bot: skip
2025-11-12 19:39:18 +01:00
Eberhard Beilharz
9710f5b06a
chore(web): remove duplicate deadkeys.ts
The file sneaked in through a merge/rebase.

Build-bot: skip
Test-bot: skip
2025-11-12 19:37:57 +01:00
Marc Durdin
dbb5f43d29
refactor(web): text-store: rename getDeadkeyCaret to getCaret
Also renames internal `_dks` to `_deadkeys`.

Test-bot: skip
2025-11-12 19:35:21 +01:00
Marc Durdin
a8339bd565
Merge branch 'epic/web-core' into maint/web/build-script-perf 2025-11-10 14:50:59 +01:00
Marc Durdin
bdca09bdeb
Merge pull request #15107 from keymanapp/refactor/web/sentry-manager-to-common-web
refactor(web): move sentry-manager and es-bundling to common 🎼
2025-11-10 14:49:58 +01:00
Eberhard Beilharz
408514daf3
Update web/src/engine/js-processor/src/deadkeys.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-11-10 12:00:28 +01:00
Eberhard Beilharz
269d619ed9
docs(web): add another clarifying comment 2025-11-07 17:32:33 +01:00
Eberhard Beilharz
03831e4f25
fix(web): clarify meaning of parameters for isMatch 2025-11-07 13:47:23 +01:00
Eberhard Beilharz
98ed960c8f
fix(web): address code review comments 2025-11-07 13:22:45 +01:00
Eberhard Beilharz
28d3378589
fix(web): add unit tests for DeadkeyTracker and fix a few bugs
- initialize `Deadkey.matched` in c'tor
- fix `Deadkey.equal` method
- verify deadkey exists before removing it in `DeadkeyTracker.remove`
- add unit tests for DeadkeyTracker

Test-bot: skip
2025-11-07 12:09:54 +01:00
Marc Durdin
feff055d8a chore(web): Merge remote-tracking branch 'origin/epic/web-core' into refactor/web/downgrade-web-utils-from-package-to-module 2025-11-07 09:25:10 +00:00
Marc Durdin
8eb7e6b0d4 maint(web): cleanup web/**/build.sh for consistency and build performance
* Simplify the build dependency / child tree
* Split building and testing tooling so we don't rebuild components
* Fixup expected outputs to avoid repeated builds of components
* Remove unused dependency references
* Move test.sh targets into build.sh, so that testing doesn't lose
  dependency tracking and cause unnecessary rebuilds. (Note that I have
  not yet deleted test.sh.)
* Make predictive-text a direct child of engine, so that we don't build
  it twice (or even more times)

Test-bot: skip
2025-11-07 10:08:38 +01:00
Eberhard Beilharz
7a7dcf8878
chore(web): apply suggestions from code review
Theses changes come out of code review of #12291.

Follow-up-of: #12291
Test-bot: skip
2025-11-06 19:13:40 +01:00
Eberhard Beilharz
fb728d922d
refactor(web): remove duplicate element-text-stores folder
Test-bot: skip
2025-11-06 19:12:49 +01:00
Marc Durdin
86a903dcf5 refactor(web): move sentry-manager and es-bundling to common
sentry-manager is used by Keyman Engine for Android and Keyman Engine
for iOS, but not directly by KeymanWeb, nor does it have any
dependencies on /web. So it does not make sense to keep it under /web.

es-bundling is used by sentry-manager and potentially other /common/web
tools in the future, so moving it under /common/tools makes it more
consistent in the future.

This is part of simplifying the web source tree; these changes do not
make significant build performance differences at this time.

Test-bot: skip
2025-11-06 15:28:04 +01:00
Marc Durdin
2e51955055 chore(web): Merge branch 'refactor/web/merge-engine-modules' into refactor/web/downgrade-web-utils-from-package-to-module 2025-11-06 14:07:19 +01:00
Marc Durdin
d94292959c chore(web): Merge branch 'epic/web-core' into refactor/web/merge-engine-modules 2025-11-06 10:54:25 +01:00
Marc Durdin
1f8f5d8796
Merge branch 'refactor/web/merge-engine-modules' into refactor/web/downgrade-web-utils-from-package-to-module 2025-11-06 08:08:38 +01:00
Eberhard Beilharz
e519d12032
Merge pull request #15096 from keymanapp/refactor/web/textStoreInterface
refactor(web): extract minimal TextStore interface that LanguageProcessor can use 🎼
2025-11-06 08:07:29 +01:00
Marc Durdin
6cf378daf8 chore(web): address review comments 2025-11-06 07:51:43 +01:00
Marc Durdin
41c9cef797 refactor(web): change @keymanapp/web-utils to keyman/common/web-utils
Removes the need for package.json references for @keymanapp/web-utils,
and relies on bundler to include keyman/common/web-utils when building.
2025-11-06 07:24:36 +01:00
Eberhard Beilharz
a9f0e2d212
refactor(web): address code review comments
- rename TextStoreTranscriptionInterface → TextStoreLanguageProcessorInterface
- also fixup references to TextStore in languageProcessor.interface.ts
2025-11-05 16:54:16 +01:00
Eberhard Beilharz
6c755e7c86
refactor(web): address code review comments 2025-11-05 15:58:59 +01:00