6e884dbfa03a98448bf4e6f1e78e4619.json 13.4 KB
{"ast":null,"code":"'use strict';var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _AnimatedValue=_interopRequireDefault(require(\"./AnimatedValue\"));var _AnimatedWithChildren2=_interopRequireDefault(require(\"./AnimatedWithChildren\"));var _invariant=_interopRequireDefault(require(\"fbjs/lib/invariant\"));function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}var _uniqueId=1;var AnimatedValueXY=function(_AnimatedWithChildren){_inheritsLoose(AnimatedValueXY,_AnimatedWithChildren);function AnimatedValueXY(valueIn){var _this;_this=_AnimatedWithChildren.call(this)||this;var value=valueIn||{x:0,y:0};if(typeof value.x==='number'&&typeof value.y==='number'){_this.x=new _AnimatedValue.default(value.x);_this.y=new _AnimatedValue.default(value.y);}else{(0,_invariant.default)(value.x instanceof _AnimatedValue.default&&value.y instanceof _AnimatedValue.default,'AnimatedValueXY must be initialized with an object of numbers or '+'AnimatedValues.');_this.x=value.x;_this.y=value.y;}_this._listeners={};return _this;}var _proto=AnimatedValueXY.prototype;_proto.setValue=function setValue(value){this.x.setValue(value.x);this.y.setValue(value.y);};_proto.setOffset=function setOffset(offset){this.x.setOffset(offset.x);this.y.setOffset(offset.y);};_proto.flattenOffset=function flattenOffset(){this.x.flattenOffset();this.y.flattenOffset();};_proto.extractOffset=function extractOffset(){this.x.extractOffset();this.y.extractOffset();};_proto.__getValue=function __getValue(){return{x:this.x.__getValue(),y:this.y.__getValue()};};_proto.resetAnimation=function resetAnimation(callback){this.x.resetAnimation();this.y.resetAnimation();callback&&callback(this.__getValue());};_proto.stopAnimation=function stopAnimation(callback){this.x.stopAnimation();this.y.stopAnimation();callback&&callback(this.__getValue());};_proto.addListener=function addListener(callback){var _this2=this;var id=String(_uniqueId++);var jointCallback=function jointCallback(_ref){var number=_ref.value;callback(_this2.__getValue());};this._listeners[id]={x:this.x.addListener(jointCallback),y:this.y.addListener(jointCallback)};return id;};_proto.removeListener=function removeListener(id){this.x.removeListener(this._listeners[id].x);this.y.removeListener(this._listeners[id].y);delete this._listeners[id];};_proto.removeAllListeners=function removeAllListeners(){this.x.removeAllListeners();this.y.removeAllListeners();this._listeners={};};_proto.getLayout=function getLayout(){return{left:this.x,top:this.y};};_proto.getTranslateTransform=function getTranslateTransform(){return[{translateX:this.x},{translateY:this.y}];};return AnimatedValueXY;}(_AnimatedWithChildren2.default);var _default=AnimatedValueXY;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValueXY.js"],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","__proto__","_uniqueId","AnimatedValueXY","_AnimatedWithChildren","valueIn","_this","call","value","x","y","AnimatedValue","_listeners","_proto","setValue","setOffset","offset","flattenOffset","extractOffset","__getValue","resetAnimation","callback","stopAnimation","addListener","_this2","id","String","jointCallback","_ref","number","removeListener","removeAllListeners","getLayout","left","top","getTranslateTransform","translateX","translateY","AnimatedWithChildren"],"mappings":"AASA,a,mKAIA,sEACA,qFACA,qEAJA,QAASA,CAAAA,cAAT,CAAwBC,QAAxB,CAAkCC,UAAlC,CAA8C,CAAED,QAAQ,CAACE,SAAT,CAAqBC,MAAM,CAACC,MAAP,CAAcH,UAAU,CAACC,SAAzB,CAArB,CAA0DF,QAAQ,CAACE,SAAT,CAAmBG,WAAnB,CAAiCL,QAAjC,CAA2CA,QAAQ,CAACM,SAAT,CAAqBL,UAArB,CAAkC,CAKvL,GAAIM,CAAAA,SAAS,CAAG,CAAhB,CAQA,GAAIC,CAAAA,eAAe,CAEnB,SAAUC,qBAAV,CAAiC,CAC/BV,cAAc,CAACS,eAAD,CAAkBC,qBAAlB,CAAd,CAEA,QAASD,CAAAA,eAAT,CAAyBE,OAAzB,CAAkC,CAChC,G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CAACL,UAAP,EAAD,CAAR,CACD,CAHD,CAKA,KAAKP,UAAL,CAAgBa,EAAhB,EAAsB,CACpBhB,CAAC,CAAE,KAAKA,CAAL,CAAOc,WAAP,CAAmBI,aAAnB,CADiB,CAEpBjB,CAAC,CAAE,KAAKA,CAAL,CAAOa,WAAP,CAAmBI,aAAnB,CAFiB,CAAtB,CAIA,MAAOF,CAAAA,EAAP,CACD,CAfD,CAwBAZ,MAAM,CAACiB,cAAP,CAAwB,QAASA,CAAAA,cAAT,CAAwBL,EAAxB,CAA4B,CAClD,KAAKhB,CAAL,CAAOqB,cAAP,CAAsB,KAAKlB,UAAL,CAAgBa,EAAhB,EAAoBhB,CAA1C,EACA,KAAKC,CAAL,CAAOoB,cAAP,CAAsB,KAAKlB,UAAL,CAAgBa,EAAhB,EAAoBf,CAA1C,EACA,MAAO,MAAKE,UAAL,CAAgBa,EAAhB,CAAP,CACD,CAJD,CAYAZ,MAAM,CAACkB,kBAAP,CAA4B,QAASA,CAAAA,kBAAT,EAA8B,CACxD,KAAKtB,CAAL,CAAOsB,kBAAP,GACA,KAAKrB,CAAL,CAAOqB,kBAAP,GACA,KAAKnB,UAAL,CAAkB,EAAlB,CACD,CAJD,CAYAC,MAAM,CAACmB,SAAP,CAAmB,QAASA,CAAAA,SAAT,EAAqB,CACtC,MAAO,CACLC,IAAI,CAAE,KAAKxB,CADN,CAELyB,GAAG,CAAE,KAAKxB,CAFL,CAAP,CAID,CALD,CAaAG,MAAM,CAACsB,qBAAP,CAA+B,QAASA,CAAAA,qBAAT,EAAiC,CAC9D,MAAO,CAAC,CACNC,UAAU,CAAE,KAAK3B,CADX,CAAD,CAEJ,CACD4B,UAAU,CAAE,KAAK3B,CADhB,CAFI,CAAP,CAKD,CAND,CAQA,MAAOP,CAAAA,eAAP,CACD,CA7LD,CA6LEmC,8BA7LF,CAFA,C,aAiMenC,e","sourcesContent":["/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\n/**\n * 2D Value for driving 2D animations, such as pan gestures. Almost identical\n * API to normal `Animated.Value`, but multiplexed.\n *\n * See http://facebook.github.io/react-native/docs/animatedvaluexy.html\n */\n\nvar AnimatedValueXY =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n  _inheritsLoose(AnimatedValueXY, _AnimatedWithChildren);\n\n  function AnimatedValueXY(valueIn) {\n    var _this;\n\n    _this = _AnimatedWithChildren.call(this) || this;\n    var value = valueIn || {\n      x: 0,\n      y: 0\n    }; // fixme: shouldn't need `: any`\n\n    if (typeof value.x === 'number' && typeof value.y === 'number') {\n      _this.x = new AnimatedValue(value.x);\n      _this.y = new AnimatedValue(value.y);\n    } else {\n      invariant(value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, 'AnimatedValueXY must be initialized with an object of numbers or ' + 'AnimatedValues.');\n      _this.x = value.x;\n      _this.y = value.y;\n    }\n\n    _this._listeners = {};\n    return _this;\n  }\n  /**\n   * Directly set the value. This will stop any animations running on the value\n   * and update all the bound properties.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setvalue\n   */\n\n\n  var _proto = AnimatedValueXY.prototype;\n\n  _proto.setValue = function setValue(value) {\n    this.x.setValue(value.x);\n    this.y.setValue(value.y);\n  }\n  /**\n   * Sets an offset that is applied on top of whatever value is set, whether\n   * via `setValue`, an animation, or `Animated.event`. Useful for compensating\n   * things like the start of a pan gesture.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setoffset\n   */\n  ;\n\n  _proto.setOffset = function setOffset(offset) {\n    this.x.setOffset(offset.x);\n    this.y.setOffset(offset.y);\n  }\n  /**\n   * Merges the offset value into the base value and resets the offset to zero.\n   * The final output of the value is unchanged.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#flattenoffset\n   */\n  ;\n\n  _proto.flattenOffset = function flattenOffset() {\n    this.x.flattenOffset();\n    this.y.flattenOffset();\n  }\n  /**\n   * Sets the offset value to the base value, and resets the base value to\n   * zero. The final output of the value is unchanged.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset\n   */\n  ;\n\n  _proto.extractOffset = function extractOffset() {\n    this.x.extractOffset();\n    this.y.extractOffset();\n  };\n\n  _proto.__getValue = function __getValue() {\n    return {\n      x: this.x.__getValue(),\n      y: this.y.__getValue()\n    };\n  }\n  /**\n   * Stops any animation and resets the value to its original.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation\n   */\n  ;\n\n  _proto.resetAnimation = function resetAnimation(callback) {\n    this.x.resetAnimation();\n    this.y.resetAnimation();\n    callback && callback(this.__getValue());\n  }\n  /**\n   * Stops any running animation or tracking. `callback` is invoked with the\n   * final value after stopping the animation, which is useful for updating\n   * state to match the animation position with layout.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation\n   */\n  ;\n\n  _proto.stopAnimation = function stopAnimation(callback) {\n    this.x.stopAnimation();\n    this.y.stopAnimation();\n    callback && callback(this.__getValue());\n  }\n  /**\n   * Adds an asynchronous listener to the value so you can observe updates from\n   * animations.  This is useful because there is no way to synchronously read\n   * the value because it might be driven natively.\n   *\n   * Returns a string that serves as an identifier for the listener.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener\n   */\n  ;\n\n  _proto.addListener = function addListener(callback) {\n    var _this2 = this;\n\n    var id = String(_uniqueId++);\n\n    var jointCallback = function jointCallback(_ref) {\n      var number = _ref.value;\n      callback(_this2.__getValue());\n    };\n\n    this._listeners[id] = {\n      x: this.x.addListener(jointCallback),\n      y: this.y.addListener(jointCallback)\n    };\n    return id;\n  }\n  /**\n   * Unregister a listener. The `id` param shall match the identifier\n   * previously returned by `addListener()`.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removelistener\n   */\n  ;\n\n  _proto.removeListener = function removeListener(id) {\n    this.x.removeListener(this._listeners[id].x);\n    this.y.removeListener(this._listeners[id].y);\n    delete this._listeners[id];\n  }\n  /**\n   * Remove all registered listeners.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removealllisteners\n   */\n  ;\n\n  _proto.removeAllListeners = function removeAllListeners() {\n    this.x.removeAllListeners();\n    this.y.removeAllListeners();\n    this._listeners = {};\n  }\n  /**\n   * Converts `{x, y}` into `{left, top}` for use in style.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#getlayout\n   */\n  ;\n\n  _proto.getLayout = function getLayout() {\n    return {\n      left: this.x,\n      top: this.y\n    };\n  }\n  /**\n   * Converts `{x, y}` into a useable translation transform.\n   *\n   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform\n   */\n  ;\n\n  _proto.getTranslateTransform = function getTranslateTransform() {\n    return [{\n      translateX: this.x\n    }, {\n      translateY: this.y\n    }];\n  };\n\n  return AnimatedValueXY;\n}(AnimatedWithChildren);\n\nexport default AnimatedValueXY;"]},"metadata":{},"sourceType":"script"}