Commit graph

1707 commits

Author SHA1 Message Date
Joshua A. Horton
3b0e19b505 feat(web): unit tests - longpress path modeling 2023-07-14 10:36:14 +07:00
Joshua A. Horton
3894ed0947 feat(web): base implementation of gesture single-contact-point matching 2023-07-14 10:36:13 +07:00
Marc Durdin
a9cae27e78
chore: apply review suggestion, delete comment
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2023-07-13 17:02:41 +10:00
Joshua A. Horton
e4cef64fdc docs(web): extra documentation b/c nomenclature shift 2023-07-13 10:37:11 +07:00
Joshua A. Horton
811648edb6 change(web): TrackedInput -> ComplexGestureSource 2023-07-13 10:29:35 +07:00
Joshua A. Horton
872a7db02e change(web): TrackedPoint -> SimpleGestureSource 2023-07-13 10:27:22 +07:00
Joshua A. Horton
fe62217414 change(web): TrackedPath -> GesturePath 2023-07-13 10:12:29 +07:00
Joshua A. Horton
e8482f61b3 fix(web): bug in suggested-change typing 2023-07-13 09:25:19 +07:00
Steven R. Loomis
f3bfef0cc3 fix(common): set variables need to serialize elementstring 🙀
- populate the 'elem' field of set variables
- this will be needed for mapFrom/mapTo

For: #7375
2023-07-12 16:44:50 -05:00
Marc Durdin
4a329f9552 chore(developer): move touch layout schema load into import 2023-07-12 15:55:44 +07:00
Joshua Horton
6ac9faab72
chore(web): Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-07-12 15:48:22 +07:00
Marc Durdin
568a8141dd chore(common): additional cleanup on schema loading 2023-07-12 13:11:06 +07:00
Marc Durdin
2d69be9104 refactor(common): bundle schemas into web/types
Removes the loadSchema function and instead resolves schema with
import statements. Next commit will do the same work for Developer
modules.
2023-07-12 12:53:56 +07:00
Steven R. Loomis
7b094f42e7 chore(common): add BUILDER_STR_REF 🙀
- and similar
- also aliases for r.uint32le on the KMXPlusFile side.

Fixes #9079
2023-07-11 18:08:46 -05:00
Marc Durdin
804215145f chore(developer): handle compilerWarningsAsErrors option
Fixes #9100.

The `compilerWarningsAsErrors` option can be passed in as a command-line
option or in the project options. Command-line option, if present, takes
precedence over the project option. If neither is set, then the value is
`false`.

Handling of this is within kmc, rather than individual modules.
2023-07-11 10:16:41 +07:00
Marc Durdin
02a1c48d18 chore(developer): add --color switch to kmc
Fixes #9233.

Adds --color and --no-color switches to kmc command line, with default
being determined by console mode.

Also ensures color initialization happens just once in
NodeCompilerCallbacks and moves constants to top of file.
2023-07-11 06:25:21 +07:00
Marc Durdin
de1c171f46 chore(developer): cleanup compiler messages in kmc
Fixes #8795.
Relates to #9090.

Cleans up and makes consistent compiler messages in kmc, and related
unit tests.

Adds support for colorized messages.

After installing chalk for ansi coloring in kmc, @types/node needed to
be brought in sync with the Typescript version, per the suggestion of
checking against `npm dist-tags @types/node`,found in a discussion at
https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64262#discussioncomment-4905069

Additional tidying up includes:
* Deprecating a set of functions in compiler-interfaces, bringing them
  together under a new CompilerError class.
  Separating CompilerErrorSeverity and CompilerErrorMask enums.
* Making CompilerError.formatEvent (formerly compilerEventFormat) print
  messages in the same format as NodeCompilerCallbacks (sans coloring).
* Adding a wrapper class for CompilerCallbacks that manages the filename
  reporting, used currently exclusively by kmc itself.
