Commit graph

36 commits

Author SHA1 Message Date
Marc Durdin
144456821b chore(common): loosen .keyman-touch-layout schema layer id requirements
Fixes #9843.
2024-02-23 10:38:45 +07:00
Marc Durdin
fae6277b20 chore: update kmp.schema.json and docs for kps schema 2023-10-19 13:09:26 +07:00
Marc Durdin
e42567906d chore: update readme for keyboard_info schema 2023-10-12 07:08:20 +07:00
Marc Durdin
cc5b8da69b refactor(developer): .keyboard_info examples should use keys as a string
Fixes #9708.

Matches the kmp.json format of keys string in the .keyboard_info schema
and compiler, in order to reduce the number of formats we are working
with. This same format may be used elsewhere in Keyman schemas in the
future for sets of keys, for example, I hope we can use it in regression
tests.
2023-10-08 19:01:14 +07:00
Marc Durdin
400444933c feat(developer): introduce WelcomeFile property to packages
Fixes #9478.

This adds a property WelcomeFile to .kps and kmp.json, which allows us
to move away from the hardcoded welcome.htm filename in the future, and
makes transform from Markdown (#9477) a simpler operation, and just
generally starts the cleanup of the messiness of hard-coded filenames.

The package compiler will fallback to injecting welcome.htm into this
property if (a) welcome.htm is present, and (b) the property does not
already have a value. This doesn't buy us much because we still need to
support welcome.htm for existing legacy packages, but does mean that
our .kmp package metadata will be more consistent for packages compiled
with 17.0+ compilers.
2023-10-08 07:22:57 +07:00
Marc Durdin
94be7bb60c chore(developer): validate emitted .keyboard_info and fix keys
Fixes #9620.

.keyboard_info keys emitted from kmc-keyboard-info had the wrong format
for the example.keys object, which I discovered when I applied the
validation to the kmc-keyboard-info output.
2023-09-25 15:53:20 +07:00
Marc Durdin
a7f8123e56 feat(developer): support building .keyboard_info without source version
Relates to #9351.

Adds support for building a .keyboard_info file without having source
.keyboard_info file:

* Constructs a default source .keyboard_info in memory
* Hints if license is missing
* If LICENSE.md is present, verifies it matches the MIT license text
* Adds project option to turn on or off metadata generation. This will
  default to False for version 1.0 projects, and to True for version 2.0
  projects. This means that the keyboard repository will need a PR to
  enable metadata generation for existing projects in the repository,
  but this is important to avoid breaking builds for existing projects
  that are not in the repository.
* Turns on additional c8 coverage for kmc projects
2023-08-16 12:47:37 +07:00
Marc Durdin
395b76df05 chore(developer): cleanup keyboard_info schema
* Removes font size
* Restricts font source to array
* Removes example
* Add examples
* Loosen structure of KeyboardExample
2023-08-16 09:26:39 +07:00
Marc Durdin
158bc28e85 feat(developer): add LicenseFile as property of package
Adds license file to .kps, kmp.json, kmc-package, package editor, and
new project templates. The intent is for LICENSE.md to be the file used,
and for any keyboards on keymanapp/keyboards, it should always be a
standard MIT license.
2023-08-16 09:13:38 +07:00
Marc Durdin
fea10f0eeb feat(developer): add web font references to package
While a package supports a .ttf or .otf font for the OSK and Display
fonts for use within the Keyman apps, on websites it also supports .woff
and .woff2. This change makes it possible to specify a set of fonts for
a package which will be provided through api.keyman.com to websites.

This means that .woff and .woff2 fonts may also be included in the
package and may not be used on target devices at this time, it further
opens the pathway to deploying .kmp packages to web in the future.

The deployment stage of keymanapp/keyboards will require a new phase to
copy web fonts from packages to s.keyman.com.
2023-08-15 15:13:24 +07:00
Marc Durdin
38c3415eed feat(developer): add relatedPackages metadata
Adds relatedPackages support to:
* .kps schema
* .kps file format for Typescript
* kmp.json file format for Typescript
* kmc-package compiler
* Package Editor
2023-08-14 14:18:01 +07:00
Marc Durdin
675f6bc91e feat(developer): description, font and example metadata in packages
Adds info.description, options.fonts, keyboard.examples metadata to
.kps and kmp.json files, updates schemas, and Typescript compiler.
2023-08-14 09:23:20 +07:00
Marc Durdin
aa9788ad46 chore(common): remove deprecated fields from keyboard_info
Removes the following fields:
* legacyId
* documentationFilename
* documentationFileSize
* links
* related[].note

None of these fields are needed any longer; see #9351 for steps to
remove data.

Eliminates difference between keyboard_info source and distribution,
renaming to keyboard_info.schema.json, and updating the required members
of the json accordingly.

Will have corresponding commits in keyman.com, api.keyman.com,
help.keyman.com, and keyboards repositories.
2023-08-11 10:34:38 +07:00
Marc Durdin
087c68f4ca
chore: Apply suggestions from code review 2023-08-09 18:32:20 +10:00
Marc Durdin
c02f5ab419 feat(developer): add 'default' property for longpress keys
Fixes #9430.

Adds a 'default' property to subkeys, only used by longpress-type
subkeys:

* Added property to schema and readers/writers
* Added property to touch layout validator
* Added editor for property to layout builder
2023-08-08 14:20:52 +07: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
Marc Durdin
608df3bcd8 chore: fix typo 2023-06-20 12:59:33 +07:00
Marc Durdin
2ca191d290 chore(developer): document displaymap format 2023-06-19 05:48:51 +07:00
Marc Durdin
adfa032e6f feat(developer): add &displayMap system store
The &displayMap system store adds support for a mapping file that remaps
the On Screen Keyboard files -- .kvks and .keyman-touch-layout, at
compile time, to new ranges. This is specifically intended to resolve a
limitation of unattached marks and diacritics which display
inconsistently across platforms; this is described in more detail in
issue #9031.
2023-06-17 16:21:26 +07:00
Marc Durdin
66a7a6fc4e feat(developer): support FollowKeyboardVersion in kmc-package
Fixes #7340.

Removes the unused <Version> element from <LexicalModel> element in the
.kps schema. (This needs to be copied to api.keyman.com also.)

Updates compiler to check for <FollowKeyboardVersion> and read the
version data from the .kmx in that case.

Unit tests updated. Some of the fixtures were incorrect as they had
<FollowKeyboardVersion> set for model-type packages or packages that
contained no keyboards. Fixed.
2023-04-21 14:04:06 +07:00
Marc Durdin
be4f036a3c feat(developer): Add support for building a folder to kmc
Relates to #2761.

kmc now supports passing in a folder and building all Keyman source
files found in the folder, even if a .kpj is not present in the folder.

If a .kpj file exists, `KeymanDeveloperProject/Options/Version` will be
checked to determine behaviour. If this field is missing or "1.0", then
the classical behaviour persists.

If the Version field is "2.0", the `Files` key is ignored, and .kmn,
.xml, .model.ts, and .kps files under `sourcePath` are enumerated and
added to the in-memory project for build.

If a .kpj is not present in the folder, a virtual project is constructed
in memory with the following defaults:

* `version`: `2.0`
* `buildPath`: `$PROJECTPATH/build`
* `sourcePath`: `$PROJECTPATH/source`
* `compilerWarningsAsErrors`: `false`
* `warnDeprecatedCode`: `true`
* `checkFilenameConventions`: `true`

It is still considered an error to include both a keyboard and a model
in the same file, but a version 2.0 project will not include the field
determining its type in `Options/ProjectType`; this will instead be
checked during build.

The call to `kmc` can reference a folder or a .kpj file. The .kpj file
must have the same basename as the folder name (e.g.
`khmer_angkor/khmer_angkor.kpj`).

WARNING: this does not add support for 2.0 projects to Keyman Developer;
it is likely that opening a version 2.0 project in Developer will
currently corrupt it.

WARNING: it is not anticipated that kmcomp.exe will be updated to
support version 2.0 projects -- rather kmcomp.exe will be removed before
release of v17, and replaced with kmc.
2023-02-27 13:11:22 +07:00
Marc Durdin
647803ef28 feat(common): add .kpj typescript reader and schema 2023-02-25 11:17:39 +07:00
Marc Durdin
da72845da3 feat(common): add keyman-touch-layout format and readers/writers for typescript 2022-10-10 07:23:38 +11:00
Marc Durdin
78f4660557 feat(common): kvks writer for TypeScript
Also splits attributes from sub-elements in kvks-file in order to make
round-trip writing more pleasant.

Adds new round-trip test for kvks writer.

Removes incorrect property keybitmap, adds missing property layout.
2022-09-29 12:32:12 +10:00
Marc Durdin
50db7a2c9b feat(developer): add schemas for .kvk and .kvks
Also minor tweaks around reading .xml files.
2022-09-26 20:05:52 +10:00
Marc Durdin
c8971a457c
chore: Apply suggestions from code review 2022-07-15 08:58:12 +10:00
Marc Durdin
6032181e18 feat(developer): rework displayHint to defaultHint
After a demo of the Touch Layout Editor @jahorton suggested using a
"default hint" model instead of the "display hint" from the design spec.
I liked this and have reworked the design accordingly. With the default
hint model, a source for the hint text can be specified, such as the
default longpress key, or a specific flick key. This can then be
overridden on a key level.

The hint input element now shows a placeholder to indicate the default
hint for the key, and if a hint has been customised for a given key, it
is shown in green on the key cap.

Changing the default hint does not impact any customised hints.
2022-07-14 10:58:59 +10:00
Marc Durdin
11d8a3ad65 feat(developer): add hint properties to touch layout schema 2022-07-14 10:58:54 +10:00
Marc Durdin
51a94a1d7d feat(developer): cleanup touch layout files on load and save
Improves the .keyman-touch-layout clean schema and adds additional
cleanup during load and save in the Touch Layout Editor.

The compiler already does transforms for the relevant fields to the
formats that KeymanWeb is expecting (in particular, width, pad to
string).

This is preparation for adding hint data to the format as well.
2022-07-14 10:57:39 +10:00
Marc Durdin
b2427386f1 feat(developer): tighter spec for .keyman-touch-layout 2022-06-30 14:37:43 +10:00
Marc Durdin
ebfd474d90 feat(developer): add flick and multitap to touch layout schema and doc
Does not tighten the spec for legacy data -- that should probably be a
separate schema file.
2022-06-30 11:43:51 +10:00
Marc Durdin
3d9d6f59dc chore: add documentation for keyman-touch-layout 2022-06-30 11:07:38 +10:00
Marc Durdin
87cc5d42a8 feat(developer): add missing props to schema and make more lenient 2022-06-29 06:05:30 +10:00
Marc Durdin
d9accbe07b feat(developer): draft .keyman-touch-layout schema 2022-06-28 11:31:20 +10:00
Marc Durdin
cb240e259f chore(windows): move schemas to common 2022-06-10 13:26:05 +10:00
Marc Durdin
b9c492a66b feat(developer): validate .kps files during compile
Fixes #5464.

The keyboards repository already has code to validate .xsd files, using
xmllint. This adds the same functionality directly into kmcomp and TIKE.
2021-11-11 14:41:04 +11:00