Commit graph

74 commits

Author SHA1 Message Date
Marc Durdin
3265a714f2 chore(common): add missing deps and files for npm publish
The build/ folder for most packages was missing due to being listed in
.gitignore.

Also, @keymanapp/ldml-keyboard-constants package was not being published
despite being a dependency of @keymanapp/kmc-keyboard.

Instead of relying on npm's use of .gitignore / .npmignore (which has
seriously wonky behaviours), we list the files that should be included
in package.json.

NPM Wonky behaviours: it seems that .npmignore causes .gitignore in the
same folder to be ignored. But, higher level .gitignore files still
affect the files included in the package, which makes
specification-by-exclusion painful (negating exclusions, etc). We do not
recommend use of .npmignore anywhere for this reason.
2023-04-12 14:05:05 +07:00
Steven R. Loomis
812fd1713a spec(core): ldml tests for either shift/ctrl/alt 🙀
- lookup needs to handle either/neither/both cases for alt and ctrl
- and a bug in the test runner: would 'pass' if failed on exactly line 256 (0x100 & 0xFF == 0)

#7533
2023-03-02 17:13:47 -06:00
Steven R. Loomis
e1e5eea469 feat(core): ldml rename key2 to keys 🙀
- So in summary, since before #7532 basically keys was restructured, and the old 'keys' was moved into 'keys.kmap'.

#8069
2023-02-20 17:40:34 -06:00
Steven R. Loomis
dd9be17228
Update core/include/ldml/keyboardprocessor_ldml.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-02-18 09:32:58 -06:00
Steven R. Loomis
8ea87aa828 feat(common): ldml: merge keys into key2 🙀 2023-02-16 12:29:19 -06:00
Steven R. Loomis
ac2366f460 feat(core): ldml C++ updates to modifiers 🙀
- spec: change caps value to 0x100 #7533
- add a 'mod_all'  for validating valid modifier keys, plus tests
- add asserts on C++ side mapping modifiers to keyman constants
- use 'mod_all' to validate modifiers
- further fix modifier -> mod in binary

For: #7985 and related to #7533
2023-02-14 09:23:03 -06:00
Steven R. Loomis
8d6366921b
Update core/include/ldml/keyboardprocessor_ldml.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-02-07 17:04:09 -06:00
Steven R. Loomis
5e445b32a1 feat(developer): ldml: modifier key updates 🙀
- per review comments
- drop opt, cmd, and shiftL/shiftR

For: #7533
2023-02-06 15:47:18 -06:00
Steven R. Loomis
af10312f84 feat(common): ldml modifier support 🙀
- spec: update spec for layr.mod field
- core/include/ldm: update constants
- bitfield modelled after s_modifier_names[]  / LCTRLFLAG etc.
- new test case k_004_tinyshift, also update k_010_mt
- update const builder to ignore all *_map properties
- split utility out to utils, add test

For: #7533
(cherry picked from commit 0346bea488)
2023-02-03 18:54:22 -06:00
Steven R. Loomis
ed30de2642 feat(core): ldml: add cldr version to constants 🙀
- also improve constant builder
- also fix build.sh so it uses sourcemaps

supports #7964
2023-01-27 12:45:00 -06:00
Steven R. Loomis
d7ce2191bf feat(core): ldml: make hardware be an enum 🙀
For: #7986
2023-01-19 12:24:47 -06:00
Steven R. Loomis
cbb5af2ae7 feat(core): ldml: Drop padding: common,core 🙀
- also add some checking in the builder
- add a Constants.str_section_id() for debugging
- update basic.txt

For: #7987
2023-01-09 16:35:47 -06:00
Steven R. Loomis
d552a46104
Merge pull request #7630 from keymanapp/feat/core/7532-layr-epic-ldml 2023-01-06 17:40:06 -06:00
Steven R. Loomis
564f98cc30
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-01-06 11:46:17 -06:00
Steven R. Loomis
63fa53a028 feat(core): ldml: updates to basic.txt and builders 🙀
- layr now passes comparison

For feat(developer): ldml: include all LDML data in kmx+ 🙀 #7532
2022-12-20 17:05:29 -06:00
Steven R. Loomis
b036fc5840 feat(core): ldml: basic: updates to basic.txt for layr 🙀
- key2 now passes!
- starting on layr

