react-native-reanimated 3.8.0 → 3.9.0-layout-animation-experimental

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
  9. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
  10. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
  11. package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
  12. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
  13. package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
  14. package/Common/cpp/SharedItems/Shareables.cpp +31 -5
  15. package/Common/cpp/SharedItems/Shareables.h +18 -2
  16. package/Common/cpp/Tools/JSScheduler.cpp +29 -5
  17. package/Common/cpp/Tools/JSScheduler.h +21 -4
  18. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
  19. package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
  20. package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
  21. package/android/CMakeLists.txt +3 -0
  22. package/android/build.gradle +17 -5
  23. package/android/src/main/cpp/NativeProxy.cpp +77 -12
  24. package/android/src/main/cpp/NativeProxy.h +35 -1
  25. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
  26. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
  27. package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
  28. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
  29. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
  30. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
  31. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
  32. package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
  33. package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
  34. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
  37. package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
  38. package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
  39. package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
  40. package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
  41. package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
  42. package/apple/LayoutReanimation/REASnapshot.h +1 -0
  43. package/apple/LayoutReanimation/REASnapshot.m +78 -37
  44. package/apple/REAModule.h +22 -2
  45. package/apple/REAModule.mm +97 -46
  46. package/apple/REANodesManager.h +3 -3
  47. package/apple/REANodesManager.mm +46 -22
  48. package/apple/native/NativeProxy.h +28 -2
  49. package/apple/native/NativeProxy.mm +65 -195
  50. package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
  51. package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
  52. package/apple/sensor/ReanimatedSensor.m +5 -5
  53. package/lib/module/Animated.js.map +1 -1
  54. package/lib/module/ConfigHelper.js +1 -1
  55. package/lib/module/ConfigHelper.js.map +1 -1
  56. package/lib/module/animationBuilder.js +1 -0
  57. package/lib/module/animationBuilder.js.map +1 -1
  58. package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
  59. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  60. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
  61. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  62. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
  63. package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
  64. package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
  65. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  66. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  67. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
  68. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  69. package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
  70. package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
  71. package/lib/module/createAnimatedComponent/index.js.map +1 -1
  72. package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
  73. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  74. package/lib/module/createAnimatedComponent/utils.js.map +1 -1
  75. package/lib/module/index.js.map +1 -1
  76. package/lib/module/index.web.js +1 -2
  77. package/lib/module/index.web.js.map +1 -1
  78. package/lib/module/mock.js +12 -12
  79. package/lib/module/mock.js.map +1 -1
  80. package/lib/module/propsAllowlists.js.map +1 -1
  81. package/lib/module/reanimated2/Bezier.js.map +1 -1
  82. package/lib/module/reanimated2/Colors.js +4 -11
  83. package/lib/module/reanimated2/Colors.js.map +1 -1
  84. package/lib/module/reanimated2/Easing.js +3 -7
  85. package/lib/module/reanimated2/Easing.js.map +1 -1
  86. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
  87. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  88. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  89. package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
  90. package/lib/module/reanimated2/PlatformChecker.js +2 -1
  91. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  92. package/lib/module/reanimated2/PropAdapters.js +1 -1
  93. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  94. package/lib/module/reanimated2/PropsRegistry.js +1 -2
  95. package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
  96. package/lib/module/reanimated2/Sensor.js +2 -2
  97. package/lib/module/reanimated2/Sensor.js.map +1 -1
  98. package/lib/module/reanimated2/SensorContainer.js +2 -2
  99. package/lib/module/reanimated2/SensorContainer.js.map +1 -1
  100. package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
  101. package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
  102. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  103. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  104. package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
  105. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  106. package/lib/module/reanimated2/animation/clamp.js.map +1 -1
  107. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
  108. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  109. package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
  110. package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
  111. package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
  112. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  113. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  114. package/lib/module/reanimated2/animation/index.js.map +1 -1
  115. package/lib/module/reanimated2/animation/repeat.js +1 -6
  116. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  117. package/lib/module/reanimated2/animation/sequence.js +1 -5
  118. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  119. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  120. package/lib/module/reanimated2/animation/springUtils.js +8 -10
  121. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  122. package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
  123. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  124. package/lib/module/reanimated2/animation/timing.js +4 -1
  125. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  126. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
  127. package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
  128. package/lib/module/reanimated2/animation/util.js +22 -2
  129. package/lib/module/reanimated2/animation/util.js.map +1 -1
  130. package/lib/module/reanimated2/commonTypes.js +3 -1
  131. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  132. package/lib/module/reanimated2/component/FlatList.js +1 -0
  133. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  134. package/lib/module/reanimated2/component/Image.js +1 -0
  135. package/lib/module/reanimated2/component/Image.js.map +1 -1
  136. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
  137. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  138. package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
  139. package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
  140. package/lib/module/reanimated2/component/ScrollView.js +1 -0
  141. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  142. package/lib/module/reanimated2/component/Text.js +1 -0
  143. package/lib/module/reanimated2/component/Text.js.map +1 -1
  144. package/lib/module/reanimated2/component/View.js +1 -0
  145. package/lib/module/reanimated2/component/View.js.map +1 -1
  146. package/lib/module/reanimated2/core.js +6 -15
  147. package/lib/module/reanimated2/core.js.map +1 -1
  148. package/lib/module/reanimated2/errors.js +8 -8
  149. package/lib/module/reanimated2/errors.js.map +1 -1
  150. package/lib/module/reanimated2/fabricUtils.js +33 -8
  151. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  152. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  153. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
  154. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  155. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  156. package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
  157. package/lib/module/reanimated2/globals.d.js.map +1 -1
  158. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  159. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  160. package/lib/module/reanimated2/hook/index.js.map +1 -1
  161. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
  162. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  163. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
  164. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  165. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  166. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
  167. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  168. package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
  169. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  170. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
  171. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  172. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  173. package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
  174. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  175. package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
  176. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  177. package/lib/module/reanimated2/hook/useEvent.js +4 -5
  178. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  179. package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
  180. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  181. package/lib/module/reanimated2/hook/useHandler.js +3 -1
  182. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  183. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  184. package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
  185. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  186. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  187. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  188. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  189. package/lib/module/reanimated2/index.js +2 -0
  190. package/lib/module/reanimated2/index.js.map +1 -1
  191. package/lib/module/reanimated2/initializers.js +1 -5
  192. package/lib/module/reanimated2/initializers.js.map +1 -1
  193. package/lib/module/reanimated2/interpolateColor.js +2 -6
  194. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  195. package/lib/module/reanimated2/interpolation.js +1 -1
  196. package/lib/module/reanimated2/interpolation.js.map +1 -1
  197. package/lib/module/reanimated2/isSharedValue.js.map +1 -1
  198. package/lib/module/reanimated2/jestUtils.js +3 -6
  199. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  200. package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
  201. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
  202. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  203. package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
  204. package/lib/module/reanimated2/js-reanimated/index.js +2 -2
  205. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  206. package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
  207. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
  208. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  209. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
  210. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  211. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
  212. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  213. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  214. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  215. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
  216. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  217. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
  218. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  219. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
  220. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  221. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
  222. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  223. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
  224. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  225. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
  226. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  227. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
  228. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  229. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
  230. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  231. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
  232. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  233. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
  234. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  235. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
  236. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  237. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  238. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
  239. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  240. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
  241. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  242. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
  243. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  244. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
  245. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  246. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
  247. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  248. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
  249. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  250. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  251. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  252. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
  253. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  254. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
  255. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  256. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
  257. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  258. package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
  259. package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
  260. package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
  261. package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
  262. package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
  263. package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
  264. package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
  265. package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
  266. package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
  267. package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
  268. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
  269. package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
  270. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
  271. package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
  272. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
  273. package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
  274. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
  275. package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
  276. package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
  277. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
  278. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  279. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
  280. package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
  281. package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
  282. package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
  283. package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
  284. package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
  285. package/lib/module/reanimated2/mappers.js +2 -4
  286. package/lib/module/reanimated2/mappers.js.map +1 -1
  287. package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
  288. package/lib/module/reanimated2/mutables.js +2 -4
  289. package/lib/module/reanimated2/mutables.js.map +1 -1
  290. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  291. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  292. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  293. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  294. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  295. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
  296. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  297. package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
  298. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
  299. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  300. package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
  301. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  302. package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
  303. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  304. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
  305. package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
  306. package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
  307. package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
  308. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  309. package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
  310. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  311. package/lib/module/reanimated2/publicGlobals.js.map +1 -1
  312. package/lib/module/reanimated2/runtimes.js +11 -19
  313. package/lib/module/reanimated2/runtimes.js.map +1 -1
  314. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
  315. package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
  316. package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
  317. package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
  318. package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
  319. package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
  320. package/lib/module/reanimated2/screenTransition/index.js +5 -0
  321. package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
  322. package/lib/module/reanimated2/screenTransition/presets.js +157 -0
  323. package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
  324. package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
  325. package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
  326. package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
  327. package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
  328. package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
  329. package/lib/module/reanimated2/shareables.js +27 -10
  330. package/lib/module/reanimated2/shareables.js.map +1 -1
  331. package/lib/module/reanimated2/threads.js +9 -34
  332. package/lib/module/reanimated2/threads.js.map +1 -1
  333. package/lib/module/reanimated2/valueSetter.js +1 -2
  334. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  335. package/lib/module/reanimated2/valueUnpacker.js +4 -3
  336. package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
  337. package/lib/module/specs/NativeReanimatedModule.js +5 -0
  338. package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
  339. package/lib/typescript/ConfigHelper.d.ts +1 -0
  340. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
  341. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
  342. package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
  343. package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
  344. package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
  345. package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
  346. package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
  347. package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
  348. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
  349. package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
  350. package/lib/typescript/reanimated2/core.d.ts +3 -4
  351. package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
  352. package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
  353. package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
  354. package/lib/typescript/reanimated2/index.d.ts +3 -0
  355. package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
  356. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
  357. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
  358. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
  359. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  360. package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
  361. package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
  362. package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
  363. package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
  364. package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
  365. package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
  366. package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
  367. package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
  368. package/package.json +29 -17
  369. package/plugin/build/plugin.js +7 -2
  370. package/src/ConfigHelper.ts +1 -1
  371. package/src/animationBuilder.tsx +2 -0
  372. package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
  373. package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
  374. package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
  375. package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
  376. package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
  377. package/src/createAnimatedComponent/getViewInfo.ts +39 -0
  378. package/src/mock.ts +13 -1
  379. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
  380. package/src/reanimated2/PlatformChecker.ts +3 -2
  381. package/src/reanimated2/PropsRegistry.ts +1 -3
  382. package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
  383. package/src/reanimated2/WorkletEventHandler.ts +98 -39
  384. package/src/reanimated2/animation/styleAnimation.ts +8 -6
  385. package/src/reanimated2/animation/timing.ts +9 -1
  386. package/src/reanimated2/animation/util.ts +28 -3
  387. package/src/reanimated2/commonTypes.ts +4 -1
  388. package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
  389. package/src/reanimated2/core.ts +9 -31
  390. package/src/reanimated2/errors.ts +1 -0
  391. package/src/reanimated2/fabricUtils.ts +43 -18
  392. package/src/reanimated2/globals.d.ts +11 -1
  393. package/src/reanimated2/hook/commonTypes.ts +10 -0
  394. package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
  395. package/src/reanimated2/hook/useEvent.ts +4 -4
  396. package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
  397. package/src/reanimated2/index.ts +11 -0
  398. package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
  399. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
  400. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
  401. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
  402. package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
  403. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
  404. package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
  405. package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
  406. package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
  407. package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
  408. package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
  409. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
  410. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  411. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
  412. package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
  413. package/src/reanimated2/screenTransition/animationManager.ts +45 -0
  414. package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
  415. package/src/reanimated2/screenTransition/index.ts +12 -0
  416. package/src/reanimated2/screenTransition/presets.ts +137 -0
  417. package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
  418. package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
  419. package/src/reanimated2/shareables.ts +29 -6
  420. package/src/reanimated2/valueUnpacker.ts +10 -3
  421. package/src/specs/NativeReanimatedModule.ts +9 -0
  422. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
  423. package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
