Commit graph

756 commits

Author SHA1 Message Date
Marc Durdin
0fb2cd2dc6 chore: Merge branch 'epic/web-core' into epic/embed-osk-in-kmx 2026-04-17 19:01:15 +02:00
Marc Durdin
f57c3d56c8 chore(developer): address review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-04-16 09:51:18 +02:00
Marc Durdin
2153403e84 refactor(common): introduce modifier-key-constants
Refactor the `getModifierState` and `getStateFromLayer` functions into a
cleaner `modifierStringToState` function, and move from web into common.

Marks existing functions as deprecated but does not update usage at this
time.
2026-04-16 09:17:24 +02:00
Marc Durdin
c985808276 chore(common): address review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-04-16 09:15:02 +02:00
Marc Durdin
8ab3f4eead chore(common): cleanup data types for kmx-plus-file
Addresses comments in #15752 review.

Test-bot: skip
See-also: #15752
2026-04-16 09:15:01 +02:00
Marc Durdin
2e38a50522 change(common): remove drafted font metadata from KMX+ format
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
This comes out of a design philosophy review on what we include when we
embed OSK data into KMX.

We will now avoid embedding font name into the OSK (and hence .kmx)
altogether, and leave that metadata to the packaging data. Reasons:

1. The font information is specified in the .kps, so we have to do a
   patchup on the .kmx during packaging if we want to embed the info
   into the OSK.

2. The referenced font must be supplied separately anyway (via .kmp,
   @font-face, or system supplied, etc), so including the font facename
   in the keyboard is not really all that helpful.

3. Philosophically, the font is really a presentation level factor
   (aside from displaymap considerations). Keeping it together with
   future theming and styling choices, rather than the key layout data,
   seems appropriate.

4. This makes fewer places where font data is referenced -- in fact, to
   just one place: in the .kps/.kmp for LDML keyboards, which is great.

This also simplifies some aspects of the embed-osk-in-kmx work, removing
the need to patch the .kmx after the build, and eliminates the smelly
kmx-plus-osk-token.ts file.

A corresponding change has been made to the design document referenced
in #14857.

Test-bot: skip
2026-04-16 09:13:15 +02:00
Marc Durdin
30f40b5092 chore(developer): polish character constants and U_ id check
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Move U_25CC to a new CharacterConstants common enumeration.

Rewrite U_ key id conversion to check for invalid characters and report
to the keyboard author with warnings.

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-04-09 10:53:56 +02:00
Marc Durdin
aa61b08473 feat(developer): embed touch layout and kvk into kmx
Add support for embedding .keyman-touch-layout into .kmx and complete
support and tests for embedding .kvk. Fixup a number of related
functions.

Add special-key-caps.ts to developer-utils -- in future this will become
the primary source for developer for these key caps, but this cannot be
done until Developer Server and Touch Layout Editor are updated with
Typescript in client code.
2026-03-26 14:45:46 +01:00
Marc Durdin
bd330e4367 feat(common): address review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Co-authored-by: ermshiperete@users.noreply.github.com
Co-authored-by: srl295@gmail.com
2026-03-23 11:19:42 +01:00
Marc Durdin
ec5efd4ee5 chore(common): adjust dependencies
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-03-17 05:57:30 +01:00
Marc Durdin
c8058fdc2c chore(common): Merge branch 'epic/embed-osk-in-kmx' into feat/common/kmx-plus-file-reader
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
2026-03-16 17:32:17 +01:00
Marc Durdin
7955745e31 chore(common): use any as ErrorOptions type not yet available everywhere 2026-03-16 17:08:25 +01:00
Marc Durdin
efad936105 feat(common): add KMX+ file reader in Typescript
Add a KMX+ file reader and tests, including a round-trip builder:reader
test.

Move basic-17.txt, basic-19.txt, and basic.xml to common test resources
folder so they can be used by unit tests in common and developer.

Test-bot: skip
2026-03-16 07:21:38 +01:00
Marc Durdin
70c54b0b40 chore: Merge branch 'epic/web-core' into auto/A19S24-merge-master-into-web-core
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
2026-03-16 04:49:38 +01:00
Marc Durdin
b6b10d1a09 chore: Merge branch 'epic/embed-osk-in-kmx' into auto/A19S24-merge-master-into-embed-osk-in-kmx 2026-03-15 07:42:03 +01:00
Marc Durdin
529a49431e maint(developer): make TestCompilerCallbacks usage more consistent and simplify
Simplify usage of `TestCompilerCallbacks` by making it responsible for
the `beforeEach` and `afterEach` incantations itself. There are a couple
of more complex usages of `TestCompilerCallbacks` which have been
excluded from this change on purpose.