For feat(developer): ldml: include all LDML data in kmx+ 🙀 #753
2022-12-16 17:53:14 -06:00
Steven R. Loomis
bc14f18460 Merge remote-tracking branch 'origin/master' into chore/core/mergemaster4-epic-ldml 2022-12-15 17:55:13 -06:00
Steven R. Loomis
02ab5b5851 feat(core): ldml: correct length of list 🙀
For #7532
2022-11-17 14:17:27 -06:00
Steven R. Loomis
64c5c796a1 feat(core): ldml: steps for list/key2 🙀
- update .ts constants
- update builder to support digits in section id
- update XML and stub KMXPlusData

For feat(developer): ldml: include all LDML data in kmx+ 🙀 #7532
2022-11-16 19:05:14 -06:00
Steven R. Loomis
0e6aa6566f feat(core): ldml: First steps for layr 🙀
For feat(developer): ldml: include all LDML data in kmx+ 🙀 #7532

- dummy Layr class for compilation
- fleshed out Layr class
- CPP validation side
2022-11-16 19:04:55 -06:00
Steven R. Loomis
5421b6ec0b Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-11-02 13:36:24 -05:00
Steven R. Loomis
1c7517c5a8 fix(developer): ldml: yet more review feedback fixes 🙀
🙀 #7532
2022-11-02 13:36:24 -05:00
Steven R. Loomis
bf45412b72 feat(core): ldml: add constants for disp 🙀
For feat(developer): ldml: include all LDML data in kmx+ 🙀 #7532

depends on #7566
2022-11-02 13:36:24 -05:00
Steven R. Loomis
2d888ecfe2 fix(core): ldml: fix const builder 🙀
- fix tsconfig per review comments
- update builder to compile again
- add some err checking

#7566
2022-11-02 13:33:00 -05:00
Steven R. Loomis
8bfa0bbfcd fix(core): ldml: fix const builder 🙀
- fix config
- Add .js to the import statement
(not a great fix)

Fixes #7566
2022-10-28 18:25:56 -05:00
Marc Durdin
7ef6f288c4
Merge pull request #7520 from keymanapp/fix/core/7487-remove-visibility-attribute-from-callback-type
fix(core): remove `KMN_API` from callback spec
2022-10-28 11:55:54 +11:00
Marc Durdin
9c2edbcbc0 fix(core): remove KMN_API from callback spec
Fixes #7487.

