Commit graph

5462 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
0954456d93
Merge pull request #15212 from keymanapp/test/web/textStoreForElement
docs(web): add clarifying comment for filename

See https://github.com/keymanapp/keyman/pull/15092#discussion_r2493661810 for background.

Follow-up-of: #15092
2025-11-21 12:10:39 +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
c9f8e880a8
docs(web): address code review comments
Build-bot: skip
Test-bot: skip
2025-11-21 11:13:23 +01:00
Eberhard Beilharz
cd52afc084
docs(web): add clarifying comment for filename
Follow-up-of: #15092
Test-bot: skip
2025-11-20 16:47:57 +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
ee913792c0
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.

Test-bot: skip
2025-11-19 19:59:58 +01:00
Eberhard Beilharz
c1e94bdca9
test(web): add unit tests for ContextManager.insertText 2025-11-19 19:50:31 +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
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
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
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
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
ef64529300
Merge pull request #15159 from keymanapp/fix/web/defaultpath
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.

Fixes: #15158
2025-11-14 14:50:44 +01:00
Marc Durdin
57c0fa3d03
Merge pull request #15129 from keymanapp/maint/resources/builder_launch
maint(resources): add `builder_launch` function
2025-11-14 14:24:19 +01:00
Eberhard Beilharz
fc04e2445b
fix(web): address code review comments
Deal with `currentScript` being null/undefined.
2025-11-14 12:35:59 +01:00
Eberhard Beilharz
cb1a308418
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.

Fixes: #15158
Test-bot: skip
2025-11-13 18:41:27 +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
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
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
Marc Durdin
5dbc438f53 maint(resources): add builder_launch function
Use `builder_launch` to launch other builder scripts rather than calling
directly, so that inheritable state and options are passed through.

Test-bot: skip
2025-11-10 11:46:14 +01:00