Commit graph

160 commits

Author SHA1 Message Date
Marc Durdin
e0b308b983 chore(web): cleanup for ts projects 2022-04-13 15:19:55 +10:00
Marc Durdin
4d94786852 chore(web): replace lerna with npm workspaces and ts projects
Fixes #6320.

Part 1 of moving from lerna to a simpler, maintained monorepo solution,
using TypeScript Projects and NPM Workspaces.

There is more work to be done here. At this point, KeymanWeb builds and
runs without errors, but the built file is substantially different,
mostly in include order.

Using TypeScript Projects, we move away from the need to run build
scripts in various locations for almost all the Typescript modules.

TODO: Embedded versions and tests have not been verified.

TODO: developer/server is not yet verified.

TODO: developer/js (needs a rename!) is not yet verified.

TODO: Currently, the predictive-text folder needs refactoring to move
the construction of the worker wrapper out of the Predictive Text build
and into the final assembly of keymanweb.js (as it should be valid to
run it as a separate .js anyway).

TODO: Most of the `<reference>` paths need to be re-verified. Ideally
there should be no references outside the current module for any given
.ts.

TODO: The embedded vs browser vs node (headless) builds should be tidied
up for consistency so that it's obvious what depends on what. This is
currently messiest in the predictive-text folder, where the output names
diverge from the filenames and the various files are mixed in the same
folder (as evidenced by the exclusions listed in each tsconfig.json).