`KMN_API` defines only import/export/static modifiers for functions, so
it makes no sense to apply it to a typedef. (Previously, I thought it
also included a calling convention, but it doesn't.)
2022-10-25 11:59:37 +11:00
Eberhard Beilharz
e04acb8295
fix(core): Add missing include files
Recently some include files got added to `common/include` which are
referenced by `core/include/keyman`. This change adds the necessary
code to install them in the same directory as the other include files.

Fixes #7490.
2022-10-20 17:06:35 +02:00
Marc Durdin
9af8e1f9c2 chore(core): ldml-keyboard-constants module type to esm 2022-09-20 08:01:22 +10:00
Marc Durdin
19f7e5353b chore(core): changes ldml tsconfig to es2020 🙀
Also splits the root tsconfig.json into tsconfig.cjs.json and
tsconfig.esm.json. These are not typically used at present but in theory
you could do a `tsc -b <tsconfig.x.json>` and build all modules. In
practice, we still have some prebuild steps that make that a bit of a
pain.
2022-09-20 06:49:56 +10:00
Marc Durdin
74a6c65710
Merge branch 'feature-ldml' into chore/merge-master-into-feature-ldml 2022-09-12 15:24:19 +10:00
Marc Durdin
5a3dad0298 chore(core): fixup km_kbp_event docs 2022-09-09 15:32:48 +10:00
Marc Durdin
b6c4e21c1d chore(developer): remove name from meta section
Fixes #7214.
2022-09-09 08:57:52 +10:00
Marc Durdin
5104914672 feat(core): add km_kbp_event API endpoint
Adds infrastructure required to support caps lock control on keyboard
activation per #5822.

Keyboardprocessor implementation is currently a stub, and engines will
need corresponding updates to support the new API.
2022-09-07 10:24:01 +10:00
Marc Durdin
8e5ce35f4d feat(developer): kmldmlc compiler and tests for transforms
Adds compilers and minimal unit tests for transform sections bksp,
finl, ordr, and tran, and cleans up problems in the corresponding
builders.

Adds a utility script for building test fixtures for manual analysis:
  ./build.sh build-fixtures

Refactors constants to give us design-time type safety once more.
2022-09-06 10:15:31 +10:00
Marc Durdin
9f5f8e976e feat(core): ldml keyboard transform elements
Adds definitions for LDML keyboard transform elements `transforms`,
`backspaces`, and `reorders`, and the binary format sections `bksp`,
`elem`, `finl`, `ordr`, and `tran`.

Minimally updates the compiler so that it will build, but no other
changes to the compiler.

Compiler and Typescript updates to support building these sections will
come in the next PR.
2022-09-05 13:11:51 +10:00
Marc Durdin
ea6bd8f09f chore(core): order sections according to binary format
Just reorders all work around the various sections to match the binary
format order -- that is, 'sect' first, then all other sections
alphabetically.

This also means the compiler now emits the sections in the expected
order.

No other changes to functionality.
2022-09-04 06:10:34 +10:00
Marc Durdin
b17805df3a feat(core): add 'name' section
Updates compiler, headers and documentation for the 'name' section,
which will always be present as the LDML keyboard spec requires at least
one name in the `<names>` element.
2022-09-04 05:45:43 +10:00
Marc Durdin
702db90a71 feat(core): add version field to meta
Also adds semver package for validating the version field.
2022-09-02 14:13:10 +10:00
Marc Durdin
db11553c9a refactor(developer): each section compiler is a pure function
Well, almost. There are still callback side-effects for messages. These
may in future be returned as an array as well, eliminating the need for
a message callback.

But restructures each section compiler so that it is self-contained and
responsible only for writing its own section. Also tightens up the types
for the sections constants.

Last, but not least, moves responsibility for writing the output .kmx
out of compiler.ts and into its callers -- removing one dependency from
the compiler. Reading input files still needs to be done in the
compiler, as there may be multiple input files with `<import>` that we
cannot know about until we start parsing xml.
2022-08-30 11:13:11 +10:00
Marc Durdin
9756c28102 chore(developer): Merge branch 'feature-ldml' into feat/developer/ldml-compiler-kmxplus-builder 2022-08-26 05:17:05 +10:00
Marc Durdin
144025e29f
Merge pull request #7113 from keymanapp/revert-7112-revert-7110-feat/developer/ldml-constants-ts-module
feat(core): turn @keymanapp/ldml-keyboard-constants into a module 🙀
2022-08-25 14:13:41 -05:00
Steven R. Loomis
af3bcd2a15 feat(core): ldml: padding for vkey and loca 🙀
- vkey and loca needed padding before the variable part
- add static asserts to validate this padding
- update sample files (null and tiny)

#7043
2022-08-25 12:54:52 -05:00
Marc Durdin
23d9aad0a0 chore(developer): cleanup 2022-08-25 15:12:00 +10:00
Marc Durdin
4f05e009d3
Merge branch 'revert-7112-revert-7110-feat/developer/ldml-constants-ts-module' into feat/developer/ldml-compiler-kmxplus-builder 2022-08-24 21:40:45 -05:00
Marc Durdin
aed8f0d11a feat(developer): Write kmxplus section
Adds support for writing kmxplus section of a kmx file. Extends KMXFile
to a KMXPlusFile subclass. Adds KMXPlusBuilder which is called from
KMXBuilder if KMXBuilder finds that the file is a KMXPlusFile.

This means that KMXPlusBuilder generates a buffer that could be stored
independently of its parent .kmx file transport, if that is later
considered desirable.

Adds new constants for sizes of various table components, which makes
building the file much simpler.
2022-08-25 12:26:21 +10:00
Marc Durdin
e84bd590b0 chore: Merge branch 'feat/developer/ldml-compiler-kmx-builder' in 2022-08-25 08:42:23 +10:00
Marc Durdin
6aeb20e77c
Revert "Revert "feat(core): turn @keymanapp/ldml-keyboard-constants into a module 🙀"" 2022-08-24 14:32:22 +10:00
Marc Durdin
8ebae9515e
Revert "feat(core): turn @keymanapp/ldml-keyboard-constants into a module 🙀" 2022-08-24 14:26:44 +10:00
Marc Durdin
fa28040643
Merge pull request #7100 from keymanapp/fix/core/7098-cxxfun
fix(core): ldml: remove 0-length arrays 🙀
2022-08-23 23:20:14 -05:00