Commit graph

1958 commits

Author SHA1 Message Date
Marc Durdin
05a4c33200 chore(web): move common/core/web to common/web
Relates to #5816.

Moves folders under common/core/web to common/web:

* input-processor -> common/web/input-processor
* keyboard-processor -> common/web/keyboard-processor
* tools/recorder -> common/web/recorder
* tools/sentry-manager -> common/web/sentry-manager
* utils -> common/web/utils

Updates scripts and configuration to point to new folders.
2022-05-18 06:01:03 +10:00
Marc Durdin
af44c0687f chore(web): move web-environment to common/web 2022-05-16 08:29:46 +10:00
Marc Durdin
8efcb5d64a chore(web): embedded web cleanup 2022-05-12 07:37:10 +10:00
Marc Durdin
4f0185dd1e chore(web): cleanup unit tests
Fixes the build for unit tests (and fixes corresponding bug in KMW
build) to eliminate Lerna dependencies.
2022-05-11 12:05:44 +10:00
Marc Durdin
d2b86c90d1 chore(web): fix predictive text module concatenation 2022-05-10 10:50:33 +10:00
Marc Durdin
21744d0ed6 chore(web): fixup test paths
Fixes some of the test paths required for core tests.
2022-05-09 13:29:41 +10:00
Marc Durdin
843cde9611 chore(web): fixup npm path ref in build.sh 2022-05-04 10:20:07 +10:00
Marc Durdin
2f2d3c72c9 chore(web): move lm-worker into its own folder
This starts the reorg required for splitting the lm worker into its own
module. Tests are still not working. But builds are going.

Some decisions to be made around the final path for wrapping of the
code. I think it may be possible to do something a whole lot more
elegant by moving the wrapping process into the KMW build and leaving
the LM Worker output as a pure tsc output -- given only KMW wants the
wrapped worker anyway (tests aside). The actual wrapping code could
still be in the lm-worker folder.
2022-04-14 15:33:23 +10:00
Marc Durdin
8046c5304b chore(web): build order for deps 2022-04-14 10:40:36 +10:00
Marc Durdin
e0b308b983 chore(web): cleanup for ts projects 2022-04-13 15:19:55 +10:00
Marc Durdin
0ac04d0530 chore(web): Merge branch 'beta' into chore/web/no-more-lerna 2022-04-12 21:17:15 +10:00
Marc Durdin
4d94786852 chore(web): replace lerna with npm workspaces and ts projects
Fixes #6320.

Part 1 of moving from lerna to a simpler, maintained monorepo solution,
using TypeScript Projects and NPM Workspaces.

There is more work to be done here. At this point, KeymanWeb builds and
runs without errors, but the built file is substantially different,
mostly in include order.

Using TypeScript Projects, we move away from the need to run build
scripts in various locations for almost all the Typescript modules.

TODO: Embedded versions and tests have not been verified.

TODO: developer/server is not yet verified.

TODO: developer/js (needs a rename!) is not yet verified.

TODO: Currently, the predictive-text folder needs refactoring to move
the construction of the worker wrapper out of the Predictive Text build
and into the final assembly of keymanweb.js (as it should be valid to
run it as a separate .js anyway).

TODO: Most of the `<reference>` paths need to be re-verified. Ideally
there should be no references outside the current module for any given
.ts.

TODO: The embedded vs browser vs node (headless) builds should be tidied
up for consistency so that it's obvious what depends on what. This is
currently messiest in the predictive-text folder, where the output names
diverge from the filenames and the various files are mixed in the same
folder (as evidenced by the exclusions listed in each tsconfig.json).

