2025-07-04 15:36:51 +08:00

3 lines
668 B
JavaScript

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@any-touch/shared"),t=require("@any-touch/compute"),n={name:"swipe",threshold:10,velocity:.3,pointLength:1};exports.default=function(i,o){var r=e.createPluginContext(n,o);return i.compute([t.ComputeDistance,t.ComputeVAndDir,t.ComputeMaxLength],(function(t){if(r.state=0,!r.disabled&&function(){if(e.TYPE_END!==t.phase)return!1;var n=t.velocityX,i=t.velocityY,o=t.distance;return t.maxPointLength===r.pointLength&&0===t.points.length&&r.threshold<o&&r.velocity<Math.max(n,i)}()){var n=r.name;r.state=1,i.emit2(n,t,r),i.emit2(n+t.direction,t,r)}})),r};
//# sourceMappingURL=index.js.map