Commit graph

323 commits

Author SHA1 Message Date
Marc Durdin
238a8e9185 fix(developer): improve support for inferred key cap text
Fixes #7616.

Fixes a crash when attempting to infer key cap text from key id, and
cleans up the support for inferred key text so that it works correctly
in the designer.

Also adds a safeguard to KMW to stop invalid key ids causing a crash.
2022-11-04 06:18:24 +11:00
Marc Durdin
6b9c7de6c0 fix(developer): tweak captions for consistency
Fixes #7605.
Fixes #7606.
2022-11-03 09:04:50 +11:00
Marc Durdin
27275013af
Merge pull request #7594 from keymanapp/fix/developer/6974-gif-splash-image-preview
fix(developer): support gif preview images in Package Editor
2022-11-03 09:02:00 +11:00
Marc Durdin
770781c0c9
Merge pull request #7593 from keymanapp/fix/developer/5238-scrollable-details-and-build-tabs
fix(developer): Make Details and Build tabs scrollable
2022-11-03 08:44:21 +11:00
Marc Durdin
69c1be968e
Merge pull request #7595 from keymanapp/fix/developer/7582-publish-keyman-version
fix(developer): publish `@keymanapp/keyman-version` to npm
2022-11-02 14:49:25 +11:00
Marc Durdin
549f627509
Merge pull request #7585 from keymanapp/fix/developer/298-avoid-reformatting-unchanged-system-stores
fix(developer): avoid reformatting unchanged system stores
2022-11-02 14:49:06 +11:00
Marc Durdin
7be90d3ac7
Merge pull request #7584 from keymanapp/fix/developer/2803-basic-project-icon
fix(developer): generate a default icon for basic keyboard projects
2022-11-02 14:35:57 +11:00
Marc Durdin
594d8c9104
Merge pull request #7586 from keymanapp/fix/developer/6363-remove-ancient-samples
fix(developer): remove ancient samples
2022-11-02 13:47:30 +11:00
Marc Durdin
8049399d1f
Merge pull request #7583 from keymanapp/fix/developer/3784-repeated-begin
fix(developer): prevent repeated `begin` statements
2022-11-02 13:47:23 +11:00
Marc Durdin
6ace0e36ef
Merge pull request #7580 from keymanapp/fix/developer/4719-kmlmp-path-awareness
fix(developer): ensure kmlmp handles paths
2022-11-02 13:47:16 +11:00
Marc Durdin
badf5e6d4b
Merge pull request #7531 from keymanapp/fix/developer/7529-enforce-us-layout-for-debugger
fix(developer): Use US base layout for debugger
2022-11-02 13:47:06 +11:00
Marc Durdin
c336a8052c fix(developer): publish @keymanapp/keyman-version to npm
Fixes #7582.

Because of https://github.com/npm/cli/issues/3466, we must publish our
internal dependency @keymanapp/keyman-version. This change adds a common
builder function builder_publish_to_npm in build-utils-ci.inc.sh to help
with that task, which should be adopted by other scripts that need to
publish to npm, in the future.

For now, responsibility for publishing keyman-version is delegated to
kmlmc. In the future, we will move this to a single top-level build
action that publishes all npm modules across the entire repo for the
given version.
2022-11-02 13:33:24 +11:00
Marc Durdin
9421ba29cb fix(developer): support gif preview images in Package Editor
Fixes #6974.

GIF images were not supported in the Details tab, Image file, because we
didn't link in GIF file support. After linking it in, we also needed to
change over the picture rendering to have an intermediate render step,
as the existing model only worked with .bmp images.

At the same time, added warnings for wrongly-sized images to the image
size information.
2022-11-02 12:05:50 +11:00
Marc Durdin
b7d305a8d3 fix(developer): Make Details and Build tabs scrollable
Fixes #5238.

