@any-touch/tap
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -25,3 +25,3 @@ import { __assign } from 'tslib'; | ||
var deltaTime = computed.timestamp - startInput.timestamp; | ||
var maxPointLength = computed.maxPointLength, distance = computed.distance; | ||
var _a = computed, maxPointLength = _a.maxPointLength, distance = _a.distance; | ||
return maxPointLength === _context.pointLength && | ||
@@ -28,0 +28,0 @@ 0 === pointLength && |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("tslib"),a=require("@any-touch/shared"),n=require("@any-touch/vector"),i=require("@any-touch/compute"),r=(t=require("@any-touch/recognizer"))&&"object"==typeof t&&"default"in t?t.default:t,u={name:"tap",pointLength:1,tapTimes:1,waitNextTapTime:300,maxDistance:2,maxDistanceFromPrevTap:9,maxPressTime:250};exports.default=function(t){var o,s,m,c=r(u,t),p=0;function T(){p=0,o=void 0,s=void 0}return[c,function(t,i){var r=t.stage,u=t.x,x=t.y;c.status=a.RECOGNIZER_STATUS.POSSIBLE,a.STAGE.END===r&&(!function(t){var e=t.startInput,a=t.pointLength,n=t.timestamp-e.timestamp,i=t.maxPointLength,r=t.distance;return i===c.pointLength&&0===a&&c.maxDistance>=r&&c.maxPressTime>n}(t)?(T(),c.status=a.RECOGNIZER_STATUS.FAILED):(clearTimeout(m),function(t){if(void 0!==o){var e=n.getVLength({x:t.x-o.x,y:t.y-o.y});return o=t,c.maxDistanceFromPrevTap>=e}return o=t,!0}({x:u,y:x})&&function(){var t=performance.now();if(void 0===s)return s=t,!0;var e=t-s;return s=t,e<c.waitNextTapTime}()?p++:p=1,0==p%c.tapTimes?(c.status=a.RECOGNIZER_STATUS.RECOGNIZED,i(c.name,e.__assign(e.__assign({},t),{tapCount:p})),T()):m=setTimeout((function(){c.status=a.RECOGNIZER_STATUS.FAILED,T()}),c.waitNextTapTime)))},[i.ComputeDistance,i.ComputeMaxLength]]}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("tslib"),a=require("@any-touch/shared"),n=require("@any-touch/vector"),i=require("@any-touch/compute"),r=(t=require("@any-touch/recognizer"))&&"object"==typeof t&&"default"in t?t.default:t,u={name:"tap",pointLength:1,tapTimes:1,waitNextTapTime:300,maxDistance:2,maxDistanceFromPrevTap:9,maxPressTime:250};exports.default=function(t){var o,s,m,c=r(u,t),p=0;function T(){p=0,o=void 0,s=void 0}return[c,function(t,i){var r=t.stage,u=t.x,x=t.y;c.status=a.RECOGNIZER_STATUS.POSSIBLE,a.STAGE.END===r&&(!function(t){var e=t.startInput,a=t.pointLength,n=t.timestamp-e.timestamp,i=t,r=i.maxPointLength,u=i.distance;return r===c.pointLength&&0===a&&c.maxDistance>=u&&c.maxPressTime>n}(t)?(T(),c.status=a.RECOGNIZER_STATUS.FAILED):(clearTimeout(m),function(t){if(void 0!==o){var e=n.getVLength({x:t.x-o.x,y:t.y-o.y});return o=t,c.maxDistanceFromPrevTap>=e}return o=t,!0}({x:u,y:x})&&function(){var t=performance.now();if(void 0===s)return s=t,!0;var e=t-s;return s=t,e<c.waitNextTapTime}()?p++:p=1,0==p%c.tapTimes?(c.status=a.RECOGNIZER_STATUS.RECOGNIZED,i(c.name,e.__assign(e.__assign({},t),{tapCount:p})),T()):m=setTimeout((function(){c.status=a.RECOGNIZER_STATUS.FAILED,T()}),c.waitNextTapTime)))},[i.ComputeDistance,i.ComputeMaxLength]]}; |
{ | ||
"name": "@any-touch/tap", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "any-touch的识别器, 用来识别点击手势.", | ||
@@ -14,6 +14,7 @@ "main": "./dist/index", | ||
"dependencies": { | ||
"@any-touch/compute": "^1.0.2", | ||
"@any-touch/recognizer": "^1.0.2", | ||
"@any-touch/shared": "^1.0.2", | ||
"@any-touch/vector": "^1.0.2" | ||
"@any-touch/compute": "^1.0.3", | ||
"@any-touch/recognizer": "^1.0.3", | ||
"@any-touch/shared": "^1.0.3", | ||
"@any-touch/vector": "^1.0.3", | ||
"tslib": "^2.0.1" | ||
}, | ||
@@ -27,3 +28,3 @@ "files": [ | ||
"sideEffects": false, | ||
"gitHead": "a11a02a110bf20b6163b5b716b60b87de3b967da" | ||
"gitHead": "b02d9990efd384d8336fba46e476a6939964d320" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7968
0
6
+ Addedtslib@^2.0.1
+ Addedtslib@2.8.1(transitive)
Updated@any-touch/compute@^1.0.3
Updated@any-touch/recognizer@^1.0.3
Updated@any-touch/shared@^1.0.3
Updated@any-touch/vector@^1.0.3