spiegel-keyman/web
Marc Durdin d55df2e630 fix(web): remove canvas use for iOS compatibility 🍒
Fixes #5831.

Cherry-pick of #5915.

iOS 15 has a significant crashing bug whereby use of a canvas element
completely crashes the browser in some contexts. In particular, we have
observed this when using a WKWebView in a keyboard extension without
'Allow Full Access' switched on.

Keyman uses canvas element to draw a nice looking key preview (key tip)
on iPhones. This is a critical issue for Keyman for iPhone. Keyman for
iPad is not affected because the iPad version does not use key previews.

The resolution here is to remove use of the canvas drawing for key tips
and use a simplified pure HTML/CSS shape. I have not conditioned this
fix on platform; I have currently opted to apply this to all platforms.

This issue will be reported to Apple for resolution. The issue applies
so far to iOS 15.0, 15.1.
2021-11-16 17:30:04 +11:00
..
bulk_rendering fix(web): bulk rendering docs 2021-01-22 16:07:45 +11:00
samples chore(web): tweaks sample pages to use init's promise for keyboard loading 2021-01-14 09:23:11 +07:00
source fix(web): remove canvas use for iOS compatibility 🍒 2021-11-16 17:30:04 +11:00
testing fix(common/core/web): Remove empty rows in OSK 2021-09-16 10:29:58 +07:00
tools feat(web): Add script to deploy KeymanWeb release to s.keyman.com 2021-05-28 10:17:37 +07:00
unit_tests chore(common/core/web): Merge branch 'master' into feat/common/core/web/input-processor-unit-tests 2020-11-10 08:27:15 +07:00
.gitattributes Patches up the /samples pages. 2018-01-08 09:51:19 +07:00
.gitignore Adds support for TS to receive build-time values for compilation. 2019-01-17 13:51:07 +07:00
history.md chore: merge stable history 2020-04-29 06:33:31 +10:00
index.html fix(web): recorder operational in new location 2020-05-01 08:06:12 +07:00
LICENSE Move KeymanWeb project to web/ 2017-05-26 11:00:34 +07:00
NOTICE Move KeymanWeb project to web/ 2017-05-26 11:00:34 +07:00
package-lock.json auto: increment stable-14.0 version to 14.0.283 2021-09-27 17:08:06 -04:00
package.json auto: increment stable-14.0 version to 14.0.283 2021-09-27 17:08:06 -04:00
README.md chore(web): Update keymanweb-osk.ttf to v. 2.100 2020-10-28 14:42:05 +07:00

Keyman Web

The Original Code is (C) 2017-2018 SIL International

Minimum Web Compilation Requirements

  • Java 7+ (required by the Google Closure Compiler)
    • This can be ignored for Keyman Developer builds.
  • A local installation of Node.js v8.9+.
    • Builds will call npm install to automatically install further necessary build dependencies.

    • Linux users can run the following to update to LTS version of nodejs

sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs

The following folders contain the distribution for KeymanWeb:

source                      Source code
sources/resources/osk       OSK resources for inclusion in mobile app builds;
                            keymanweb-osk.ttf is maintained at https://github.com/silnrsi/font-keymanweb-osk
unit_tests                  Automated testing resources

intermediate    	Intermediate compiled code; TypeScript source is compiled here before it is minified.
release/web			Fully-compiled KeymanWeb modules for testing
release/embedded	Fully-compiled KMEA/KMEI modules for inclusion in mobile app builds
release/unminified/web       Fully-compiled but non-minified KeymanWeb modules
release/unminified/embedded  Fully-compiled KMEA/KMEI modules for inclusion in mobile app builds

samples				Sample pages demonstrating ways to link with KeymanWeb
testing     		Test-case web-pages for various aspects of KeymanWeb functionality
unit_tests			A Node-driven test suite for automated testing of KeymanWeb

Usage

Open index.html or samples/index.html in your browser. Be sure to compile KeymanWeb before viewing the pages.

Refer to the samples for usage details.

To view pages using compiled KeymanWeb,

  1. cd to keyman/web/source
  2. Run ./build.sh

build.sh options:

  • -ui
    • to compile desktop user interface modules to output folder
  • -test
    • to compile for testing without copying resources or updating the saved version number.
  • -embed
    • to compile only the KMEA/KMEI embedded engine.
  • -web
    • to compile only the KeymanWeb engine.
  • -debug_embedded
    • to compile a readable version of the embedded KMEA/KMEI code
  • -no_minify
    • to disable the minified '/release/web' and '/release/embedded' build sections.
    • the '/release/unminified/web' and '/release/unminified/embedded' folders will still be built.
  • -clean
    • to erase pre-existing build products before the build.

If more than one target is specified, the last one will take precedence.

Unit Testing

Before running unit tests on KeymanWeb, first run ./build.sh according to the instructions above.

Once the build is complete, running npm test will run the unit testing suite on your local machine in-browser. Alternatively, see unit_tests/test.sh, which the former command executes.