The Details and Build tabs have fixed positional content in the Keyboard
Editor, Model Editor, and Package Editor. Sizing the window too small
can cause content to be outside the bounds of the tab. This patch moves
these tabs into scrollboxes (except for Details tabs on Keyboard and
Model editors, which were already in scrollboxes). The remaining tabs
have resizable content. The tabs will still become fairly unusable if
they become too small, but this should be less of a problem than before.
2022-11-02 11:37:07 +11:00
Marc Durdin
aff1d682cc fix(developer): remove ancient samples
The sample keyboards included with Keyman Developer were decidedly
unhelpful. Removing them and instead we should point users to the
Keyboards repo in the future.

Fixes #6363.
2022-11-01 17:04:38 +11:00
Marc Durdin
4be2dcc9e4 fix(developer): avoid reformatting unchanged system stores
Fixes #298.
2022-11-01 16:33:10 +11:00
Marc Durdin
3e220e33c4 fix(developer): generate a default icon for basic keyboard projects
Fixes #2803.

The new basic project template will now include a default icon,
generated either from the first BCP 47 tag, or else from the first 3
letters of the filename of the keyboard.

The icon will not be included if the keyboard does not target desktop
platforms, as web/touch do not currently support the icon.
2022-11-01 15:14:13 +11:00
Marc Durdin
7793be015b fix(developer): prevent repeated begin statements
Fixes #3784.

Only one type of each `begin` statement should be allowed in any given
keyboard source file.
2022-11-01 14:25:05 +11:00
Marc Durdin
8a18547662 fix(developer): ensure kmlmp handles paths
Fixes #4719.

kmlmp no longer assumes '../source/' for paths. It works with paths
relative to the source file. This makes it more compatible with any
valid source .kps file, as well as making current working directory
irrelevant.

Also adds corresponding tests for building .kmp and verifying file
layout.
2022-11-01 11:56:28 +11:00
Marc Durdin
20e230d3ba
Merge pull request #7553 from keymanapp/fix/developer/7551-exclude-nocaps-from-layer-id-modifiers
fix(developer): exclude `nocaps` from layer id modifier components
2022-10-28 11:56:45 +11:00
Marc Durdin
be2b529e65 fix(developer): exclude nocaps from layer id modifier components
Fixes #7551.
2022-10-27 08:37:04 +11:00
Marc Durdin
bff8e09db5 fix(developer): Use US base layout for debugger
Fixes #7529.

We must always use the US base layout for the debugger, as positional
keyboards are not affected by the active Windows system keyboard. This
fix ensures that the behaviour in the debugger matches what the user
experiences in Keyman for Windows.

Note that this does not address support for mnemonic layouts, tracked in
issue #1074.
2022-10-26 09:49:57 +11:00
Marc Durdin
24ba21abab fix(developer): handle LControl being set by Windows when AltGr pressed
Fixes #7506.

In the keyboard debugger, we need to mask out LControl when AltGr is
pressed by the user, because Windows will generate LControl + AltGr for
European layouts.

Note: have also hidden the System Keyboard debug setting in this commit,
given it is not currently implemented; see #1225.

