d35db1d0425ab72e109355c5a431100d.json 14.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 _AnimatedNode=_interopRequireDefault(require(\"./AnimatedNode\"));var _AnimatedTransform=_interopRequireDefault(require(\"./AnimatedTransform\"));var _AnimatedWithChildren2=_interopRequireDefault(require(\"./AnimatedWithChildren\"));var _NativeAnimatedHelper=_interopRequireDefault(require(\"../NativeAnimatedHelper\"));var _StyleSheet=_interopRequireDefault(require(\"../../../../exports/StyleSheet\"));function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}var flattenStyle=_StyleSheet.default.flatten;var AnimatedStyle=function(_AnimatedWithChildren){_inheritsLoose(AnimatedStyle,_AnimatedWithChildren);function AnimatedStyle(style){var _this;_this=_AnimatedWithChildren.call(this)||this;style=flattenStyle(style)||{};if(style.transform){style=_objectSpread({},style,{transform:new _AnimatedTransform.default(style.transform)});}_this._style=style;return _this;}var _proto=AnimatedStyle.prototype;_proto._walkStyleAndGetValues=function _walkStyleAndGetValues(style){var updatedStyle={};for(var key in style){var value=style[key];if(value instanceof _AnimatedNode.default){if(!value.__isNative){updatedStyle[key]=value.__getValue();}}else if(value&&!Array.isArray(value)&&typeof value==='object'){updatedStyle[key]=this._walkStyleAndGetValues(value);}else{updatedStyle[key]=value;}}return updatedStyle;};_proto.__getValue=function __getValue(){return this._walkStyleAndGetValues(this._style);};_proto._walkStyleAndGetAnimatedValues=function _walkStyleAndGetAnimatedValues(style){var updatedStyle={};for(var key in style){var value=style[key];if(value instanceof _AnimatedNode.default){updatedStyle[key]=value.__getAnimatedValue();}else if(value&&!Array.isArray(value)&&typeof value==='object'){updatedStyle[key]=this._walkStyleAndGetAnimatedValues(value);}}return updatedStyle;};_proto.__getAnimatedValue=function __getAnimatedValue(){return this._walkStyleAndGetAnimatedValues(this._style);};_proto.__attach=function __attach(){for(var key in this._style){var value=this._style[key];if(value instanceof _AnimatedNode.default){value.__addChild(this);}}};_proto.__detach=function __detach(){for(var key in this._style){var value=this._style[key];if(value instanceof _AnimatedNode.default){value.__removeChild(this);}}_AnimatedWithChildren.prototype.__detach.call(this);};_proto.__makeNative=function __makeNative(){_AnimatedWithChildren.prototype.__makeNative.call(this);for(var key in this._style){var value=this._style[key];if(value instanceof _AnimatedNode.default){value.__makeNative();}}};_proto.__getNativeConfig=function __getNativeConfig(){var styleConfig={};for(var styleKey in this._style){if(this._style[styleKey]instanceof _AnimatedNode.default){styleConfig[styleKey]=this._style[styleKey].__getNativeTag();}}_NativeAnimatedHelper.default.validateStyles(styleConfig);return{type:'style',style:styleConfig};};return AnimatedStyle;}(_AnimatedWithChildren2.default);var _default=AnimatedStyle;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/AnimatedStyle.js"],"names":["_objectSpread","target","i","arguments","length","source","ownKeys","Object","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","_defineProperty","obj","value","defineProperty","configurable","writable","_inheritsLoose","subClass","superClass","prototype","create","constructor","__proto__","flattenStyle","StyleSheet","flatten","AnimatedStyle","_AnimatedWithChildren","style","_this","call","transform","AnimatedTransform","_style","_proto","_walkStyleAndGetValues","updatedStyle","AnimatedNode","__isNative","__getValue","Array","isArray","_walkStyleAndGetAnimatedValues","__getAnimatedValue","__attach","__addChild","__detach","__removeChild","__makeNative","__getNativeConfig","styleConfig","styleKey","__getNativeTag","NativeAnimatedHelper","validateStyles","type","AnimatedWithChildren"],"mappings":"AASA,a,mKAQA,oEACA,8EACA,qFACA,qFACA,kFAVA,QAASA,CAAAA,aAAT,CAAuBC,MAAvB,CAA+B,CAAE,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGC,SAAS,CAACC,MAA9B,CAAsCF,CAAC,EAAvC,CAA2C,CAAE,GAAIG,CAAAA,MAAM,CAAGF,SAAS,CAACD,CAAD,CAAT,EAAgB,IAAhB,CAAuBC,SAAS,CAACD,CAAD,CAAhC,CAAsC,EAAnD,CAAuD,GAAII,CAAAA,OAAO,CAAGC,MAAM,CAACC,IAAP,CAAYH,MAAZ,CAAd,CAAmC,GAAI,MAAOE,CAAAA,MAAM,CAACE,qBAAd,GAAwC,UAA5C,CAAwD,CAAEH,OAAO,CAAGA,OAAO,CAACI,MAAR,CAAeH,MAAM,CAACE,qBAAP,CAA6BJ,MAA7B,EAAqCM,MAArC,CAA4C,SAAUC,GAAV,CAAe,CAAE,MAAOL,CAAAA,MAAM,CAACM,wBAAP,CAAgCR,MAAhC,CAAwCO,GAAxC,EAA6CE,UAApD,CAAiE,CAA9H,CAAf,CAAV,CAA4J,CAACR,OAAO,CAACS,OAAR,CAAgB,SAAUC,GAAV,CAAe,CAAEC,eAAe,CAAChB,MAAD,CAASe,GAAT,CAAcX,MAAM,CAACW,GAAD,CAApB,CAAf,CAA4C,CAA7E,EAAiF,CAAC,MAAOf,CAAAA,MAAP,CAAgB,CAEje,QAASgB,CAAAA,eAAT,CAAyBC,GAAzB,CAA8BF,GAA9B,CAAmCG,KAAnC,CAA0C,CAAE,GAAIH,GAAG,GAAIE,CAAAA,GAAX,CAAgB,CAAEX,MAAM,CAACa,cAAP,CAAsBF,GAAtB,CAA2BF,GAA3B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,MAAL,CAAYxB,GAAZ,CAAZ,CAEA,GAAIG,KAAK,WAAYyB,sBAArB,CAAmC,CACjCzB,KAAK,CAACoC,YAAN,GACD,CACF,CACF,CAVD,CAYAd,MAAM,CAACe,iBAAP,CAA2B,QAASA,CAAAA,iBAAT,EAA6B,CACtD,GAAIC,CAAAA,WAAW,CAAG,EAAlB,CAEA,IAAK,GAAIC,CAAAA,QAAT,GAAqB,MAAKlB,MAA1B,CAAkC,CAChC,GAAI,KAAKA,MAAL,CAAYkB,QAAZ,WAAiCd,sBAArC,CAAmD,CACjDa,WAAW,CAACC,QAAD,CAAX,CAAwB,KAAKlB,MAAL,CAAYkB,QAAZ,EAAsBC,cAAtB,EAAxB,CACD,CAGF,CAEDC,8BAAqBC,cAArB,CAAoCJ,WAApC,EACA,MAAO,CACLK,IAAI,CAAE,OADD,CAEL3B,KAAK,CAAEsB,WAFF,CAAP,CAID,CAhBD,CAkBA,MAAOxB,CAAAA,aAAP,CACD,CA5HD,CA4HE8B,8BA5HF,CAFA,C,aAgIe9B,a","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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedTransform from './AnimatedTransform';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport StyleSheet from '../../../../exports/StyleSheet';\nvar flattenStyle = StyleSheet.flatten;\n\nvar AnimatedStyle =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n  _inheritsLoose(AnimatedStyle, _AnimatedWithChildren);\n\n  function AnimatedStyle(style) {\n    var _this;\n\n    _this = _AnimatedWithChildren.call(this) || this;\n    style = flattenStyle(style) || {};\n\n    if (style.transform) {\n      style = _objectSpread({}, style, {\n        transform: new AnimatedTransform(style.transform)\n      });\n    }\n\n    _this._style = style;\n    return _this;\n  } // Recursively get values for nested styles (like iOS's shadowOffset)\n\n\n  var _proto = AnimatedStyle.prototype;\n\n  _proto._walkStyleAndGetValues = function _walkStyleAndGetValues(style) {\n    var updatedStyle = {};\n\n    for (var key in style) {\n      var value = style[key];\n\n      if (value instanceof AnimatedNode) {\n        if (!value.__isNative) {\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          updatedStyle[key] = value.__getValue();\n        }\n      } else if (value && !Array.isArray(value) && typeof value === 'object') {\n        // Support animating nested values (for example: shadowOffset.height)\n        updatedStyle[key] = this._walkStyleAndGetValues(value);\n      } else {\n        updatedStyle[key] = value;\n      }\n    }\n\n    return updatedStyle;\n  };\n\n  _proto.__getValue = function __getValue() {\n    return this._walkStyleAndGetValues(this._style);\n  } // Recursively get animated values for nested styles (like iOS's shadowOffset)\n  ;\n\n  _proto._walkStyleAndGetAnimatedValues = function _walkStyleAndGetAnimatedValues(style) {\n    var updatedStyle = {};\n\n    for (var key in style) {\n      var value = style[key];\n\n      if (value instanceof AnimatedNode) {\n        updatedStyle[key] = value.__getAnimatedValue();\n      } else if (value && !Array.isArray(value) && typeof value === 'object') {\n        // Support animating nested values (for example: shadowOffset.height)\n        updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);\n      }\n    }\n\n    return updatedStyle;\n  };\n\n  _proto.__getAnimatedValue = function __getAnimatedValue() {\n    return this._walkStyleAndGetAnimatedValues(this._style);\n  };\n\n  _proto.__attach = function __attach() {\n    for (var key in this._style) {\n      var value = this._style[key];\n\n      if (value instanceof AnimatedNode) {\n        value.__addChild(this);\n      }\n    }\n  };\n\n  _proto.__detach = function __detach() {\n    for (var key in this._style) {\n      var value = this._style[key];\n\n      if (value instanceof AnimatedNode) {\n        value.__removeChild(this);\n      }\n    }\n\n    _AnimatedWithChildren.prototype.__detach.call(this);\n  };\n\n  _proto.__makeNative = function __makeNative() {\n    _AnimatedWithChildren.prototype.__makeNative.call(this);\n\n    for (var key in this._style) {\n      var value = this._style[key];\n\n      if (value instanceof AnimatedNode) {\n        value.__makeNative();\n      }\n    }\n  };\n\n  _proto.__getNativeConfig = function __getNativeConfig() {\n    var styleConfig = {};\n\n    for (var styleKey in this._style) {\n      if (this._style[styleKey] instanceof AnimatedNode) {\n        styleConfig[styleKey] = this._style[styleKey].__getNativeTag();\n      } // Non-animated styles are set using `setNativeProps`, no need\n      // to pass those as a part of the node config\n\n    }\n\n    NativeAnimatedHelper.validateStyles(styleConfig);\n    return {\n      type: 'style',\n      style: styleConfig\n    };\n  };\n\n  return AnimatedStyle;\n}(AnimatedWithChildren);\n\nexport default AnimatedStyle;"]},"metadata":{},"sourceType":"script"}