repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 19 kB
JSON
{"ast":null,"code":"'use strict';\n\nimport AnimatedInterpolation from \"./AnimatedInterpolation\";\nimport AnimatedWithChildren from \"./AnimatedWithChildren\";\nimport InteractionManager from \"../../../../exports/InteractionManager\";\nimport NativeAnimatedHelper from \"../NativeAnimatedHelper\";\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nfunction _flush(rootNode) {\n var animatedStyles = new Set();\n function findAnimatedStyles(node) {\n if (typeof node.update === 'function') {\n animatedStyles.add(node);\n } else {\n node.__getChildren().forEach(findAnimatedStyles);\n }\n }\n findAnimatedStyles(rootNode);\n animatedStyles.forEach(animatedStyle => animatedStyle.update());\n}\nfunction _executeAsAnimatedBatch(id, operation) {\n NativeAnimatedAPI.setWaitingForIdentifier(id);\n operation();\n NativeAnimatedAPI.unsetWaitingForIdentifier(id);\n}\nclass AnimatedValue extends AnimatedWithChildren {\n constructor(value, config) {\n super();\n if (typeof value !== 'number') {\n throw new Error('AnimatedValue: Attempting to set value to undefined');\n }\n this._startingValue = this._value = value;\n this._offset = 0;\n this._animation = null;\n if (config && config.useNativeDriver) {\n this.__makeNative();\n }\n }\n __detach() {\n if (this.__isNative) {\n NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {\n this._value = value - this._offset;\n });\n }\n this.stopAnimation();\n super.__detach();\n }\n __getValue() {\n return this._value + this._offset;\n }\n setValue(value) {\n if (this._animation) {\n this._animation.stop();\n this._animation = null;\n }\n this._updateValue(value, !this.__isNative);\n if (this.__isNative) {\n _executeAsAnimatedBatch(this.__getNativeTag().toString(), () => NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value));\n }\n }\n setOffset(offset) {\n this._offset = offset;\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);\n }\n }\n flattenOffset() {\n this._value += this._offset;\n this._offset = 0;\n if (this.__isNative) {\n NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());\n }\n }\n extractOffset() {\n this._offset += this._value;\n this._value = 0;\n if (this.__isNative) {\n NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());\n }\n }\n stopAnimation(callback) {\n this.stopTracking();\n this._animation && this._animation.stop();\n this._animation = null;\n if (callback) {\n if (this.__isNative) {\n NativeAnimatedAPI.getValue(this.__getNativeTag(), callback);\n } else {\n callback(this.__getValue());\n }\n }\n }\n resetAnimation(callback) {\n this.stopAnimation(callback);\n this._value = this._startingValue;\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue);\n }\n }\n __onAnimatedValueUpdateReceived(value) {\n this._updateValue(value, false);\n }\n interpolate(config) {\n return new AnimatedInterpolation(this, config);\n }\n animate(animation, callback) {\n var handle = null;\n if (animation.__isInteraction) {\n handle = InteractionManager.createInteractionHandle();\n }\n var previousAnimation = this._animation;\n this._animation && this._animation.stop();\n this._animation = animation;\n animation.start(this._value, value => {\n this._updateValue(value, true);\n }, result => {\n this._animation = null;\n if (handle !== null) {\n InteractionManager.clearInteractionHandle(handle);\n }\n callback && callback(result);\n }, previousAnimation, this);\n }\n stopTracking() {\n this._tracking && this._tracking.__detach();\n this._tracking = null;\n }\n track(tracking) {\n this.stopTracking();\n this._tracking = tracking;\n this._tracking && this._tracking.update();\n }\n _updateValue(value, flush) {\n if (value === undefined) {\n throw new Error('AnimatedValue: Attempting to set value to undefined');\n }\n this._value = value;\n if (flush) {\n _flush(this);\n }\n super.__callListeners(this.__getValue());\n }\n __getNativeConfig() {\n return {\n type: 'value',\n value: this._value,\n offset: this._offset\n };\n }\n}\nexport default AnimatedValue;","map":{"version":3,"names":["AnimatedInterpolation","AnimatedWithChildren","InteractionManager","NativeAnimatedHelper","NativeAnimatedAPI","API","_flush","rootNode","animatedStyles","Set","findAnimatedStyles","node","update","add","__getChildren","forEach","animatedStyle","_executeAsAnimatedBatch","id","operation","setWaitingForIdentifier","unsetWaitingForIdentifier","AnimatedValue","constructor","value","config","Error","_startingValue","_value","_offset","_animation","useNativeDriver","__makeNative","__detach","__isNative","getValue","__getNativeTag","stopAnimation","__getValue","setValue","stop","_updateValue","toString","setAnimatedNodeValue","setOffset","offset","setAnimatedNodeOffset","flattenOffset","flattenAnimatedNodeOffset","extractOffset","extractAnimatedNodeOffset","callback","stopTracking","resetAnimation","__onAnimatedValueUpdateReceived","interpolate","animate","animation","handle","__isInteraction","createInteractionHandle","previousAnimation","start","result","clearInteractionHandle","_tracking","track","tracking","flush","undefined","__callListeners","__getNativeConfig","type"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValue.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 AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport InteractionManager from '../../../../exports/InteractionManager';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\n\n/**\n * Animated works by building a directed acyclic graph of dependencies\n * transparently when you render your Animated components.\n *\n * new Animated.Value(0)\n * .interpolate() .interpolate() new Animated.Value(1)\n * opacity translateY scale\n * style transform\n * View#234 style\n * View#123\n *\n * A) Top Down phase\n * When an Animated.Value is updated, we recursively go down through this\n * graph in order to find leaf nodes: the views that we flag as needing\n * an update.\n *\n * B) Bottom Up phase\n * When a view is flagged as needing an update, we recursively go back up\n * in order to build the new value that it needs. The reason why we need\n * this two-phases process is to deal with composite props such as\n * transform which can receive values from multiple parents.\n */\nfunction _flush(rootNode) {\n var animatedStyles = new Set();\n function findAnimatedStyles(node) {\n /* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment\n * suppresses an error found when Flow v0.68 was deployed. To see the error\n * delete this comment and run Flow. */\n if (typeof node.update === 'function') {\n animatedStyles.add(node);\n } else {\n node.__getChildren().forEach(findAnimatedStyles);\n }\n }\n findAnimatedStyles(rootNode);\n // $FlowFixMe[prop-missing]\n animatedStyles.forEach(animatedStyle => animatedStyle.update());\n}\n\n/**\n * Some operations are executed only on batch end, which is _mostly_ scheduled when\n * Animated component props change. For some of the changes which require immediate execution\n * (e.g. setValue), we create a separate batch in case none is scheduled.\n */\nfunction _executeAsAnimatedBatch(id, operation) {\n NativeAnimatedAPI.setWaitingForIdentifier(id);\n operation();\n NativeAnimatedAPI.unsetWaitingForIdentifier(id);\n}\n\n/**\n * Standard value for driving animations. One `Animated.Value` can drive\n * multiple properties in a synchronized fashion, but can only be driven by one\n * mechanism at a time. Using a new mechanism (e.g. starting a new animation,\n * or calling `setValue`) will stop any previous ones.\n *\n * See https://reactnative.dev/docs/animatedvalue\n */\nclass AnimatedValue extends AnimatedWithChildren {\n constructor(value, config) {\n super();\n if (typeof value !== 'number') {\n throw new Error('AnimatedValue: Attempting to set value to undefined');\n }\n this._startingValue = this._value = value;\n this._offset = 0;\n this._animation = null;\n if (config && config.useNativeDriver) {\n this.__makeNative();\n }\n }\n __detach() {\n if (this.__isNative) {\n NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {\n this._value = value - this._offset;\n });\n }\n this.stopAnimation();\n super.__detach();\n }\n __getValue() {\n return this._value + this._offset;\n }\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/animatedvalue#setvalue\n */\n setValue(value) {\n if (this._animation) {\n this._animation.stop();\n this._animation = null;\n }\n this._updateValue(value, !this.__isNative /* don't perform a flush for natively driven values */);\n if (this.__isNative) {\n _executeAsAnimatedBatch(this.__getNativeTag().toString(), () => NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value));\n }\n }\n\n /**\n * Sets an offset that is applied on top of whatever value is set, whether via\n * `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/animatedvalue#setoffset\n */\n setOffset(offset) {\n this._offset = offset;\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);\n }\n }\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/animatedvalue#flattenoffset\n */\n flattenOffset() {\n this._value += this._offset;\n this._offset = 0;\n if (this.__isNative) {\n NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());\n }\n }\n\n /**\n * Sets the offset value to the base value, and resets the base value to zero.\n * The final output of the value is unchanged.\n *\n * See https://reactnative.dev/docs/animatedvalue#extractoffset\n */\n extractOffset() {\n this._offset += this._value;\n this._value = 0;\n if (this.__isNative) {\n NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());\n }\n }\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/animatedvalue#stopanimation\n */\n stopAnimation(callback) {\n this.stopTracking();\n this._animation && this._animation.stop();\n this._animation = null;\n if (callback) {\n if (this.__isNative) {\n NativeAnimatedAPI.getValue(this.__getNativeTag(), callback);\n } else {\n callback(this.__getValue());\n }\n }\n }\n\n /**\n * Stops any animation and resets the value to its original.\n *\n * See https://reactnative.dev/docs/animatedvalue#resetanimation\n */\n resetAnimation(callback) {\n this.stopAnimation(callback);\n this._value = this._startingValue;\n if (this.__isNative) {\n NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue);\n }\n }\n __onAnimatedValueUpdateReceived(value) {\n this._updateValue(value, false /*flush*/);\n }\n\n /**\n * Interpolates the value before updating the property, e.g. mapping 0-1 to\n * 0-10.\n */\n interpolate(config) {\n return new AnimatedInterpolation(this, config);\n }\n\n /**\n * Typically only used internally, but could be used by a custom Animation\n * class.\n *\n * See https://reactnative.dev/docs/animatedvalue#animate\n */\n animate(animation, callback) {\n var handle = null;\n if (animation.__isInteraction) {\n handle = InteractionManager.createInteractionHandle();\n }\n var previousAnimation = this._animation;\n this._animation && this._animation.stop();\n this._animation = animation;\n animation.start(this._value, value => {\n // Natively driven animations will never call into that callback\n this._updateValue(value, true /* flush */);\n }, result => {\n this._animation = null;\n if (handle !== null) {\n InteractionManager.clearInteractionHandle(handle);\n }\n callback && callback(result);\n }, previousAnimation, this);\n }\n\n /**\n * Typically only used internally.\n */\n stopTracking() {\n this._tracking && this._tracking.__detach();\n this._tracking = null;\n }\n\n /**\n * Typically only used internally.\n */\n track(tracking) {\n this.stopTracking();\n this._tracking = tracking;\n // Make sure that the tracking animation starts executing\n this._tracking && this._tracking.update();\n }\n _updateValue(value, flush) {\n if (value === undefined) {\n throw new Error('AnimatedValue: Attempting to set value to undefined');\n }\n this._value = value;\n if (flush) {\n _flush(this);\n }\n super.__callListeners(this.__getValue());\n }\n __getNativeConfig() {\n return {\n type: 'value',\n value: this._value,\n offset: this._offset\n };\n }\n}\nexport default AnimatedValue;"],"mappings":"AAUA,YAAY;;AAEZ,OAAOA,qBAAqB;AAC5B,OAAOC,oBAAoB;AAC3B,OAAOC,kBAAkB;AACzB,OAAOC,oBAAoB;AAC3B,IAAIC,iBAAiB,GAAGD,oBAAoB,CAACE,GAAG;AAwBhD,SAASC,MAAMA,CAACC,QAAQ,EAAE;EACxB,IAAIC,cAAc,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9B,SAASC,kBAAkBA,CAACC,IAAI,EAAE;IAIhC,IAAI,OAAOA,IAAI,CAACC,MAAM,KAAK,UAAU,EAAE;MACrCJ,cAAc,CAACK,GAAG,CAACF,IAAI,CAAC;IAC1B,CAAC,MAAM;MACLA,IAAI,CAACG,aAAa,CAAC,CAAC,CAACC,OAAO,CAACL,kBAAkB,CAAC;IAClD;EACF;EACAA,kBAAkB,CAACH,QAAQ,CAAC;EAE5BC,cAAc,CAAC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