Renamed `testCallbacks` to `callbacks` in the one place where it was
different.

Hoist @types/node and @types/mocha because inconsistent versions of
@types/mocha were causing compiler errors with this change.

Also added a cast to `fs.readFileSync` to `Uint8Array` to eliminate
compiler warnings/errors in test files.

Fixes: #15654
Test-bot: skip
2026-03-03 16:44:06 +01:00
Eberhard Beilharz
08a94ad961
docs(web): document purpose of key codes > 50000
Build-bot: skip
Test-bot: skip
2026-01-09 11:05:20 +01:00
Marc Durdin
f3bab43e96
chore(developer): Apply suggestions from code review
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-12-01 11:15:58 +01:00
Marc Durdin
56cdf428ea feat(developer): make shared constants tree-shakable
In order to avoid embedding unused tables of constants into KeymanWeb,
we need to make their declarations pure.

https://esbuild.github.io/api/#tree-shaking-and-side-effects
2025-11-28 10:45:34 +01:00
Marc Durdin
12b77a5a78 feat(developer): convert .kvk into KMX+ and embed into .kmx
Implement the conversion from .kvk into KMX+ format, and embed the
result into the .kmx file. This change does not yet support &displaymap.

Move some virtual key modifier state helpers out of
visual-keyboard-compiler.ts and into shared module
modifier-key-constants.ts.

This change also flags the need to update the package compiler to
rewrite the font metadata into the KMX+ tables.

Test-bot: skip
2025-11-25 11:59:34 +01:00
Marc Durdin
cecc518db0
Update common/web/types/src/consts/modifier-key-constants.ts
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-11-21 14:45:29 +01:00
Marc Durdin
f11803651d refactor(developer): pass extra data from kmcmplib and move helpers for embed
Move some modifier key conversion utilities to a shared unit and also
add touchLayoutFilename and targetVersion to the kmcmplib extra data,
in preparation for generating and embedding OSK data.

Test-bot: skip
2025-11-20 10:47:55 +01:00
Eberhard Beilharz
825573d8f1
docs(web): address code review comment 2025-11-18 15:26:10 +01:00
Marc Durdin
a53a1593ec feat(common): add v19 sections to KMX+ in Core and Developer
The disp and layr sections have new v19 layouts, to support the Keyman
OSK requirements for epic/embed-osk-in-kmx. This supports writing the
new versions of these sections in Developer and loading them into Core,
doing transformations where necessary so that Core always works with v19
structures after load.

This does not implement the transformations required to support the OSK
APIs; that will be implemented in a follow-up PR. Nor is support for
writing the OSK data from source .kvks and .keyman-touch-layout
supported; this is just the scaffolding for supporting the structures in
the KMX+ data.

Test-bot: skip
2025-11-18 13:55:01 +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
Marc Durdin
fc0ff90684 refactor(developer): rename layr.lists to layr.forms
The name `form` better represents the semantic meaning of the
structure, and reduces confusion with the `list` section and other uses
of `list` in KMX+.

Test-bot: skip
2025-11-12 11:29:58 +01:00
Marc Durdin
aa6b3c328e chore: Merge branch 'epic/web-core' into auto/A19S15-merge-master-into-web-core 2025-11-07 14:23:43 +01:00
Keyman Server
b7c93d9e37
Merge branch 'epic/embed-osk-in-kmx' into auto/A19S15-merge-master-into-embed-osk-in-kmx 2025-11-07 14:06:33 +01:00
Eberhard Beilharz
f5ee9a46a2
refactor(web): rename OutputTargetStubTextStoreStub 2025-11-04 17:14:38 +01:00
Eberhard Beilharz
c9fa02f21c
refactor(web): rename OutputTargetBaseTextStore 2025-11-04 16:58:08 +01:00
Marc Durdin
df212364a2 maint(resources): add repository record for all published packages
While not documented as such, it appears that the repository record is
required with trusted publishing of npm packages.

Test-bot: skip
Build-bot: skip
2025-10-29 14:35:31 +01:00
Marc Durdin
ba411774f6 maint(resources): move NPM package publishing to GitHub Actions
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.

