Commit graph

32923 commits

Author SHA1 Message Date
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
7ec6f8c523
Merge pull request #15168 from keymanapp/feat/web/corekbdproc
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
Follows: #15167
2025-11-18 14:23:58 +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
08e92a4352
Merge pull request #15167 from keymanapp/feat/web/kmxtestpage
feat(web): add KMX keyboard test page

Part-of: #13926
Follows: #15166
2025-11-17 17:28:40 +01:00
Eberhard Beilharz
5ce9a3edd1
feat(web): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-11-17 16:55:55 +01:00
Eberhard Beilharz
ce6a768b64
Merge pull request #15166 from keymanapp/feat/web/core-adapter
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
Follows: #15165
2025-11-17 11:07:07 +01:00
Eberhard Beilharz
665f259b34
Merge branch 'epic/web-core' into feat/web/core-adapter 2025-11-17 08:31:33 +01:00
Eberhard Beilharz
db056f66aa
Merge pull request #15165 from keymanapp/fix/web/cherry-pick/defaultpaths
fix(web): improve determination of default path 🍒

Browser extensions can dynamically insert scripts into a web page, so it's possible that the last script is not what we expected, which can cause the path to the script to be wrong. This change fixes the determination of the default path by using the `document.currentScript` property. It also replaces the use of the deprecated `substr` function in those places.

Cherry-pick-of: #15159
Fixes: #15158
2025-11-17 08:31:02 +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
14826a4ab6
feat(web): add KMX keyboard test page
Part-of: #13926
Test-bot: skip
2025-11-14 15:12:08 +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
3897517760
fix(web): improve determination of default path 🍒
Browser extensions can dynamically insert scripts into a web page, so
it's possible that the last script is not what we expected, which
can cause the path to the script to be wrong. This change fixes the
determination of the default path by using the `document.currentScript`
property. It also replaces the use of the deprecated `substr` function
in those places.

Cherry-pick-of: #15159
Fixes: #15158
Test-bot: skip
2025-11-14 15:05:38 +01:00
Eberhard Beilharz
f9985e3778
Merge pull request #15149 from keymanapp/feat/web/contextwasm
feat(web): expose `km_core_context_get/set` to WASM

