diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml index 8c745bef3071cbfadd576e89610860a4fb7c0712..8495f5577a6617e31affd811a93b27038295aadb 100644 --- a/.github/workflows/deb-packaging.yml +++ b/.github/workflows/deb-packaging.yml @@ -119,8 +119,8 @@ jobs: platform: "${{ matrix.arch }}" source_dir: "artifacts/keyman-srcpkg" sourcepackage: "keyman_${{ needs.sourcepackage.outputs.VERSION }}-1.dsc" - deb_fullname: $DEBFULLNAME - deb_email: $DEBEMAIL + deb_fullname: ${{env.DEBFULLNAME}} + deb_email: ${{env.DEBEMAIL}} prerelease_tag: ${{ needs.sourcepackage.outputs.PRERELEASE_TAG }} - name: Output resulting .deb files diff --git a/HISTORY.md b/HISTORY.md index c05c241eff96740ca9e41e287d1a851045aaf025..50d64334643faebc41b87d6c8af2d042dab78340 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,37 @@ # Keyman Version History +## 17.0.118 alpha 2023-06-05 + +* chore(ios): replace fv cert (#8900) +* fix(core): Fix compilation if hotdoc is installed (#8912) +* feat(linux): Rename column and add tooltip (#8918) + +## 17.0.117 alpha 2023-06-04 + +* chore(developer): verify long lines compile correctly (#8915) + +## 17.0.116 alpha 2023-06-02 + +* feat(linux): Add column for installation location (#8897) +* chore(developer): verify kvks files and report errors (#8892) +* refactor(developer): rearrange kmcmplib interface source (#8899) +* refactor(developer): move filename consistency check to kmc (#8907) +* chore(developer): loadFile callback error check and optimization (#8908) +* chore(common): remove url module ref from common/web/types (#8914) + +## 17.0.115 alpha 2023-06-01 + +* refactor(developer): complete fs move out of kmcmplib (#8882) +* fix(common): tweak pack/publish support for npm 9.5.1 and node 18.16.0 (#8894) +* feat(linux): Implement Options page and option to disable Sentry error reporting (#7989) + +## 17.0.114 alpha 2023-05-31 + +* chore(developer): replace cwrap wasm bindings (#8857) +* chore(developer): refactor kmcmplib interfaces (#8870) +* chore(developer): move keyboard repo fixtures (#8874) +* chore(linux): Move build steps to build.sh (#8864) + ## 17.0.113 alpha 2023-05-26 * docs(android): Update documentation for building Android on Linux (#8860) diff --git a/VERSION.md b/VERSION.md index a3a3dc809e3ff7ff42f204abcc79812de3a7b640..7d14d88a17924860f9933506ff2ae81ec0be6d1f 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.114 \ No newline at end of file +17.0.119 \ No newline at end of file diff --git a/android/.gitignore b/android/.gitignore index 09e84019e45cb0f92efbbb0e099af0ca4bf1ce69..ad30f1a79d8e55e1c31b759a4620188ca6a93956 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -34,6 +34,9 @@ gradle_models.ser KMEA/**/assets/ajax-loader.gif KMEA/**/assets/keymanandroid.js KMEA/**/assets/keyman.js.map +KMEA/**/assets/keymanweb-webview.js +KMEA/**/assets/keymanweb-webview.js.map +KMEA/**/assets/sentry.min.js KMEA/**/assets/keyman-sentry.js KMEA/**/assets/es6-shim.min.js KMEA/**/assets/kmwosk.css diff --git a/android/KMEA/app/src/main/assets/android-host.js b/android/KMEA/app/src/main/assets/android-host.js index 1bfcb0b1d660f1581e5914ed7f1876073cca076d..25e4223032e861c401d1775a1e2a4e31c41c6989 100644 --- a/android/KMEA/app/src/main/assets/android-host.js +++ b/android/KMEA/app/src/main/assets/android-host.js @@ -10,7 +10,7 @@ var oskHeight = Math.ceil(window.jsInterface.getKeyboardHeight() / window.device var oskWidth = 0; var fragmentToggle = 0; -var sentryManager = new com.keyman.KeymanSentryManager({ +var sentryManager = new KeymanSentryManager({ hostPlatform: "android" }); sentryManager.init(); @@ -25,24 +25,24 @@ function init() { //document.body.style.backgroundColor="transparent"; //window.console.log('Device type = '+device); //window.console.log('Keyboard height = '+oskHeight); - keyman.init({'app':device,'fonts':'packages/',root:'./'}); - keyman.util.setOption('attachType','manual'); - keyman.oninserttext = insertText; keyman.showKeyboardList = showMenu; - keyman.menuKeyUp = menuKeyUp; keyman.hideKeyboard = hideKeyboard; + keyman.menuKeyUp = menuKeyUp; keyman.getOskHeight = getOskHeight; keyman.getOskWidth = getOskWidth; keyman.beepKeyboard = beepKeyboard; - var ta = document.getElementById('ta'); - keyman.setActiveElement(ta); - - ta.readOnly = false; - checkTextArea(); - - // Tell KMW the default banner height to use - com.keyman.osk.Banner.DEFAULT_HEIGHT = - Math.ceil(window.jsInterface.getDefaultBannerHeight() / window.devicePixelRatio); + keyman.init({ + 'embeddingApp':device, + 'fonts':'packages/', + oninserttext: insertText, + root:'./' + }).then(function () { // Note: For non-upgraded API 21, arrow functions will break the keyboard! + const bannerHeight = Math.ceil(window.jsInterface.getDefaultBannerHeight() / window.devicePixelRatio); + + // The OSK is not available until initialization is complete. + keyman.osk.bannerView.activeBannerHeight = bannerHeight; + keyman.refreshOskLayout(); + }); keyman.addEventListener('keyboardloaded', setIsChiral); keyman.addEventListener('keyboardchange', setIsChiral); @@ -71,7 +71,7 @@ function setBannerHeight(h) { osk.banner.height = Math.ceil(h / window.devicePixelRatio); } // Refresh KMW OSK - keyman.correctOSKTextSize(); + keyman.refreshOskLayout(); } function setOskHeight(h) { @@ -81,7 +81,7 @@ function setOskHeight(h) { if(keyman && keyman.core && keyman.core.activeKeyboard) { keyman.core.activeKeyboard.refreshLayouts(); } - keyman.correctOSKTextSize(); + keyman.refreshOskLayout(); } function setOskWidth(w) { @@ -111,7 +111,7 @@ function onStateChange(change) { //window.console.log('onStateChange change: ' + change); // Refresh KMW OSK - keyman.correctOSKTextSize(); + keyman.refreshOskLayout(); fragmentToggle = (fragmentToggle + 1) % 100; if(change != 'configured') { // doesn't change the display; only initiates suggestions. @@ -129,16 +129,11 @@ function setIsChiral(keyboardProperties) { function setKeymanLanguage(k) { KeymanWeb.registerStub(k); - keyman.setActiveKeyboard(k.KP + '::'+k.KI, k.KLC); - keyman.osk.show(true); + keyman.setActiveKeyboard(k.KI, k.KLC); } function setSpacebarText(mode) { - keyman.options['spacebarText'] = mode; - keyman.osk.show(true); - - // Refresh KMW OSK - keyman.correctOSKTextSize(); + keyman.config.spacebarText = mode; } // #6665: we need to know when the user has pressed a hardware key so we don't @@ -164,29 +159,25 @@ function insertText(dn, s, dr) { } function deregisterModel(modelID) { - keyman.modelManager.deregister(modelID); + keyman.removeModel(modelID); } function enableSuggestions(model, mayPredict, mayCorrect) { // Set the options first so that KMW's ModelManager can properly handle model enablement states // the moment we actually register the new model. - keyman.osk.banner.setOptions({ - 'mayPredict': mayPredict, - 'mayCorrect': mayCorrect - }); + keyman.core.languageProcessor.mayPredict = mayPredict; + keyman.core.languageProcessor.mayCorrect = mayCorrect; registerModel(model); } function setBannerOptions(mayPredict) { - keyman.osk.banner.setOptions({ - 'mayPredict': mayPredict - }); + keyman.core.languageProcessor.mayPredict = mayPredict; } function registerModel(model) { //window.console.log('registerModel: ' + model); - keyman.registerModel(model); + keyman.addModel(model); } function resetContext() { @@ -201,16 +192,15 @@ function setNumericLayer() { } function updateKMText(text) { - var ta = document.getElementById('ta'); - console_debug('updateKMText(text='+text+') ta.value='+ta.value); - if(text == undefined) { text = ''; } - if(ta.value != text) { - ta.value = text; - window.resetContext(); + console_debug('updateKMText(text='+text+') context.value='+keyman.context.getText()); + + if(text != keyman.context.getText()) { + keyman.context.setText(text); + keyman.resetContext(); } } @@ -221,22 +211,19 @@ function console_debug(s) { } function updateKMSelectionRange(start, end) { - var ta = document.getElementById('ta'); - console_debug('updateKMSelectionRange('+start+','+end+'): ta.selectionStart='+ta.selectionStart+' '+ - '['+ta._KeymanWebSelectionStart+'] ta.selectionEnd='+ta.selectionEnd+' '+ta._KeymanWebSelectionEnd); + var context = keyman.context; + + // console_debug('updateKMSelectionRange('+start+','+end+'): context.selStart='+ta.selectionStart+' '+ + // '['+ta._KeymanWebSelectionStart+'] context.selEnd='+ta.selectionEnd+' '+ta._KeymanWebSelectionEnd); - var selDirection = 'forward'; if(start > end) { var e0 = end; end = start; start = e0; - selDirection = 'backward'; } - if(ta.selectionStart != start || ta.selectionEnd != end || ta.selectionDirection != selDirection) { - ta.selectionStart = ta._KeymanWebSelectionStart = start; - ta.selectionEnd = ta._KeymanWebSelectionEnd = end; - ta.selectionDirection = selDirection; + if(context.selStart != start || context.selEnd != end) { + keyman.context.setSelection(start, end); keyman.resetContext(); } } @@ -330,7 +317,7 @@ function hideKeyboard() { function showKeyboard() { // Refresh KMW OSK - keyman.correctOSKTextSize(); + keyman.refreshOskLayout(); } function executePopupKey(keyID, keyText) { @@ -339,19 +326,24 @@ function executePopupKey(keyID, keyText) { keyman.executePopupKey(keyID); } +// Cannot make it explicitly async / await on API 21. function executeHardwareKeystroke(code, shift, lstates, eventModifiers) { console_debug('executeHardwareKeystroke(code='+code+',shift='+shift+',lstates='+lstates+',eventModifiers='+eventModifiers+')'); - try { - executingHardwareKeystroke = true; - if (keyman.executeHardwareKeystroke(code, shift, lstates)) { // false if matched, true if not + + executingHardwareKeystroke = true; + + // Would be cleaner if we could async / await here, which would give us a simple try-catch implementation. + var promise = keyman.hardKeyboard.raiseKeyEvent(code, shift, lstates); + promise.then(function (result) { + if(result) { // false if matched, true if not // KMW didn't process the key, so have the Android app dispatch the key with the original event modifiers window.jsInterface.dispatchKey(code, eventModifiers); + executingHardwareKeystroke = false; } - executingHardwareKeystroke = false; - } catch(e) { + }).catch(function (e) { window.console.log('executeHardwareKeystroke exception: '+e); executingHardwareKeystroke = false; - } + }); } function popupVisible(value) { @@ -373,24 +365,3 @@ function toHex(theString) { } return hexString; } - -/** - * Check the WebView version and determine if the textarea that KeymanWeb uses needs to be "visible". - * Normally, this textarea is not displayed to avoid redundant layout calculations. - * In older WebViews on Android 5.0 though, selectionStart and selectionEnd positions fail to - * update unless the textarea is visible. - * Reference: Issue #5376 - */ -function checkTextArea() { - var uaRe = /Chrome\/([0-9]*)\./g; - var chromeMajorVersion = uaRe.exec(navigator.userAgent); - if (chromeMajorVersion && parseInt(chromeMajorVersion[1]) <= 37) { - var ta = document.getElementById('ta'); - if (ta != null) { - ta.style.display = ''; - ta.style.position = 'absolute'; - ta.style.left = '-500px'; - ta.style.top = '0px'; - } - } -} diff --git a/android/KMEA/app/src/main/assets/keyboard.html b/android/KMEA/app/src/main/assets/keyboard.html index e677ba4c46ec95cec1d0dbbafb670b6951b25482..b11a21124eca991f2417bb409e3d11cf11182c32 100644 --- a/android/KMEA/app/src/main/assets/keyboard.html +++ b/android/KMEA/app/src/main/assets/keyboard.html @@ -15,7 +15,8 @@ polyfill. --> - + +
-