chore(web): drops non-pred text dependence on es6-shim

This commit is contained in:
jahorton 2022-04-22 11:30:08 -05:00
parent f600406192
commit 75964b0077
8 changed files with 20 additions and 11 deletions

View file

@ -13,8 +13,7 @@
{ "path": "../../utils", "prepend": true },
{ "path": "../../keyboard-processor/src", "prepend": true },
// For headless tests, we need the headless version of the compile.
{ "path": "../../../predictive-text/tsconfig.json", "prepend": true },
{ "path": "../..//es6-shim", "prepend": true }
{ "path": "../../../predictive-text/tsconfig.json", "prepend": true }
],
"files": [
"text/inputProcessor.ts",

View file

@ -19,7 +19,6 @@
"references": [
{ "path": "../../common/web/utils", "prepend": true },
{ "path": "../../common/web/keyman-version", "prepend": true },
{ "path": "../../common/web/es6-shim", "prepend": true },
{ "path": "../../common/web/lm-message-types" },
]
}

View file

@ -58,7 +58,6 @@
"@keymanapp/keyman-version": "*",
"@keymanapp/web-utils": "*",
"@types/node": "^11.9.4",
"es6-shim": "^0.35.5",
"eventemitter3": "^4.0.0"
}
}

View file

@ -52,8 +52,10 @@ namespace com.keyman.osk {
}
public static isValidTarget(vkbd: VisualKeyboard, baseKey: KeyElement) {
// Could use String.includes, but Chrome for Android must be version 41+.
// We support down to version 37.
return (
baseKey['keyId'].includes('K_SHIFT') &&
baseKey['keyId'].indexOf('K_SHIFT') >= 0 &&
vkbd.layerGroup.layers['caps'] &&
!baseKey['subKeys'] &&
vkbd.touchCount == 1

View file

@ -11,7 +11,18 @@ namespace com.keyman.osk {
public readonly special: 'em' | 'rem';
public constructor(style: LengthStyle | string) {
Object.assign(this, typeof style == 'string' ? ParsedLengthStyle.parseLengthStyle(style) : style);
let parsed: LengthStyle = (typeof style == 'string') ? ParsedLengthStyle.parseLengthStyle(style) : style;
// While Object.assign would be nice (and previously, was used), it will break
// on old but still supported versions of Android if their Chrome isn't updated.
// Requires mobile Chrome 45+, but API 21 (5.0) launches with an older browser.
// Object.assign(this, parsed);
this.val = parsed.val;
this.absolute = parsed.absolute;
if(parsed.special) {
this.special = parsed.special;
}
}
public get styleString(): string {

View file

@ -32,7 +32,6 @@
{ "path": "../../common/predictive-text/browser.tsconfig.json", "prepend": true },
{ "path": "../../common/web/input-processor/src", "prepend": true },
{ "path": "../../common/web/keyboard-processor/src", "prepend": true },
{ "path": "../../common/web/es6-shim", "prepend": true },
{ "path": "../../common/web/lm-message-types" },
// sentry-manager is used by Keyman for Android and Keyman for iOS but not
// directly by KeymanWeb, but it's neater to reference it here and get the

View file

@ -30,10 +30,8 @@
{ "path": "../../common/web/keyman-version", "prepend": true },
{ "path": "../../common/web/utils", "prepend": true },
{ "path": "../../common/predictive-text/browser.tsconfig.json", "prepend": true },
//{ "path": "../../common/web/lm-worker", "prepend": true },
{ "path": "../../common/web/input-processor/src", "prepend": true },
{ "path": "../../common/web/keyboard-processor/src", "prepend": true },
{ "path": "../../common/web/es6-shim", "prepend": true },
{ "path": "../../common/web/lm-message-types" }
]
}

View file

@ -41,9 +41,11 @@
*/
function errToString(err) {
// Painful? Kinda. But needed on un-updated Android API 21!
if(Array.isArray(err)) {
let result = '';
for(let e of err) {
var result = '';
for(var i = 0; i < err.length; i++) {
var e = err[i];
if(e.error instanceof Error) {
result += e.error.message + '\n';
} else {