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
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
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
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
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
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
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
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
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
`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
This implements and uses`CoreKeyboardProcessor.applyContextFromTextStore`
and `CoreKeyboardProcessor.saveMarkersToTextStore`, and also adds unit
tests.
Fixes: #13926
Test-bot: skip
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
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: #15159Fixes: #15158
Test-bot: skip
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
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
- 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
Use `builder_launch` to launch other builder scripts rather than calling
directly, so that inheritable state and options are passed through.
Test-bot: skip