TODO: `npm install` should be removed from most build scripts and
instead `npm ci` (#6196) should be run only once from the top-level
folder for any given build. I've had eliminated side-effects from the
`install` action for npm, which makes it easier to reason about state.

TODO: verify_npm_setup and related functions can probably be eliminated.

TODO: most of the build scripts should be largely eliminated for web.

TODO: several ts projects use inconsistent output folders.

TODO: it may be possible to generate a .d.ts for models/types so that
we can use a consistent reference for those as well.

TODO: build.sh, tsconfig.json should always be in the module's top-level
folder, not in a subfolder such as src (e.g. see input-processor/src,
keyboard-processor/src, web/source).

TODO: resources/web-environment should be in common/web.

TODO: other js node_modules imports should be wrapped like es6-shim.

TODO: fix up the publish code for npm modules

TODO: eliminate version numbers from package.json if possible?

Whew, that's most of the stuff I noticed!
2022-04-12 21:02:33 +10:00
Marc Durdin
49eb062c65 feat(web): prediction casing follows current layer
Fixes #6455.

This involved adding an extra hint to the data passed into the lexical
model layer, being the CasingForm that the current layer wants to use.

Given there are several entry points to the lexical model layer, this
meant a few places where we needed to check the current layer.

I refactored the very long function `InputProcessor.processKeyEvent` to
extract out the `buildAlternates` function. There should be no
functional changes to the `buildAlternates` code. But it makes
`processKeyEvent` significantly easier to read.
2022-04-08 16:14:01 +10:00
Marc Durdin
e616900cad
Revert "feat(web): prediction casing follows current layer" 2022-04-08 14:50:32 +10:00
Marc Durdin
b7ce99480f feat(web): prediction casing follows current layer
Fixes #6455.

This involved adding an extra hint to the data passed into the lexical
model layer, being the CasingForm that the current layer wants to use.

Given there are several entry points to the lexical model layer, this
meant a few places where we needed to check the current layer.

I refactored the very long function `InputProcessor.processKeyEvent` to
extract out the `buildAlternates` function. There should be no
functional changes to the `buildAlternates` code. But it makes
`processKeyEvent` significantly easier to read.
2022-04-01 16:20:50 +11:00
Marc Durdin
a192803021 chore(web): address review comment 2022-03-30 16:39:49 +11:00
Marc Durdin
0cadb83383 fix(web): track load error detail
This is a follow-up for #6331. We still did not have enough detail to
be able to trace the root cause of the load errors. This adds a little
more diagnostics.
2022-03-30 06:44:03 +11:00
Marc Durdin
c0248bec1b
Merge pull request #6432 from keymanapp/fix/web/shifted-key-cap
fix(web): *Shifted* showed unshifted key cap
2022-03-29 12:36:12 +11:00
Marc Durdin
46807d7af2 fix(web): *Shifted* showed unshifted key cap
While this was done in code as a global override, probably following
Apple stylistic changes, it is better to leave this to the keyboard
developer to decide on.
2022-03-28 09:02:22 +11:00
Marc Durdin
295f25144d
Merge pull request #6383 from keymanapp/fix/web/5929-ios-popup-positioning-and-style
fix(web): ios popup positioning and style
2022-03-28 04:46:00 +11:00
Marc Durdin
b3ddf633df fix(web): adjust calc for callout height 2022-03-25 09:10:29 +11:00
Marc Durdin
3858a4c9e5 fix(web): further iOS adjustments 2022-03-24 07:35:28 +11:00
Darcy Wong
19f1d4f5a7 chore(android): Merge remote-tracking branch 'origin/beta' into fix/android/subkey-move 2022-03-23 13:05:25 +07:00
Marc Durdin
5c388d1d7e
Merge pull request #6366 from keymanapp/feat/web/6364-new-layer-old-layer-replaces-layerchanged
feat(web): `&newLayer` and `&oldLayer`
2022-03-23 16:53:34 +11:00
Marc Durdin
336ab51010
Merge pull request #6406 from keymanapp/fix/web/5942-touch-alias-element-position
fix(web): adjust touch alias element positioning
2022-03-23 11:27:35 +11:00
Marc Durdin
adf3fe28c9 fix(web): tweak iOS key preview and longpress dimensions
Adjusts the dimensions to use pixel boundaries to prevent antialiasing
for some of the key preview and longpress popups, and adjusts horizontal
positioning of key preview to center more precisely, for iOS.
2022-03-23 08:23:29 +11:00
Marc Durdin
558a742a45 fix(web): adjust callout height 2022-03-22 10:02:36 +11:00
Marc Durdin
6b1ae79c11 fix(ios): remove busy 100ms waitForFonts timer on iOS
Observed while debugging another issue on iOS. The
VisualKeyboard.waitForFonts function sets up a busy timer to wait for
font loading. This functionality is not even needed on the iOS app,
because it's really only used for the touch alias elements.

However, it was being called, potentially multiple times, leading to the
timer never being removed. On Android, the timer was correctly removed.

This aligns the iOS code path with the Android code path.
2022-03-22 09:21:17 +11:00
Marc Durdin
88ffb8bbd2 fix(web): adjust touch alias element positioning
Fixes #5942.

The touch alias element position was not consistent across all browsers,
leading to misalignment in some situations. Identified missing CSS to
make the positioning consistent, as far as I can tell, which led to the
additional benefit of reducing the per-browser special cases.
2022-03-22 08:38:12 +11:00
Marc Durdin
767d278f87
Merge pull request #6357 from keymanapp/fix/web/bounding-rect-offset
fix(web): bounding rect offset was incorrect
2022-03-19 13:13:19 +11:00
Marc Durdin
e3537e7bb7 fix(web): crash on focus before init
Fixes the following crash noted when testing on keymanweb.com, focusing
during the load process on a slow network.

```
helpers.ts:111 Uncaught TypeError: Cannot read properties of null (reading 'vkbd')
    at g.pageFocusHandler (keymanweb.ts:125:44)
    at sentryWrapped (helpers.ts:87:17)
```
2022-03-17 15:50:52 +11:00
Darcy Wong
70ec9b7096 fix(web): Don't update base key if popups displayed 2022-03-17 10:58:48 +07:00
Marc Durdin
dde56e6b90 fix(web): adjust positioning for longpress popup
Adjusts positioning calculations for longpress popups and corresponding
styles to make it consistent across all platforms, particularly iOS.
2022-03-17 10:20:19 +11:00
Marc Durdin
86b4b82661 fix(web): key preview position was inconsistent on iOS
Adjusts calculations for key preview and ensures we use box-sizing:
content-box in all circumstances, to make it consistent across all
platforms.
2022-03-17 10:19:10 +11:00
Marc Durdin
24398b4461 fix(web): key square needed vertical align top
On Safari, some keys were vertically misaligned, due to different
default vertical-align.
2022-03-17 10:17:23 +11:00
Marc Durdin
a2aef99c3e fix(web): font size on key preview
Font size adjustment needed an override for the key preview to prevent
it using the base key font size as a starting point.
2022-03-17 10:15:40 +11:00
Marc Durdin
7a5d1b964f chore(web): Merge branch 'beta' into feat/web/6364-new-layer-old-layer-replaces-layerchanged 2022-03-17 04:55:25 +11:00
Marc Durdin
d3136b8860 fix(web): ios popup positioning and style
Fixes #5929.
Fixes #6381.

This fixes four separate issues with the longpress popups and key
previews:

1. The key preview was offset by a couple of pixels (unreported issue).
2. The background 'shim' did not cover the key caps, which caused them
   to look startlingly white when the rest of the background greyed
   down (#5929).
3. The popup menu was incorrectly wrapping to two rows due to sizing
   model mismatches (#6381).
4. The popup menu would be realigned incorrectly for the in-app
   keyboard, when moving it to keep it in the keyboard area (#5929).
2022-03-16 11:24:02 +11:00
Marc Durdin
1038379c41
Merge pull request #6351 from keymanapp/fix/web/caps-state-tracking-for-touch
fix(web): caps state tracking for touch
2022-03-15 10:04:45 +11:00
Marc Durdin
4b15c4988e
Merge pull request #6340 from keymanapp/fix/web/5964-subkey-position-on-scroll-non-zero
fix(web): subkey touch position after scroll
2022-03-15 10:02:07 +11:00
Marc Durdin
45c5f8a1ea chore(web): remove 0 from store defaults 2022-03-13 08:31:15 +11:00
Marc Durdin
b23df3fbc8 feat(web): &newLayer and &oldLayer
Fixes #6364.

Removes `&layerChanged` and adds `&newLayer` and `&oldLayer` system
stores with the additional nuances around values as described in #6364.
2022-03-13 08:29:15 +11:00
Marc Durdin
ada527bd80 fix(web): bounding rect offset was incorrect
When embedding the On Screen Keyboard into a page, the calculation for
the bounding rectangle only took into account the first offsetParent,
which meant it would get the offset incorrect when there were multiple
layers of offsetParents.

Once I changed to using getAbsoluteX / getAbsoluteY, this also corrects
for scroll with window.pageOffsetY, so we can eliminate that special
case for fixed positioning.

This was observable in the Web Developer test window, where interaction
with the bottom row of the keyboard in touch mode was not working
correctly, in 15.0.210-beta.
2022-03-11 04:34:36 +11:00
Marc Durdin
f355722191 fix(web): back out caps lock and refix
The Caps Lock change I made in the previous commit broke
desktop Caps Lock handling. The fix was a little more
convoluted. Turns out that _UpdateVKShift is also pretty
crufty. I simplified it, removing dead code.
2022-03-10 13:31:06 +11:00
Marc Durdin
6e1e7e8e7e chore: additional scripts 2022-03-10 10:26:15 +11:00
Marc Durdin
272c1f0d1c fix(web): subkey touch position after scroll
Fixes #5964.

It seems that the test for subkey position was incorrect when the
document had been scrolled. Removing the test for `fixed` positioning
resolves the issue.
2022-03-08 17:27:16 +11:00
Marc Durdin
f633174f9f fix(web): stop masking error
We are seeing this error thrown in some logs but it masks the underlying error.
2022-03-04 11:44:54 +11:00
Marc Durdin
aeeffc3568
Merge pull request #6310 from keymanapp/fix/web/6072-stop-css-repeated-injection
fix(web): stop repeated CSS injection ✂
2022-03-02 12:50:16 +11:00
Marc Durdin
b5615e3a4b fix(web): error in floating osk view when no keyboard active
This fixes an issue that arises when loading the Keyman Developer Server
home page and there are registered keyboards, but no keyboards active.
The floating osk view would throw an exception because it would attempt
to set the title of the view from the active keyboard, which is `null`.
2022-03-02 08:46:10 +11:00
Marc Durdin
6734d824a5 fix(web): stop repeated CSS injection 2022-03-02 06:37:51 +11:00