2023-07-10 15:13:48 +07:00
Joshua A. Horton
2523b41a9d chore(web): DRYs out timedPromise defs 2023-07-10 14:35:52 +07:00
Joshua A. Horton
1f338bae99 change(web): better adherence to official Promise terms 2023-07-10 14:35:44 +07:00
Joshua A. Horton
a32412410b feat(web): adds TimeoutPromise 2023-07-10 13:03:30 +07:00
Joshua A. Horton
42f0aeb190 chore: Merge branch 'master' into chore/feature-gestures-update-a17s16-end 2023-07-07 12:39:05 +07:00
Marc Durdin
5c0f0e87a8 chore: Merge branch 'feature-kmc-kmw' into chore/merge-master-into-feature-kmc-kmw-A17S16 2023-07-07 09:53:34 +07:00
Joshua A. Horton
e8fbafe194 feat(web): logs enhanced debug info for error reports 2023-07-07 09:40:02 +07:00
Joshua Horton
a61d95f419
Merge pull request #9200 from keymanapp/chore/web/cleaner-sentry-sourcemapping
chore(web): normalizes sourcemap paths for cleaner Sentry reports
2023-07-06 14:26:21 +07:00
Marc Durdin
306934eb62 fix(developer): kmc-package support for keyboard metadata
Fixes #9208.
Fixes #9209.
Fixes #9203.
Fixes #9198.

The changes here overlap in kmp-compiler.ts. Addresses several issues
with the package compiler:

