Commit graph

1276 commits

Author SHA1 Message Date
Eberhard Beilharz
4ba1fcbfb3
Merge pull request #15376 from keymanapp/refactor/web/keyboard-storage
refactor(web): remove defaults in keyboard-storage

- Also renamed `prefixed` and `withoutPrefix` functions to use the name   that was aliased on most cases: `toPrefixedKeyboardId` and   `toUnprefixedKeyboardId`. 
- Renamed `ModelManager` class to `ModelCache` which was the name used   everywhere except in comments.

Part-of: #15292
2025-12-22 14:53:28 +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
5b38557227
refactor(web): remove defaults in keyboard-storage
- Also renamed `prefixed` and `withoutPrefix` functions to use the name
  that was aliased on most cases: `toPrefixedKeyboardId` and
  `toUnprefixedKeyboardId`.
- Renamed `ModelManager` class to `ModelCache` which was the name used
  everywhere except in comments.

Part-of: #15292
Test-bot: skip
2025-12-19 18:43:02 +01:00
Eberhard Beilharz
72d12622ff
refactor(web): address code review comment 2025-12-19 11:59:32 +01:00
Eberhard Beilharz
1895a944a2
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-12-18 12:48:45 +01:00
Eberhard Beilharz
e4e76caea7
refactor(web): address code review comment
Build-bot: skip
Test-bot: skip
2025-12-17 15:55:52 +01:00
Eberhard Beilharz
4d644cd00e
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-12-15 15:44:42 +01:00
Eberhard Beilharz
1b04772bb9
refactor(web): address code review comments 2025-12-12 11:31:55 +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
654f1b2103
chore(web): Merge remote-tracking branch 'origin/epic/web-core' into feat/web/15283_keydown 2025-12-09 20:06:48 +01:00
Eberhard Beilharz
b7369d79d7
Merge pull request #15251 from keymanapp/test/web/baseline
test(web): add baseline tests

This adds the baseline tests from `/common/test/keyboards/baseline`. Some tests are skipped because they rely on functionality not implemented in Web, other tests are skipped because they require functionality still marked with `TODO-web-core` and should pass once web-core is finished.
2025-12-09 18:13:01 +01:00
Eberhard Beilharz
d594afb317
Merge pull request #15310 from keymanapp/maint/web/cleanup
maint(web): remove file that sneaked in through wrong merge

A previous PR (#15092) renamed `outputTargetForElement.ts` to `textStoreForElement.ts`, another PR (#15093) moved files around. In the end we ended up having both files. This change removes the unused file.

Follow-up-of: #15092
Follow-up-of: #15093
2025-12-08 08:43:25 +01:00
Eberhard Beilharz
191964260f
feat(web): properly set keyDown flag
This change passes the right value to the `is_key_down` parameter of
Core's `process_event`. It also updates the WASM interface to accept
a boolean instead of a number, and adds the enum values for the core
event flags.

Fixes: #15283
Test-bot: skip
2025-12-05 19:18:15 +01:00
Eberhard Beilharz
8784e0aacf
test(web): add baseline tests 2025-12-05 19:14:09 +01:00
Eberhard Beilharz
490add936f
maint(web): remove file that sneaked in through wrong merge
A previous PR (#15092) renamed `outputTargetForElement.ts` to
`textStoreForElement.ts`, another PR (#15093) moved files around. In the
end we ended up having both files. This change removes the unused file.

Follow-up-of: #15092
Follow-up-of: #15093
Test-bot: skip
2025-12-05 15:01:18 +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
ec7f1b6b35
Merge pull request #15234 from keymanapp/fix/web/context
fix(web): add text after last deadkey to context

Previously we forgot to add the text after the last deadkey - or any text if didn't have deadkeys. This change fixes this and verifies things with additional unit tests.
2025-11-28 18:36:25 +01:00
Eberhard Beilharz
bf652fb18c
fix(web): another simplification
Plus another unit test.

Test-bot: skip
2025-11-28 12:03:11 +01:00
Eberhard Beilharz
e442fc36d6
fix(web): simplify function
Addresses code review comments.

Co-authored-by: Marc Durdin <marc@durdin.net>
Test-bot: skip
2025-11-27 17:46:03 +01:00
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
a5c243b7e2
fix(web): address code review comments 2025-11-26 18:31:33 +01:00
Eberhard Beilharz
8875a904a3
fix(web): add text after last deadkey to context
Test-bot: skip
2025-11-25 19:20:40 +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