@any-touch/press
Advanced tools
Comparing version 2.0.2 to 2.0.3-alpha.0
@@ -1,2 +0,2 @@ | ||
import{createPluginContext as e,isDisabled as t,TYPE_START as i,resetState as a,TYPE_END as m,DIRECTION_UP as n,TYPE_CANCEL as s}from"@any-touch/shared";import{ComputeDistance as r}from"@any-touch/compute";var o={name:"press",pointLength:1,maxDistance:9,minPressTime:251};function u(u,c){var p=e(o,c),f=0;return u.compute([r],(function(e){if(!t(p)){var r,o=e.phase,c=e.startInput,h=e.pointLength;if(i===o&&p.pointLength===h)a(p),clearTimeout(f),f=setTimeout((function(){p.state=1,u.emit2(p.name,e,p)}),p.minPressTime);else if(m===o&&1===p.state)u.emit2(""+p.name+n,e,p);else if(1!==p.state){var l=e.timestamp-c.timestamp;(!((r=e.distance)&&p.maxDistance>r)||p.minPressTime>l&&[m,s].includes(o))&&(clearTimeout(f),p.state=2)}}})),p}export{u as default}; | ||
import{createPluginContext as t,isDisabled as e,TYPE_START as n,resetState as s,TYPE_END as i,DIRECTION_UP as m,TYPE_CANCEL as a}from"@any-touch/shared";import{ComputeDistance as o}from"@any-touch/compute";const r={name:"press",pointLength:1,maxDistance:9,minPressTime:251};function c(c,u){const p=t(r,u);let f=0;return c.compute([o],(t=>{if(e(p))return;const{phase:o,startInput:r,pointLength:u}=t;if(n===o&&p.pointLength===u)s(p),clearTimeout(f),f=setTimeout((()=>{p.state=1,c.emit2(p.name,t,p)}),p.minPressTime);else if(i===o&&1===p.state)c.emit2(`${p.name}${m}`,t,p);else if(1!==p.state){const e=t.timestamp-r.timestamp;(!function(){const{distance:e}=t;return e&&p.maxDistance>e}()||p.minPressTime>e&&[i,a].includes(o))&&(clearTimeout(f),p.state=2)}})),p}export{c as default}; | ||
//# sourceMappingURL=index.es.js.map |
{ | ||
"name": "@any-touch/press", | ||
"version": "2.0.2", | ||
"version": "2.0.3-alpha.0", | ||
"description": "any-touch的识别器, 用来识别按压手势.", | ||
@@ -14,4 +14,4 @@ "main": "./dist/index", | ||
"dependencies": { | ||
"@any-touch/compute": "^2.0.2", | ||
"@any-touch/shared": "^2.0.2" | ||
"@any-touch/compute": "^2.0.3-alpha.0", | ||
"@any-touch/shared": "^2.0.3-alpha.0" | ||
}, | ||
@@ -22,3 +22,3 @@ "publishConfig": { | ||
"sideEffects": false, | ||
"gitHead": "7df4617ecb8b89c720ce9747cdd77554c4966a88" | ||
"gitHead": "e53ab5c44a400b04b0de853a9358303007f67e8e" | ||
} |
Sorry, the diff of this file is not supported yet
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
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
7293
3