Also remove `EMSCRIPTEN_KEEPALIVE` which is not needed when using embind (cf [this article](https://web.dev/articles/embind#enter_embind). Also the [embind docs](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html) have all the samples without using EMSCRIPTEN_KEEPALIVE).
2025-11-13 16:27:00 +01:00
Eberhard Beilharz
c02805ec90
Merge pull request #15148 from keymanapp/feat/web/tostring
feat(web): add `Deadkey.toString` function

This allows to use `console.log(deadkey.toString())` to output the values of a deadkey which is useful for debugging.
2025-11-13 15:35:08 +01:00
Eberhard Beilharz
ad8eb0686d
Merge pull request #15147 from keymanapp/fix/web/dktracker
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

Cherry-pick-of: #15113
2025-11-13 15:34:13 +01:00
Eberhard Beilharz
4e61b98bf5
Merge pull request #15146 from keymanapp/chore/web/duplicatedk
The file sneaked in through a merge/rebase.
2025-11-13 15:32:10 +01:00
Eberhard Beilharz
5a3f98ee32
Merge pull request #15145 from keymanapp/refactor/web/getcaret
refactor(web): text-store: rename `getDeadkeyCaret` to `getCaret`

Also renames internal `_dks` to `_deadkeys`.
2025-11-13 15:31:42 +01:00
Eberhard Beilharz
bc0c75162c
Merge pull request #15144 from keymanapp/maint/core/cherry-pick/mesonoptions
Meson 1.1 changed the name of the options file from `meson_options.txt` to `meson.options`. Currently we're stuck with Meson 1.0 as minimum Meson version because we still support Ubuntu 22.04 Jammy, but on some machines a newer version of meson gets installed which causes the options to be ignored.

The first attempt to simply symlink or copy `meson_options.txt` to `meson.options` failed because git on Windows doesn't support symlinks by default, and Meson complains if it finds two options files (#15127).

Fortunately not having an options file is only a problem for Core where we have one option in the options file that defaults to true. The solution implemented in this change is to always pass the option to Meson.

Cherry-pick-of: #15131
2025-11-13 11:05:21 +01:00
Eberhard Beilharz
937460b104
feat(web): expose km_core_context_get/set to WASM
Test-bot: skip
2025-11-12 19:50:29 +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
Eberhard Beilharz
081e72b7ca
maint(core): fix option defaults for Meson >= 1.1 🍒
Meson 1.1 changed the name of the options file from `meson_options.txt`
to `meson.options`. Currently we're stuck with Meson 1.0 as minimum
Meson version because we still support Ubuntu 22.04 Jammy, but on some
machines a newer version of meson gets installed which causes the
options to be ignored.

The first attempt to simply symlink or copy `meson_options.txt` to
`meson.options` failed because git on Windows doesn't support symlinks
by default, and Meson complains if it finds two options files (#15127).

Fortunately not having an options file is only a problem for Core where
we have one option in the options file that defaults to true. The solution
implemented in this change is to always pass the option to Meson.

Cherry-pick-of: #15131
Test-bot: skip
2025-11-12 19:30:20 +01:00
Marc Durdin
03755fb3fd
Merge pull request #15111 from keymanapp/maint/web/build-script-perf
maint(web): cleanup web/**/build.sh for consistency and build performance 🎼
2025-11-11 07:19:51 +01:00
Marc Durdin
d07dbfefd6 chore(web): npm install and remove unused dep 2025-11-11 06:31:33 +01:00
Marc Durdin
a177526dbe
Merge branch 'epic/web-core' into maint/web/build-script-perf 2025-11-10 14:59:57 +01:00
Marc Durdin
cf1add0bb4
Merge pull request #15112 from keymanapp/fix/web/dont-reset-context-with-beep
fix(web): don't reset context cache with beep 🎼
2025-11-10 14:51:06 +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
Marc Durdin
0c6c9a5f9e
Merge pull request #15124 from keymanapp/auto/A19S15-merge-master-into-web-core
auto: A19S15 merge master into web-core 🎼
2025-11-07 17:56:45 +01:00
Marc Durdin
aa6b3c328e chore: Merge branch 'epic/web-core' into auto/A19S15-merge-master-into-web-core 2025-11-07 14:23:43 +01:00
Marc Durdin
5b6540a6eb
Merge pull request #15102 from keymanapp/refactor/web/downgrade-web-utils-from-package-to-module
refactor(web): change @keymanapp/web-utils to keyman/common/web-utils 🎼
2025-11-07 11:42:33 +01:00
Marc Durdin
db187e52ad fix(web): don't clear context when beep happens
After review with @ermshiperete, we decided to remove this. It is
unclear to me why we were ever clearing the context when a beep was
triggered by the keyboard. This is legacy from v2.0 of KeymanWeb, and I
suspect it's an edge case that no one has ever noticed, but I can't see
a reason to keep it.

Test-bot: skip
2025-11-07 09:58:46 +00: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
9376f08761
Merge pull request #15110 from keymanapp/chore/web/codereview
chore(web): apply suggestions from code review 🎼
2025-11-07 08:23:05 +01:00
Eberhard Beilharz
424fc59271
Merge pull request #15109 from keymanapp/refactor/web/element-text-stores
refactor(web): remove duplicate element-text-stores folder 🎼
2025-11-07 08:22:46 +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
Keyman Server
2069d7fd44
Merge pull request #15108 from keymanapp/auto/version-master-19.0.158
auto: increment master version to 19.0.158
2025-11-06 19:03:44 +01:00
Keyman Build Agent
c58ce35248 auto: increment master version to 19.0.158
Test-bot: skip
Build-bot: skip
2025-11-06 12:01:22 -06: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
5b37e843be
Merge pull request #15106 from keymanapp/refactor/web/defaultContextMgr
refactor(web): change default export of ContextManager 🎼
2025-11-06 14:15:24 +01:00
Marc Durdin
eb8e08ab3c
Merge pull request #15093 from keymanapp/refactor/web/merge-engine-modules
refactor(web): merge engine modules 🎼
2025-11-06 14:14:40 +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