Build update

This commit is contained in:
Francisco Hodge 2019-03-07 07:32:24 -05:00
parent 6e54729f46
commit 3012ce24e2
8 changed files with 88 additions and 42 deletions

View File

@ -1,6 +1,6 @@
/*!
*
* simple-keyboard v2.16.0
* simple-keyboard v2.17.0
* https://github.com/hodgef/simple-keyboard
*
* Copyright (c) Francisco Hodge (https://github.com/hodgef)

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*!
*
* simple-keyboard v2.16.0 (Non-minified build)
* simple-keyboard v2.17.0 (Non-minified build)
* https://github.com/hodgef/simple-keyboard
*
* Copyright (c) Francisco Hodge (https://github.com/hodgef)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*!
*
* simple-keyboard v2.16.0 (Non-minified build)
* simple-keyboard v2.17.0 (Non-minified build)
* https://github.com/hodgef/simple-keyboard
*
* Copyright (c) Francisco Hodge (https://github.com/hodgef)
@ -660,6 +660,13 @@
return "ontouchstart" in window || navigator.maxTouchPoints;
}
/**
* Determines whether pointer events are supported
*/ }, {
key: "pointerEventsSupported",
value: function pointerEventsSupported() {
return window.PointerEvent;
}
/**
* Bind all methods in a given class
*/ }, {
key: "camelCase",
@ -1363,6 +1370,20 @@
}
if (typeof this.options.beforeFirstRender === "function") {
this.options.beforeFirstRender();
/**
* Notify about PointerEvents usage
*/ }
if (this.utilities.pointerEventsSupported() && !this.options.useTouchEvents) {
if (this.options.debug) {
console.log("Using PointerEvents as it is supported by this browser");
}
}
/**
* Notify about touch events usage
*/ if (this.options.useTouchEvents) {
if (this.options.debug) {
console.log("useTouchEvents has been enabled. Only touch events will be used.");
}
}
}
/**
@ -1462,28 +1483,53 @@
*/ var buttonType = _this9.options.useButtonTag ? "button" : "div";
var buttonDOM = document.createElement(buttonType);
buttonDOM.className += "hg-button ".concat(fctBtnClass).concat(buttonThemeClass ? " " + buttonThemeClass : "");
if (useTouchEvents) {
buttonDOM.ontouchstart = function(e) {
_this9.handleButtonClicked(button);
_this9.handleButtonMouseDown(button, e);
};
buttonDOM.ontouchend = function(e) {
return _this9.handleButtonMouseUp();
};
buttonDOM.ontouchcancel = function(e) {
return _this9.handleButtonMouseUp();
};
} else {
buttonDOM.onclick = function() {
_this9.isMouseHold = false;
_this9.handleButtonClicked(button);
};
buttonDOM.onmousedown = function(e) {
/**
* Handle button click event
*/ /* istanbul ignore next */ if (_this9.utilities.pointerEventsSupported() && !useTouchEvents) {
/**
* PointerEvents support
*/ buttonDOM.onpointerdown = function(e) {
if (_this9.options.preventMouseDownDefault) {
e.preventDefault();
}
_this9.handleButtonClicked(button);
_this9.handleButtonMouseDown(button, e);
};
buttonDOM.onpointerup = function(e) {
if (_this9.options.preventMouseDownDefault) {
e.preventDefault();
}
_this9.handleButtonMouseUp();
};
buttonDOM.onpointercancel = function(e) {
return _this9.handleButtonMouseUp();
};
} else {
/**
* Fallback for browsers not supporting PointerEvents
*/ if (useTouchEvents) {
buttonDOM.ontouchstart = function(e) {
_this9.handleButtonClicked(button);
_this9.handleButtonMouseDown(button, e);
};
buttonDOM.ontouchend = function(e) {
return _this9.handleButtonMouseUp();
};
buttonDOM.ontouchcancel = function(e) {
return _this9.handleButtonMouseUp();
};
} else {
buttonDOM.onclick = function() {
_this9.isMouseHold = false;
_this9.handleButtonClicked(button);
};
buttonDOM.onmousedown = function(e) {
if (_this9.options.preventMouseDownDefault) {
e.preventDefault();
}
_this9.handleButtonMouseDown(button, e);
};
}
}
/**
* Adding identifier

34
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "simple-keyboard",
"version": "2.16.0",
"version": "2.17.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -13879,9 +13879,9 @@
}
},
"react-dev-utils": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-7.0.3.tgz",
"integrity": "sha512-KEFsH1CewnmddPLXIuU+QWKTH/hpJKZClL2+74XN54NkPnR2KnB5gGmuQ0E7DwcCkUpdMxxqBX+rB7aB5sZS4A==",
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-7.0.5.tgz",
"integrity": "sha512-zJnqqb0x6gd63E3xoz5pXAxBPNaW75Hyz7GgQp0qPhMroBCRQtRvG67AoTZZY1z4yCYVJQZAfQJFdnea0Ujbug==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0",
@ -13902,7 +13902,7 @@
"loader-utils": "1.2.3",
"opn": "5.4.0",
"pkg-up": "2.0.0",
"react-error-overlay": "^5.1.3",
"react-error-overlay": "^5.1.4",
"recursive-readdir": "2.2.2",
"shell-quote": "1.6.1",
"sockjs-client": "1.3.0",
@ -13934,9 +13934,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30000938",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000938.tgz",
"integrity": "sha512-ekW8NQ3/FvokviDxhdKLZZAx7PptXNwxKgXtnR5y+PR3hckwuP3yJ1Ir+4/c97dsHNqtAyfKUGdw8P4EYzBNgw==",
"version": "1.0.30000942",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000942.tgz",
"integrity": "sha512-wLf+IhZUy2rfz48tc40OH7jHjXjnvDFEYqBHluINs/6MgzoNLPf25zhE4NOVzqxLKndf+hau81sAW0RcGHIaBQ==",
"dev": true
},
"electron-to-chromium": {
@ -14012,18 +14012,18 @@
"dev": true
},
"node-releases": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.7.tgz",
"integrity": "sha512-bKdrwaqJUPHqlCzDD7so/R+Nk0jGv9a11ZhLrD9f6i947qGLrGAhU3OxRENa19QQmwzGy/g6zCDEuLGDO8HPvA==",
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.9.tgz",
"integrity": "sha512-oic3GT4OtbWWKfRolz5Syw0Xus0KRFxeorLNj0s93ofX6PWyuzKjsiGxsCtWktBwwmTF6DdRRf2KreGqeOk5KA==",
"dev": true,
"requires": {
"semver": "^5.3.0"
}
},
"p-limit": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
"integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
@ -14068,9 +14068,9 @@
}
},
"react-error-overlay": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-5.1.3.tgz",
"integrity": "sha512-GoqeM3Xadie7XUApXOjkY3Qhs8RkwB/Za4WMedBGrOKH1eTuKGyoAECff7jiVonJchOx6KZ9i8ILO5XIoHB+Tg==",
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-5.1.4.tgz",
"integrity": "sha512-fp+U98OMZcnduQ+NSEiQa4s/XMsbp+5KlydmkbESOw4P69iWZ68ZMFM5a2BuE0FgqPBKApJyRuYHR95jM8lAmg==",
"dev": true
},
"read-pkg": {

View File

@ -1,6 +1,6 @@
{
"name": "simple-keyboard",
"version": "2.16.0",
"version": "2.17.0",
"description": "On-screen Javascript Virtual Keyboard",
"main": "build/index.js",
"types": "build/index.d.ts",