efd4f061d57b0b7be52c69aefbcb9ea4.json 5.63 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var _InternalAnimatedValue=_interopRequireDefault(require(\"../core/InternalAnimatedValue\"));var _timing=_interopRequireDefault(require(\"./timing\"));var _base=require(\"../base\");var _AnimatedClock=_interopRequireDefault(require(\"../core/AnimatedClock\"));var _Easing=_interopRequireDefault(require(\"../Easing\"));var _Animation2=_interopRequireDefault(require(\"./Animation\"));var easeInOut=_Easing.default.inOut(_Easing.default.ease);var TimingAnimation=function(_Animation){(0,_inherits2.default)(TimingAnimation,_Animation);function TimingAnimation(config){var _this;(0,_classCallCheck2.default)(this,TimingAnimation);_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(TimingAnimation).call(this));_this._toValue=config.toValue;_this._easing=config.easing!==undefined?config.easing:easeInOut;_this._duration=config.duration!==undefined?config.duration:500;return _this;}(0,_createClass2.default)(TimingAnimation,[{key:\"start\",value:function start(value){this._clock=new _AnimatedClock.default();var state={finished:new _InternalAnimatedValue.default(0),position:value,time:new _InternalAnimatedValue.default(0),frameTime:new _InternalAnimatedValue.default(0)};var config={duration:this._duration,toValue:this._toValue,easing:this._easing};return(0,_base.block)([(0,_base.cond)((0,_base.clockRunning)(this._clock),0,[(0,_base.startClock)(this._clock)]),(0,_timing.default)(this._clock,state,config),(0,_base.cond)(state.finished,(0,_base.stopClock)(this._clock))]);}},{key:\"stop\",value:function stop(){}}],[{key:\"getDefaultState\",value:function getDefaultState(){return{position:new _InternalAnimatedValue.default(0),finished:new _InternalAnimatedValue.default(0),time:new _InternalAnimatedValue.default(0),frameTime:new _InternalAnimatedValue.default(0)};}}]);return TimingAnimation;}(_Animation2.default);exports.default=TimingAnimation;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-reanimated/src/animations/TimingAnimation.js"],"names":["easeInOut","Easing","inOut","ease","TimingAnimation","config","_toValue","toValue","_easing","easing","undefined","_duration","duration","value","_clock","Clock","state","finished","AnimatedValue","position","time","frameTime","Animation"],"mappings":"6nBAAA,4FACA,wDACA,6BACA,4EACA,yDAEA,+DAEA,GAAMA,CAAAA,SAAS,CAAGC,gBAAOC,KAAP,CAAaD,gBAAOE,IAApB,CAAlB,C,GAEqBC,CAAAA,e,yEAOnB,yBAAYC,MAAZ,CAAoB,8DAClB,6GACA,MAAKC,QAAL,CAAgBD,MAAM,CAACE,OAAvB,CACA,MAAKC,OAAL,CAAeH,MAAM,CAACI,MAAP,GAAkBC,SAAlB,CAA8BL,MAAM,CAACI,MAArC,CAA8CT,SAA7D,CACA,MAAKW,SAAL,CAAiBN,MAAM,CAACO,QAAP,GAAoBF,SAApB,CAAgCL,MAAM,CAACO,QAAvC,CAAkD,GAAnE,CAJkB,aAKnB,C,6EAEKC,K,CAAO,CACX,KAAKC,MAAL,CAAc,GAAIC,uBAAJ,EAAd,CAEA,GAAMC,CAAAA,KAAK,CAAG,CACZC,QAAQ,CAAE,GAAIC,+BAAJ,CAAkB,CAAlB,CADE,CAEZC,QAAQ,CAAEN,KAFE,CAGZO,IAAI,CAAE,GAAIF,+BAAJ,CAAkB,CAAlB,CAHM,CAIZG,SAAS,CAAE,GAAIH,+BAAJ,CAAkB,CAAlB,CAJC,CAAd,CAOA,GAAMb,CAAAA,MAAM,CAAG,CACbO,QAAQ,CAAE,KAAKD,SADF,CAEbJ,OAAO,CAAE,KAAKD,QAFD,CAGbG,MAAM,CAAE,KAAKD,OAHA,CAAf,CAMA,MAAO,gBAAM,CACX,eAAK,uBAAa,KAAKM,MAAlB,CAAL,CAAgC,CAAhC,CAAmC,CAAC,qBAAW,KAAKA,MAAhB,CAAD,CAAnC,CADW,CAEX,oBAAO,KAAKA,MAAZ,CAAoBE,KAApB,CAA2BX,MAA3B,CAFW,CAGX,eAAKW,KAAK,CAACC,QAAX,CAAqB,oBAAU,KAAKH,MAAf,CAArB,CAHW,CAAN,CAAP,CAKD,C,mCAEM,CAEN,C,2DACwB,CACvB,MAAO,CACLK,QAAQ,CAAE,GAAID,+BAAJ,CAAkB,CAAlB,CADL,CAELD,QAAQ,CAAE,GAAIC,+BAAJ,CAAkB,CAAlB,CAFL,CAGLE,IAAI,CAAE,GAAIF,+BAAJ,CAAkB,CAAlB,CAHD,CAILG,SAAS,CAAE,GAAIH,+BAAJ,CAAkB,CAAlB,CAJN,CAAP,CAMD,C,6BA/C0CI,mB","sourcesContent":["import AnimatedValue from '../core/InternalAnimatedValue';\nimport timing from './timing';\nimport { block, clockRunning, startClock, stopClock, cond } from '../base';\nimport Clock from '../core/AnimatedClock';\nimport Easing from '../Easing';\n\nimport Animation from './Animation';\n\nconst easeInOut = Easing.inOut(Easing.ease);\n\nexport default class TimingAnimation extends Animation {\n  _toValue;\n  _duration;\n  _easing;\n\n  _clock;\n\n  constructor(config) {\n    super();\n    this._toValue = config.toValue;\n    this._easing = config.easing !== undefined ? config.easing : easeInOut;\n    this._duration = config.duration !== undefined ? config.duration : 500;\n  }\n\n  start(value) {\n    this._clock = new Clock();\n\n    const state = {\n      finished: new AnimatedValue(0),\n      position: value,\n      time: new AnimatedValue(0),\n      frameTime: new AnimatedValue(0),\n    };\n\n    const config = {\n      duration: this._duration,\n      toValue: this._toValue,\n      easing: this._easing,\n    };\n\n    return block([\n      cond(clockRunning(this._clock), 0, [startClock(this._clock)]),\n      timing(this._clock, state, config),\n      cond(state.finished, stopClock(this._clock)),\n    ]);\n  }\n\n  stop() {\n    // this._finished && this._finished.setValue(1);\n  }\n  static getDefaultState() {\n    return {\n      position: new AnimatedValue(0),\n      finished: new AnimatedValue(0),\n      time: new AnimatedValue(0),\n      frameTime: new AnimatedValue(0),\n    };\n  }\n}\n"]},"metadata":{},"sourceType":"script"}