Packages will be `npm pack`ed on PR and test builds, and published in
release builds.

Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/
Fixes: #14963
Test-bot: skip
Build-bot: release:developer
2025-10-27 16:31:55 +01:00
Marc Durdin
83b6247139
Update common/web/types/src/kmx/kmx.ts 2025-10-23 13:32:57 +02:00
Marc Durdin
e3fbe510e7
Merge branch 'feat/core/add-kmx-plus-version-header' into feat/developer/add-targetversion-parameter 2025-10-22 15:08:38 +02:00
Marc Durdin
0227b277f0
Merge branch 'refactor/common/consolidate-kmx-plus-header-struct' into feat/developer/add-kmx-plus-version-header 2025-10-22 15:08:22 +02:00
Marc Durdin
95a5bcc362
Merge branch 'epic/embed-osk-in-kmx' into refactor/common/consolidate-kmx-plus-header-struct 2025-10-22 15:08:07 +02:00
Marc Durdin
f16545380a docs(common): clarify usage of KMXPlus structures
Build-bot: skip
2025-10-22 14:32:30 +02:00
Marc Durdin
8d74d2c8a6 feat(developer): add targetVersion support to kmc and kmc-kmn
Make the target version parameter for kmc-ldml into a generic build
parameter, so we can use it for any compiler. Add support and tests
to kmc-kmn, kmcmplib, kmc-ldml, kmc.

Support not yet in place for lexical models, or packages. However,
packages will be picking up the min version from the embedded keyboards.
Lexical models need work on minimum version support before this can be
implemented there.
2025-10-22 05:48:24 +02:00
Marc Durdin
693c741884 feat(common): add version header to KMX+ Typescript modules
Add support for header.version to KMX+ files, with differentiation
between v17 and v19 in the compiler, and associated tests. This does not
yet make the target version accessible to authors using `kmc`, but the
interfaces from `kmc-ldml` are available.

A v17 KMX+ file will have:
* comp_header.version = VERSION_17
* initial 'sect' section in KMX+ data
* no sect.header.version field in any section

A v19+ KMX+ file will have:
* comp_header.version = VERSION_19
* initial 'sec2' section in KMX+ data
* sect.header.version field for all sections
* each section 4 bytes larger to accommodate
* 'sec2' must have sect.header.version = KMXPlusVersion.Version19
* currently all other sections have sect.header.version = Version17
2025-10-17 11:23:09 +02:00
Marc Durdin
b4bb07ecc4 refactor(common): consolidate header struct to kmx-plus-file.ts
Consolidate the header structure in KMX+ to make it easier to add a
version value to the header for v19+ KMX+ files; also DRYs out the
header definitions a little.
2025-10-17 08:46:53 +02:00
Marc Durdin
1f8c6fbf58
Merge branch 'epic/embed-osk-in-kmx' into feat/common/add-osk-embed-support-to-kmx-plus 2025-10-16 12:46:07 +02:00
Marc Durdin
9406e16294 refactor(common): split KMX+ binary format from in-memory representation
Split kmx-plus.ts into two files, so that the in-memory parsed
representation of the file can be maintained separately from the binary
structures, which need to maintain version metadata.

This refactor makes no functional changes.

Test-bot: skip
Build-bot: build
2025-10-15 10:21:17 +02:00
Marc Durdin
fd17bb5f81
Merge pull request #14869 from keymanapp/feat/common/kmx-plus-osk-flag-in-header
feat(common): add KF_KMXPLUSOSK and VERSION_190 to kmx_file.h 🔱
2025-10-13 14:43:54 +02:00
Eberhard Beilharz
34c43b1e15
refactor(web): cleanup in test scripts
Also use common function for running web types tests.

Test-bot: skip
2025-09-30 17:40:15 +02:00
Marc Durdin
49846fea2d feat(common): add KF_KMXPLUSOSK and VERSION_190 to kmx_file.h
Add version 19.0 flags and metadata relating to embed-osk-in-kmx to
kmx_file.h and corresponding headers for other languages.

Test-bot: skip
2025-09-30 14:51:40 +02:00
Marc Durdin
81c807c257 chore(common): Merge branch 'master' into maint/common/14453-move-ci-scripts 2025-08-19 10:46:11 +02:00
Joshua Horton
e24deefdb8 fix(web): improve typing accuracy for suggestions & suggestion-generation
Also adds doc-comments to a couple of the related types
2025-08-13 10:27:13 -05:00
Marc Durdin
f3fb3ac87b maint(common): move build-utils-ci.inc.sh to ci/ci-publish.inc.sh
Removes a number of unused functions from the file, renames remaining
functions to match our builder script prefix patterns, removes unused
imports from various build scripts (e.g. Android).

Fixes: #14453
2025-08-05 12:54:56 +10:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.

Fixes: #14447
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00