3 lines
706 B
JavaScript
3 lines
706 B
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@any-touch/shared"),t=require("@any-touch/compute"),a={name:"pan",threshold:10,pointLength:1};exports.default=function(n,i){var r=e.createPluginContext(a,i);return n.compute([t.ComputeVAndDir,t.ComputeDistance,t.ComputeDeltaXY],(function(t){if(e.resetState(r),!e.isDisabled(r)){var a,i,o=(a=t.pointLength,i=t.distance,r.pointLength===a&&r.threshold<=i);if(r.state=e.flow(o,r.state,t.phase),o||e.isMoveOrEndOrCancel(r.state)){var s=r.name;n.emit2(s,t,r),n.emit2(s+e.getStatusName(r.state),t,r),![e.TYPE_END,e.TYPE_CANCEL].includes(t.phase)&&t.direction&&n.emit2(s+t.direction,t,r)}}})),r};
|
|
//# sourceMappingURL=index.js.map
|