You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
13 KiB
1 line
13 KiB
{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport AnimatedValue from \"./AnimatedValue\";\nimport AnimatedWithChildren from \"./AnimatedWithChildren\";\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\nvar AnimatedValueXY = function (_AnimatedWithChildren) {\n _inherits(AnimatedValueXY, _AnimatedWithChildren);\n var _super = _createSuper(AnimatedValueXY);\n function AnimatedValueXY(valueIn) {\n var _this;\n _classCallCheck(this, AnimatedValueXY);\n _this = _super.call(this);\n var value = valueIn || {\n x: 0,\n y: 0\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 _this._listeners = {};\n return _this;\n }\n _createClass(AnimatedValueXY, [{\n key: \"setValue\",\n value: function setValue(value) {\n this.x.setValue(value.x);\n this.y.setValue(value.y);\n }\n }, {\n key: \"setOffset\",\n value: function setOffset(offset) {\n this.x.setOffset(offset.x);\n this.y.setOffset(offset.y);\n }\n }, {\n key: \"flattenOffset\",\n value: function flattenOffset() {\n this.x.flattenOffset();\n this.y.flattenOffset();\n }\n }, {\n key: \"extractOffset\",\n value: function extractOffset() {\n this.x.extractOffset();\n this.y.extractOffset();\n }\n }, {\n key: \"__getValue\",\n value: function __getValue() {\n return {\n x: this.x.__getValue(),\n y: this.y.__getValue()\n };\n }\n }, {\n key: \"resetAnimation\",\n value: function resetAnimation(callback) {\n this.x.resetAnimation();\n this.y.resetAnimation();\n callback && callback(this.__getValue());\n }\n }, {\n key: \"stopAnimation\",\n value: function stopAnimation(callback) {\n this.x.stopAnimation();\n this.y.stopAnimation();\n callback && callback(this.__getValue());\n }\n }, {\n key: \"addListener\",\n value: function addListener(callback) {\n var _this2 = this;\n var id = String(_uniqueId++);\n var jointCallback = function jointCallback(_ref) {\n var number = _ref.value;\n callback(_this2.__getValue());\n };\n this._listeners[id] = {\n x: this.x.addListener(jointCallback),\n y: this.y.addListener(jointCallback)\n };\n return id;\n }\n }, {\n key: \"removeListener\",\n value: 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 key: \"removeAllListeners\",\n value: function removeAllListeners() {\n this.x.removeAllListeners();\n this.y.removeAllListeners();\n this._listeners = {};\n }\n }, {\n key: \"getLayout\",\n value: function getLayout() {\n return {\n left: this.x,\n top: this.y\n };\n }\n }, {\n key: \"getTranslateTransform\",\n value: function getTranslateTransform() {\n return [{\n translateX: this.x\n }, {\n translateY: this.y\n }];\n }\n }]);\n return AnimatedValueXY;\n}(AnimatedWithChildren);\nexport default AnimatedValueXY;","map":{"version":3,"names":["AnimatedValue","AnimatedWithChildren","invariant","_uniqueId","AnimatedValueXY","valueIn","value","x","y","_listeners","setValue","offset","setOffset","flattenOffset","extractOffset","__getValue","callback","resetAnimation","stopAnimation","id","String","jointCallback","_ref","number","addListener","removeListener","removeAllListeners","left","top","translateX","translateY"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValueXY.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\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\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 https://reactnative.dev/docs/animatedvaluexy.html\n */\n\nclass AnimatedValueXY extends AnimatedWithChildren {\n constructor(valueIn) {\n super();\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 }\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 https://reactnative.dev/docs/animatedvaluexy.html#setvalue\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#setoffset\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#flattenoffset\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#extractoffset\n */\n\n\n extractOffset() {\n this.x.extractOffset();\n this.y.extractOffset();\n }\n\n __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 https://reactnative.dev/docs/animatedvaluexy.html#resetanimation\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#stopanimation\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#addlistener\n */\n\n\n addListener(callback) {\n var id = String(_uniqueId++);\n\n var jointCallback = _ref => {\n var number = _ref.value;\n callback(this.__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 https://reactnative.dev/docs/animatedvaluexy.html#removelistener\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#removealllisteners\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#getlayout\n */\n\n\n 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 https://reactnative.dev/docs/animatedvaluexy.html#gettranslatetransform\n */\n\n\n getTranslateTransform() {\n return [{\n translateX: this.x\n }, {\n translateY: this.y\n }];\n }\n\n}\n\nexport default AnimatedValueXY;"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEb,OAAOA,aAAa;AACpB,OAAOC,oBAAoB;AAC3B,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,IAAIC,SAAS,GAAG,CAAC;AAAC,IAQZC,eAAe;EAAA;EAAA;EACnB,yBAAYC,OAAO,EAAE;IAAA;IAAA;IACnB;IACA,IAAIC,KAAK,GAAGD,OAAO,IAAI;MACrBE,CAAC,EAAE,CAAC;MACJC,CAAC,EAAE;IACL,CAAC;IAED,IAAI,OAAOF,KAAK,CAACC,CAAC,KAAK,QAAQ,IAAI,OAAOD,KAAK,CAACE,CAAC,KAAK,QAAQ,EAAE;MAC9D,MAAKD,CAAC,GAAG,IAAIP,aAAa,CAACM,KAAK,CAACC,CAAC,CAAC;MACnC,MAAKC,CAAC,GAAG,IAAIR,aAAa,CAACM,KAAK,CAACE,CAAC,CAAC;IACrC,CAAC,MAAM;MACLN,SAAS,CAACI,KAAK,CAACC,CAAC,YAAYP,aAAa,IAAIM,KAAK,CAACE,CAAC,YAAYR,aAAa,EAAE,mEAAmE,GAAG,iBAAiB,CAAC;MACxK,MAAKO,CAAC,GAAGD,KAAK,CAACC,CAAC;MAChB,MAAKC,CAAC,GAAGF,KAAK,CAACE,CAAC;IAClB;IAEA,MAAKC,UAAU,GAAG,CAAC,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