swipe-keyboard
Advanced tools
Comparing version 2.2.484 to 2.2.485
/*! For license information please see index.js.LICENSE.txt */ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.SimpleKeyboardSwipe=n():e.SimpleKeyboardSwipe=n()}(self,(()=>(()=>{"use strict";var e={424:(e,n,t)=>{t.d(n,{Z:()=>r});var a=t(645),o=t.n(a)()((function(e){return e[1]}));o.push([e.id,".keyboardContainer {\n position: relative;\n}\n\n.keyboardContainer .swipeCanvasElement {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n z-index: 999;\n user-select: none;\n}\n\n.simple-keyboard.hg-theme-default.module-simplekeyboardswipe .hg-button {\n height: 60px;\n}\n\n.simple-keyboard.module-simplekeyboardswipe .hg-button span {\n pointer-events: none;\n}\n",""]);const r=o},645:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t=e(n);return n[2]?"@media ".concat(n[2]," {").concat(t,"}"):t})).join("")},n.i=function(e,t,a){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(a)for(var r=0;r<this.length;r++){var i=this[r][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);a&&o[c[0]]||(t&&(c[2]?c[2]="".concat(t," and ").concat(c[2]):c[2]=t),n.push(c))}},n}},379:(e,n,t)=>{var a,o=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),r=[];function i(e){for(var n=-1,t=0;t<r.length;t++)if(r[t].identifier===e){n=t;break}return n}function s(e,n){for(var t={},a=[],o=0;o<e.length;o++){var s=e[o],c=n.base?s[0]+n.base:s[0],u=t[c]||0,l="".concat(c," ").concat(u);t[c]=u+1;var d=i(l),v={css:s[1],media:s[2],sourceMap:s[3]};-1!==d?(r[d].references++,r[d].updater(v)):r.push({identifier:l,updater:m(v,n),references:1}),a.push(l)}return a}function c(e){var n=document.createElement("style"),a=e.attributes||{};if(void 0===a.nonce){var r=t.nc;r&&(a.nonce=r)}if(Object.keys(a).forEach((function(e){n.setAttribute(e,a[e])})),"function"==typeof e.insert)e.insert(n);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}return n}var u,l=(u=[],function(e,n){return u[e]=n,u.filter(Boolean).join("\n")});function d(e,n,t,a){var o=t?"":a.media?"@media ".concat(a.media," {").concat(a.css,"}"):a.css;if(e.styleSheet)e.styleSheet.cssText=l(n,o);else{var r=document.createTextNode(o),i=e.childNodes;i[n]&&e.removeChild(i[n]),i.length?e.insertBefore(r,i[n]):e.appendChild(r)}}function v(e,n,t){var a=t.css,o=t.media,r=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}var f=null,p=0;function m(e,n){var t,a,o;if(n.singleton){var r=p++;t=f||(f=c(n)),a=d.bind(null,t,r,!1),o=d.bind(null,t,r,!0)}else t=c(n),a=v.bind(null,t,n),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return a(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;a(e=n)}else o()}}e.exports=function(e,n){(n=n||{}).singleton||"boolean"==typeof n.singleton||(n.singleton=(void 0===a&&(a=Boolean(window&&document&&document.all&&!window.atob)),a));var t=s(e=e||[],n);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var a=0;a<t.length;a++){var o=i(t[a]);r[o].references--}for(var c=s(e,n),u=0;u<t.length;u++){var l=i(t[u]);0===r[l].references&&(r[l].updater(),r.splice(l,1))}t=c}}}}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var r=n[a]={id:a,exports:{}};return e[a](r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nc=void 0;var a={};return(()=>{t.r(a),t.d(a,{default:()=>d});var e=t(379),n=t.n(e),o=t(424);function r(e,n){for(var t,a=0;a<n.length;a++)(t=n[a]).enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}function i(e,n,t){return n&&r(e.prototype,n),t&&r(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}n()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;const c=i((function e(){var n=this;(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")})(this,e),s(this,"init",(function(e,t,a){n.canvasW=t,n.canvasH=a;var o=document.createElement("canvas");o.className="swipeCanvasElement",o.width=t,o.height=a,e.insertAdjacentElement("beforebegin",o),n.canvas=document.querySelector(".swipeCanvasElement"),n.ctx=n.canvas.getContext("2d")})),s(this,"clear",(function(){n.ctx.clearRect(0,0,n.canvasW,n.canvasH)})),s(this,"draw",(function(e,t,a,o){n.ctx.beginPath(),n.ctx.moveTo(e,t),n.ctx.lineTo(a,o),n.ctx.strokeStyle="rgba(10, 103, 115, 0.9)",n.ctx.lineWidth=3,n.ctx.stroke(),n.ctx.closePath()}))}));function u(e,n){for(var t,a=0;a<n.length;a++)(t=n[a]).enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}function l(e,n,t){return n&&u(e.prototype,n),t&&u(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}const d=l((function e(){var n,t;(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")})(this,e),t=function(e){e.registerModule("swipe",(function(n){n.Canvas=c,n.init=function(){n.canvasHandler=new n.Canvas,n.initVars(),n.canvasHandler.init(e.keyboardDOM,n.canvasW,n.canvasH),n.initEvents()},n.initVars=function(){var t=e.keyboardDOMClass;e.keyboardDOM=document.querySelector(".".concat(t)),n.canvasW=e.keyboardDOM.offsetWidth,n.canvasH=e.keyboardDOM.offsetHeight,n.isMouseClicked=!1,n.isMouseInCanvas=!1,n.prevX=0,n.currX=0,n.prevY=0,n.currY=0,n.lastButton="",n.swipeTolerance=30,n.stoppedTime=50,n.repeatResetTime=200},n.initEvents=function(){n.canvasHandler.canvas.addEventListener("mousemove",(function(e){n.onMouseMove(e)}),!1),n.canvasHandler.canvas.addEventListener("mousedown",(function(e){n.onMouseDown(e)}),!1),n.canvasHandler.canvas.addEventListener("mouseup",(function(){n.onMouseUp()}),!1),n.canvasHandler.canvas.addEventListener("mouseout",(function(){n.onMouseOut()}),!1),n.canvasHandler.canvas.addEventListener("mouseenter",(function(e){n.onMouseEnter(e)}),!1),document.addEventListener("touchstart",n.touchHandler,!0),document.addEventListener("touchmove",n.touchHandler,!0),document.addEventListener("touchend",n.touchHandler,!0),document.addEventListener("touchcancel",n.touchHandler,!0)},n.onMouseDown=function(e){n.swipeStart=!0,n.isMouseClicked=!0,n.isMouseInCanvas=!0,n.updateCurrentPosition(e),n.canvasHandler.canvas.classList.add("swipe-mousedown"),n.canvasHandler.canvas.classList.remove("swipe-mouseup"),n.isMouseHold=!0,n.holdTimeout=setTimeout((function(){n.isMouseHold&&n.handleInteraction(e),clearTimeout(n.holdTimeout)}),500)},n.onMouseUp=function(){n.isMouseHold=!1,n.swipeStart=!1,n.canvasHandler.clear(),n.isMouseClicked=!1,n.canvasHandler.canvas.classList.add("swipe-mouseup"),n.canvasHandler.canvas.classList.remove("swipe-mousedown"),n.canvasHandler.canvas.classList.remove("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mousemove")},n.onMouseEnter=function(){n.swipeStart=!1,n.isMouseClicked=!1,n.canvasHandler.clear(),n.isMouseInCanvas=!0,n.canvasHandler.canvas.classList.add("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mouseout")},n.onMouseOut=function(){n.swipeStart=!1,n.canvasHandler.clear(),n.isMouseInCanvas=!1,n.canvasHandler.canvas.classList.add("swipe-mouseout"),n.canvasHandler.canvas.classList.remove("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mousemove")},n.onMouseMove=function(e){n.isMouseHold=!1,n.isMouseClicked&&n.isMouseInCanvas&&(clearTimeout(n.mouseStopped),n.mouseStopped=!1,n.updateCurrentPosition(e),n.canvasHandler.draw(n.prevX,n.prevY,n.currX,n.currY),n.mouseStopped=setTimeout((function(){n.mouseStopped=!0,n.handleInteraction(e)}),n.stoppedTime)),n.canvasHandler.canvas.classList.add("swipe-mousemove")},n.updateCurrentPosition=function(e){var t=n.canvasHandler.canvas.getBoundingClientRect();n.prevX=n.currX,n.prevY=n.currY,n.currX=e.clientX-t.left,n.currY=e.clientY-t.top,n.getMouseDirection(e)},n.getMouseDirection=function(e){var t,a;n.enforceTolerance(n.prevX,n.currX)&&(t=n.prevX<n.currX?"right":"left"),n.enforceTolerance(n.prevX,n.currX)&&(a=n.prevY<n.currY?"down":"up"),(a!==n.yDirection||t!==n.xDirection)&&(t&&(n.xDirection=t),a&&(n.yDirection=a),n.swipeStart&&(n.handleInteraction(e),n.swipeStart=!1))},n.handleInteraction=function(e){n.canvasHandler.canvas.style.display="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(t){var a=t.getAttribute("data-skbtn");if(a&&(n.lastButton!==a||n.isMouseHold)&&t.onclick)if(!n.isMouseHold||(a.includes("{")||a.includes("}"))&&"{bksp}"!==a&&"{space}"!==a){clearTimeout(n.holdInteractionTimeout),t.onclick(),n.lastButton=a;var o=setTimeout((function(){clearTimeout(o),n.lastButton=""}),n.repeatResetTime)}else n.holdInteractionTimeout=setTimeout((function(){t.onclick(),n.handleInteraction(e)}),100);n.canvasHandler.canvas.style.display="block"}},n.enforceTolerance=function(e,t,a){a=a||n.swipeTolerance;var o=Math.abs(e-t);return!!(o>a||0===o)},n.throttle=function(e,n){var t=!1;t||(e(),t=!0,setTimeout((function(){t=!1}),n))},n.touchHandler=function(e){var t=e.changedTouches[0],a="";switch(e.type){case"touchstart":a="mousedown";break;case"touchmove":a="mousemove";break;case"touchend":a="mouseup";break;default:return}var o=document.createEvent("MouseEvent");o.initMouseEvent(a,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),n.canvasHandler.canvas.dispatchEvent(o),e.preventDefault()},n.init()}))},(n="init")in this?Object.defineProperty(this,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[n]=t}))})(),a})())); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.SimpleKeyboardSwipe=n():e.SimpleKeyboardSwipe=n()}(self,(()=>(()=>{"use strict";var e={424:(e,n,t)=>{t.d(n,{Z:()=>i});var a=t(81),o=t.n(a),r=t(645),s=t.n(r)()(o());s.push([e.id,".keyboardContainer {\n position: relative;\n}\n\n.keyboardContainer .swipeCanvasElement {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n z-index: 999;\n user-select: none;\n}\n\n.simple-keyboard.hg-theme-default.module-simplekeyboardswipe .hg-button {\n height: 60px;\n}\n\n.simple-keyboard.module-simplekeyboardswipe .hg-button span {\n pointer-events: none;\n}\n",""]);const i=s},645:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t="",a=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),a&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),a&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t})).join("")},n.i=function(e,t,a,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(a)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);a&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),t&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=t):l[2]=t),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),n.push(l))}},n}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var n=[];function t(e){for(var t=-1,a=0;a<n.length;a++)if(n[a].identifier===e){t=a;break}return t}function a(e,a){for(var r={},s=[],i=0;i<e.length;i++){var c=e[i],u=a.base?c[0]+a.base:c[0],l=r[u]||0,d="".concat(u," ").concat(l);r[u]=l+1;var v=t(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==v)n[v].references++,n[v].updater(p);else{var f=o(p,a);a.byIndex=i,n.splice(i,0,{identifier:d,updater:f,references:1})}s.push(d)}return s}function o(e,n){var t=n.domAPI(n);return t.update(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap&&n.supports===e.supports&&n.layer===e.layer)return;t.update(e=n)}else t.remove()}}e.exports=function(e,o){var r=a(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var i=t(r[s]);n[i].references--}for(var c=a(e,o),u=0;u<r.length;u++){var l=t(r[u]);0===n[l].references&&(n[l].updater(),n.splice(l,1))}r=c}}},569:e=>{var n={};e.exports=function(e,t){var a=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}},216:e=>{e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},565:(e,n,t)=>{e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},795:e=>{e.exports=function(e){var n=e.insertStyleElement(e);return{update:function(t){!function(e,n,t){var a="";t.supports&&(a+="@supports (".concat(t.supports,") {")),t.media&&(a+="@media ".concat(t.media," {"));var o=void 0!==t.layer;o&&(a+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),a+=t.css,o&&(a+="}"),t.media&&(a+="}"),t.supports&&(a+="}");var r=t.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),n.styleTagTransform(a,e,n.options)}(n,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)}}}},589:e=>{e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}}},n={};function t(a){var o=n[a];if(void 0!==o)return o.exports;var r=n[a]={id:a,exports:{}};return e[a](r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nc=void 0;var a={};return(()=>{t.r(a),t.d(a,{default:()=>H});var e=t(379),n=t.n(e),o=t(795),r=t.n(o),s=t(569),i=t.n(s),c=t(565),u=t.n(c),l=t(216),d=t.n(l),v=t(589),p=t.n(v),f=t(424),m={};function h(e,n){for(var t,a=0;a<n.length;a++)(t=n[a]).enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}function b(e,n,t){return n&&h(e.prototype,n),t&&h(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}m.styleTagTransform=p(),m.setAttributes=u(),m.insert=i().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=d(),n()(f.Z,m),f.Z&&f.Z.locals&&f.Z.locals;const w=b((function e(){var n=this;(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")})(this,e),y(this,"init",(function(e,t,a){n.canvasW=t,n.canvasH=a;var o=document.createElement("canvas");o.className="swipeCanvasElement",o.width=t,o.height=a,e.insertAdjacentElement("beforebegin",o),n.canvas=document.querySelector(".swipeCanvasElement"),n.ctx=n.canvas.getContext("2d")})),y(this,"clear",(function(){n.ctx.clearRect(0,0,n.canvasW,n.canvasH)})),y(this,"draw",(function(e,t,a,o){n.ctx.beginPath(),n.ctx.moveTo(e,t),n.ctx.lineTo(a,o),n.ctx.strokeStyle="rgba(10, 103, 115, 0.9)",n.ctx.lineWidth=3,n.ctx.stroke(),n.ctx.closePath()}))}));function M(e,n){for(var t,a=0;a<n.length;a++)(t=n[a]).enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}function g(e,n,t){return n&&M(e.prototype,n),t&&M(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}const H=g((function e(){var n,t;(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")})(this,e),t=function(e){e.registerModule("swipe",(function(n){n.Canvas=w,n.init=function(){n.canvasHandler=new n.Canvas,n.initVars(),n.canvasHandler.init(e.keyboardDOM,n.canvasW,n.canvasH),n.initEvents()},n.initVars=function(){var t=e.keyboardDOMClass;e.keyboardDOM=document.querySelector(".".concat(t)),n.canvasW=e.keyboardDOM.offsetWidth,n.canvasH=e.keyboardDOM.offsetHeight,n.isMouseClicked=!1,n.isMouseInCanvas=!1,n.prevX=0,n.currX=0,n.prevY=0,n.currY=0,n.lastButton="",n.swipeTolerance=30,n.stoppedTime=50,n.repeatResetTime=200},n.initEvents=function(){n.canvasHandler.canvas.addEventListener("mousemove",(function(e){n.onMouseMove(e)}),!1),n.canvasHandler.canvas.addEventListener("mousedown",(function(e){n.onMouseDown(e)}),!1),n.canvasHandler.canvas.addEventListener("mouseup",(function(){n.onMouseUp()}),!1),n.canvasHandler.canvas.addEventListener("mouseout",(function(){n.onMouseOut()}),!1),n.canvasHandler.canvas.addEventListener("mouseenter",(function(e){n.onMouseEnter(e)}),!1),document.addEventListener("touchstart",n.touchHandler,!0),document.addEventListener("touchmove",n.touchHandler,!0),document.addEventListener("touchend",n.touchHandler,!0),document.addEventListener("touchcancel",n.touchHandler,!0)},n.onMouseDown=function(e){n.swipeStart=!0,n.isMouseClicked=!0,n.isMouseInCanvas=!0,n.updateCurrentPosition(e),n.canvasHandler.canvas.classList.add("swipe-mousedown"),n.canvasHandler.canvas.classList.remove("swipe-mouseup"),n.isMouseHold=!0,n.holdTimeout=setTimeout((function(){n.isMouseHold&&n.handleInteraction(e),clearTimeout(n.holdTimeout)}),500)},n.onMouseUp=function(){n.isMouseHold=!1,n.swipeStart=!1,n.canvasHandler.clear(),n.isMouseClicked=!1,n.canvasHandler.canvas.classList.add("swipe-mouseup"),n.canvasHandler.canvas.classList.remove("swipe-mousedown"),n.canvasHandler.canvas.classList.remove("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mousemove")},n.onMouseEnter=function(){n.swipeStart=!1,n.isMouseClicked=!1,n.canvasHandler.clear(),n.isMouseInCanvas=!0,n.canvasHandler.canvas.classList.add("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mouseout")},n.onMouseOut=function(){n.swipeStart=!1,n.canvasHandler.clear(),n.isMouseInCanvas=!1,n.canvasHandler.canvas.classList.add("swipe-mouseout"),n.canvasHandler.canvas.classList.remove("swipe-mouseenter"),n.canvasHandler.canvas.classList.remove("swipe-mousemove")},n.onMouseMove=function(e){n.isMouseHold=!1,n.isMouseClicked&&n.isMouseInCanvas&&(clearTimeout(n.mouseStopped),n.mouseStopped=!1,n.updateCurrentPosition(e),n.canvasHandler.draw(n.prevX,n.prevY,n.currX,n.currY),n.mouseStopped=setTimeout((function(){n.mouseStopped=!0,n.handleInteraction(e)}),n.stoppedTime)),n.canvasHandler.canvas.classList.add("swipe-mousemove")},n.updateCurrentPosition=function(e){var t=n.canvasHandler.canvas.getBoundingClientRect();n.prevX=n.currX,n.prevY=n.currY,n.currX=e.clientX-t.left,n.currY=e.clientY-t.top,n.getMouseDirection(e)},n.getMouseDirection=function(e){var t,a;n.enforceTolerance(n.prevX,n.currX)&&(t=n.prevX<n.currX?"right":"left"),n.enforceTolerance(n.prevX,n.currX)&&(a=n.prevY<n.currY?"down":"up"),(a!==n.yDirection||t!==n.xDirection)&&(t&&(n.xDirection=t),a&&(n.yDirection=a),n.swipeStart&&(n.handleInteraction(e),n.swipeStart=!1))},n.handleInteraction=function(e){n.canvasHandler.canvas.style.display="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(t){var a=t.getAttribute("data-skbtn");if(a&&(n.lastButton!==a||n.isMouseHold)&&t.onclick)if(!n.isMouseHold||(a.includes("{")||a.includes("}"))&&"{bksp}"!==a&&"{space}"!==a){clearTimeout(n.holdInteractionTimeout),t.onclick(),n.lastButton=a;var o=setTimeout((function(){clearTimeout(o),n.lastButton=""}),n.repeatResetTime)}else n.holdInteractionTimeout=setTimeout((function(){t.onclick(),n.handleInteraction(e)}),100);n.canvasHandler.canvas.style.display="block"}},n.enforceTolerance=function(e,t,a){a=a||n.swipeTolerance;var o=Math.abs(e-t);return!!(o>a||0===o)},n.throttle=function(e,n){var t=!1;t||(e(),t=!0,setTimeout((function(){t=!1}),n))},n.touchHandler=function(e){var t=e.changedTouches[0],a="";switch(e.type){case"touchstart":a="mousedown";break;case"touchmove":a="mousemove";break;case"touchend":a="mouseup";break;default:return}var o=document.createEvent("MouseEvent");o.initMouseEvent(a,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),n.canvasHandler.canvas.dispatchEvent(o),e.preventDefault()},n.init()}))},(n="init")in this?Object.defineProperty(this,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[n]=t}))})(),a})())); |
/*! | ||
* | ||
* swipe-keyboard v2.2.484 | ||
* swipe-keyboard v2.2.485 | ||
* https://github.com/hodgef/swipe-keyboard | ||
@@ -5,0 +5,0 @@ * |
{ | ||
"name": "swipe-keyboard", | ||
"version": "2.2.484", | ||
"version": "2.2.485", | ||
"description": "Swipe keyboard module for simple-keyboard", | ||
@@ -48,3 +48,3 @@ "main": "build/index.js", | ||
"babel-preset-minify": "^0.5.2", | ||
"css-loader": "^5.2.7", | ||
"css-loader": "^6.7.1", | ||
"file-loader": "^6.2.0", | ||
@@ -57,3 +57,3 @@ "jest": "^26.6.3", | ||
"simple-keyboard": "3.4.149", | ||
"style-loader": "^2.0.0", | ||
"style-loader": "^3.3.1", | ||
"url-loader": "^4.1.1", | ||
@@ -60,0 +60,0 @@ "webpack": "^5.74.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16211