@any-touch/recognizer
Advanced tools
Comparing version 0.6.0-beta.29 to 0.6.0-beta.30
@@ -5,3 +5,2 @@ import { Input, ComputeConstructor } from '@any-touch/shared'; | ||
export default abstract class { | ||
static type: string; | ||
name: string; | ||
@@ -8,0 +7,0 @@ disabled: boolean; |
@@ -119,3 +119,2 @@ 'use strict'; | ||
}; | ||
default_1.type = 'Recognizer'; | ||
return default_1; | ||
@@ -122,0 +121,0 @@ }()); |
@@ -115,3 +115,2 @@ import { __assign, __values, __spread } from 'tslib'; | ||
}; | ||
default_1.type = 'Recognizer'; | ||
return default_1; | ||
@@ -118,0 +117,0 @@ }()); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib=require("tslib"),shared=require("@any-touch/shared");function resetStatus(e){-1!==[shared.STATUS_END,shared.STATUS_CANCELLED,shared.STATUS_RECOGNIZED,shared.STATUS_FAILED].indexOf(e.status)&&(e.status=shared.STATUS_POSSIBLE)}function flow(e,s,t){var r,a,T,i,o,d,S,h={1:(r={},r[shared.STATUS_POSSIBLE]=(a={},a[shared.INPUT_MOVE]=shared.STATUS_START,a),r[shared.STATUS_START]=(T={},T[shared.INPUT_MOVE]=shared.STATUS_MOVE,T[shared.INPUT_END]=shared.STATUS_END,T[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,T),r[shared.STATUS_MOVE]=(i={},i[shared.INPUT_MOVE]=shared.STATUS_MOVE,i[shared.INPUT_END]=shared.STATUS_END,i[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,i),r),0:(o={},o[shared.STATUS_START]=(d={},d[shared.INPUT_MOVE]=shared.STATUS_CANCELLED,d[shared.INPUT_END]=shared.STATUS_END,d[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,d),o[shared.STATUS_MOVE]=(S={},S[shared.INPUT_MOVE]=shared.STATUS_CANCELLED,S[shared.INPUT_END]=shared.STATUS_END,S[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,S),o)};return void 0!==h[Number(e)][s]&&h[Number(e)][s][t]||s}function recognizeForPressMoveLike(e,s,t){var r=e.test(s);resetStatus(e);var a=s.inputType;e.status=flow(r,e.status,a);var T=e.computed;e.isRecognized=-1<[shared.STATUS_START,shared.STATUS_MOVE,shared.STATUS_END,shared.STATUS_CANCELLED,shared.STATUS_RECOGNIZED].indexOf(e.status);var i=e.name,o=e.status;return e.isRecognized&&(shared.INPUT_END!==a&&t(i,T),t(i+o,T)),r}var default_1=function(){function e(e){this.options=e,this.name=this.options.name,this.disabled=!1,this.status=shared.STATUS_POSSIBLE,this.isRecognized=!1,this.computed={},this.computedGroup={},this.usedComputeFunctionMap={},this.recognizerMap={}}return e.prototype.set=function(e){return void 0!==e&&(this.options=tslib.__assign(tslib.__assign({},this.options),e)),this},e.prototype.isValidPointLength=function(e){return 0===this.options.pointLength||this.options.pointLength===e},e.prototype.compute=function(e){for(var s,t,r,a=[],T=1;T<arguments.length;T++)a[T-1]=arguments[T];var i=Object.create(null);try{for(var o=tslib.__values(e),d=o.next();!d.done;d=o.next()){var S=d.value,h=S._id,n=this,_=n.computedGroup,u=n.usedComputeFunctionMap;void 0===u[h]&&(u[h]=new S),_[h]=_[h]||(r=u[h]).compute.apply(r,tslib.__spread(a)),i=tslib.__assign(tslib.__assign({},i),_[h])}}catch(e){s={error:e}}finally{try{d&&!d.done&&(t=o.return)&&t.call(o)}finally{if(s)throw s.error}}return this.computed=i,i},e.type="Recognizer",e}();exports.default=default_1,exports.recognizeForPressMoveLike=recognizeForPressMoveLike,exports.resetStatusForPressMoveLike=resetStatus; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib=require("tslib"),shared=require("@any-touch/shared");function resetStatus(e){-1!==[shared.STATUS_END,shared.STATUS_CANCELLED,shared.STATUS_RECOGNIZED,shared.STATUS_FAILED].indexOf(e.status)&&(e.status=shared.STATUS_POSSIBLE)}function flow(e,s,t){var r,a,T,i,o,d,S,h={1:(r={},r[shared.STATUS_POSSIBLE]=(a={},a[shared.INPUT_MOVE]=shared.STATUS_START,a),r[shared.STATUS_START]=(T={},T[shared.INPUT_MOVE]=shared.STATUS_MOVE,T[shared.INPUT_END]=shared.STATUS_END,T[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,T),r[shared.STATUS_MOVE]=(i={},i[shared.INPUT_MOVE]=shared.STATUS_MOVE,i[shared.INPUT_END]=shared.STATUS_END,i[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,i),r),0:(o={},o[shared.STATUS_START]=(d={},d[shared.INPUT_MOVE]=shared.STATUS_CANCELLED,d[shared.INPUT_END]=shared.STATUS_END,d[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,d),o[shared.STATUS_MOVE]=(S={},S[shared.INPUT_MOVE]=shared.STATUS_CANCELLED,S[shared.INPUT_END]=shared.STATUS_END,S[shared.INPUT_CANCEL]=shared.STATUS_CANCELLED,S),o)};return void 0!==h[Number(e)][s]&&h[Number(e)][s][t]||s}function recognizeForPressMoveLike(e,s,t){var r=e.test(s);resetStatus(e);var a=s.inputType;e.status=flow(r,e.status,a);var T=e.computed;e.isRecognized=-1<[shared.STATUS_START,shared.STATUS_MOVE,shared.STATUS_END,shared.STATUS_CANCELLED,shared.STATUS_RECOGNIZED].indexOf(e.status);var i=e.name,o=e.status;return e.isRecognized&&(shared.INPUT_END!==a&&t(i,T),t(i+o,T)),r}var default_1=function(){function e(e){this.options=e,this.name=this.options.name,this.disabled=!1,this.status=shared.STATUS_POSSIBLE,this.isRecognized=!1,this.computed={},this.computedGroup={},this.usedComputeFunctionMap={},this.recognizerMap={}}return e.prototype.set=function(e){return void 0!==e&&(this.options=tslib.__assign(tslib.__assign({},this.options),e)),this},e.prototype.isValidPointLength=function(e){return 0===this.options.pointLength||this.options.pointLength===e},e.prototype.compute=function(e){for(var s,t,r,a=[],T=1;T<arguments.length;T++)a[T-1]=arguments[T];var i=Object.create(null);try{for(var o=tslib.__values(e),d=o.next();!d.done;d=o.next()){var S=d.value,h=S._id,n=this,_=n.computedGroup,u=n.usedComputeFunctionMap;void 0===u[h]&&(u[h]=new S),_[h]=_[h]||(r=u[h]).compute.apply(r,tslib.__spread(a)),i=tslib.__assign(tslib.__assign({},i),_[h])}}catch(e){s={error:e}}finally{try{d&&!d.done&&(t=o.return)&&t.call(o)}finally{if(s)throw s.error}}return this.computed=i,i},e}();exports.default=default_1,exports.recognizeForPressMoveLike=recognizeForPressMoveLike,exports.resetStatusForPressMoveLike=resetStatus; |
{ | ||
"name": "@any-touch/recognizer", | ||
"version": "0.6.0-beta.29", | ||
"version": "0.6.0-beta.30", | ||
"description": "any-touch的识别器的基类.", | ||
@@ -11,3 +11,3 @@ "main": "./dist/index", | ||
"dependencies": { | ||
"@any-touch/shared": "^0.6.0-beta.26" | ||
"@any-touch/shared": "^0.6.0-beta.30" | ||
}, | ||
@@ -18,3 +18,3 @@ "publishConfig": { | ||
"sideEffects": false, | ||
"gitHead": "141852aaf51673c194a8b8d3d76f0db56c8ca8d4" | ||
"gitHead": "72c35289e4996e7a568625595c8b1fd05728eadb" | ||
} |
@@ -10,6 +10,3 @@ import { Input, ComputeConstructor } from '@any-touch/shared'; | ||
export { default as resetStatusForPressMoveLike } from './resetStatusForPressMoveLike'; | ||
export default abstract class { | ||
// 给use方法用来判断是手势插件 | ||
static type = 'Recognizer'; | ||
// 手势名 | ||
@@ -16,0 +13,0 @@ name: string; |
@@ -96,2 +96,3 @@ import { CommonEmitFunction, Input } from '@any-touch/shared'; | ||
} | ||
// console.log(recognizer.name) | ||
emit(name + status, computed); | ||
@@ -98,0 +99,0 @@ } |
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
24974
537