877ebad39a7659503bd6c3d2b4f70fb1.json
6.29 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.createOrReuseTransformNode=createOrReuseTransformNode;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 _AnimatedNode2=_interopRequireDefault(require(\"./AnimatedNode\"));var _areEqual=_interopRequireDefault(require(\"fbjs/lib/areEqual\"));function sanitizeTransform(inputTransform){var outputTransform=[];inputTransform.forEach(function(transform){for(var key in transform){var value=transform[key];if(value instanceof _AnimatedNode2.default){outputTransform.push({property:key,nodeID:value.__nodeID});}else{outputTransform.push({property:key,value:value});}}});return outputTransform;}function extractAnimatedParentNodes(transform){var parents=[];transform.forEach(function(transform){for(var key in transform){var value=transform[key];if(value instanceof _AnimatedNode2.default){parents.push(value);}}});return parents;}function createOrReuseTransformNode(transform,oldNode){var config=sanitizeTransform(transform);if(oldNode&&(0,_areEqual.default)(config,oldNode._config)){return oldNode;}return new AnimatedTransform(transform,config);}var AnimatedTransform=function(_AnimatedNode){(0,_inherits2.default)(AnimatedTransform,_AnimatedNode);function AnimatedTransform(transform,config){var _this;(0,_classCallCheck2.default)(this,AnimatedTransform);_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(AnimatedTransform).call(this,{type:'transform',transform:config},extractAnimatedParentNodes(transform)));_this._config=config;_this._transform=transform;return _this;}(0,_createClass2.default)(AnimatedTransform,[{key:\"__onEvaluate\",value:function __onEvaluate(){return this._transform.map(function(transform){var result={};for(var key in transform){var value=transform[key];if(value instanceof _AnimatedNode2.default){result[key]=value.__getValue();}}return result;});}}]);return AnimatedTransform;}(_AnimatedNode2.default);","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-reanimated/src/core/AnimatedTransform.js"],"names":["sanitizeTransform","inputTransform","outputTransform","forEach","transform","key","value","AnimatedNode","push","property","nodeID","__nodeID","extractAnimatedParentNodes","parents","createOrReuseTransformNode","oldNode","config","_config","AnimatedTransform","type","_transform","map","result","__getValue"],"mappings":"oqBAAA,qEAEA,mEAEA,QAASA,CAAAA,iBAAT,CAA2BC,cAA3B,CAA2C,CACzC,GAAMC,CAAAA,eAAe,CAAG,EAAxB,CACAD,cAAc,CAACE,OAAf,CAAuB,SAAAC,SAAS,CAAI,CAClC,IAAK,GAAMC,CAAAA,GAAX,GAAkBD,CAAAA,SAAlB,CAA6B,CAC3B,GAAME,CAAAA,KAAK,CAAGF,SAAS,CAACC,GAAD,CAAvB,CACA,GAAIC,KAAK,WAAYC,uBAArB,CAAmC,CACjCL,eAAe,CAACM,IAAhB,CAAqB,CACnBC,QAAQ,CAAEJ,GADS,CAEnBK,MAAM,CAAEJ,KAAK,CAACK,QAFK,CAArB,EAID,CALD,IAKO,CACLT,eAAe,CAACM,IAAhB,CAAqB,CACnBC,QAAQ,CAAEJ,GADS,CAEnBC,KAAK,CAALA,KAFmB,CAArB,EAID,CACF,CACF,CAfD,EAgBA,MAAOJ,CAAAA,eAAP,CACD,CAED,QAASU,CAAAA,0BAAT,CAAoCR,SAApC,CAA+C,CAC7C,GAAMS,CAAAA,OAAO,CAAG,EAAhB,CACAT,SAAS,CAACD,OAAV,CAAkB,SAAAC,SAAS,CAAI,CAC7B,IAAK,GAAMC,CAAAA,GAAX,GAAkBD,CAAAA,SAAlB,CAA6B,CAC3B,GAAME,CAAAA,KAAK,CAAGF,SAAS,CAACC,GAAD,CAAvB,CACA,GAAIC,KAAK,WAAYC,uBAArB,CAAmC,CACjCM,OAAO,CAACL,IAAR,CAAaF,KAAb,EACD,CACF,CACF,CAPD,EAQA,MAAOO,CAAAA,OAAP,CACD,CAEM,QAASC,CAAAA,0BAAT,CAAoCV,SAApC,CAA+CW,OAA/C,CAAwD,CAC7D,GAAMC,CAAAA,MAAM,CAAGhB,iBAAiB,CAACI,SAAD,CAAhC,CACA,GAAIW,OAAO,EAAI,sBAAUC,MAAV,CAAkBD,OAAO,CAACE,OAA1B,CAAf,CAAmD,CACjD,MAAOF,CAAAA,OAAP,CACD,CACD,MAAO,IAAIG,CAAAA,iBAAJ,CAAsBd,SAAtB,CAAiCY,MAAjC,CAAP,CACD,C,GAEKE,CAAAA,iB,iFACJ,2BAAYd,SAAZ,CAAuBY,MAAvB,CAA+B,gEAC7B,6GACE,CAAEG,IAAI,CAAE,WAAR,CAAqBf,SAAS,CAAEY,MAAhC,CADF,CAEEJ,0BAA0B,CAACR,SAAD,CAF5B,GAIA,MAAKa,OAAL,CAAeD,MAAf,CACA,MAAKI,UAAL,CAAkBhB,SAAlB,CAN6B,aAO9B,C,8FAEc,CACb,MAAO,MAAKgB,UAAL,CAAgBC,GAAhB,CAAoB,SAAAjB,SAAS,CAAI,CACtC,GAAMkB,CAAAA,MAAM,CAAG,EAAf,CACA,IAAK,GAAMjB,CAAAA,GAAX,GAAkBD,CAAAA,SAAlB,CAA6B,CAC3B,GAAME,CAAAA,KAAK,CAAGF,SAAS,CAACC,GAAD,CAAvB,CACA,GAAIC,KAAK,WAAYC,uBAArB,CAAmC,CACjCe,MAAM,CAACjB,GAAD,CAAN,CAAcC,KAAK,CAACiB,UAAN,EAAd,CACD,CACF,CACD,MAAOD,CAAAA,MAAP,CACD,CATM,CAAP,CAUD,C,+BArB6Bf,sB","sourcesContent":["import AnimatedNode from './AnimatedNode';\n\nimport deepEqual from 'fbjs/lib/areEqual';\n\nfunction sanitizeTransform(inputTransform) {\n const outputTransform = [];\n inputTransform.forEach(transform => {\n for (const key in transform) {\n const value = transform[key];\n if (value instanceof AnimatedNode) {\n outputTransform.push({\n property: key,\n nodeID: value.__nodeID,\n });\n } else {\n outputTransform.push({\n property: key,\n value,\n });\n }\n }\n });\n return outputTransform;\n}\n\nfunction extractAnimatedParentNodes(transform) {\n const parents = [];\n transform.forEach(transform => {\n for (const key in transform) {\n const value = transform[key];\n if (value instanceof AnimatedNode) {\n parents.push(value);\n }\n }\n });\n return parents;\n}\n\nexport function createOrReuseTransformNode(transform, oldNode) {\n const config = sanitizeTransform(transform);\n if (oldNode && deepEqual(config, oldNode._config)) {\n return oldNode;\n }\n return new AnimatedTransform(transform, config);\n}\n\nclass AnimatedTransform extends AnimatedNode {\n constructor(transform, config) {\n super(\n { type: 'transform', transform: config },\n extractAnimatedParentNodes(transform)\n );\n this._config = config;\n this._transform = transform;\n }\n\n __onEvaluate() {\n return this._transform.map(transform => {\n const result = {};\n for (const key in transform) {\n const value = transform[key];\n if (value instanceof AnimatedNode) {\n result[key] = value.__getValue();\n }\n }\n return result;\n });\n }\n}\n"]},"metadata":{},"sourceType":"script"}