@@ -2,11 +2,11 @@
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React from 'react';
8
8
  import { findNodeHandle, Platform } from 'react-native';
9
- import WorkletEventHandler from '../reanimated2/WorkletEventHandler';
9
+ import { WorkletEventHandler } from '../reanimated2/WorkletEventHandler';
10
10
  import '../reanimated2/layoutReanimation/animationsManager';
11
11
  import invariant from 'invariant';
12
12
  import { adaptViewConfig } from '../ConfigHelper';
@@ -27,8 +27,8 @@ import { PropsFilter } from './PropsFilter';
27
27
  import { startWebLayoutAnimation, tryActivateLayoutTransition, configureWebLayoutAnimations, getReducedMotionFromConfig, saveSnapshot } from '../reanimated2/layoutReanimation/web';
28
28
  import { updateLayoutAnimations } from '../reanimated2/UpdateLayoutAnimations';
29
29
  import { addHTMLMutationObserver } from '../reanimated2/layoutReanimation/web/domUtils';
30
+ import { getViewInfo } from './getViewInfo';
30
31
  const IS_WEB = isWeb();
31
- const IS_FABRIC = isFabric();
32
32
  if (IS_WEB) {
33
33
  configureWebLayoutAnimations();
34
34
  }
@@ -42,11 +42,16 @@ function onlyAnimatedStyles(styles) {
42
42
  * @param component - The component you want to make animatable.
43
43
  * @returns A component that Reanimated is capable of animating.
44
44
  * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent
45
- */ // Don't change the order of overloads, since such a change breaks current behavior
45
+ */
46
+
47
+ // Don't change the order of overloads, since such a change breaks current behavior
48
+
46
49
  /**
47
50
  * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.
48
51
  */
49
52
  // @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList
53
+
54
+ let id = 0;
50
55
  export function createAnimatedComponent(Component, options) {
51
56
  invariant(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, `Looks like you're passing a function component \`${Component.name}\` to \`createAnimatedComponent\` function which supports only class components. Please wrap your function component with \`React.forwardRef()\` or use a class component instead.`);
52
57
  class AnimatedComponent extends React.Component {
@@ -66,12 +71,14 @@ export function createAnimatedComponent(Component, options) {
66
71
  _defineProperty(this, "_PropsFilter", new PropsFilter());
67
72
  _defineProperty(this, "_viewInfo", void 0);
68
73
  _defineProperty(this, "context", void 0);
74
+ _defineProperty(this, "nativeID", id++);
69
75
  _defineProperty(this, "_setComponentRef", setAndForwardRef({
70
76
  getForwardedRef: () => this.props.forwardedRef,
71
77
  setLocalRef: ref => {
72
78
  // TODO update config
73
79
 
74
80
  const tag = IS_WEB ? ref : findNodeHandle(ref);
81
+ this._viewTag = tag;
75
82
  const {
76
83
  layout,
77
84
  entering,
@@ -79,14 +86,11 @@ export function createAnimatedComponent(Component, options) {
79
86
  sharedTransitionTag
80
87
  } = this.props;
81
88
  if ((layout || entering || exiting || sharedTransitionTag) && tag != null) {
82
- var _this$context;
83
89
  if (!shouldBeUseWeb()) {
84
90
  enableLayoutAnimations(true, false);
85
91
  }
86
- const skipEntering = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.current;
87
- if (entering && !skipEntering) {
88
- var _this$props;
89
- updateLayoutAnimations(tag, LayoutAnimationType.ENTERING, maybeBuild(entering, (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.style, AnimatedComponent.displayName));
92
+ if (sharedTransitionTag) {
93
+ this._configureSharedTransition();
90
94
  }
91
95
  if (sharedTransitionTag && !IS_WEB) {
92
96
  const sharedElementTransition = this.props.sharedTransitionStyle ?? new SharedTransition();
@@ -96,6 +100,13 @@ export function createAnimatedComponent(Component, options) {
96
100
  this._sharedElementTransition = sharedElementTransition;
97
101
  }
98
102
  }
103
+ if (exiting) {
104
+ const reduceMotionInExiting = 'getReduceMotion' in exiting && typeof exiting.getReduceMotion === 'function' ? getReduceMotionFromConfig(exiting.getReduceMotion()) : getReduceMotionFromConfig();
105
+ if (!reduceMotionInExiting) {
106
+ var _this$props;
107
+ updateLayoutAnimations(tag, LayoutAnimationType.EXITING, maybeBuild(exiting, (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.style, AnimatedComponent.displayName));
108
+ }
109
+ }
99
110
  }
100
111
  if (ref !== this._component) {
101
112
  this._component = ref;
@@ -107,8 +118,14 @@ export function createAnimatedComponent(Component, options) {
107
118
  value: {}
108
119
  };
109
120
  }
121
+ const _entering = this.props.entering;
122
+ if (_entering) {
123
+ var _this$props2;
124
+ updateLayoutAnimations(this.nativeID, LayoutAnimationType.ENTERING, maybeBuild(_entering, (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : _this$props2.style, AnimatedComponent.displayName));
125
+ }
110
126
  }
111
127
  componentDidMount() {
128
+ this._viewTag = this._getViewInfo().viewTag;
112
129
  this._attachNativeEvents();
113
130
  this._jsPropsUpdater.addOnJSPropsChangeListener(this);
114
131
  this._attachAnimatedStyles();
@@ -135,16 +152,19 @@ export function createAnimatedComponent(Component, options) {
135
152
  this._jsPropsUpdater.removeOnJSPropsChangeListener(this);
136
153
  this._detachStyles();
137
154
  this._InlinePropManager.detachInlineProps();
138
- (_this$_sharedElementT = this._sharedElementTransition) === null || _this$_sharedElementT === void 0 ? void 0 : _this$_sharedElementT.unregisterTransition(this._viewTag);
155
+ if (this.props.sharedTransitionTag) {
156
+ this._configureSharedTransition(true);
157
+ }
158
+ (_this$_sharedElementT = this._sharedElementTransition) === null || _this$_sharedElementT === void 0 || _this$_sharedElementT.unregisterTransition(this._viewTag, true);
139
159
  const exiting = this.props.exiting;
140
- if (IS_WEB && this.props.exiting && !getReducedMotionFromConfig(this.props.exiting)) {
160
+ if (IS_WEB && this._component && this.props.exiting && !getReducedMotionFromConfig(this.props.exiting)) {
141
161
  addHTMLMutationObserver();
142
162
  startWebLayoutAnimation(this.props, this._component, LayoutAnimationType.EXITING);
143
163
  } else if (exiting) {
144
164
  const reduceMotionInExiting = 'getReduceMotion' in exiting && typeof exiting.getReduceMotion === 'function' ? getReduceMotionFromConfig(exiting.getReduceMotion()) : getReduceMotionFromConfig();
145
165
  if (!reduceMotionInExiting) {
146
- var _this$props2;
147
- updateLayoutAnimations(this._viewTag, LayoutAnimationType.EXITING, maybeBuild(exiting, (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : _this$props2.style, AnimatedComponent.displayName));
166
+ var _this$props3;
167
+ updateLayoutAnimations(this._viewTag, LayoutAnimationType.EXITING, maybeBuild(exiting, (_this$props3 = this.props) === null || _this$props3 === void 0 ? void 0 : _this$props3.style, AnimatedComponent.displayName));
148
168
  }
149
169
  }
150
170
  }
@@ -155,16 +175,10 @@ export function createAnimatedComponent(Component, options) {
155
175
  return (_this$_component = this._component) !== null && _this$_component !== void 0 && _this$_component.getScrollableNode ? (_getScrollableNode = (_ref = this._component).getScrollableNode) === null || _getScrollableNode === void 0 ? void 0 : _getScrollableNode.call(_ref) : this._component;
156
176
  }
157
177
  _attachNativeEvents() {
158
- const node = this._getEventViewRef();
159
- let viewTag = null; // We set it only if needed
160
-
161
178
  for (const key in this.props) {
162
179
  const prop = this.props[key];
163
180
  if (has('workletEventHandler', prop) && prop.workletEventHandler instanceof WorkletEventHandler) {
164
- if (viewTag === null) {
165
- viewTag = IS_WEB ? this._component : findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node);
166
- }
167
- prop.workletEventHandler.registerForEvents(viewTag, key);
181
+ prop.workletEventHandler.registerForEvents(this._viewTag, key);
168
182
  }
169
183
  }
170
184
  }
@@ -172,7 +186,7 @@ export function createAnimatedComponent(Component, options) {
172
186
  for (const key in this.props) {
173
187
  const prop = this.props[key];
174
188
  if (has('workletEventHandler', prop) && prop.workletEventHandler instanceof WorkletEventHandler) {
175
- prop.workletEventHandler.unregisterFromEvents();
189
+ prop.workletEventHandler.unregisterFromEvents(this._viewTag);
176
190
  }
177
191
  }
178
192
  }
@@ -189,28 +203,31 @@ export function createAnimatedComponent(Component, options) {
189
203
  if ((_this$props$animatedP = this.props.animatedProps) !== null && _this$props$animatedP !== void 0 && _this$props$animatedP.viewDescriptors) {
190
204
  this.props.animatedProps.viewDescriptors.remove(this._viewTag);
191
205
  }
192
- if (IS_FABRIC) {
206
+ if (isFabric()) {
193
207
  removeFromPropsRegistry(this._viewTag);
194
208
  }
195
209
  }
196
210
  }
197
- _reattachNativeEvents(prevProps) {
211
+ _updateNativeEvents(prevProps) {
198
212
  for (const key in prevProps) {
199
- const prop = this.props[key];
200
- if (has('workletEventHandler', prop) && prop.workletEventHandler instanceof WorkletEventHandler && prop.workletEventHandler.reattachNeeded) {
201
- prop.workletEventHandler.unregisterFromEvents();
213
+ const prevProp = prevProps[key];
214
+ if (has('workletEventHandler', prevProp) && prevProp.workletEventHandler instanceof WorkletEventHandler) {
215
+ const newProp = this.props[key];
216
+ if (!newProp) {
217
+ // Prop got deleted
218
+ prevProp.workletEventHandler.unregisterFromEvents(this._viewTag);
219
+ } else if (has('workletEventHandler', newProp) && newProp.workletEventHandler instanceof WorkletEventHandler && newProp.workletEventHandler !== prevProp.workletEventHandler) {
220
+ // Prop got changed
221
+ prevProp.workletEventHandler.unregisterFromEvents(this._viewTag);
222
+ newProp.workletEventHandler.registerForEvents(this._viewTag);
223
+ }
202
224
  }
203
225
  }
204
- let viewTag = null;
205
226
  for (const key in this.props) {
206
- const prop = this.props[key];
207
- if (has('workletEventHandler', prop) && prop.workletEventHandler instanceof WorkletEventHandler && prop.workletEventHandler.reattachNeeded) {
208
- if (viewTag === null) {
209
- const node = this._getEventViewRef();
210
- viewTag = IS_WEB ? this._component : findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node);
211
- }
212
- prop.workletEventHandler.registerForEvents(viewTag, key);
213
- prop.workletEventHandler.reattachNeeded = false;
227
+ const newProp = this.props[key];
228
+ if (has('workletEventHandler', newProp) && newProp.workletEventHandler instanceof WorkletEventHandler && !prevProps[key]) {
229
+ // Prop got added
230
+ newProp.workletEventHandler.registerForEvents(this._viewTag);
214
231
  }
215
232
  }
216
233
  }
@@ -219,7 +236,7 @@ export function createAnimatedComponent(Component, options) {
219
236
  options.setNativeProps(this._component, props);
220
237
  } else {
221
238
  var _this$_component2, _this$_component2$set;
222
- (_this$_component2 = this._component) === null || _this$_component2 === void 0 ? void 0 : (_this$_component2$set = _this$_component2.setNativeProps) === null || _this$_component2$set === void 0 ? void 0 : _this$_component2$set.call(_this$_component2, props);
239
+ (_this$_component2 = this._component) === null || _this$_component2 === void 0 || (_this$_component2$set = _this$_component2.setNativeProps) === null || _this$_component2$set === void 0 || _this$_component2$set.call(_this$_component2, props);
223
240
  }
224
241
  }
225
242
  _getViewInfo() {
@@ -242,23 +259,16 @@ export function createAnimatedComponent(Component, options) {
242
259
  shadowNodeWrapper = null;
243
260
  viewConfig = null;
244
261
  } else {
245
- var _hostInstance$viewCon;
246
262
  // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx
247
263
  const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);
248
264
  if (!hostInstance) {
249
265
  throw new Error('[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?');
250
266
  }
251
- // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146
252
- viewTag = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance._nativeTag;
253
- /**
254
- * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).
255
- * The name we're looking for is in the field named uiViewClassName.
256
- */
257
- viewName = hostInstance === null || hostInstance === void 0 ? void 0 : (_hostInstance$viewCon = hostInstance.viewConfig) === null || _hostInstance$viewCon === void 0 ? void 0 : _hostInstance$viewCon.uiViewClassName;
258
- viewConfig = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig;
259
- if (IS_FABRIC) {
260
- shadowNodeWrapper = getShadowNodeWrapperFromRef(this);
261
- }
267
+ const viewInfo = getViewInfo(hostInstance);
268
+ viewTag = viewInfo.viewTag;
269
+ viewName = viewInfo.viewName;
270
+ viewConfig = viewInfo.viewConfig;
271
+ shadowNodeWrapper = isFabric() ? getShadowNodeWrapperFromRef(this) : null;
262
272
  }
263
273
  this._viewInfo = {
264
274
  viewTag,
@@ -347,7 +357,10 @@ export function createAnimatedComponent(Component, options) {
347
357
  if (layout !== oldLayout) {
348
358
  this._configureLayoutTransition();
349
359
  }
350
- this._reattachNativeEvents(prevProps);
360
+ if (this.props.sharedTransitionTag !== undefined || prevProps.sharedTransitionTag !== undefined) {
361
+ this._configureSharedTransition();
362
+ }
363
+ this._updateNativeEvents(prevProps);
351
364
  this._attachAnimatedStyles();
352
365
  this._InlinePropManager.attachInlineProps(this, this._getViewInfo());
353
366
  if (IS_WEB && this.props.exiting) {
@@ -363,6 +376,23 @@ export function createAnimatedComponent(Component, options) {
363
376
  const layout = this.props.layout ? maybeBuild(this.props.layout, undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */, AnimatedComponent.displayName) : undefined;
364
377
  updateLayoutAnimations(this._viewTag, LayoutAnimationType.LAYOUT, layout);
365
378
  }
379
+ _configureSharedTransition(isUnmounting = false) {
380
+ if (IS_WEB) {
381
+ return;
382
+ }
383
+ const {
384
+ sharedTransitionTag
385
+ } = this.props;
386
+ if (!sharedTransitionTag) {
387
+ var _this$_sharedElementT2;
388
+ (_this$_sharedElementT2 = this._sharedElementTransition) === null || _this$_sharedElementT2 === void 0 || _this$_sharedElementT2.unregisterTransition(this._viewTag, isUnmounting);
389
+ this._sharedElementTransition = null;
390
+ return;
391
+ }
392
+ const sharedElementTransition = this.props.sharedTransitionStyle ?? this._sharedElementTransition ?? new SharedTransition();
393
+ sharedElementTransition.registerTransition(this._viewTag, sharedTransitionTag, isUnmounting);
394
+ this._sharedElementTransition = sharedElementTransition;
395
+ }
366
396
  // This is a component lifecycle method from React, therefore we are not calling it directly.
367
397
  // It is called before the component gets rerendered. This way we can access components' position before it changed
368
398
  // and later on, in componentDidUpdate, calculate translation for layout transition.
@@ -389,14 +419,15 @@ export function createAnimatedComponent(Component, options) {
389
419
  visibility: 'hidden' // Hide component until `componentDidMount` triggers
390
420
  };
391
421
  }
392
-
393
422
  const platformProps = Platform.select({
394
423
  web: {},
395
424
  default: {
396
425
  collapsable: false
397
426
  }
398
427
  });
399
- return /*#__PURE__*/React.createElement(Component, _extends({}, filteredProps, {
428
+ return /*#__PURE__*/React.createElement(Component, _extends({
429
+ nativeID: `${this.nativeID}`
430
+ }, filteredProps, {
400
431
  // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.
401
432
  // After spending some time trying to figure out what to do with this problem, we decided to leave it this way
402
433
  ref: this._setComponentRef
@@ -1 +1 @@
1
- {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","obj","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","React","findNodeHandle","Platform","WorkletEventHandler","invariant","adaptViewConfig","RNRenderer","enableLayoutAnimations","SharedTransition","LayoutAnimationType","getShadowNodeWrapperFromRef","removeFromPropsRegistry","getReduceMotionFromConfig","maybeBuild","SkipEnteringContext","JSPropsUpdater","has","flattenArray","setAndForwardRef","isFabric","isJest","isWeb","shouldBeUseWeb","InlinePropManager","PropsFilter","startWebLayoutAnimation","tryActivateLayoutTransition","configureWebLayoutAnimations","getReducedMotionFromConfig","saveSnapshot","updateLayoutAnimations","addHTMLMutationObserver","IS_WEB","IS_FABRIC","onlyAnimatedStyles","styles","filter","style","viewDescriptors","createAnimatedComponent","Component","options","isReactComponent","name","AnimatedComponent","constructor","props","getForwardedRef","forwardedRef","setLocalRef","ref","tag","layout","entering","exiting","sharedTransitionTag","_this$context","skipEntering","context","current","_this$props","ENTERING","displayName","sharedElementTransition","sharedTransitionStyle","reduceMotionInTransition","getReduceMotion","registerTransition","_sharedElementTransition","_component","jestAnimatedStyle","componentDidMount","_attachNativeEvents","_jsPropsUpdater","addOnJSPropsChangeListener","_attachAnimatedStyles","_InlinePropManager","attachInlineProps","_getViewInfo","_configureLayoutTransition","_isFirstRender","componentWillUnmount","_this$_sharedElementT","_detachNativeEvents","removeOnJSPropsChangeListener","_detachStyles","detachInlineProps","unregisterTransition","_viewTag","EXITING","reduceMotionInExiting","_this$props2","_getEventViewRef","_this$_component","_getScrollableNode","_ref","getScrollableNode","node","viewTag","prop","workletEventHandler","setNativeProps","registerForEvents","unregisterFromEvents","_styles","viewsRef","remove","_this$props$animatedP","animatedProps","_reattachNativeEvents","prevProps","reattachNeeded","_updateFromNative","_this$_component2","_this$_component2$set","_this$_component3","_getAnimatableRef","_ref2","_viewInfo","viewName","shadowNodeWrapper","viewConfig","component","getAnimatableRef","_hostInstance$viewCon","hostInstance","findHostInstance_DEPRECATED","Error","_nativeTag","uiViewClassName","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","hasOneSameStyle","prevStyle","isPresent","some","forEach","add","initial","componentDidUpdate","_prevState","snapshot","oldLayout","LAYOUT","getSnapshotBeforeUpdate","_this$_component4","getBoundingClientRect","render","filteredProps","_PropsFilter","filterNonAnimatedProps","visibility","platformProps","select","web","default","collapsable","createElement","_setComponentRef","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["'use strict';\nimport type {\n Component,\n ComponentClass,\n ComponentType,\n FunctionComponent,\n MutableRefObject,\n} from 'react';\nimport React from 'react';\nimport { findNodeHandle, Platform } from 'react-native';\nimport WorkletEventHandler from '../reanimated2/WorkletEventHandler';\nimport '../reanimated2/layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport { RNRenderer } from '../reanimated2/platform-specific/RNRenderer';\nimport { enableLayoutAnimations } from '../reanimated2/core';\nimport {\n SharedTransition,\n LayoutAnimationType,\n} from '../reanimated2/layoutReanimation';\nimport type { StyleProps, ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils';\nimport { removeFromPropsRegistry } from '../reanimated2/PropsRegistry';\nimport { getReduceMotionFromConfig } from '../reanimated2/animation/util';\nimport { maybeBuild } from '../animationBuilder';\nimport { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { AnimateProps } from '../reanimated2';\nimport JSPropsUpdater from './JSPropsUpdater';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n AnimatedComponentRef,\n IAnimatedComponentInternal,\n ViewInfo,\n} from './commonTypes';\nimport { has, flattenArray } from './utils';\nimport setAndForwardRef from './setAndForwardRef';\nimport {\n isFabric,\n isJest,\n isWeb,\n shouldBeUseWeb,\n} from '../reanimated2/PlatformChecker';\nimport { InlinePropManager } from './InlinePropManager';\nimport { PropsFilter } from './PropsFilter';\nimport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n configureWebLayoutAnimations,\n getReducedMotionFromConfig,\n saveSnapshot,\n} from '../reanimated2/layoutReanimation/web';\nimport { updateLayoutAnimations } from '../reanimated2/UpdateLayoutAnimations';\nimport type { CustomConfig } from '../reanimated2/layoutReanimation/web/config';\nimport type { FlatList, FlatListProps } from 'react-native';\nimport { addHTMLMutationObserver } from '../reanimated2/layoutReanimation/web/domUtils';\n\nconst IS_WEB = isWeb();\nconst IS_FABRIC = isFabric();\n\nif (IS_WEB) {\n configureWebLayoutAnimations();\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\ntype Options<P> = {\n setNativeProps: (ref: AnimatedComponentRef, props: P) => void;\n};\n\n/**\n * Lets you create an Animated version of any React Native component.\n *\n * @param component - The component you want to make animatable.\n * @returns A component that Reanimated is capable of animating.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent\n */\n\n// Don't change the order of overloads, since such a change breaks current behavior\nexport function createAnimatedComponent<P extends object>(\n component: FunctionComponent<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n component: ComponentClass<P>,\n options?: Options<P>\n): ComponentClass<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n // Actually ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P> but we need this overload too\n // since some external components (like FastImage) are typed just as ComponentType\n component: ComponentType<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>> | ComponentClass<AnimateProps<P>>;\n\n/**\n * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.\n */\n// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList\nexport function createAnimatedComponent(\n component: typeof FlatList<unknown>,\n options?: Options<any>\n): ComponentClass<AnimateProps<FlatListProps<unknown>>>;\n\nexport function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): any {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent\n extends React.Component<AnimatedComponentProps<InitialComponentProps>>\n implements IAnimatedComponentInternal\n {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag = -1;\n _isFirstRender = true;\n jestAnimatedStyle: { value: StyleProps } = { value: {} };\n _component: AnimatedComponentRef | HTMLElement | null = null;\n _sharedElementTransition: SharedTransition | null = null;\n _jsPropsUpdater = new JSPropsUpdater();\n _InlinePropManager = new InlinePropManager();\n _PropsFilter = new PropsFilter();\n _viewInfo?: ViewInfo;\n static displayName: string;\n static contextType = SkipEnteringContext;\n context!: React.ContextType<typeof SkipEnteringContext>;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.jestAnimatedStyle = { value: {} };\n }\n }\n\n componentDidMount() {\n this._attachNativeEvents();\n this._jsPropsUpdater.addOnJSPropsChangeListener(this);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n const layout = this.props.layout;\n if (layout) {\n this._configureLayoutTransition();\n }\n\n if (IS_WEB) {\n if (this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n if (\n !this.props.entering ||\n getReducedMotionFromConfig(this.props.entering as CustomConfig)\n ) {\n this._isFirstRender = false;\n return;\n }\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.ENTERING\n );\n }\n\n this._isFirstRender = false;\n }\n\n componentWillUnmount() {\n this._detachNativeEvents();\n this._jsPropsUpdater.removeOnJSPropsChangeListener(this);\n this._detachStyles();\n this._InlinePropManager.detachInlineProps();\n this._sharedElementTransition?.unregisterTransition(this._viewTag);\n\n const exiting = this.props.exiting;\n if (\n IS_WEB &&\n this.props.exiting &&\n !getReducedMotionFromConfig(this.props.exiting as CustomConfig)\n ) {\n addHTMLMutationObserver();\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.EXITING\n );\n } else if (exiting) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n this._viewTag,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n }\n\n _getEventViewRef() {\n // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n return (this._component as AnimatedComponentRef)?.getScrollableNode\n ? (this._component as AnimatedComponentRef).getScrollableNode?.()\n : this._component;\n }\n\n _attachNativeEvents() {\n const node = this._getEventViewRef() as AnimatedComponentRef;\n let viewTag = null; // We set it only if needed\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler\n ) {\n if (viewTag === null) {\n viewTag = IS_WEB\n ? this._component\n : findNodeHandle(options?.setNativeProps ? this : node);\n }\n prop.workletEventHandler.registerForEvents(viewTag as number, key);\n }\n }\n }\n\n _detachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler\n ) {\n prop.workletEventHandler.unregisterFromEvents();\n }\n }\n }\n\n _detachStyles() {\n if (IS_WEB && this._styles !== null) {\n for (const style of this._styles) {\n style.viewsRef.remove(this);\n }\n } else if (this._viewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._viewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(this._viewTag);\n }\n if (IS_FABRIC) {\n removeFromPropsRegistry(this._viewTag);\n }\n }\n }\n\n _reattachNativeEvents(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n for (const key in prevProps) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler &&\n prop.workletEventHandler.reattachNeeded\n ) {\n prop.workletEventHandler.unregisterFromEvents();\n }\n }\n\n let viewTag = null;\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler &&\n prop.workletEventHandler.reattachNeeded\n ) {\n if (viewTag === null) {\n const node = this._getEventViewRef() as AnimatedComponentRef;\n\n viewTag = IS_WEB\n ? this._component\n : findNodeHandle(options?.setNativeProps ? this : node);\n }\n prop.workletEventHandler.registerForEvents(viewTag as number, key);\n prop.workletEventHandler.reattachNeeded = false;\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n options.setNativeProps(this._component as AnimatedComponentRef, props);\n } else {\n (this._component as AnimatedComponentRef)?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo(): ViewInfo {\n if (this._viewInfo !== undefined) {\n return this._viewInfo;\n }\n\n let viewTag: number | HTMLElement | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n // Component can specify ref which should be animated when animated version of the component is created.\n // Otherwise, we animate the component itself.\n const component = (this._component as AnimatedComponentRef)\n ?.getAnimatableRef\n ? (this._component as AnimatedComponentRef).getAnimatableRef?.()\n : this;\n\n if (IS_WEB) {\n // At this point I assume that `_setComponentRef` was already called and `_component` is set.\n // `this._component` on web represents HTMLElement of our component, that's why we use casting\n viewTag = this._component as HTMLElement;\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);\n if (!hostInstance) {\n throw new Error(\n '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146\n viewTag = hostInstance?._nativeTag;\n /**\n * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).\n * The name we're looking for is in the field named uiViewClassName.\n */\n viewName = hostInstance?.viewConfig?.uiViewClassName;\n\n viewConfig = hostInstance?.viewConfig;\n\n if (IS_FABRIC) {\n shadowNodeWrapper = getShadowNodeWrapperFromRef(this);\n }\n }\n this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig };\n return this._viewInfo;\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._viewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n styles[0] === prevStyles[0];\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) => style === prevStyle);\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.jestAnimatedStyle.value = {\n ...this.jestAnimatedStyle.value,\n ...style.initial.value,\n };\n style.jestAnimatedStyle.current = this.jestAnimatedStyle;\n }\n });\n\n // detach old animatedProps\n if (prevAnimatedProps && prevAnimatedProps !== this.props.animatedProps) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>,\n _prevState: Readonly<unknown>,\n // This type comes straight from React\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n snapshot: DOMRect | null\n ) {\n const layout = this.props.layout;\n const oldLayout = prevProps.layout;\n if (layout !== oldLayout) {\n this._configureLayoutTransition();\n }\n this._reattachNativeEvents(prevProps);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n if (IS_WEB && this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method\n if (\n IS_WEB &&\n snapshot !== null &&\n this.props.layout &&\n !getReducedMotionFromConfig(this.props.layout as CustomConfig)\n ) {\n tryActivateLayoutTransition(\n this.props,\n this._component as HTMLElement,\n snapshot\n );\n }\n }\n\n _configureLayoutTransition() {\n const layout = this.props.layout\n ? maybeBuild(\n this.props.layout,\n undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,\n AnimatedComponent.displayName\n )\n : undefined;\n updateLayoutAnimations(this._viewTag, LayoutAnimationType.LAYOUT, layout);\n }\n\n _setComponentRef = setAndForwardRef<Component | HTMLElement>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n\n const tag = IS_WEB\n ? (ref as HTMLElement)\n : findNodeHandle(ref as Component);\n\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n\n const skipEntering = this.context?.current;\n if (entering && !skipEntering) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.ENTERING,\n maybeBuild(\n entering,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n if (sharedTransitionTag && !IS_WEB) {\n const sharedElementTransition =\n this.props.sharedTransitionStyle ?? new SharedTransition();\n const reduceMotionInTransition = getReduceMotionFromConfig(\n sharedElementTransition.getReduceMotion()\n );\n if (!reduceMotionInTransition) {\n sharedElementTransition.registerTransition(\n tag as number,\n sharedTransitionTag\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n // This is a component lifecycle method from React, therefore we are not calling it directly.\n // It is called before the component gets rerendered. This way we can access components' position before it changed\n // and later on, in componentDidUpdate, calculate translation for layout transition.\n getSnapshotBeforeUpdate() {\n if (\n IS_WEB &&\n (this._component as HTMLElement)?.getBoundingClientRect !== undefined\n ) {\n return (this._component as HTMLElement).getBoundingClientRect();\n }\n\n return null;\n }\n\n render() {\n const filteredProps = this._PropsFilter.filterNonAnimatedProps(this);\n\n if (isJest()) {\n filteredProps.jestAnimatedStyle = this.jestAnimatedStyle;\n }\n\n // Layout animations on web are set inside `componentDidMount` method, which is called after first render.\n // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.\n // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,\n // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.\n if (\n this._isFirstRender &&\n IS_WEB &&\n filteredProps.entering &&\n !getReducedMotionFromConfig(filteredProps.entering as CustomConfig)\n ) {\n filteredProps.style = {\n ...(filteredProps.style ?? {}),\n visibility: 'hidden', // Hide component until `componentDidMount` triggers\n };\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n\n return (\n <Component\n {...filteredProps}\n // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.\n // After spending some time trying to figure out what to do with this problem, we decided to leave it this way\n ref={this._setComponentRef as (ref: Component) => void}\n {...platformProps}\n />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD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I,qBAC/BtB,SAAS,CAACsB,WAAW,IAAItB,SAAS,CAACG,IAAI,IAAI,WAC5C,GAAE;EAEH,oBAAO3C,KAAK,CAACmK,UAAU,CAAY,CAACrH,KAAK,EAAEI,GAAG,KAAK;IACjD,oBACElD,KAAA,CAAAiK,aAAA,CAACrH,iBAAiB,EAAA9E,QAAA,KACZgF,KAAK,EACJI,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;MAAEF,YAAY,EAAEE;IAAI,CAAC,EAChD;EAEN,CAAC,CAAC;AACJ"}
1
+ {"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","obj","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","t","_toPrimitive","r","e","Symbol","toPrimitive","TypeError","String","Number","React","findNodeHandle","Platform","WorkletEventHandler","invariant","adaptViewConfig","RNRenderer","enableLayoutAnimations","SharedTransition","LayoutAnimationType","getShadowNodeWrapperFromRef","removeFromPropsRegistry","getReduceMotionFromConfig","maybeBuild","SkipEnteringContext","JSPropsUpdater","has","flattenArray","setAndForwardRef","isFabric","isJest","isWeb","shouldBeUseWeb","InlinePropManager","PropsFilter","startWebLayoutAnimation","tryActivateLayoutTransition","configureWebLayoutAnimations","getReducedMotionFromConfig","saveSnapshot","updateLayoutAnimations","addHTMLMutationObserver","getViewInfo","IS_WEB","onlyAnimatedStyles","styles","filter","style","viewDescriptors","id","createAnimatedComponent","Component","options","isReactComponent","name","AnimatedComponent","constructor","props","getForwardedRef","forwardedRef","setLocalRef","ref","tag","_viewTag","layout","entering","exiting","sharedTransitionTag","_configureSharedTransition","sharedElementTransition","sharedTransitionStyle","reduceMotionInTransition","getReduceMotion","registerTransition","_sharedElementTransition","reduceMotionInExiting","_this$props","EXITING","displayName","_component","jestAnimatedStyle","_this$props2","nativeID","ENTERING","componentDidMount","_getViewInfo","viewTag","_attachNativeEvents","_jsPropsUpdater","addOnJSPropsChangeListener","_attachAnimatedStyles","_InlinePropManager","attachInlineProps","_configureLayoutTransition","_isFirstRender","componentWillUnmount","_this$_sharedElementT","_detachNativeEvents","removeOnJSPropsChangeListener","_detachStyles","detachInlineProps","unregisterTransition","_this$props3","_getEventViewRef","_this$_component","_getScrollableNode","_ref","getScrollableNode","prop","workletEventHandler","registerForEvents","unregisterFromEvents","_styles","viewsRef","remove","_this$props$animatedP","animatedProps","_updateNativeEvents","prevProps","prevProp","newProp","_updateFromNative","setNativeProps","_this$_component2","_this$_component2$set","_this$_component3","_getAnimatableRef","_ref2","_viewInfo","undefined","viewName","shadowNodeWrapper","viewConfig","component","getAnimatableRef","hostInstance","findHostInstance_DEPRECATED","Error","viewInfo","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","hasOneSameStyle","prevStyle","isPresent","some","forEach","add","initial","current","componentDidUpdate","_prevState","snapshot","oldLayout","LAYOUT","isUnmounting","_this$_sharedElementT2","getSnapshotBeforeUpdate","_this$_component4","getBoundingClientRect","render","filteredProps","_PropsFilter","filterNonAnimatedProps","visibility","platformProps","select","web","default","collapsable","createElement","_setComponentRef","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["'use strict';\nimport type {\n Component,\n ComponentClass,\n ComponentType,\n FunctionComponent,\n MutableRefObject,\n} from 'react';\nimport React from 'react';\nimport { findNodeHandle, Platform } from 'react-native';\nimport { WorkletEventHandler } from '../reanimated2/WorkletEventHandler';\nimport '../reanimated2/layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport { RNRenderer } from '../reanimated2/platform-specific/RNRenderer';\nimport { enableLayoutAnimations } from '../reanimated2/core';\nimport {\n SharedTransition,\n LayoutAnimationType,\n} from '../reanimated2/layoutReanimation';\nimport type { StyleProps, ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils';\nimport { removeFromPropsRegistry } from '../reanimated2/PropsRegistry';\nimport { getReduceMotionFromConfig } from '../reanimated2/animation/util';\nimport { maybeBuild } from '../animationBuilder';\nimport { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { AnimateProps } from '../reanimated2';\nimport JSPropsUpdater from './JSPropsUpdater';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n AnimatedComponentRef,\n IAnimatedComponentInternal,\n ViewInfo,\n} from './commonTypes';\nimport { has, flattenArray } from './utils';\nimport setAndForwardRef from './setAndForwardRef';\nimport {\n isFabric,\n isJest,\n isWeb,\n shouldBeUseWeb,\n} from '../reanimated2/PlatformChecker';\nimport { InlinePropManager } from './InlinePropManager';\nimport { PropsFilter } from './PropsFilter';\nimport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n configureWebLayoutAnimations,\n getReducedMotionFromConfig,\n saveSnapshot,\n} from '../reanimated2/layoutReanimation/web';\nimport { updateLayoutAnimations } from '../reanimated2/UpdateLayoutAnimations';\nimport type { CustomConfig } from '../reanimated2/layoutReanimation/web/config';\nimport type { FlatList, FlatListProps } from 'react-native';\nimport { addHTMLMutationObserver } from '../reanimated2/layoutReanimation/web/domUtils';\nimport { getViewInfo } from './getViewInfo';\n\nconst IS_WEB = isWeb();\n\nif (IS_WEB) {\n configureWebLayoutAnimations();\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\ntype Options<P> = {\n setNativeProps: (ref: AnimatedComponentRef, props: P) => void;\n};\n\n/**\n * Lets you create an Animated version of any React Native component.\n *\n * @param component - The component you want to make animatable.\n * @returns A component that Reanimated is capable of animating.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent\n */\n\n// Don't change the order of overloads, since such a change breaks current behavior\nexport function createAnimatedComponent<P extends object>(\n component: FunctionComponent<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n component: ComponentClass<P>,\n options?: Options<P>\n): ComponentClass<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n // Actually ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P> but we need this overload too\n // since some external components (like FastImage) are typed just as ComponentType\n component: ComponentType<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>> | ComponentClass<AnimateProps<P>>;\n\n/**\n * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.\n */\n// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList\nexport function createAnimatedComponent(\n component: typeof FlatList<unknown>,\n options?: Options<any>\n): ComponentClass<AnimateProps<FlatListProps<unknown>>>;\n\nlet id = 0;\n\nexport function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): any {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent\n extends React.Component<AnimatedComponentProps<InitialComponentProps>>\n implements IAnimatedComponentInternal\n {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _viewTag = -1;\n _isFirstRender = true;\n jestAnimatedStyle: { value: StyleProps } = { value: {} };\n _component: AnimatedComponentRef | HTMLElement | null = null;\n _sharedElementTransition: SharedTransition | null = null;\n _jsPropsUpdater = new JSPropsUpdater();\n _InlinePropManager = new InlinePropManager();\n _PropsFilter = new PropsFilter();\n _viewInfo?: ViewInfo;\n static displayName: string;\n static contextType = SkipEnteringContext;\n context!: React.ContextType<typeof SkipEnteringContext>;\n nativeID = id++;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.jestAnimatedStyle = { value: {} };\n }\n const entering = this.props.entering;\n if (entering) {\n updateLayoutAnimations(\n this.nativeID,\n LayoutAnimationType.ENTERING,\n maybeBuild(entering, this.props?.style, AnimatedComponent.displayName)\n );\n }\n }\n\n componentDidMount() {\n this._viewTag = this._getViewInfo().viewTag as number;\n this._attachNativeEvents();\n this._jsPropsUpdater.addOnJSPropsChangeListener(this);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n const layout = this.props.layout;\n if (layout) {\n this._configureLayoutTransition();\n }\n\n if (IS_WEB) {\n if (this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n if (\n !this.props.entering ||\n getReducedMotionFromConfig(this.props.entering as CustomConfig)\n ) {\n this._isFirstRender = false;\n return;\n }\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.ENTERING\n );\n }\n\n this._isFirstRender = false;\n }\n\n componentWillUnmount() {\n this._detachNativeEvents();\n this._jsPropsUpdater.removeOnJSPropsChangeListener(this);\n this._detachStyles();\n this._InlinePropManager.detachInlineProps();\n if (this.props.sharedTransitionTag) {\n this._configureSharedTransition(true);\n }\n this._sharedElementTransition?.unregisterTransition(this._viewTag, true);\n\n const exiting = this.props.exiting;\n if (\n IS_WEB &&\n this._component &&\n this.props.exiting &&\n !getReducedMotionFromConfig(this.props.exiting as CustomConfig)\n ) {\n addHTMLMutationObserver();\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.EXITING\n );\n } else if (exiting) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n this._viewTag,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n }\n\n _getEventViewRef() {\n // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n return (this._component as AnimatedComponentRef)?.getScrollableNode\n ? (this._component as AnimatedComponentRef).getScrollableNode?.()\n : this._component;\n }\n\n _attachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler\n ) {\n prop.workletEventHandler.registerForEvents(this._viewTag, key);\n }\n }\n }\n\n _detachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('workletEventHandler', prop) &&\n prop.workletEventHandler instanceof WorkletEventHandler\n ) {\n prop.workletEventHandler.unregisterFromEvents(this._viewTag);\n }\n }\n }\n\n _detachStyles() {\n if (IS_WEB && this._styles !== null) {\n for (const style of this._styles) {\n style.viewsRef.remove(this);\n }\n } else if (this._viewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._viewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(this._viewTag);\n }\n if (isFabric()) {\n removeFromPropsRegistry(this._viewTag);\n }\n }\n }\n\n _updateNativeEvents(\n prevProps: AnimatedComponentProps<InitialComponentProps>\n ) {\n for (const key in prevProps) {\n const prevProp = prevProps[key];\n if (\n has('workletEventHandler', prevProp) &&\n prevProp.workletEventHandler instanceof WorkletEventHandler\n ) {\n const newProp = this.props[key];\n if (!newProp) {\n // Prop got deleted\n prevProp.workletEventHandler.unregisterFromEvents(this._viewTag);\n } else if (\n has('workletEventHandler', newProp) &&\n newProp.workletEventHandler instanceof WorkletEventHandler &&\n newProp.workletEventHandler !== prevProp.workletEventHandler\n ) {\n // Prop got changed\n prevProp.workletEventHandler.unregisterFromEvents(this._viewTag);\n newProp.workletEventHandler.registerForEvents(this._viewTag);\n }\n }\n }\n\n for (const key in this.props) {\n const newProp = this.props[key];\n if (\n has('workletEventHandler', newProp) &&\n newProp.workletEventHandler instanceof WorkletEventHandler &&\n !prevProps[key]\n ) {\n // Prop got added\n newProp.workletEventHandler.registerForEvents(this._viewTag);\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n options.setNativeProps(this._component as AnimatedComponentRef, props);\n } else {\n (this._component as AnimatedComponentRef)?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo(): ViewInfo {\n if (this._viewInfo !== undefined) {\n return this._viewInfo;\n }\n\n let viewTag: number | HTMLElement | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n // Component can specify ref which should be animated when animated version of the component is created.\n // Otherwise, we animate the component itself.\n const component = (this._component as AnimatedComponentRef)\n ?.getAnimatableRef\n ? (this._component as AnimatedComponentRef).getAnimatableRef?.()\n : this;\n\n if (IS_WEB) {\n // At this point I assume that `_setComponentRef` was already called and `_component` is set.\n // `this._component` on web represents HTMLElement of our component, that's why we use casting\n viewTag = this._component as HTMLElement;\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);\n if (!hostInstance) {\n throw new Error(\n '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n\n const viewInfo = getViewInfo(hostInstance);\n viewTag = viewInfo.viewTag;\n viewName = viewInfo.viewName;\n viewConfig = viewInfo.viewConfig;\n shadowNodeWrapper = isFabric()\n ? getShadowNodeWrapperFromRef(this)\n : null;\n }\n this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig };\n return this._viewInfo;\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._viewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n styles[0] === prevStyles[0];\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) => style === prevStyle);\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.jestAnimatedStyle.value = {\n ...this.jestAnimatedStyle.value,\n ...style.initial.value,\n };\n style.jestAnimatedStyle.current = this.jestAnimatedStyle;\n }\n });\n\n // detach old animatedProps\n if (prevAnimatedProps && prevAnimatedProps !== this.props.animatedProps) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>,\n _prevState: Readonly<unknown>,\n // This type comes straight from React\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n snapshot: DOMRect | null\n ) {\n const layout = this.props.layout;\n const oldLayout = prevProps.layout;\n if (layout !== oldLayout) {\n this._configureLayoutTransition();\n }\n if (\n this.props.sharedTransitionTag !== undefined ||\n prevProps.sharedTransitionTag !== undefined\n ) {\n this._configureSharedTransition();\n }\n this._updateNativeEvents(prevProps);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n if (IS_WEB && this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method\n if (\n IS_WEB &&\n snapshot !== null &&\n this.props.layout &&\n !getReducedMotionFromConfig(this.props.layout as CustomConfig)\n ) {\n tryActivateLayoutTransition(\n this.props,\n this._component as HTMLElement,\n snapshot\n );\n }\n }\n\n _configureLayoutTransition() {\n const layout = this.props.layout\n ? maybeBuild(\n this.props.layout,\n undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,\n AnimatedComponent.displayName\n )\n : undefined;\n updateLayoutAnimations(this._viewTag, LayoutAnimationType.LAYOUT, layout);\n }\n\n _configureSharedTransition(isUnmounting = false) {\n if (IS_WEB) {\n return;\n }\n const { sharedTransitionTag } = this.props;\n if (!sharedTransitionTag) {\n this._sharedElementTransition?.unregisterTransition(\n this._viewTag,\n isUnmounting\n );\n this._sharedElementTransition = null;\n return;\n }\n const sharedElementTransition =\n this.props.sharedTransitionStyle ??\n this._sharedElementTransition ??\n new SharedTransition();\n sharedElementTransition.registerTransition(\n this._viewTag,\n sharedTransitionTag,\n isUnmounting\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n\n _setComponentRef = setAndForwardRef<Component | HTMLElement>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n\n const tag = IS_WEB\n ? (ref as HTMLElement)\n : findNodeHandle(ref as Component);\n\n this._viewTag = tag as number;\n\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n\n if (sharedTransitionTag) {\n this._configureSharedTransition();\n }\n if (sharedTransitionTag && !IS_WEB) {\n const sharedElementTransition =\n this.props.sharedTransitionStyle ?? new SharedTransition();\n const reduceMotionInTransition = getReduceMotionFromConfig(\n sharedElementTransition.getReduceMotion()\n );\n if (!reduceMotionInTransition) {\n sharedElementTransition.registerTransition(\n tag as number,\n sharedTransitionTag\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n }\n if (exiting) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n // This is a component lifecycle method from React, therefore we are not calling it directly.\n // It is called before the component gets rerendered. This way we can access components' position before it changed\n // and later on, in componentDidUpdate, calculate translation for layout transition.\n getSnapshotBeforeUpdate() {\n if (\n IS_WEB &&\n (this._component as HTMLElement)?.getBoundingClientRect !== undefined\n ) {\n return (this._component as HTMLElement).getBoundingClientRect();\n }\n\n return null;\n }\n\n render() {\n const filteredProps = this._PropsFilter.filterNonAnimatedProps(this);\n\n if (isJest()) {\n filteredProps.jestAnimatedStyle = this.jestAnimatedStyle;\n }\n\n // Layout animations on web are set inside `componentDidMount` method, which is called after first render.\n // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.\n // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,\n // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.\n if (\n this._isFirstRender &&\n IS_WEB &&\n filteredProps.entering &&\n !getReducedMotionFromConfig(filteredProps.entering as CustomConfig)\n ) {\n filteredProps.style = {\n ...(filteredProps.style ?? {}),\n visibility: 'hidden', // Hide component until `componentDidMount` triggers\n };\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n\n return (\n <Component\n nativeID={`${this.nativeID}`}\n {...filteredProps}\n // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.\n // After spending some time trying to figure out what to do with this problem, we decided to leave it this way\n ref={this._setComponentRef as (ref: Component) => void}\n {...platformProps}\n />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,gBAAAC,GAAA,EAAAN,GAAA,EAAAO,KAAA,IAAAP,GAAA,GAAAQ,cAAA,CAAAR,GAAA,OAAAA,GAAA,IAAAM,GAAA,IAAAd,MAAA,CAAAiB,cAAA,CAAAH,GAAA,EAAAN,GAAA,IAAAO,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAN,GAAA,CAAAN,GAAA,IAAAO,KAAA,WAAAD,GAAA;AAAA,SAAAE,eAAAK,CAAA,QAAAjB,CAAA,GAAAkB,YAAA,CAAAD,CAAA,uCAAAjB,CAAA,GAAAA,CAAA,GAAAA,CAAA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C;AACJ","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
4
+
5
+ // This is a makeshift solution to handle both 0.73 and 0.74 versions of React Native.
6
+ export let getViewInfo = element => {
7
+ if (element._nativeTag !== undefined && element.__nativeTag !== null) {
8
+ getViewInfo = getViewInfo73;
9
+ return getViewInfo73(element);
10
+ } else if (element.__nativeTag !== undefined && element.__nativeTag !== null) {
11
+ getViewInfo = getViewInfoLatest;
12
+ return getViewInfoLatest(element);
13
+ }
14
+ return getViewInfo73(element);
15
+ };
16
+ function getViewInfo73(element) {
17
+ var _element$viewConfig;
18
+ return {
19
+ // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146
20
+ viewName: element === null || element === void 0 || (_element$viewConfig = element.viewConfig) === null || _element$viewConfig === void 0 ? void 0 : _element$viewConfig.uiViewClassName,
21
+ /**
22
+ * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).
23
+ * The name we're looking for is in the field named uiViewClassName.
24
+ */
25
+ viewTag: element === null || element === void 0 ? void 0 : element._nativeTag,
26
+ viewConfig: element === null || element === void 0 ? void 0 : element.viewConfig
27
+ };
28
+ }
29
+ function getViewInfoLatest(element) {
30
+ var _element$_viewConfig;
31
+ return {
32
+ viewName: element === null || element === void 0 || (_element$_viewConfig = element._viewConfig) === null || _element$_viewConfig === void 0 ? void 0 : _element$_viewConfig.uiViewClassName,
33
+ viewTag: element === null || element === void 0 ? void 0 : element.__nativeTag,
34
+ viewConfig: element === null || element === void 0 ? void 0 : element._viewConfig
35
+ };
36
+ }
37
+ //# sourceMappingURL=getViewInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getViewInfo","element","_nativeTag","undefined","__nativeTag","getViewInfo73","getViewInfoLatest","_element$viewConfig","viewName","viewConfig","uiViewClassName","viewTag","_element$_viewConfig","_viewConfig"],"sources":["getViewInfo.ts"],"sourcesContent":["'use strict';\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// This is a makeshift solution to handle both 0.73 and 0.74 versions of React Native.\n\nexport let getViewInfo = (element: any) => {\n if (element._nativeTag !== undefined && element.__nativeTag !== null) {\n getViewInfo = getViewInfo73;\n return getViewInfo73(element);\n } else if (\n element.__nativeTag !== undefined &&\n element.__nativeTag !== null\n ) {\n getViewInfo = getViewInfoLatest;\n return getViewInfoLatest(element);\n }\n return getViewInfo73(element);\n};\n\nfunction getViewInfo73(element: any) {\n return {\n // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146\n viewName: element?.viewConfig?.uiViewClassName,\n /**\n * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).\n * The name we're looking for is in the field named uiViewClassName.\n */\n viewTag: element?._nativeTag,\n viewConfig: element?.viewConfig,\n };\n}\n\nfunction getViewInfoLatest(element: any) {\n return {\n viewName: element?._viewConfig?.uiViewClassName,\n viewTag: element?.__nativeTag,\n viewConfig: element?._viewConfig,\n };\n}\n"],"mappings":"AAAA,YAAY;;AACZ;;AAEA;AAEA,OAAO,IAAIA,WAAW,GAAIC,OAAY,IAAK;EACzC,IAAIA,OAAO,CAACC,UAAU,KAAKC,SAAS,IAAIF,OAAO,CAACG,WAAW,KAAK,IAAI,EAAE;IACpEJ,WAAW,GAAGK,aAAa;IAC3B,OAAOA,aAAa,CAACJ,OAAO,CAAC;EAC/B,CAAC,MAAM,IACLA,OAAO,CAACG,WAAW,KAAKD,SAAS,IACjCF,OAAO,CAACG,WAAW,KAAK,IAAI,EAC5B;IACAJ,WAAW,GAAGM,iBAAiB;IAC/B,OAAOA,iBAAiB,CAACL,OAAO,CAAC;EACnC;EACA,OAAOI,aAAa,CAACJ,OAAO,CAAC;AAC/B,CAAC;AAED,SAASI,aAAaA,CAACJ,OAAY,EAAE;EAAA,IAAAM,mBAAA;EACnC,OAAO;IACL;IACAC,QAAQ,EAAEP,OAAO,aAAPA,OAAO,gBAAAM,mBAAA,GAAPN,OAAO,CAAEQ,UAAU,cAAAF,mBAAA,uBAAnBA,mBAAA,CAAqBG,eAAe;IAC9C;AACJ;AACA;AACA;IACIC,OAAO,EAAEV,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,UAAU;IAC5BO,UAAU,EAAER,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ;EACvB,CAAC;AACH;AAEA,SAASH,iBAAiBA,CAACL,OAAY,EAAE;EAAA,IAAAW,oBAAA;EACvC,OAAO;IACLJ,QAAQ,EAAEP,OAAO,aAAPA,OAAO,gBAAAW,oBAAA,GAAPX,OAAO,CAAEY,WAAW,cAAAD,oBAAA,uBAApBA,oBAAA,CAAsBF,eAAe;IAC/CC,OAAO,EAAEV,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEG,WAAW;IAC7BK,UAAU,EAAER,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEY;EACvB,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["createAnimatedComponent"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { createAnimatedComponent } from './createAnimatedComponent';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B"}
1
+ {"version":3,"names":["createAnimatedComponent"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { createAnimatedComponent } from './createAnimatedComponent';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B","ignoreList":[]}
@@ -35,11 +35,10 @@
35
35
  * module.exports = MyViewWithRef;
36
36
  */
37
37
  /* eslint-enable */
38
- function setAndForwardRef(_ref) {
39
- let {
40
- getForwardedRef,
41
- setLocalRef
42
- } = _ref;
38
+ function setAndForwardRef({
39
+ getForwardedRef,
40
+ setLocalRef
41
+ }) {
43
42
  return function forwardRef(ref) {
44
43
  const forwardedRef = getForwardedRef();
45
44
  setLocalRef(ref);
@@ -1 +1 @@
1
- {"version":3,"names":["setAndForwardRef","_ref","getForwardedRef","setLocalRef","forwardRef","ref","forwardedRef","current"],"sources":["setAndForwardRef.ts"],"sourcesContent":["'use strict';\n/**\n * imported from react-native\n */\n\nimport type { MutableRefObject } from 'react';\n\n/* eslint-disable */\n/**\n * This is a helper function for when a component needs to be able to forward a ref\n * to a child component, but still needs to have access to that component as part of\n * its implementation.\n *\n * Its main use case is in wrappers for native components.\n *\n * Usage:\n *\n * class MyView extends React.Component {\n * _nativeRef = null;\n *\n * _setNativeRef = setAndForwardRef({\n * getForwardedRef: () => this.props.forwardedRef,\n * setLocalRef: ref => {\n * this._nativeRef = ref;\n * },\n * });\n *\n * render() {\n * return <View ref={this._setNativeRef} />;\n * }\n * }\n *\n * const MyViewWithRef = React.forwardRef((props, ref) => (\n * <MyView {...props} forwardedRef={ref} />\n * ));\n *\n * module.exports = MyViewWithRef;\n */\n/* eslint-enable */\n\ntype ForwardedRef<T> = () => MutableRefObject<T> | ((ref: T) => void);\n\nfunction setAndForwardRef<T>({\n getForwardedRef,\n setLocalRef,\n}: {\n getForwardedRef: ForwardedRef<T>;\n setLocalRef: (ref: T) => void;\n}): (ref: T) => void {\n return function forwardRef(ref: T) {\n const forwardedRef = getForwardedRef();\n\n setLocalRef(ref);\n\n // Forward to user ref prop (if one has been specified)\n if (typeof forwardedRef === 'function') {\n // Handle function-based refs. String-based refs are handled as functions.\n forwardedRef(ref);\n } else if (typeof forwardedRef === 'object' && forwardedRef != null) {\n // Handle createRef-based refs\n forwardedRef.current = ref;\n }\n };\n}\n\nexport default setAndForwardRef;\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,gBAAgBA,CAAAC,IAAA,EAMJ;EAAA,IANQ;IAC3BC,eAAe;IACfC;EAIF,CAAC,GAAAF,IAAA;EACC,OAAO,SAASG,UAAUA,CAACC,GAAM,EAAE;IACjC,MAAMC,YAAY,GAAGJ,eAAe,EAAE;IAEtCC,WAAW,CAACE,GAAG,CAAC;;IAEhB;IACA,IAAI,OAAOC,YAAY,KAAK,UAAU,EAAE;MACtC;MACAA,YAAY,CAACD,GAAG,CAAC;IACnB,CAAC,MAAM,IAAI,OAAOC,YAAY,KAAK,QAAQ,IAAIA,YAAY,IAAI,IAAI,EAAE;MACnE;MACAA,YAAY,CAACC,OAAO,GAAGF,GAAG;IAC5B;EACF,CAAC;AACH;AAEA,eAAeL,gBAAgB"}
1
+ {"version":3,"names":["setAndForwardRef","getForwardedRef","setLocalRef","forwardRef","ref","forwardedRef","current"],"sources":["setAndForwardRef.ts"],"sourcesContent":["'use strict';\n/**\n * imported from react-native\n */\n\nimport type { MutableRefObject } from 'react';\n\n/* eslint-disable */\n/**\n * This is a helper function for when a component needs to be able to forward a ref\n * to a child component, but still needs to have access to that component as part of\n * its implementation.\n *\n * Its main use case is in wrappers for native components.\n *\n * Usage:\n *\n * class MyView extends React.Component {\n * _nativeRef = null;\n *\n * _setNativeRef = setAndForwardRef({\n * getForwardedRef: () => this.props.forwardedRef,\n * setLocalRef: ref => {\n * this._nativeRef = ref;\n * },\n * });\n *\n * render() {\n * return <View ref={this._setNativeRef} />;\n * }\n * }\n *\n * const MyViewWithRef = React.forwardRef((props, ref) => (\n * <MyView {...props} forwardedRef={ref} />\n * ));\n *\n * module.exports = MyViewWithRef;\n */\n/* eslint-enable */\n\ntype ForwardedRef<T> = () => MutableRefObject<T> | ((ref: T) => void);\n\nfunction setAndForwardRef<T>({\n getForwardedRef,\n setLocalRef,\n}: {\n getForwardedRef: ForwardedRef<T>;\n setLocalRef: (ref: T) => void;\n}): (ref: T) => void {\n return function forwardRef(ref: T) {\n const forwardedRef = getForwardedRef();\n\n setLocalRef(ref);\n\n // Forward to user ref prop (if one has been specified)\n if (typeof forwardedRef === 'function') {\n // Handle function-based refs. String-based refs are handled as functions.\n forwardedRef(ref);\n } else if (typeof forwardedRef === 'object' && forwardedRef != null) {\n // Handle createRef-based refs\n forwardedRef.current = ref;\n }\n };\n}\n\nexport default setAndForwardRef;\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,gBAAgBA,CAAI;EAC3BC,eAAe;EACfC;AAIF,CAAC,EAAoB;EACnB,OAAO,SAASC,UAAUA,CAACC,GAAM,EAAE;IACjC,MAAMC,YAAY,GAAGJ,eAAe,CAAC,CAAC;IAEtCC,WAAW,CAACE,GAAG,CAAC;;IAEhB;IACA,IAAI,OAAOC,YAAY,KAAK,UAAU,EAAE;MACtC;MACAA,YAAY,CAACD,GAAG,CAAC;IACnB,CAAC,MAAM,IAAI,OAAOC,YAAY,KAAK,QAAQ,IAAIA,YAAY,IAAI,IAAI,EAAE;MACnE;MACAA,YAAY,CAACC,OAAO,GAAGF,GAAG;IAC5B;EACF,CAAC;AACH;AAEA,eAAeJ,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined"],"sources":["utils.ts"],"sourcesContent":["'use strict';\nimport type { NestedArray } from './commonTypes';\n\nexport function flattenArray<T>(array: NestedArray<T>): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray<T>[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nexport const has = <K extends string>(\n key: K,\n x: unknown\n): x is { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACuB;EACjC,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined"],"sources":["utils.ts"],"sourcesContent":["'use strict';\nimport type { NestedArray } from './commonTypes';\n\nexport function flattenArray<T>(array: NestedArray<T>): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray<T>[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nexport const has = <K extends string>(\n key: K,\n x: unknown\n): x is { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACuB;EACjC,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Animated"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport * as Animated from './Animated';\n\nexport * from './reanimated2';\nexport default Animated;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,KAAKA,QAAQ,MAAM,YAAY;AAEtC,cAAc,eAAe;AAC7B,eAAeA,QAAQ"}
1
+ {"version":3,"names":["Animated"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport * as Animated from './Animated';\n\nexport * from './reanimated2';\nexport default Animated;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,KAAKA,QAAQ,MAAM,YAAY;AAEtC,cAAc,eAAe;AAC7B,eAAeA,QAAQ","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
3
  export * from './reanimated2';
4
- import * as _default from './Animated';
5
- export { _default as default }; // If this line fails, you probably forgot some installation steps. Check out the installation guide here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#installation 1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache
4
+ export * as default from './Animated'; // If this line fails, you probably forgot some installation steps. Check out the installation guide here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#installation 1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details) 2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache
6
5
  //# sourceMappingURL=index.web.js.map