A follow-up issue is #7529.
2022-10-26 09:37:36 +11:00
Joshua A. Horton
1d8595d48e fix(developer): developer build path partial reversion 2022-10-25 15:44:26 +07:00
Joshua A. Horton
23b516182f change(web): build/<product> -> build/app/<product> 2022-10-25 09:12:43 +07:00
Joshua A. Horton
d36b912c6f fix(developer): KMW copy path lacking a path piece 2022-10-25 08:42:42 +07:00
Joshua A. Horton
242cb1312c fix(developer): fixes developer-server's Web build call 2022-10-24 10:06:18 +07:00
Joshua A. Horton
0d643a88f7 fix(developer): KMW build product copying 2022-10-24 10:05:08 +07:00
Marc Durdin
3c14a8312f
Merge pull request #7431 from keymanapp/fix/developer/7419-handle-invalid-graphics-in-ico-editor
fix(developer): Handle invalid graphics in icon editor
2022-10-21 09:57:01 +11:00
Marc Durdin
08c9cd6239
Merge pull request #7430 from keymanapp/fix/developer/7425-ctrl-key-press-release
fix(developer): Ctrl key to select key was conflicting with shortcuts
2022-10-19 06:19:48 +11:00
Marc Durdin
ec953cf689
Merge pull request #7372 from keymanapp/fix/developer/4324-handle-model-hints-and-warnings-cleanly
fix(developer): Handle hints and warnings cleanly
2022-10-19 06:19:34 +11:00
Joshua Horton
66f9c520f7
Merge pull request #7343 from keymanapp/change/web/drop-touch-aliases
change(web): now utilizes 'inputMode="none"' on supported touch devices 📴
2022-10-17 10:18:58 +07:00
Marc Durdin
6b52b439bb fix(developer): address ico validity during assignment 2022-10-14 16:49:17 +11:00
Marc Durdin
25d91e8f4d fix(developer): manual attachment for kmw in server 2022-10-14 11:10:26 +11:00
Marc Durdin
f054b06014 chore(developer): minor tweaks for usability
move Clear All button in read-only view
don't show a dialog for invalid graphics
2022-10-11 07:29:46 +11:00
Marc Durdin
bf8f636a14 fix(developer): Handle invalid graphics in icon editor
Fixes #7419.

If the user attempts to add an invalid graphic (e.g. a .png file saved
with a .ico extension), Keyman Developer will no longer crash when
trying to load the file.

Note that while the keyboard will still compile with an invalid graphic,
Keyman for Windows will refuse to install it. I have not tested other
platform handling of such a situation.
2022-10-11 07:18:09 +11:00
Marc Durdin
51a3679a90 fix(developer): Ctrl key to select key was conflicting with shortcuts
Fixes #7425.

In the layout editor, the "Select Key" dialog was being shown sometimes
when using shortcuts such as Ctrl+V. The reason this happened was that
the shortcut handler in Delphi was capturing the keydown of the V key,
so the Ctrl event handler never saw it. Then, if you pressed Ctrl+V, and
released the Ctrl key before releasing the V key (which often happens
when you press a shortcut rapidly), the Ctrl event handler would receive
notification of the Ctrl key release and trigger the "Select Key"
dialog.

This fix shifts the Ctrl key event handler out of the keyboard editor
and into the top-level application events handler -- this is the best
place where we can preview key events before they are passed to the
shortcut handler and controls for processing.

This necessitated adding a general `ControlKeyPressedAndReleased` event
function to the TIKE editor base class. This is currently only used by
`UfrmKeymanWizard` and `UfrmOSKEditor`.

I noted that the OSK editor did not currently support the Ctrl key
event to select a new key. As a part of this fix, I added support for
this, to bring it into line with the Layout Editor and the Touch Layout
Editor.
2022-10-11 06:39:38 +11:00
Joshua A. Horton
f8438d2117 chore(web): Merge branch 'master' into change/web/drop-touch-aliases 2022-10-10 09:04:24 +07:00
Marc Durdin
61a058fcec
Merge pull request #7371 from keymanapp/fix/developer/7368-handle-invalid-kps-in-project-view
fix(developer): handle invalid kps xml when loading project view
2022-10-03 14:26:59 +11:00
Joshua A. Horton
fe585b88af chore(web): removal of 'kmw_ip' checks, references 2022-09-29 08:17:47 +07:00
Marc Durdin
687c8bae99
Merge pull request #7370 from keymanapp/fix/developer/7090-7091-use-path-backslash-format-for-parameters
fix(developer): ensure backslash in paths passed to kmcomp
2022-09-29 09:22:57 +10:00
Marc Durdin
7a819598e7 fix(developer): Handle hints and warnings cleanly
Relates to #4324 (but slightly orthogonal.)

We wanted some message classes to be handled in the lexical model editor
more cleanly, including drill-down to line of error. A few changes
required to make this work well:

1. Parse error messages from kmlmc. This is not perfect but works while
   the two projects are kept in sync, which they always are for Keyman
   Developer. Note that at this stage, .ts warnings are not captured in
   this parser, as they are generated by tsc.
