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
15 KiB
1 line
15 KiB
{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _get from \"@babel/runtime/helpers/get\";\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 _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { AnimatedEvent } from \"../AnimatedEvent\";\nimport AnimatedNode from \"./AnimatedNode\";\nimport AnimatedStyle from \"./AnimatedStyle\";\nimport NativeAnimatedHelper from \"../NativeAnimatedHelper\";\nimport findNodeHandle from \"../../../../exports/findNodeHandle\";\nimport invariant from 'fbjs/lib/invariant';\nvar AnimatedProps = function (_AnimatedNode) {\n _inherits(AnimatedProps, _AnimatedNode);\n var _super = _createSuper(AnimatedProps);\n function AnimatedProps(props, callback) {\n var _this;\n _classCallCheck(this, AnimatedProps);\n _this = _super.call(this);\n if (props.style) {\n props = _objectSpread(_objectSpread({}, props), {}, {\n style: new AnimatedStyle(props.style)\n });\n }\n _this._props = props;\n _this._callback = callback;\n _this.__attach();\n return _this;\n }\n _createClass(AnimatedProps, [{\n key: \"__getValue\",\n value: function __getValue() {\n var props = {};\n for (var key in this._props) {\n var value = this._props[key];\n if (value instanceof AnimatedNode) {\n if (!value.__isNative || value instanceof AnimatedStyle) {\n props[key] = value.__getValue();\n }\n } else if (value instanceof AnimatedEvent) {\n props[key] = value.__getHandler();\n } else {\n props[key] = value;\n }\n }\n return props;\n }\n }, {\n key: \"__getAnimatedValue\",\n value: function __getAnimatedValue() {\n var props = {};\n for (var key in this._props) {\n var value = this._props[key];\n if (value instanceof AnimatedNode) {\n props[key] = value.__getAnimatedValue();\n }\n }\n return props;\n }\n }, {\n key: \"__attach\",\n value: function __attach() {\n for (var key in this._props) {\n var value = this._props[key];\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n }\n }, {\n key: \"__detach\",\n value: function __detach() {\n if (this.__isNative && this._animatedView) {\n this.__disconnectAnimatedView();\n }\n for (var key in this._props) {\n var value = this._props[key];\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n _get(_getPrototypeOf(AnimatedProps.prototype), \"__detach\", this).call(this);\n }\n }, {\n key: \"update\",\n value: function update() {\n this._callback();\n }\n }, {\n key: \"__makeNative\",\n value: function __makeNative() {\n if (!this.__isNative) {\n this.__isNative = true;\n for (var key in this._props) {\n var value = this._props[key];\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n if (this._animatedView) {\n this.__connectAnimatedView();\n }\n }\n }\n }, {\n key: \"setNativeView\",\n value: function setNativeView(animatedView) {\n if (this._animatedView === animatedView) {\n return;\n }\n this._animatedView = animatedView;\n if (this.__isNative) {\n this.__connectAnimatedView();\n }\n }\n }, {\n key: \"__connectAnimatedView\",\n value: function __connectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);\n }\n }, {\n key: \"__disconnectAnimatedView\",\n value: function __disconnectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);\n }\n }, {\n key: \"__restoreDefaultValues\",\n value: function __restoreDefaultValues() {\n if (this.__isNative) {\n NativeAnimatedHelper.API.restoreDefaultValues(this.__getNativeTag());\n }\n }\n }, {\n key: \"__getNativeConfig\",\n value: function __getNativeConfig() {\n var propsConfig = {};\n for (var propKey in this._props) {\n var value = this._props[propKey];\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n propsConfig[propKey] = value.__getNativeTag();\n }\n }\n return {\n type: 'props',\n props: propsConfig\n };\n }\n }]);\n return AnimatedProps;\n}(AnimatedNode);\nexport default AnimatedProps;","map":{"version":3,"names":["_objectSpread","AnimatedEvent","AnimatedNode","AnimatedStyle","NativeAnimatedHelper","findNodeHandle","invariant","AnimatedProps","props","callback","style","_props","_callback","__attach","key","value","__isNative","__getValue","__getHandler","__getAnimatedValue","__addChild","_animatedView","__disconnectAnimatedView","__removeChild","__makeNative","__connectAnimatedView","animatedView","nativeViewTag","API","connectAnimatedNodeToView","__getNativeTag","disconnectAnimatedNodeFromView","restoreDefaultValues","propsConfig","propKey","type"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.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 _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { AnimatedEvent } from '../AnimatedEvent';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedStyle from './AnimatedStyle';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport findNodeHandle from '../../../../exports/findNodeHandle';\nimport invariant from 'fbjs/lib/invariant';\n\nclass AnimatedProps extends AnimatedNode {\n constructor(props, callback) {\n super();\n\n if (props.style) {\n props = _objectSpread(_objectSpread({}, props), {}, {\n style: new AnimatedStyle(props.style)\n });\n }\n\n this._props = props;\n this._callback = callback;\n\n this.__attach();\n }\n\n __getValue() {\n var props = {};\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n if (!value.__isNative || value instanceof AnimatedStyle) {\n // We cannot use value of natively driven nodes this way as the value we have access from\n // JS may not be up to date.\n props[key] = value.__getValue();\n }\n } else if (value instanceof AnimatedEvent) {\n props[key] = value.__getHandler();\n } else {\n props[key] = value;\n }\n }\n\n return props;\n }\n\n __getAnimatedValue() {\n var props = {};\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n props[key] = value.__getAnimatedValue();\n }\n }\n\n return props;\n }\n\n __attach() {\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n }\n\n __detach() {\n if (this.__isNative && this._animatedView) {\n this.__disconnectAnimatedView();\n }\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n\n super.__detach();\n }\n\n update() {\n this._callback();\n }\n\n __makeNative() {\n if (!this.__isNative) {\n this.__isNative = true;\n\n for (var key in this._props) {\n var value = this._props[key];\n\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n\n if (this._animatedView) {\n this.__connectAnimatedView();\n }\n }\n }\n\n setNativeView(animatedView) {\n if (this._animatedView === animatedView) {\n return;\n }\n\n this._animatedView = animatedView;\n\n if (this.__isNative) {\n this.__connectAnimatedView();\n }\n }\n\n __connectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);\n }\n\n __disconnectAnimatedView() {\n invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n var nativeViewTag = findNodeHandle(this._animatedView);\n invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree');\n NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);\n }\n\n __restoreDefaultValues() {\n // When using the native driver, view properties need to be restored to\n // their default values manually since react no longer tracks them. This\n // is needed to handle cases where a prop driven by native animated is removed\n // after having been changed natively by an animation.\n if (this.__isNative) {\n NativeAnimatedHelper.API.restoreDefaultValues(this.__getNativeTag());\n }\n }\n\n __getNativeConfig() {\n var propsConfig = {};\n\n for (var propKey in this._props) {\n var value = this._props[propKey];\n\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n\n propsConfig[propKey] = value.__getNativeTag();\n }\n }\n\n return {\n type: 'props',\n props: propsConfig\n };\n }\n\n}\n\nexport default AnimatedProps;"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEb,OAAOA,aAAa,MAAM,sCAAsC;AAChE,SAASC,aAAa;AACtB,OAAOC,YAAY;AACnB,OAAOC,aAAa;AACpB,OAAOC,oBAAoB;AAC3B,OAAOC,cAAc;AACrB,OAAOC,SAAS,MAAM,oBAAoB;AAAC,IAErCC,aAAa;EAAA;EAAA;EACjB,uBAAYC,KAAK,EAAEC,QAAQ,EAAE;IAAA;IAAA;IAC3B;IAEA,IAAID,KAAK,CAACE,KAAK,EAAE;MACfF,KAAK,GAAGR,aAAa,CAACA,aAAa,CAAC,CAAC,CAAC,EAAEQ,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE;QAClDE,KAAK,EAAE,IAAIP,aAAa,CAACK,KAAK,CAACE,KAAK;MACtC,CAAC,CAAC;IACJ;IAEA,MAAKC,MAAM,GAAGH,KAAK;IACnB,M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