TODO: `npm install` should be removed from most build scripts and
instead `npm ci` (#6196) should be run only once from the top-level
folder for any given build. I've had eliminated side-effects from the
`install` action for npm, which makes it easier to reason about state.

TODO: verify_npm_setup and related functions can probably be eliminated.

TODO: most of the build scripts should be largely eliminated for web.

TODO: several ts projects use inconsistent output folders.

TODO: it may be possible to generate a .d.ts for models/types so that
we can use a consistent reference for those as well.

TODO: build.sh, tsconfig.json should always be in the module's top-level
folder, not in a subfolder such as src (e.g. see input-processor/src,
keyboard-processor/src, web/source).

TODO: resources/web-environment should be in common/web.

TODO: other js node_modules imports should be wrapped like es6-shim.

TODO: fix up the publish code for npm modules

TODO: eliminate version numbers from package.json if possible?

Whew, that's most of the stuff I noticed!
2022-04-12 21:02:33 +10:00
Marc Durdin
bbbf1afce7 feat(web): basic support for newContext
Relates to #3621.

Adds basic support for `begin newContext`.
2021-11-23 15:00:47 +11:00
Marc Durdin
a7c050d71b fix(web): resolve unhandled exception in promise
Fixes #5353.

I made the promise usage consistent in the relevant addKeyboards
functions, instead of mixing promise and async/await style code, which
made it easier to spot the place(s) where promises had not been returned
as we needed.
2021-11-14 15:43:43 +11:00
jahorton
127197db95 feat(web): starts InlinedOSKView 2021-09-01 11:49:23 +07:00
jahorton
6971f09c4d refactor(web): activeElement, lastActiveElement as properties 2021-09-01 09:44:01 +07:00
jahorton
aebe4788a7 refactor(web): Anchored vs Floating OSKViews (pass 1) 2021-08-25 09:40:18 +07:00
jahorton
e1da0014c3 refactor(web): start of OSKView abstraction 2021-08-23 10:01:06 +07:00
Darcy Wong
d60954ef81 fix(web): Check addKeyboards() for empty args 2021-07-26 09:42:16 +07:00
Darcy Wong
5d1a652314 Merge remote-tracking branch 'origin/master' into feat/web/add-keyboard-promise 2021-07-23 13:12:40 +07:00
jahorton
b723d8c51b chore(web): Merge branch 'refactor/web/osk-keyboard-view' into refactor/web/osk-cleanup-and-init 2021-07-21 09:13:27 +07:00
jahorton
c3717a1813 chore(web): Merge branch 'master' into refactor/web/osk-keyboard-view 2021-07-19 15:37:11 +07:00
Joshua Horton
8156356ad5
Merge pull request #5393 from keymanapp/refactor/web/osk-desktop-header-footer
refactor(web): partial encapsulation of the desktop title bar and resize bar 🍕
2021-07-19 14:39:04 +07:00
Darcy Wong
e01f6bf201 fix(web): Add wrapper to convert one-to-many keyboard stubs 2021-07-09 16:16:41 +07:00
jahorton
7d08b2795f feat(web): delayed keyman.osk initialization 2021-07-07 11:45:27 +07:00
jahorton
06414b2243 refactor(web): no param VisualKeyboard.show, simple param adjustHeights 2021-07-06 12:08:31 +07:00
Darcy Wong
6af2831c23 chore(web): Merge branch 'master' into feat/web/add-keyboard-promise 2021-07-02 09:04:58 +07:00
Marc Durdin
55c2192171
Merge pull request #5348 from keymanapp/feat/web/949-spacebar-text-controls
feat(web): spacebar text controls
2021-07-02 08:17:59 +10:00
jahorton
b3f134a9e9 refactor(web): _TitleElement now field of OSKManager 2021-07-01 13:41:30 +07:00
Darcy Wong
1a791bb5f7 fix(web): Fix handling of addKeyboards args 2021-06-30 14:36:17 +07:00
Darcy Wong
f5e7343d35 chore(web): Handle args in kmwbase 2021-06-29 08:51:57 +07:00
Marc Durdin
b4840f96c4 fix(web): add spacebarText to OptionType 2021-06-29 06:07:11 +10:00
Darcy Wong
1d6ed84155 feat(web): Start updating addKeyboards to return Promise 2021-06-28 23:39:15 +07:00
Darcy Wong
ec9e6aaef8
Update web/source/kmwbase.ts
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2021-06-28 14:29:39 +07:00
Marc Durdin
e56f377d69
Merge branch 'master' into feat/web/949-spacebar-text-controls 2021-06-28 16:01:26 +10:00
Darcy Wong
fc514cc0f0 chore(web): Merge remote-tracking branch 'origin/master' into feat/web/error-stubs 2021-06-25 14:45:39 +07:00
Darcy Wong
026bf9db2e
Merge pull request #5302 from keymanapp/feat/web/alert-option
feat(web): Add option useAlerts to control alerts()
2021-06-25 14:29:54 +07:00
Darcy Wong
1ba05a429a
Merge pull request #5260 from keymanapp/feat/web/promise-api
feat(web): Update addLanguageKeyboards to return a Promise
2021-06-25 14:29:26 +07:00
Darcy Wong
37c42e7dee chore(web): Merge branch 'feat/web/alert-option' into feat/web/error-stubs 2021-06-25 09:24:19 +07:00
Darcy Wong
b843a24f9a chore(web): Address additional review comments
* Add more description on promise-api/index.html
* Use OptionType
2021-06-25 09:15:13 +07:00
Marc Durdin
38fc826fbf feat(web): spacebar text controls
Relates to #949.

* Adds optional `displayName` property to keyboard stubs: if present,
  this will override the name on the spacebar.

* Adds optional `spacebarText` member to `keyman.options`. This defaults
  to `SpacebarText.LANGUAGE_KEYBOARD`, and can be one of:

  ```
  SpacebarText.LANGUAGE
  SpacebarText.KEYBOARD
  SpacebarText.LANGUAGE_KEYBOARD
  SpacebarText.BLANK
  ```

* Sets the display pattern for LANGUAGE_KEYBOARD to be
  "language - keyboard" instead of "language (keyboard)", which
  reduces the number of parentheses visible on the spacebar.
2021-06-24 08:44:23 +10:00
Darcy Wong
359eabec2f feat(web): Merge keyboard stub with error stub 2021-06-23 16:19:37 +07:00
Darcy Wong
b68ed7f874 fix(web): revert assigning default attachType 2021-06-23 13:58:48 +07:00
Darcy Wong
9c4170bba6 fix(web): Handle blank attachType 2021-06-23 12:43:34 +07:00
Darcy Wong
ccc2ecaddb fix(web): Set optional properties in OptionType 2021-06-20 09:05:48 +07:00
Darcy Wong
473b0b44be fix(web): And attachType assignment 2021-06-19 07:44:55 +07:00
Darcy Wong
e7d35a798d fix(web): Fix attachType enumeration 2021-06-19 07:43:47 +07:00
Darcy Wong
9bbd8035e0 fix(web): Start addressing review comments 2021-06-18 15:26:54 +07:00
Darcy Wong
b2636603d8 feat(web): Add option useAlerts to control alerts() 2021-06-17 13:03:56 +07:00
Darcy Wong
d7d5ad085d chore(web): Update preamble 2021-06-16 21:44:02 +07:00
Darcy Wong
e81a7c1611 fix(web): Fix return of nested promises 2021-06-16 17:57:17 +07:00
Darcy Wong
59f26a0e64 chore(web): Remove Error return type 2021-06-16 09:26:59 +07:00
Darcy Wong
2c0f8e8566 chore(web): Minor cleanup 2021-06-15 12:59:00 +07:00
Darcy Wong
083d2ba711 fix(web): Use async/await for getting language list catalog 2021-06-15 12:27:27 +07:00
Darcy Wong
9c93f31861 fix(web): Cleanup params 2021-06-11 12:14:52 +07:00
Darcy Wong
61f3a8dd5b feat(web): Initial try for addLanguageKeyboards to return a Promise 2021-06-10 15:02:57 +07:00
jahorton
99b186b9f4 refactor(web): internal BuildVisualKeyboard signature (external API unchanged) 2021-06-10 14:39:24 +07:00
jahorton
a702262637 refactor(web): osk height-adjustment 2021-06-10 14:33:17 +07:00
Marc Durdin
34568b3e8e fix(web): toolbar and loading optimisations
There are a number of changes here to improve the performance of
KeymanWeb and the toolbar and reduce unnecessary requests:

1. (kmwbase.ts and kmwkeyboards.ts) Added option `setActiveOnRegister`,
   default `'true'`; if set to `'false'` then will never attempt to
   activate the first registered keyboard. Note that this property is a
   string because the `options` object currently supports only string
   types, which is not ideal, but out of scope for this PR.

2. (kmwuitoolbar.ts) fixed issue with toolbar not matching correctly on
   full BCP 47 code (line 960) after keyboard change notification.

3. (kmwuitoolbar.ts) fixed issue with toolbar not showing active
   keyboard if the keyboard is activated before init is complete
   (see `ui.lastSelectedKeyboard` references).

4. (kmwuitoolbar.ts) avoided re-entrancy for `ui.changeKeyboardEvent`
   by ensuring that `ui.selectKeyboard` does not attempt to set the
   active keyboard again for keymanweb; note that this was being caught
   by the event dispatcher in keymanweb but it was still not ideal.

5. (kmwuitoolbar.ts) with above changes, able to remove appalling two
   second timeout on load (yay!)

These changes will be useful immediately with keymanweb.com.
2021-01-21 12:07:15 +11:00
jahorton
6d111783e3 fix(common/core/web): predictive context reset 2020-12-03 15:48:18 +07:00