* refactors the reading of the metadata from keyboards to make use of it
  when refreshing the keyboard metadata in kmp.json (#9208). This is the
  bulk of the changes.
* Fixes case on some fields in the kps file format (#9209)
* Removes code which emitted strings table to kmp.json, as these were
  only ever used for package installer executables (#9203)
* Cleans up code which emitted Start Menu items to make it match spec
  (#9198)
2023-07-06 13:49:04 +07:00
Joshua A. Horton
f21d8183ed chore(web): right, a sourceRoot would help sentry-manager 2023-07-06 12:27:53 +07:00
Steven R. Loomis
1bea614fd5 chore(common): improve coverage, fix todos 🙀
- remove SectionCompiler.required as unused
- minor fixes to common setSplitter
- add edge case tests

for: #8069
2023-07-05 15:48:12 -05:00
Marc Durdin
413e32f389 fix(developer): strip pure whitespace from key text in kvks reader
Fixes #9184.

kmcomp was unable to track pure whitespace in .kvks files. To match this
behaviour, we should strip pure space whitespace from key element values
in .kvks files only.
2023-07-05 10:19:46 +07:00
Marc Durdin
7ac6bfc189 fix(developer): kmc - support bitmap field in .kvk/kvks files
Fixes #9180.
2023-07-05 09:45:59 +07:00
Marc Durdin
c11393b834 fix(developer): strip default values when compiling touch layout
Fixes #9178.

The values `pad`, `width`, and `hint` should not be emitted in a
compiled touch layout file, if they have default values of `0`, `0`,
or `""`, respectively. This matches the legacy kmcomp pattern.
2023-07-05 09:40:08 +07:00
Marc Durdin
1a06133d9d fix(developer): vk constants requires K_oDF and K_?C1
Fixes #9177.

Some imported visual keyboards include `K_oDF` or `K_?C1` key codes.
These are not made visible in the UI but as they are "valid" VK codes,
they should not cause an error.
2023-07-05 09:37:41 +07:00
Steven R. Loomis
8cd846f298 fix(common): support multichar escapes in element sets 🙀
- \u{22 0127} acts like \u{22}\u{0127}

for: #7377
2023-07-04 12:47:58 -05:00
Steven R. Loomis
52b8dfb205 feat(common): preflighting on uset 🙀
- update docs on UnicodeSet
- uset parser: fix/clarify that the wasm interface takes a bufferSize, but the ts interface takes a range count. This was muddled before.

For: #7377
2023-07-04 10:26:50 -05:00
Marc Durdin
70f7c1634d fix(developer): kvks file reader needs to handle bitmaps
Fixes #9159.

If a key contains a bitmap, then ignore the text for the key.
2023-07-04 14:46:51 +07:00
Marc Durdin
d2acfdec5c fix(developer): improve kmcmplib/kmw compiler performance
Fixes #9154.

Improves performance in both kmcmplib and in kmc-kmn/kmw-compiler. After
these changes are applied, vietnamese_telex keyboard builds in around 6
seconds on my machine (down from over 2 minutes). This is certainly only
the surface of performance improvements we could make.

Addresses excessive memory reallocations in kmcmplib, by reallocating
store and key arrays in large chunks of 100 items rather than
reallocating on each new item added. This resulted in a 250x speed-up on
functions such as `AddStore` in WASM build.

Some careful modulus arithmetic was needed for resizing the key array,
which can be grown in larger increments.

Resolved excessive zeroing out of destination buffer in u16ncpy, which
was being called with an 8kb destination buffer on every line of the
file.

In the kmw side, vast majority of the performance cost was in copying of
buffers while loading a .kmx into memory, rather than creating views
into the memory. Essentially replaced this pattern:

```
return this.rString.fromBuffer(source.slice(offset));
```

with:

```
const data = new Uint8Array(source.buffer, source.byteOffset + offset);
return this.rString.fromBuffer(data);
```
2023-07-04 14:36:25 +07:00
Marc Durdin
9dacaaac4e fix(developer): kmc-kmn/kmw should add/delete certain fields in touch layout when writing
Fixes #9160.

To match the behaviour of kmcomp, kmc should add/delete the following
fields when writing out a kmw touch layout:

* `platform.displayUnderlying` flag is always emitted by kmcomp, so kmc
  should always emit it too.
* `platform.font` and `platform.fontsize` should be eliminated if empty
  string
* `key.id` should be eliminated if empty string
2023-07-04 14:29:19 +07:00
Steven R. Loomis
0f0c1e5e61 feat(common): preflighting on uset 🙀
- allow uset to preflight (calculate # of ranges)

For: #7377
2023-07-03 18:48:48 -05:00
Steven R. Loomis
a6dcf4dfce
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-07-03 18:20:20 -05:00
Steven R. Loomis
a25d3819d1 Merge remote-tracking branch 'upstream/master' into feat/developer-7377-reorder-uset 2023-07-03 18:09:22 -05:00
Steven R. Loomis
3ecf8da917
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-07-03 18:08:25 -05:00
Marc Durdin
33affc660f fix(common): legacy .kpj schema
Fixes #9140.
Fixes #9148.

Keyman Developer 9.0 .kpj files included a lot of additional state
metadata. We need a schema which validates these files, as they are
otherwise valid to load (we'll never save them any more). Rather than
add all the extra metadata to what is otherwise a fairly clean schema,
we'll provide a legacy .schema.json.

In the future, we may be able to merge these schemas, as we move towards
the .kpj 2.0 format which doesn't list files. Ideally, all three formats
(Keyman Developer 9.0 schema, call it legacy, 1.0 schema for Keyman
Developer 10.0+ which has Options and Files listed, 2.0 schema for
capturing just project settings for a folder) will be supported by a
single schema file.
2023-07-03 09:06:03 +07:00
Steven R. Loomis
88650e2085 feat(developer): uset in element string 🙀
- fix uset builder and other missing uset parts
- basic.xml passes
- update to constants

Fixes: #7377
2023-06-30 17:27:04 -05:00
Steven R. Loomis
5d5b61cd0a feat(developer): uset in element string 🙀
- update element string constructors to support UnicodeString and the segmented array from ElementParser
- update compiler machinery to pass USetParser in the DependencySections
- test cases

#7377
2023-06-30 15:56:45 -05:00
Steven R. Loomis
067c0b2f67 feat(common): unescaper / element updates for uset 🙀
- add unescaper for quad string (\u0127)

#7377
2023-06-30 15:50:38 -05:00
Steven R. Loomis
3d6af245de feat(common): add segmenter for element strings 🙀
- detect and reject nested square brackets, for now
- implement segmentation of reorder element strings,
  including type identification (escape, codepoint, uset)
- tests

For #7377
2023-06-30 08:49:07 -05:00
Joshua Horton
2a62e3cecf
Merge pull request #9128 from keymanapp/chore/web/rework-touchpath-turtle
chore(web): touchpath-turtle rework 🐵
2023-06-30 11:58:21 +07:00
Joshua Horton
8f8d31c265
Merge pull request #9127 from keymanapp/refactor/web/headless-input-tracking
refactor(web): all gesture-oriented input control flows now have a headless form 🐵
2023-06-30 11:58:12 +07:00
Joshua Horton
951ef90157
Merge pull request #9126 from keymanapp/chore/web/sample-gesture-recording-end
fix(web): touchpath recordings always sample end of path, even when stationary 🐵
2023-06-30 11:58:05 +07:00
Joshua Horton
883f9575e6
Merge pull request #9122 from keymanapp/feat/web/hovered-item-tracking
change(web): tracking for 'initial' and 'current' UI item per touchpoint 🐵
2023-06-30 11:57:58 +07:00
Joshua Horton
08f761c90f
Merge pull request #9067 from keymanapp/chore/web/disconnect-subsegmentation
chore(web): disconnects the gesture-oriented touchpath-subsegmentation engine 🐵
2023-06-30 11:57:50 +07:00