2. Drill-down in Wordlist Editor Frame to find line of error
3. Model editor reports ownership of .tsv files so they can be loaded
4. In case of model editor not open (e.g. building from project view),
   the TSV standalone editor was not displaying the frame, so it never
   actually worked.
5. If the text editor had never loaded, then FindError was effectively
   a no-op; adds code to seek to error line after page load finishes.
6. Ensures that if we attempt to seek an error in a sub-file owned by
   an editor (e.g. .tsv owned by .model.ts, .kvks owned by .kmn), that
   the parent editor will be focused first. Does not verify all paths
   here, just the tsv one.
2022-09-28 20:17:44 +10:00
Marc Durdin
73e0a2e461 fix(developer): generate valid js when using unquoted digits in stores
Fixes #7005.

If a developer used single digit values in stores, unquoted (which is
not really the usual approach, but should work just fine for non-zero
values), the KMW compiler would emit invalid single-digit hexadecimal
escapes for them, e.g. `"\x1"` instead of `"\x01"`.

Sample code:

```
store(option) 1

if(option = 1) + 'a' > 'one'
if(option = 2) + 'a' > 'two'
+ '1' > set(option = 1)
+ '2' > set(option = 2)
```

It is not immediately obvious from this code, but the value `1` is
actually a character with value `'\x01'` or `U+0001`!

The more usual approach will not encounter this problem:

```
store(option) '1'

if(option = '1') + 'a' > 'one'
if(option = '2') + 'a' > 'two'
+ '1' > set(option = '1')
+ '2' > set(option = '2')
```

Note that the following is a compile error (due to internal use of
null terminated strings).

```
store(option) 0
```
2022-09-28 17:00:55 +10:00
Marc Durdin
f5b8effaae fix(developer): ensure backslash in paths passed to kmcomp
Fixes #7090.
Fixes #7091.

While kmcomp loads most files just fine when paths with forward slashes
are passed in, it fails to parse target path correctly when building one
file out of a project.

For example, if the user runs:

```
kmcomp.exe -t khmer_angkor.kmn release/k/khmer_angkor/khmer_angkor.kpj
```

Then the following error arises:

```
khmer_angkor.kps: Error: 0001 Validation error: The system cannot find the path specified.
khmer_angkor.kps: Failure: Package C:\Projects\keyman\keyboards\source\khmer_angkor.kps had validation errors.
```

This patch ensures all paths passed in as command-line parameters are
converted to backslashes, matching the expected Windows format. While I
only needed to fix the `FParamTarget` parameter in order to address the
reported issues, for consistency I applied the same fix to all input
paths.
2022-09-28 16:50:58 +10:00
Marc Durdin
50614fb088 fix(developer): handle invalid kps xml when loading project view
Fixes #7368.
2022-09-28 16:32:36 +10:00
Marc Durdin
d1de02d43e chore(developer): Merge branch 'master' into chore/developer/server-node-gyp-dependency 2022-09-20 10:19:11 +10:00
Marc Durdin
9f290cac21 chore(developer): Merge branch 'master' into chore/developer/server-update-multer-dependency 2022-09-20 10:16:46 +10:00
Marc Durdin
aab9d1aad5 chore(developer): Merge branch 'master' into chore/developer/server-node-gyp-dependency 2022-09-20 10:14:16 +10:00
Marc Durdin
a59a6c334a chore: update node-windows-trayicon to update node-gyp to 9.1.0 2022-09-19 15:07:24 +10:00
Marc Durdin
3d61d18371 chore(developer): update multer dependency for server
Removes Keyman Developer Server's transitive dependency on dicer by
updating multer to `1.4.5-lts.1`, which updates its dependency on
busboy.

See
https://github.com/expressjs/multer/pull/1097#issuecomment-1141286771
for reasoning behind use of  `-lts.1` rather than a full release
version.

At some point in the future, multer will publish a full release with
this fix, at which point we can move back to a full release version.
2022-09-19 12:36:51 +10:00