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 2.0.2 to 2.0.3-alpha.0

2

dist/index.es.js

@@ -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

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