repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 11.3 kB
JSON
{"ast":null,"code":"'use strict';\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;\nfunction createAnimatedStyle(inputStyle) {\n var style = flattenStyle(inputStyle);\n var animatedStyles = {};\n for (var key in style) {\n var value = style[key];\n if (key === 'transform' && Array.isArray(value)) {\n animatedStyles[key] = new AnimatedTransform(value);\n } else if (value instanceof AnimatedNode) {\n animatedStyles[key] = value;\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n animatedStyles[key] = createAnimatedStyle(value);\n }\n }\n return animatedStyles;\n}\nclass AnimatedStyle extends AnimatedWithChildren {\n constructor(style) {\n super();\n this._inputStyle = style;\n this._style = createAnimatedStyle(style);\n }\n _walkStyleAndGetValues(style) {\n var updatedStyle = {};\n for (var key in style) {\n var value = style[key];\n if (value instanceof AnimatedNode) {\n if (!value.__isNative) {\n updatedStyle[key] = value.__getValue();\n }\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n updatedStyle[key] = this._walkStyleAndGetValues(value);\n } else {\n updatedStyle[key] = value;\n }\n }\n return updatedStyle;\n }\n __getValue() {\n return [this._inputStyle, this._walkStyleAndGetValues(this._style)];\n }\n _walkStyleAndGetAnimatedValues(style) {\n var updatedStyle = {};\n for (var key in style) {\n var value = style[key];\n if (value instanceof AnimatedNode) {\n updatedStyle[key] = value.__getAnimatedValue();\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);\n }\n }\n return updatedStyle;\n }\n __getAnimatedValue() {\n return this._walkStyleAndGetAnimatedValues(this._style);\n }\n __attach() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n }\n __detach() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n super.__detach();\n }\n __makeNative() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n super.__makeNative();\n }\n __getNativeConfig() {\n var styleConfig = {};\n for (var styleKey in this._style) {\n if (this._style[styleKey] instanceof AnimatedNode) {\n var style = this._style[styleKey];\n style.__makeNative();\n styleConfig[styleKey] = style.__getNativeTag();\n }\n }\n NativeAnimatedHelper.validateStyles(styleConfig);\n return {\n type: 'style',\n style: styleConfig\n };\n }\n}\nexport default AnimatedStyle;","map":{"version":3,"names":["AnimatedNode","AnimatedTransform","AnimatedWithChildren","NativeAnimatedHelper","StyleSheet","flattenStyle","flatten","createAnimatedStyle","inputStyle","style","animatedStyles","key","value","Array","isArray","AnimatedStyle","constructor","_inputStyle","_style","_walkStyleAndGetValues","updatedStyle","__isNative","__getValue","_walkStyleAndGetAnimatedValues","__getAnimatedValue","__attach","__addChild","__detach","__removeChild","__makeNative","__getNativeConfig","styleConfig","styleKey","__getNativeTag","validateStyles","type"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedStyle.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\n'use strict';\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;\nfunction createAnimatedStyle(inputStyle) {\n var style = flattenStyle(inputStyle);\n var animatedStyles = {};\n for (var key in style) {\n var value = style[key];\n if (key === 'transform' && Array.isArray(value)) {\n animatedStyles[key] = new AnimatedTransform(value);\n } else if (value instanceof AnimatedNode) {\n animatedStyles[key] = value;\n } else if (value && !Array.isArray(value) && typeof value === 'object') {\n animatedStyles[key] = createAnimatedStyle(value);\n }\n }\n return animatedStyles;\n}\nclass AnimatedStyle extends AnimatedWithChildren {\n constructor(style) {\n super();\n this._inputStyle = style;\n this._style = createAnimatedStyle(style);\n }\n\n // Recursively get values for nested styles (like iOS's shadowOffset)\n _walkStyleAndGetValues(style) {\n var updatedStyle = {};\n for (var key in style) {\n var value = style[key];\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 return updatedStyle;\n }\n __getValue() {\n return [this._inputStyle, this._walkStyleAndGetValues(this._style)];\n }\n\n // Recursively get animated values for nested styles (like iOS's shadowOffset)\n _walkStyleAndGetAnimatedValues(style) {\n var updatedStyle = {};\n for (var key in style) {\n var value = style[key];\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 return updatedStyle;\n }\n __getAnimatedValue() {\n return this._walkStyleAndGetAnimatedValues(this._style);\n }\n __attach() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__addChild(this);\n }\n }\n }\n __detach() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__removeChild(this);\n }\n }\n super.__detach();\n }\n __makeNative() {\n for (var key in this._style) {\n var value = this._style[key];\n if (value instanceof AnimatedNode) {\n value.__makeNative();\n }\n }\n super.__makeNative();\n }\n __getNativeConfig() {\n var styleConfig = {};\n for (var styleKey in this._style) {\n if (this._style[styleKey] instanceof AnimatedNode) {\n var style = this._style[styleKey];\n style.__makeNative();\n styleConfig[styleKey] = style.__getNativeTag();\n }\n }\n NativeAnimatedHelper.validateStyles(styleConfig);\n return {\n type: 'style',\n style: styleConfig\n };\n }\n}\nexport default AnimatedStyle;"],"mappings":"AAUA,YAAY;;AAEZ,OAAOA,YAAY;AACnB,OAAOC,iBAAiB;AACxB,OAAOC,oBAAoB;AAC3B,OAAOC,oBAAoB;AAC3B,OAAOC,UAAU;AACjB,IAAIC,YAAY,GAAGD,UAAU,CAACE,OAAO;AACrC,SAASC,mBAAmBA,CAACC,UAAU,EAAE;EACvC,IAAIC,KAAK,GAAGJ,YAAY,CAACG,UAAU,CAAC;EACpC,IAAIE,cAAc,GAAG,CAAC,CAAC;EACvB,KAAK,IAAIC,GAAG,IAAIF,KAAK,EAAE;IACrB,IAAIG,KAAK,GAAGH,KAAK,CAACE,GAAG,CAAC;IACtB,IAAIA,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MAC/CF,cAAc,CAACC,GAAG,CAAC,GAAG,IAAIV,iBAAiB,CAACW,KAAK,CAAC;IACpD,CAAC,MAAM,IAAIA,KAAK,YAAYZ,YAAY,EAAE;MACxCU,cAAc,CAACC,GAAG,CAAC,GAAGC,KAAK;IAC7B,CAAC,MAAM,IAAIA,KAAK,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MACtEF,cAAc,CAACC,GAAG,CAAC,GAAGJ,mBAAmB,CAACK,KAAK,CAAC;IAClD;EACF;EACA,OAAOF,cAAc;AACvB;AACA,MAAMK,aAAa,SAASb,oBAAoB,CAAC;EAC/Cc,WAAWA,CAACP,KAAK,EAAE;IACjB,KAAK,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ACjD,IAAIS,KAAK,GAAG,IAAI,CAACS,MAAM,CAACc,QAAQ,CAAC;QACjCvB,KAAK,CAACoB,YAAY,CAAC,CAAC;QACpBE,WAAW,CAACC,QAAQ,CAAC,GAAGvB,KAAK,CAACwB,cAAc,CAAC,CAAC;MAChD;IACF;IACA9B,oBAAoB,CAAC+B,cAAc,CAACH,WAAW,CAAC;IAChD,OAAO;MACLI,IAAI,EAAE,OAAO;MACb1B,KAAK,EAAEsB;IACT,CAAC;EACH;AACF;AACA,eAAehB,aAAa","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}