UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 13.4 kB
{"ast":null,"code":"'use strict';\n\nimport NativeAnimatedHelper from \"../NativeAnimatedHelper\";\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\nclass AnimatedNode {\n __attach() {}\n __detach() {\n if (this.__isNative && this.__nativeTag != null) {\n NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n this.__nativeTag = undefined;\n }\n }\n __getValue() {}\n __getAnimatedValue() {\n return this.__getValue();\n }\n __addChild(child) {}\n __removeChild(child) {}\n __getChildren() {\n return [];\n }\n constructor() {\n this._listeners = {};\n }\n __makeNative(platformConfig) {\n if (!this.__isNative) {\n throw new Error('This node cannot be made a \"native\" animated node');\n }\n this._platformConfig = platformConfig;\n if (this.hasListeners()) {\n this._startListeningToNativeValueUpdates();\n }\n }\n addListener(callback) {\n var id = String(_uniqueId++);\n this._listeners[id] = callback;\n if (this.__isNative) {\n this._startListeningToNativeValueUpdates();\n }\n return id;\n }\n removeListener(id) {\n delete this._listeners[id];\n if (this.__isNative && !this.hasListeners()) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n removeAllListeners() {\n this._listeners = {};\n if (this.__isNative) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n hasListeners() {\n return !!Object.keys(this._listeners).length;\n }\n _startListeningToNativeValueUpdates() {\n if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {\n return;\n }\n if (this.__shouldUpdateListenersForNewNativeTag) {\n this.__shouldUpdateListenersForNewNativeTag = false;\n this._stopListeningForNativeValueUpdates();\n }\n NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', data => {\n if (data.tag !== this.__getNativeTag()) {\n return;\n }\n this.__onAnimatedValueUpdateReceived(data.value);\n });\n }\n __onAnimatedValueUpdateReceived(value) {\n this.__callListeners(value);\n }\n __callListeners(value) {\n for (var _key in this._listeners) {\n this._listeners[_key]({\n value\n });\n }\n }\n _stopListeningForNativeValueUpdates() {\n if (!this.__nativeAnimatedValueListener) {\n return;\n }\n this.__nativeAnimatedValueListener.remove();\n this.__nativeAnimatedValueListener = null;\n NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n }\n __getNativeTag() {\n var _this$__nativeTag;\n NativeAnimatedHelper.assertNativeAnimatedModule();\n invariant(this.__isNative, 'Attempt to get native tag from node not marked as \"native\"');\n var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : NativeAnimatedHelper.generateNewNodeTag();\n if (this.__nativeTag == null) {\n this.__nativeTag = nativeTag;\n var config = this.__getNativeConfig();\n if (this._platformConfig) {\n config.platformConfig = this._platformConfig;\n }\n NativeAnimatedHelper.API.createAnimatedNode(nativeTag, config);\n this.__shouldUpdateListenersForNewNativeTag = true;\n }\n return nativeTag;\n }\n __getNativeConfig() {\n throw new Error('This JS animated node type cannot be used as native animated node');\n }\n toJSON() {\n return this.__getValue();\n }\n __getPlatformConfig() {\n return this._platformConfig;\n }\n __setPlatformConfig(platformConfig) {\n this._platformConfig = platformConfig;\n }\n}\nexport default AnimatedNode;","map":{"version":3,"names":["NativeAnimatedHelper","NativeAnimatedAPI","API","invariant","_uniqueId","AnimatedNode","__attach","__detach","__isNative","__nativeTag","dropAnimatedNode","undefined","__getValue","__getAnimatedValue","__addChild","child","__removeChild","__getChildren","constructor","_listeners","__makeNative","platformConfig","Error","_platformConfig","hasListeners","_startListeningToNativeValueUpdates","addListener","callback","id","String","removeListener","_stopListeningForNativeValueUpdates","removeAllListeners","Object","keys","length","__nativeAnimatedValueListener","__shouldUpdateListenersForNewNativeTag","startListeningToAnimatedNodeValue","__getNativeTag","nativeEventEmitter","data","tag","__onAnimatedValueUpdateReceived","value","__callListeners","_key","remove","stopListeningToAnimatedNodeValue","_this$__nativeTag","assertNativeAnimatedModule","nativeTag","generateNewNodeTag","config","__getNativeConfig","createAnimatedNode","toJSON","__getPlatformConfig","__setPlatformConfig"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedNode.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 NativeAnimatedHelper from '../NativeAnimatedHelper';\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\n\n// Note(vjeux): this would be better as an interface but flow doesn't\n// support them yet\nclass AnimatedNode {\n __attach() {}\n __detach() {\n if (this.__isNative && this.__nativeTag != null) {\n NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n this.__nativeTag = undefined;\n }\n }\n __getValue() {}\n __getAnimatedValue() {\n return this.__getValue();\n }\n __addChild(child) {}\n __removeChild(child) {}\n __getChildren() {\n return [];\n }\n\n /* Methods and props used by native Animated impl */\n\n constructor() {\n this._listeners = {};\n }\n __makeNative(platformConfig) {\n if (!this.__isNative) {\n throw new Error('This node cannot be made a \"native\" animated node');\n }\n this._platformConfig = platformConfig;\n if (this.hasListeners()) {\n this._startListeningToNativeValueUpdates();\n }\n }\n\n /**\n * Adds an asynchronous listener to the value so you can observe updates from\n * animations. This is useful because there is no way to\n * synchronously read the value because it might be driven natively.\n *\n * See https://reactnative.dev/docs/animatedvalue#addlistener\n */\n addListener(callback) {\n var id = String(_uniqueId++);\n this._listeners[id] = callback;\n if (this.__isNative) {\n this._startListeningToNativeValueUpdates();\n }\n return id;\n }\n\n /**\n * Unregister a listener. The `id` param shall match the identifier\n * previously returned by `addListener()`.\n *\n * See https://reactnative.dev/docs/animatedvalue#removelistener\n */\n removeListener(id) {\n delete this._listeners[id];\n if (this.__isNative && !this.hasListeners()) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n\n /**\n * Remove all registered listeners.\n *\n * See https://reactnative.dev/docs/animatedvalue#removealllisteners\n */\n removeAllListeners() {\n this._listeners = {};\n if (this.__isNative) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n hasListeners() {\n return !!Object.keys(this._listeners).length;\n }\n _startListeningToNativeValueUpdates() {\n if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {\n return;\n }\n if (this.__shouldUpdateListenersForNewNativeTag) {\n this.__shouldUpdateListenersForNewNativeTag = false;\n this._stopListeningForNativeValueUpdates();\n }\n NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', data => {\n if (data.tag !== this.__getNativeTag()) {\n return;\n }\n this.__onAnimatedValueUpdateReceived(data.value);\n });\n }\n __onAnimatedValueUpdateReceived(value) {\n this.__callListeners(value);\n }\n __callListeners(value) {\n for (var _key in this._listeners) {\n this._listeners[_key]({\n value\n });\n }\n }\n _stopListeningForNativeValueUpdates() {\n if (!this.__nativeAnimatedValueListener) {\n return;\n }\n this.__nativeAnimatedValueListener.remove();\n this.__nativeAnimatedValueListener = null;\n NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n }\n __getNativeTag() {\n var _this$__nativeTag;\n NativeAnimatedHelper.assertNativeAnimatedModule();\n invariant(this.__isNative, 'Attempt to get native tag from node not marked as \"native\"');\n var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : NativeAnimatedHelper.generateNewNodeTag();\n if (this.__nativeTag == null) {\n this.__nativeTag = nativeTag;\n var config = this.__getNativeConfig();\n if (this._platformConfig) {\n config.platformConfig = this._platformConfig;\n }\n NativeAnimatedHelper.API.createAnimatedNode(nativeTag, config);\n this.__shouldUpdateListenersForNewNativeTag = true;\n }\n return nativeTag;\n }\n __getNativeConfig() {\n throw new Error('This JS animated node type cannot be used as native animated node');\n }\n toJSON() {\n return this.__getValue();\n }\n __getPlatformConfig() {\n return this._platformConfig;\n }\n __setPlatformConfig(platformConfig) {\n this._platformConfig = platformConfig;\n }\n}\nexport default AnimatedNode;"],"mappings":"AAUA,YAAY;;AAEZ,OAAOA,oBAAoB;AAC3B,IAAIC,iBAAiB,GAAGD,oBAAoB,CAACE,GAAG;AAChD,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,IAAIC,SAAS,GAAG,CAAC;AAIjB,MAAMC,YAAY,CAAC;EACjBC,QAAQA,CAAA,EAAG,CAAC;EACZC,QAAQA,CAAA,EAAG;IACT,IAAI,IAAI,CAACC,UAAU,IAAI,IAAI,CAACC,WAAW,IAAI,IAAI,EAAE;MAC/CT,oBAAoB,CAACE,GAAG,CAACQ,gBAAgB,CAAC,IAAI,CAACD,WAAW,CAAC;MAC3D,IAAI,CAACA,WAAW,GAAGE,SAAS;IAC9B;EACF;EACAC,UAAUA,CAAA,EAAG,CAAC;EACdC,kBAAkBA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACD,UAAU,CAAC,CAAC;EAC1B;EACAE,UAAUA,CAACC,KAAK,EAAE,CAAC;EACnBC,aAAaA,CAACD,KAAK,EAAE,CAAC;EACtBE,aAAaA,CAAA,EAAG;IACd,OAAO,EAAE;EACX;EAIAC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,UAAU,GAAG,CAAC,CAAC;EACtB;EACAC,YAAYA,CAACC,cAAc,EAAE;IAC3B,IAAI,CAAC,IAAI,CAACb,UAAU,EAAE;MACpB,MAAM,IAAIc,KAAK,CAAC,mDAAmD,CAAC;IACtE;IACA,IAAI,CAACC,eAAe,GAAGF,cAAc;IACrC,IAAI,IAAI,CAACG,YAAY,CAAC,CAAC,EAAE;MACvB,IAAI,CAACC,mCAAmC,CAAC,CAAC;IAC5C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