@any-touch/tap
Advanced tools
Comparing version 2.0.2-alpha.1 to 2.0.2
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@any-touch/shared"),t=require("@any-touch/vector"),a=require("@any-touch/compute"),i={name:"tap",pointLength:1,tapTimes:1,waitNextTapTime:300,maxDistance:2,maxDistanceFromPrevTap:9,maxPressTime:250};exports.default=function(n,r){var o,m,s,u=e.createPluginContext(i,r),c=0;function p(){c=0,o=void 0,m=void 0}return n.compute([a.ComputeDistance,a.ComputeMaxLength],(function(a){if(!e.isDisabled(u)){var i,r,x,T,v=a.phase,f=a.x,h=a.y;if(e.TYPE_END===v)u.state=0,i=a.startInput,r=a.pointLength,x=a.timestamp-i.timestamp,T=a.distance,a.maxPointLength===u.pointLength&&0===r&&u.maxDistance>=T&&u.maxPressTime>x?(clearTimeout(s),function(e,a){if(void 0!==o){var i=t.getVLength({x:e.x-o.x,y:e.y-o.y});return o=e,a.maxDistanceFromPrevTap>=i}return o=e,!0}({x:f,y:h},u)&&function(e){var t=performance.now();if(void 0===m)return m=t,!0;var a=t-m;return m=t,a<e}(u.waitNextTapTime)?c++:c=1,0==c%u.tapTimes?(u.state=1,n.emit2(u.name,a,u),p()):s=setTimeout((function(){u.state=2,p()}),u.waitNextTapTime)):(p(),u.state=2)}})),u}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@any-touch/tap", | ||
"version": "2.0.2-alpha.1", | ||
"version": "2.0.2", | ||
"description": "any-touch的识别器, 用来识别点击手势.", | ||
@@ -11,5 +11,5 @@ "main": "./dist/index", | ||
"dependencies": { | ||
"@any-touch/compute": "^2.0.2-alpha.1", | ||
"@any-touch/shared": "^2.0.2-alpha.1", | ||
"@any-touch/vector": "^2.0.2-alpha.1" | ||
"@any-touch/compute": "^2.0.2", | ||
"@any-touch/shared": "^2.0.2", | ||
"@any-touch/vector": "^2.0.2" | ||
}, | ||
@@ -23,3 +23,3 @@ "files": [ | ||
"sideEffects": false, | ||
"gitHead": "6448e271ecbc59ba49d220264ff4f5ab19950b87" | ||
"gitHead": "7df4617ecb8b89c720ce9747cdd77554c4966a88" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10909
8
87
2
Updated@any-touch/compute@^2.0.2
Updated@any-touch/shared@^2.0.2
Updated@any-touch/vector@^2.0.2