Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@any-touch/press

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@any-touch/press - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

8

dist/index.es.js

@@ -26,10 +26,10 @@ import { __extends, __assign } from 'tslib';

this._timeoutId = setTimeout(function () {
_this._$status = STATUS_RECOGNIZED;
_this.status = STATUS_RECOGNIZED;
emit(_this.options.name);
}, this.options.minPressTime);
}
else if (INPUT_END === stage && STATUS_RECOGNIZED === this._$status) {
else if (INPUT_END === stage && STATUS_RECOGNIZED === this.status) {
emit("" + this.options.name + DIRECTION_UP);
}
else if (STATUS_RECOGNIZED !== this._$status) {
else if (STATUS_RECOGNIZED !== this.status) {
var deltaTime = computed.timestamp - startInput.timestamp;

@@ -39,3 +39,3 @@ if (!this._$test(computed) ||

this._$cancel();
this._$status = STATUS_FAILED;
this.status = STATUS_FAILED;
}

@@ -42,0 +42,0 @@ }

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("tslib"),s=require("@any-touch/shared"),i=require("@any-touch/compute"),n=require("@any-touch/recognizer"),o=(t=n)&&"object"==typeof t&&"default"in t?t.default:t,r={name:"press",pointLength:1,maxDistance:9,minPressTime:251},a=function(t){function o(s){var n=t.call(this,e.__assign(e.__assign({},r),s))||this;return n.computeFunctions=[i.ComputeDistance],n}return e.__extends(o,t),o.prototype.recognize=function(t,e){var i=this,o=t.stage,r=t.startInput,a=t.pointLength;if(s.INPUT_START===o&&this._$isValidPointLength(a))n.resetStatusForPressMoveLike(this),this._$cancel(),this._timeoutId=setTimeout((function(){i._$status=s.STATUS_RECOGNIZED,e(i.options.name)}),this.options.minPressTime);else if(s.INPUT_END===o&&s.STATUS_RECOGNIZED===this._$status)e(""+this.options.name+s.DIRECTION_UP);else if(s.STATUS_RECOGNIZED!==this._$status){var u=t.timestamp-r.timestamp;(!this._$test(t)||this.options.minPressTime>u&&[s.INPUT_END,s.INPUT_CANCEL].includes(o))&&(this._$cancel(),this._$status=s.STATUS_FAILED)}},o.prototype._$test=function(t){var e=t.distance;return this.options.maxDistance>e},o.prototype._$cancel=function(){clearTimeout(this._timeoutId)},o}(o);exports.default=a;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("tslib"),s=require("@any-touch/shared"),i=require("@any-touch/compute"),n=require("@any-touch/recognizer"),o=(t=n)&&"object"==typeof t&&"default"in t?t.default:t,r={name:"press",pointLength:1,maxDistance:9,minPressTime:251},a=function(t){function o(s){var n=t.call(this,e.__assign(e.__assign({},r),s))||this;return n.computeFunctions=[i.ComputeDistance],n}return e.__extends(o,t),o.prototype.recognize=function(t,e){var i=this,o=t.stage,r=t.startInput,a=t.pointLength;if(s.INPUT_START===o&&this._$isValidPointLength(a))n.resetStatusForPressMoveLike(this),this._$cancel(),this._timeoutId=setTimeout((function(){i.status=s.STATUS_RECOGNIZED,e(i.options.name)}),this.options.minPressTime);else if(s.INPUT_END===o&&s.STATUS_RECOGNIZED===this.status)e(""+this.options.name+s.DIRECTION_UP);else if(s.STATUS_RECOGNIZED!==this.status){var u=t.timestamp-r.timestamp;(!this._$test(t)||this.options.minPressTime>u&&[s.INPUT_END,s.INPUT_CANCEL].includes(o))&&(this._$cancel(),this.status=s.STATUS_FAILED)}},o.prototype._$test=function(t){var e=t.distance;return this.options.maxDistance>e},o.prototype._$cancel=function(){clearTimeout(this._timeoutId)},o}(o);exports.default=a;
{
"name": "@any-touch/press",
"version": "1.0.6",
"version": "1.0.7",
"description": "any-touch的识别器, 用来识别按压手势.",

@@ -14,5 +14,5 @@ "main": "./dist/index",

"dependencies": {
"@any-touch/compute": "^1.0.6",
"@any-touch/recognizer": "^1.0.6",
"@any-touch/shared": "^1.0.6"
"@any-touch/compute": "^1.0.7",
"@any-touch/recognizer": "^1.0.7",
"@any-touch/shared": "^1.0.7"
},

@@ -23,3 +23,3 @@ "publishConfig": {

"sideEffects": false,
"gitHead": "ce583217caf3a34eb5aa0267b855a92a9ca9c043"
"gitHead": "fa8e0eb63d3f306ad6f381ec6bac173c70559e5b"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc