react-native-reanimated 3.0.2 → 3.1.0

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 (473) hide show
  1. package/Common/cpp/Fabric/FabricUtils.h +1 -1
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -27
  3. package/Common/cpp/SharedItems/Shareables.h +22 -0
  4. package/Common/cpp/Tools/PlatformDepMethodsHolder.h +2 -0
  5. package/Common/cpp/Tools/RuntimeDecorator.cpp +4 -1
  6. package/Common/cpp/Tools/RuntimeDecorator.h +2 -1
  7. package/Common/cpp/Tools/SingleInstanceChecker.h +14 -2
  8. package/RNReanimated.podspec +5 -2
  9. package/android/CMakeLists.txt +4 -0
  10. package/android/build.gradle +18 -10
  11. package/android/src/main/cpp/NativeProxy.cpp +316 -337
  12. package/android/src/main/cpp/NativeProxy.h +53 -11
  13. package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +7 -12
  14. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +11 -8
  15. package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +21 -14
  16. package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +0 -3
  17. package/ios/Fabric/REAInitializerRCTFabricSurface.mm +1 -0
  18. package/ios/REANodesManager.h +1 -0
  19. package/ios/REANodesManager.mm +30 -4
  20. package/ios/keyboardObserver/REAKeyboardEventObserver.m +51 -130
  21. package/ios/native/NativeMethods.mm +1 -1
  22. package/ios/native/NativeProxy.mm +4 -1
  23. package/ios/native/REAIOSErrorHandler.mm +1 -1
  24. package/ios/native/REAIOSLogger.mm +1 -1
  25. package/ios/native/REAIOSScheduler.mm +1 -1
  26. package/ios/native/REAInitializer.mm +1 -1
  27. package/ios/native/REAMessageThread.mm +2 -2
  28. package/lib/commonjs/Animated.js +0 -8
  29. package/lib/commonjs/Animated.js.map +1 -1
  30. package/lib/commonjs/ConfigHelper.js +8 -19
  31. package/lib/commonjs/ConfigHelper.js.map +1 -1
  32. package/lib/commonjs/createAnimatedComponent.js +20 -158
  33. package/lib/commonjs/createAnimatedComponent.js.map +1 -1
  34. package/lib/commonjs/index.js +0 -9
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/index.web.js +0 -7
  37. package/lib/commonjs/index.web.js.map +1 -1
  38. package/lib/commonjs/reanimated2/Bezier.js +14 -34
  39. package/lib/commonjs/reanimated2/Bezier.js.map +1 -1
  40. package/lib/commonjs/reanimated2/Colors.js +60 -132
  41. package/lib/commonjs/reanimated2/Colors.js.map +1 -1
  42. package/lib/commonjs/reanimated2/Easing.js +81 -34
  43. package/lib/commonjs/reanimated2/Easing.js.map +1 -1
  44. package/lib/commonjs/reanimated2/NativeMethods.js +8 -20
  45. package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -1
  46. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +5 -31
  47. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  48. package/lib/commonjs/reanimated2/NativeReanimated/index.js +0 -7
  49. package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -1
  50. package/lib/commonjs/reanimated2/PlatformChecker.js +0 -6
  51. package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -1
  52. package/lib/commonjs/reanimated2/PropAdapters.js +10 -12
  53. package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -1
  54. package/lib/commonjs/reanimated2/UpdateProps.js +3 -12
  55. package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -1
  56. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +0 -10
  57. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -1
  58. package/lib/commonjs/reanimated2/WorkletEventHandler.js +5 -22
  59. package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -1
  60. package/lib/commonjs/reanimated2/animation/decay.js +7 -18
  61. package/lib/commonjs/reanimated2/animation/decay.js.map +1 -1
  62. package/lib/commonjs/reanimated2/animation/delay.js +0 -11
  63. package/lib/commonjs/reanimated2/animation/delay.js.map +1 -1
  64. package/lib/commonjs/reanimated2/animation/index.js +0 -8
  65. package/lib/commonjs/reanimated2/animation/index.js.map +1 -1
  66. package/lib/commonjs/reanimated2/animation/repeat.js +6 -22
  67. package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -1
  68. package/lib/commonjs/reanimated2/animation/sequence.js +3 -20
  69. package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -1
  70. package/lib/commonjs/reanimated2/animation/spring.js +11 -23
  71. package/lib/commonjs/reanimated2/animation/spring.js.map +1 -1
  72. package/lib/commonjs/reanimated2/animation/styleAnimation.js +3 -35
  73. package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
  74. package/lib/commonjs/reanimated2/animation/timing.js +0 -11
  75. package/lib/commonjs/reanimated2/animation/timing.js.map +1 -1
  76. package/lib/commonjs/reanimated2/animation/util.js +11 -41
  77. package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
  78. package/lib/commonjs/reanimated2/commonTypes.js +16 -23
  79. package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
  80. package/lib/commonjs/reanimated2/component/FlatList.js +0 -16
  81. package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
  82. package/lib/commonjs/reanimated2/component/Image.js +0 -4
  83. package/lib/commonjs/reanimated2/component/Image.js.map +1 -1
  84. package/lib/commonjs/reanimated2/component/ScrollView.js +0 -4
  85. package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -1
  86. package/lib/commonjs/reanimated2/component/Text.js +0 -4
  87. package/lib/commonjs/reanimated2/component/Text.js.map +1 -1
  88. package/lib/commonjs/reanimated2/component/View.js +0 -4
  89. package/lib/commonjs/reanimated2/component/View.js.map +1 -1
  90. package/lib/commonjs/reanimated2/core.js +6 -48
  91. package/lib/commonjs/reanimated2/core.js.map +1 -1
  92. package/lib/commonjs/reanimated2/errors.js +3 -14
  93. package/lib/commonjs/reanimated2/errors.js.map +1 -1
  94. package/lib/commonjs/reanimated2/fabricUtils.js +3 -5
  95. package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -1
  96. package/lib/commonjs/reanimated2/fabricUtils.web.js +1 -3
  97. package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -1
  98. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -12
  99. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  100. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -17
  101. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  102. package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
  103. package/lib/commonjs/reanimated2/hook/Hooks.js +0 -5
  104. package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -1
  105. package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -1
  106. package/lib/commonjs/reanimated2/hook/index.js +0 -12
  107. package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
  108. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +4 -17
  109. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  110. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +2 -9
  111. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  112. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +1 -11
  113. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  114. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +0 -12
  115. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
  116. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +2 -9
  117. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  118. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +8 -23
  119. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  120. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +13 -71
  121. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  122. package/lib/commonjs/reanimated2/hook/useDerivedValue.js +4 -13
  123. package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
  124. package/lib/commonjs/reanimated2/hook/useFrameCallback.js +0 -5
  125. package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -1
  126. package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +0 -7
  127. package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  128. package/lib/commonjs/reanimated2/hook/useSharedValue.js +2 -7
  129. package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -1
  130. package/lib/commonjs/reanimated2/hook/utils.js +8 -39
  131. package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
  132. package/lib/commonjs/reanimated2/index.js +0 -26
  133. package/lib/commonjs/reanimated2/index.js.map +1 -1
  134. package/lib/commonjs/reanimated2/initializers.js +21 -43
  135. package/lib/commonjs/reanimated2/initializers.js.map +1 -1
  136. package/lib/commonjs/reanimated2/interpolateColor.js +6 -43
  137. package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
  138. package/lib/commonjs/reanimated2/interpolation.js +14 -29
  139. package/lib/commonjs/reanimated2/interpolation.js.map +1 -1
  140. package/lib/commonjs/reanimated2/jestUtils.js +11 -44
  141. package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
  142. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +15 -39
  143. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  144. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +9 -28
  145. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
  146. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +7 -37
  147. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
  148. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +5 -18
  149. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -1
  150. package/lib/commonjs/reanimated2/js-reanimated/global.js +2 -9
  151. package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
  152. package/lib/commonjs/reanimated2/js-reanimated/index.js +3 -14
  153. package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
  154. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -26
  155. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  156. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -49
  157. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  158. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -43
  159. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  160. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -5
  161. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  162. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +0 -4
  163. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  164. package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +4 -23
  165. package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  166. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -74
  167. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  168. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -53
  169. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  170. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -63
  171. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  172. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -26
  173. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  174. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -13
  175. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  176. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -23
  177. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  178. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -43
  179. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  180. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -43
  181. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  182. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -23
  183. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  184. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -83
  185. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  186. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -20
  187. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  188. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -22
  189. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  190. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -29
  191. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  192. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -9
  193. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  194. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -11
  195. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  196. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -8
  197. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  198. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -12
  199. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  200. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -12
  201. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  202. package/lib/commonjs/reanimated2/layoutReanimation/index.js +0 -9
  203. package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
  204. package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -17
  205. package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  206. package/lib/commonjs/reanimated2/mappers.js +26 -32
  207. package/lib/commonjs/reanimated2/mappers.js.map +1 -1
  208. package/lib/commonjs/reanimated2/mock.js +5 -15
  209. package/lib/commonjs/reanimated2/mock.js.map +1 -1
  210. package/lib/commonjs/reanimated2/mutables.js +2 -28
  211. package/lib/commonjs/reanimated2/mutables.js.map +1 -1
  212. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +0 -2
  213. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  214. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  215. package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +31 -0
  216. package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
  217. package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +0 -2
  218. package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
  219. package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +14 -0
  220. package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -0
  221. package/lib/commonjs/reanimated2/pluginUtils.js +0 -1
  222. package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -1
  223. package/lib/commonjs/reanimated2/shareables.js +92 -49
  224. package/lib/commonjs/reanimated2/shareables.js.map +1 -1
  225. package/lib/commonjs/reanimated2/threads.js +42 -46
  226. package/lib/commonjs/reanimated2/threads.js.map +1 -1
  227. package/lib/commonjs/reanimated2/utils.js +0 -5
  228. package/lib/commonjs/reanimated2/utils.js.map +1 -1
  229. package/lib/commonjs/reanimated2/valueSetter.js +6 -21
  230. package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
  231. package/lib/commonjs/setAndForwardRef.js +3 -3
  232. package/lib/commonjs/setAndForwardRef.js.map +1 -1
  233. package/lib/module/Animated.js.map +1 -1
  234. package/lib/module/ConfigHelper.js +9 -15
  235. package/lib/module/ConfigHelper.js.map +1 -1
  236. package/lib/module/createAnimatedComponent.js +20 -139
  237. package/lib/module/createAnimatedComponent.js.map +1 -1
  238. package/lib/module/index.js +0 -2
  239. package/lib/module/index.js.map +1 -1
  240. package/lib/module/index.web.js.map +1 -1
  241. package/lib/module/reanimated2/Bezier.js +14 -33
  242. package/lib/module/reanimated2/Bezier.js.map +1 -1
  243. package/lib/module/reanimated2/Colors.js +59 -109
  244. package/lib/module/reanimated2/Colors.js.map +1 -1
  245. package/lib/module/reanimated2/Easing.js +37 -33
  246. package/lib/module/reanimated2/Easing.js.map +1 -1
  247. package/lib/module/reanimated2/NativeMethods.js +8 -15
  248. package/lib/module/reanimated2/NativeMethods.js.map +1 -1
  249. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +5 -27
  250. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
  251. package/lib/module/reanimated2/NativeReanimated/index.js +0 -2
  252. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
  253. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  254. package/lib/module/reanimated2/PropAdapters.js +12 -10
  255. package/lib/module/reanimated2/PropAdapters.js.map +1 -1
  256. package/lib/module/reanimated2/UpdateProps.js +3 -5
  257. package/lib/module/reanimated2/UpdateProps.js.map +1 -1
  258. package/lib/module/reanimated2/ViewDescriptorsSet.js +0 -6
  259. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
  260. package/lib/module/reanimated2/WorkletEventHandler.js +5 -18
  261. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
  262. package/lib/module/reanimated2/animation/decay.js +7 -15
  263. package/lib/module/reanimated2/animation/decay.js.map +1 -1
  264. package/lib/module/reanimated2/animation/delay.js +0 -9
  265. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  266. package/lib/module/reanimated2/animation/index.js.map +1 -1
  267. package/lib/module/reanimated2/animation/repeat.js +6 -20
  268. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  269. package/lib/module/reanimated2/animation/sequence.js +3 -18
  270. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  271. package/lib/module/reanimated2/animation/spring.js +11 -21
  272. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  273. package/lib/module/reanimated2/animation/styleAnimation.js +7 -31
  274. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
  275. package/lib/module/reanimated2/animation/timing.js +0 -8
  276. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  277. package/lib/module/reanimated2/animation/util.js +10 -33
  278. package/lib/module/reanimated2/animation/util.js.map +1 -1
  279. package/lib/module/reanimated2/commonTypes.js +12 -19
  280. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  281. package/lib/module/reanimated2/component/FlatList.js +0 -4
  282. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  283. package/lib/module/reanimated2/component/Image.js.map +1 -1
  284. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  285. package/lib/module/reanimated2/component/Text.js.map +1 -1
  286. package/lib/module/reanimated2/component/View.js.map +1 -1
  287. package/lib/module/reanimated2/core.js +6 -22
  288. package/lib/module/reanimated2/core.js.map +1 -1
  289. package/lib/module/reanimated2/errors.js +3 -13
  290. package/lib/module/reanimated2/errors.js.map +1 -1
  291. package/lib/module/reanimated2/fabricUtils.js +3 -3
  292. package/lib/module/reanimated2/fabricUtils.js.map +1 -1
  293. package/lib/module/reanimated2/fabricUtils.web.js +1 -1
  294. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
  295. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -8
  296. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
  297. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -15
  298. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
  299. package/lib/module/reanimated2/globals.d.js.map +1 -1
  300. package/lib/module/reanimated2/hook/Hooks.js +3 -2
  301. package/lib/module/reanimated2/hook/Hooks.js.map +1 -1
  302. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
  303. package/lib/module/reanimated2/hook/index.js.map +1 -1
  304. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +3 -14
  305. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
  306. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +2 -5
  307. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  308. package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -7
  309. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  310. package/lib/module/reanimated2/hook/useAnimatedRef.js +0 -6
  311. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  312. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +2 -7
  313. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  314. package/lib/module/reanimated2/hook/useAnimatedSensor.js +9 -20
  315. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  316. package/lib/module/reanimated2/hook/useAnimatedStyle.js +13 -59
  317. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  318. package/lib/module/reanimated2/hook/useDerivedValue.js +4 -8
  319. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  320. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  321. package/lib/module/reanimated2/hook/useScrollViewOffset.js +0 -1
  322. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  323. package/lib/module/reanimated2/hook/useSharedValue.js +2 -3
  324. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  325. package/lib/module/reanimated2/hook/utils.js +8 -21
  326. package/lib/module/reanimated2/hook/utils.js.map +1 -1
  327. package/lib/module/reanimated2/index.js.map +1 -1
  328. package/lib/module/reanimated2/initializers.js +23 -37
  329. package/lib/module/reanimated2/initializers.js.map +1 -1
  330. package/lib/module/reanimated2/interpolateColor.js +5 -34
  331. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  332. package/lib/module/reanimated2/interpolation.js +13 -28
  333. package/lib/module/reanimated2/interpolation.js.map +1 -1
  334. package/lib/module/reanimated2/jestUtils.js +11 -35
  335. package/lib/module/reanimated2/jestUtils.js.map +1 -1
  336. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +15 -35
  337. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
  338. package/lib/module/reanimated2/js-reanimated/Mapper.js +9 -23
  339. package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
  340. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +7 -35
  341. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
  342. package/lib/module/reanimated2/js-reanimated/MutableValue.js +5 -16
  343. package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -1
  344. package/lib/module/reanimated2/js-reanimated/global.js +2 -6
  345. package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
  346. package/lib/module/reanimated2/js-reanimated/index.js +3 -9
  347. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
  348. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -23
  349. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  350. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -45
  351. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  352. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -39
  353. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  354. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +3 -3
  355. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  356. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
  357. package/lib/module/reanimated2/layoutReanimation/animationsManager.js +4 -19
  358. package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
  359. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -52
  360. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  361. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -32
  362. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  363. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -38
  364. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  365. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -16
  366. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  367. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -8
  368. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  369. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -14
  370. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  371. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -26
  372. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  373. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -26
  374. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  375. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -14
  376. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  377. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -50
  378. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  379. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
  380. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -17
  381. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  382. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -23
  383. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  384. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -5
  385. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  386. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -6
  387. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  388. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -5
  389. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  390. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -8
  391. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  392. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
  393. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
  394. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -13
  395. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
  396. package/lib/module/reanimated2/mappers.js +26 -25
  397. package/lib/module/reanimated2/mappers.js.map +1 -1
  398. package/lib/module/reanimated2/mock.js +5 -15
  399. package/lib/module/reanimated2/mock.js.map +1 -1
  400. package/lib/module/reanimated2/mutables.js +2 -19
  401. package/lib/module/reanimated2/mutables.js.map +1 -1
  402. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
  403. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
  404. package/lib/module/reanimated2/platform-specific/checkCppVersion.js +24 -0
  405. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
  406. package/lib/module/reanimated2/platform-specific/checkVersion.web.js +0 -1
  407. package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
  408. package/lib/module/reanimated2/platform-specific/jsVersion.js +7 -0
  409. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -0
  410. package/lib/module/reanimated2/pluginUtils.js.map +1 -1
  411. package/lib/module/reanimated2/shareables.js +96 -44
  412. package/lib/module/reanimated2/shareables.js.map +1 -1
  413. package/lib/module/reanimated2/threads.js +39 -33
  414. package/lib/module/reanimated2/threads.js.map +1 -1
  415. package/lib/module/reanimated2/utils.js +0 -3
  416. package/lib/module/reanimated2/utils.js.map +1 -1
  417. package/lib/module/reanimated2/valueSetter.js +6 -19
  418. package/lib/module/reanimated2/valueSetter.js.map +1 -1
  419. package/lib/module/setAndForwardRef.js +3 -2
  420. package/lib/module/setAndForwardRef.js.map +1 -1
  421. package/package.json +46 -40
  422. package/plugin/.eslintrc.js +7 -0
  423. package/plugin/README.md +241 -0
  424. package/plugin/build/plugin.js +714 -0
  425. package/plugin/build/plugin.js.map +7 -0
  426. package/plugin/index.js +1 -807
  427. package/plugin/package.json +23 -0
  428. package/plugin/src/buildWorkletString.ts +213 -0
  429. package/plugin/src/commonObjects.ts +60 -0
  430. package/plugin/src/injectVersion.ts +37 -0
  431. package/plugin/src/makeWorklet.ts +375 -0
  432. package/plugin/src/plugin.ts +49 -0
  433. package/plugin/src/processForCalleesWorklets.ts +106 -0
  434. package/plugin/src/processIfGestureHandlerEventCallbackFunctionNode.ts +156 -0
  435. package/plugin/src/processIfWorkletFunction.ts +55 -0
  436. package/plugin/src/processIfWorkletNode.ts +44 -0
  437. package/plugin/src/processInlineStylesWarning.ts +129 -0
  438. package/plugin/src/processWorkletObjectMethod.ts +31 -0
  439. package/plugin/src/types.ts +15 -0
  440. package/plugin/src/utils.ts +6 -0
  441. package/plugin/tsconfig.json +15 -0
  442. package/plugin/yarn.lock +2193 -0
  443. package/react-native-reanimated.d.ts +1 -0
  444. package/scripts/reanimated_utils.rb +2 -2
  445. package/src/createAnimatedComponent.tsx +2 -3
  446. package/src/reanimated2/Easing.ts +19 -0
  447. package/src/reanimated2/NativeMethods.ts +9 -4
  448. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +2 -2
  449. package/src/reanimated2/UpdateProps.ts +2 -2
  450. package/src/reanimated2/animation/decay.ts +7 -1
  451. package/src/reanimated2/animation/styleAnimation.ts +5 -1
  452. package/src/reanimated2/core.ts +4 -4
  453. package/src/reanimated2/errors.ts +1 -0
  454. package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +12 -4
  455. package/src/reanimated2/globals.d.ts +71 -112
  456. package/src/reanimated2/hook/commonTypes.ts +1 -1
  457. package/src/reanimated2/hook/useAnimatedReaction.ts +2 -2
  458. package/src/reanimated2/hook/useAnimatedSensor.ts +2 -2
  459. package/src/reanimated2/initializers.ts +11 -8
  460. package/src/reanimated2/jestUtils.ts +0 -1
  461. package/src/reanimated2/js-reanimated/JSReanimated.ts +5 -1
  462. package/src/reanimated2/js-reanimated/index.ts +1 -1
  463. package/src/reanimated2/mappers.ts +26 -4
  464. package/src/reanimated2/mock.ts +1 -0
  465. package/src/reanimated2/platform-specific/checkCppVersion.ts +29 -0
  466. package/src/reanimated2/platform-specific/jsVersion.ts +6 -0
  467. package/src/reanimated2/shareables.ts +107 -8
  468. package/src/reanimated2/threads.ts +36 -17
  469. package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +0 -42
  470. package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +0 -1
  471. package/lib/module/reanimated2/platform-specific/checkVersion.js +0 -35
  472. package/lib/module/reanimated2/platform-specific/checkVersion.js.map +0 -1
  473. package/src/reanimated2/platform-specific/checkVersion.ts +0 -39
@@ -1 +1 @@
1
- {"version":3,"names":["configureProps","jsiConfigureProps","UI_THREAD_PROPS_WHITELIST","opacity","transform","backgroundColor","borderRightColor","borderBottomColor","borderColor","borderEndColor","borderLeftColor","borderStartColor","borderTopColor","shadowOpacity","shadowRadius","scaleX","scaleY","translateX","translateY","NATIVE_THREAD_PROPS_WHITELIST","borderBottomWidth","borderEndWidth","borderLeftWidth","borderRightWidth","borderStartWidth","borderTopWidth","borderWidth","bottom","flex","flexGrow","flexShrink","height","left","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","right","start","top","width","zIndex","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderRadius","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","elevation","fontSize","lineHeight","textShadowRadius","letterSpacing","display","backfaceVisibility","overflow","resizeMode","fontStyle","fontWeight","textAlign","textDecorationLine","fontFamily","textAlignVertical","fontVariant","textDecorationStyle","textTransform","writingDirection","color","tintColor","shadowColor","placeholderTextColor","Object","keys","addWhitelistedNativeProps","props","oldSize","length","addWhitelistedUIProps","PROCESSED_VIEW_NAMES","Set","adaptViewConfig","viewConfig","viewName","uiViewClassName","validAttributes","has","propsToAdd","forEach","key","add"],"sources":["ConfigHelper.ts"],"sourcesContent":["import { configureProps as jsiConfigureProps } from './reanimated2/core';\n\n/**\n * Styles allowed to be direcly updated in UI thread\n */\nlet UI_THREAD_PROPS_WHITELIST: Record<string, boolean> = {\n opacity: true,\n transform: true,\n /* colors */\n backgroundColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderStartColor: true,\n borderTopColor: true,\n /* ios styles */\n shadowOpacity: true,\n shadowRadius: true,\n /* legacy android transform properties */\n scaleX: true,\n scaleY: true,\n translateX: true,\n translateY: true,\n};\n\n/**\n * Whitelist of view props that can be updated in native thread via UIManagerModule\n */\nlet NATIVE_THREAD_PROPS_WHITELIST: Record<string, boolean> = {\n borderBottomWidth: true,\n borderEndWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderStartWidth: true,\n borderTopWidth: true,\n borderWidth: true,\n bottom: true,\n flex: true,\n flexGrow: true,\n flexShrink: true,\n height: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderRadius: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n elevation: true,\n fontSize: true,\n lineHeight: true,\n textShadowRadius: true,\n letterSpacing: true,\n /* strings */\n display: true,\n backfaceVisibility: true,\n overflow: true,\n resizeMode: true,\n fontStyle: true,\n fontWeight: true,\n textAlign: true,\n textDecorationLine: true,\n fontFamily: true,\n textAlignVertical: true,\n fontVariant: true,\n textDecorationStyle: true,\n textTransform: true,\n writingDirection: true,\n /* text color */\n color: true,\n tintColor: true,\n shadowColor: true,\n placeholderTextColor: true,\n};\n\nfunction configureProps(): void {\n jsiConfigureProps(\n Object.keys(UI_THREAD_PROPS_WHITELIST),\n Object.keys(NATIVE_THREAD_PROPS_WHITELIST)\n );\n}\n\nexport function addWhitelistedNativeProps(\n props: Record<string, boolean>\n): void {\n const oldSize = Object.keys(NATIVE_THREAD_PROPS_WHITELIST).length;\n NATIVE_THREAD_PROPS_WHITELIST = {\n ...NATIVE_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (oldSize !== Object.keys(NATIVE_THREAD_PROPS_WHITELIST).length) {\n configureProps();\n }\n}\n\nexport function addWhitelistedUIProps(props: Record<string, boolean>): void {\n const oldSize = Object.keys(UI_THREAD_PROPS_WHITELIST).length;\n UI_THREAD_PROPS_WHITELIST = { ...UI_THREAD_PROPS_WHITELIST, ...props };\n if (oldSize !== Object.keys(UI_THREAD_PROPS_WHITELIST).length) {\n configureProps();\n }\n}\n\nconst PROCESSED_VIEW_NAMES = new Set();\n\ninterface ViewConfig {\n uiViewClassName: string;\n validAttributes: Record<string, unknown>;\n}\n/**\n * updates UI props whitelist for given view host instance\n * this will work just once for every view name\n */\n\nexport function adaptViewConfig(viewConfig: ViewConfig): void {\n const viewName = viewConfig.uiViewClassName;\n const props = viewConfig.validAttributes;\n\n // update whitelist of UI props for this view name only once\n if (!PROCESSED_VIEW_NAMES.has(viewName)) {\n const propsToAdd: Record<string, boolean> = {};\n Object.keys(props).forEach((key) => {\n // we don't want to add native props as they affect layout\n // we also skip props which repeat here\n if (\n !(key in NATIVE_THREAD_PROPS_WHITELIST) &&\n !(key in UI_THREAD_PROPS_WHITELIST)\n ) {\n propsToAdd[key] = true;\n }\n });\n addWhitelistedUIProps(propsToAdd);\n\n PROCESSED_VIEW_NAMES.add(viewName);\n }\n}\n\nconfigureProps();\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,iBAA3B,QAAoD,oBAApD;AAEA;AACA;AACA;;AACA,IAAIC,yBAAkD,GAAG;EACvDC,OAAO,EAAE,IAD8C;EAEvDC,SAAS,EAAE,IAF4C;;EAGvD;EACAC,eAAe,EAAE,IAJsC;EAKvDC,gBAAgB,EAAE,IALqC;EAMvDC,iBAAiB,EAAE,IANoC;EAOvDC,WAAW,EAAE,IAP0C;EAQvDC,cAAc,EAAE,IARuC;EASvDC,eAAe,EAAE,IATsC;EAUvDC,gBAAgB,EAAE,IAVqC;EAWvDC,cAAc,EAAE,IAXuC;;EAYvD;EACAC,aAAa,EAAE,IAbwC;EAcvDC,YAAY,EAAE,IAdyC;;EAevD;EACAC,MAAM,EAAE,IAhB+C;EAiBvDC,MAAM,EAAE,IAjB+C;EAkBvDC,UAAU,EAAE,IAlB2C;EAmBvDC,UAAU,EAAE;AAnB2C,CAAzD;AAsBA;AACA;AACA;;AACA,IAAIC,6BAAsD,GAAG;EAC3DC,iBAAiB,EAAE,IADwC;EAE3DC,cAAc,EAAE,IAF2C;EAG3DC,eAAe,EAAE,IAH0C;EAI3DC,gBAAgB,EAAE,IAJyC;EAK3DC,gBAAgB,EAAE,IALyC;EAM3DC,cAAc,EAAE,IAN2C;EAO3DC,WAAW,EAAE,IAP8C;EAQ3DC,MAAM,EAAE,IARmD;EAS3DC,IAAI,EAAE,IATqD;EAU3DC,QAAQ,EAAE,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C,IAAP,CAAY3F,yBAAZ,EAAuC+F,MAAvD;EACA/F,yBAAyB,GAAG,EAAE,GAAGA,yBAAL;IAAgC,GAAG6F;EAAnC,CAA5B;;EACA,IAAIC,OAAO,KAAKJ,MAAM,CAACC,IAAP,CAAY3F,yBAAZ,EAAuC+F,MAAvD,EAA+D;IAC7DjG,cAAc;EACf;AACF;AAED,MAAMmG,oBAAoB,GAAG,IAAIC,GAAJ,EAA7B;;AAMA;AACA;AACA;AACA;AAEA,OAAO,SAASC,eAAT,CAAyBC,UAAzB,EAAuD;EAC5D,MAAMC,QAAQ,GAAGD,UAAU,CAACE,eAA5B;EACA,MAAMT,KAAK,GAAGO,UAAU,CAACG,eAAzB,CAF4D,CAI5D;;EACA,IAAI,CAACN,oBAAoB,CAACO,GAArB,CAAyBH,QAAzB,CAAL,EAAyC;IACvC,MAAMI,UAAmC,GAAG,EAA5C;IACAf,MAAM,CAACC,IAAP,CAAYE,KAAZ,EAAmBa,OAAnB,CAA4BC,GAAD,IAAS;MAClC;MACA;MACA,IACE,EAAEA,GAAG,IAAI1F,6BAAT,KACA,EAAE0F,GAAG,IAAI3G,yBAAT,CAFF,EAGE;QACAyG,UAAU,CAACE,GAAD,CAAV,GAAkB,IAAlB;MACD;IACF,CATD;IAUAX,qBAAqB,CAACS,UAAD,CAArB;IAEAR,oBAAoB,CAACW,GAArB,CAAyBP,QAAzB;EACD;AACF;AAEDvG,cAAc"}
1
+ {"version":3,"names":["configureProps","jsiConfigureProps","UI_THREAD_PROPS_WHITELIST","opacity","transform","backgroundColor","borderRightColor","borderBottomColor","borderColor","borderEndColor","borderLeftColor","borderStartColor","borderTopColor","shadowOpacity","shadowRadius","scaleX","scaleY","translateX","translateY","NATIVE_THREAD_PROPS_WHITELIST","borderBottomWidth","borderEndWidth","borderLeftWidth","borderRightWidth","borderStartWidth","borderTopWidth","borderWidth","bottom","flex","flexGrow","flexShrink","height","left","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","right","start","top","width","zIndex","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderRadius","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","elevation","fontSize","lineHeight","textShadowRadius","letterSpacing","display","backfaceVisibility","overflow","resizeMode","fontStyle","fontWeight","textAlign","textDecorationLine","fontFamily","textAlignVertical","fontVariant","textDecorationStyle","textTransform","writingDirection","color","tintColor","shadowColor","placeholderTextColor","Object","keys","addWhitelistedNativeProps","props","oldSize","length","addWhitelistedUIProps","PROCESSED_VIEW_NAMES","Set","adaptViewConfig","viewConfig","viewName","uiViewClassName","validAttributes","has","propsToAdd","forEach","key","add"],"sources":["ConfigHelper.ts"],"sourcesContent":["import { configureProps as jsiConfigureProps } from './reanimated2/core';\n\n/**\n * Styles allowed to be direcly updated in UI thread\n */\nlet UI_THREAD_PROPS_WHITELIST: Record<string, boolean> = {\n opacity: true,\n transform: true,\n /* colors */\n backgroundColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderStartColor: true,\n borderTopColor: true,\n /* ios styles */\n shadowOpacity: true,\n shadowRadius: true,\n /* legacy android transform properties */\n scaleX: true,\n scaleY: true,\n translateX: true,\n translateY: true,\n};\n\n/**\n * Whitelist of view props that can be updated in native thread via UIManagerModule\n */\nlet NATIVE_THREAD_PROPS_WHITELIST: Record<string, boolean> = {\n borderBottomWidth: true,\n borderEndWidth: true,\n borderLeftWidth: true,\n borderRightWidth: true,\n borderStartWidth: true,\n borderTopWidth: true,\n borderWidth: true,\n bottom: true,\n flex: true,\n flexGrow: true,\n flexShrink: true,\n height: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderRadius: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n elevation: true,\n fontSize: true,\n lineHeight: true,\n textShadowRadius: true,\n letterSpacing: true,\n /* strings */\n display: true,\n backfaceVisibility: true,\n overflow: true,\n resizeMode: true,\n fontStyle: true,\n fontWeight: true,\n textAlign: true,\n textDecorationLine: true,\n fontFamily: true,\n textAlignVertical: true,\n fontVariant: true,\n textDecorationStyle: true,\n textTransform: true,\n writingDirection: true,\n /* text color */\n color: true,\n tintColor: true,\n shadowColor: true,\n placeholderTextColor: true,\n};\n\nfunction configureProps(): void {\n jsiConfigureProps(\n Object.keys(UI_THREAD_PROPS_WHITELIST),\n Object.keys(NATIVE_THREAD_PROPS_WHITELIST)\n );\n}\n\nexport function addWhitelistedNativeProps(\n props: Record<string, boolean>\n): void {\n const oldSize = Object.keys(NATIVE_THREAD_PROPS_WHITELIST).length;\n NATIVE_THREAD_PROPS_WHITELIST = {\n ...NATIVE_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (oldSize !== Object.keys(NATIVE_THREAD_PROPS_WHITELIST).length) {\n configureProps();\n }\n}\n\nexport function addWhitelistedUIProps(props: Record<string, boolean>): void {\n const oldSize = Object.keys(UI_THREAD_PROPS_WHITELIST).length;\n UI_THREAD_PROPS_WHITELIST = { ...UI_THREAD_PROPS_WHITELIST, ...props };\n if (oldSize !== Object.keys(UI_THREAD_PROPS_WHITELIST).length) {\n configureProps();\n }\n}\n\nconst PROCESSED_VIEW_NAMES = new Set();\n\ninterface ViewConfig {\n uiViewClassName: string;\n validAttributes: Record<string, unknown>;\n}\n/**\n * updates UI props whitelist for given view host instance\n * this will work just once for every view name\n */\n\nexport function adaptViewConfig(viewConfig: ViewConfig): void {\n const viewName = viewConfig.uiViewClassName;\n const props = viewConfig.validAttributes;\n\n // update whitelist of UI props for this view name only once\n if (!PROCESSED_VIEW_NAMES.has(viewName)) {\n const propsToAdd: Record<string, boolean> = {};\n Object.keys(props).forEach((key) => {\n // we don't want to add native props as they affect layout\n // we also skip props which repeat here\n if (\n !(key in NATIVE_THREAD_PROPS_WHITELIST) &&\n !(key in UI_THREAD_PROPS_WHITELIST)\n ) {\n propsToAdd[key] = true;\n }\n });\n addWhitelistedUIProps(propsToAdd);\n\n PROCESSED_VIEW_NAMES.add(viewName);\n }\n}\n\nconfigureProps();\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,iBAAiB,QAAQ,oBAAoB;;AAExE;AACA;AACA;AACA,IAAIC,yBAAkD,GAAG;EACvDC,OAAO,EAAE,IAAI;EACbC,SAAS,EAAE,IAAI;EACf;EACAC,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,iBAAiB,EAAE,IAAI;EACvBC,WAAW,EAAE,IAAI;EACjBC,cAAc,EAAE,IAAI;EACpBC,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,cAAc,EAAE,IAAI;EACpB;EACAC,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,IAAI;EAClB;EACAC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,IAAI;EAChBC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA,IAAIC,6BAAsD,GAAG;EAC3DC,iBAAiB,EAAE,IAAI;EACvBC,cAAc,EAAE,IAAI;EACpBC,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,gBAAgB,E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AACC,IAAI,CAAC3F,yBAAyB,CAAC,CAAC+F,MAAM,EAAE;IAC7DjG,cAAc,EAAE;EAClB;AACF;AAEA,MAAMmG,oBAAoB,GAAG,IAAIC,GAAG,EAAE;AAMtC;AACA;AACA;AACA;;AAEA,OAAO,SAASC,eAAeA,CAACC,UAAsB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,UAAU,CAACE,eAAe;EAC3C,MAAMT,KAAK,GAAGO,UAAU,CAACG,eAAe;;EAExC;EACA,IAAI,CAACN,oBAAoB,CAACO,GAAG,CAACH,QAAQ,CAAC,EAAE;IACvC,MAAMI,UAAmC,GAAG,CAAC,CAAC;IAC9Cf,MAAM,CAACC,IAAI,CAACE,KAAK,CAAC,CAACa,OAAO,CAAEC,GAAG,IAAK;MAClC;MACA;MACA,IACE,EAAEA,GAAG,IAAI1F,6BAA6B,CAAC,IACvC,EAAE0F,GAAG,IAAI3G,yBAAyB,CAAC,EACnC;QACAyG,UAAU,CAACE,GAAG,CAAC,GAAG,IAAI;MACxB;IACF,CAAC,CAAC;IACFX,qBAAqB,CAACS,UAAU,CAAC;IAEjCR,oBAAoB,CAACW,GAAG,CAACP,QAAQ,CAAC;EACpC;AACF;AAEAvG,cAAc,EAAE"}
@@ -1,7 +1,7 @@
1
1
  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); }
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ 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
5
  import React from 'react';
6
6
  import { findNodeHandle, Platform, StyleSheet } from 'react-native';
7
7
  import WorkletEventHandler from './reanimated2/WorkletEventHandler';
@@ -19,28 +19,23 @@ import { getShadowNodeWrapperFromRef } from './reanimated2/fabricUtils';
19
19
  import updateProps from './reanimated2/UpdateProps';
20
20
  import NativeReanimatedModule from './reanimated2/NativeReanimated';
21
21
  import { isSharedValue } from './reanimated2';
22
-
23
- function dummyListener() {// empty listener we use to assign to listener properties for which animated
22
+ function dummyListener() {
23
+ // empty listener we use to assign to listener properties for which animated
24
24
  // event is used.
25
25
  }
26
-
27
26
  function maybeBuild(layoutAnimationOrBuilder) {
28
27
  const isAnimationBuilder = value => 'build' in layoutAnimationOrBuilder && typeof layoutAnimationOrBuilder.build === 'function';
29
-
30
28
  if (isAnimationBuilder(layoutAnimationOrBuilder)) {
31
29
  return layoutAnimationOrBuilder.build();
32
30
  } else {
33
31
  return layoutAnimationOrBuilder;
34
32
  }
35
33
  }
36
-
37
34
  function flattenArray(array) {
38
35
  if (!Array.isArray(array)) {
39
36
  return [array];
40
37
  }
41
-
42
38
  const resultArr = [];
43
-
44
39
  const _flattenArray = arr => {
45
40
  arr.forEach(item => {
46
41
  if (Array.isArray(item)) {
@@ -50,24 +45,18 @@ function flattenArray(array) {
50
45
  }
51
46
  });
52
47
  };
53
-
54
48
  _flattenArray(array);
55
-
56
49
  return resultArr;
57
50
  }
58
-
59
51
  function onlyAnimatedStyles(styles) {
60
52
  return styles.filter(style => style === null || style === void 0 ? void 0 : style.viewDescriptors);
61
53
  }
62
-
63
54
  function isSameAnimatedStyle(style1, style2) {
64
55
  // We cannot use equality check to compare useAnimatedStyle outputs directly.
65
56
  // Instead, we can compare its viewsRefs.
66
57
  return (style1 === null || style1 === void 0 ? void 0 : style1.viewsRef) === (style2 === null || style2 === void 0 ? void 0 : style2.viewsRef);
67
58
  }
68
-
69
59
  const isSameAnimatedProps = isSameAnimatedStyle;
70
-
71
60
  const has = (key, x) => {
72
61
  if (typeof x === 'function' || typeof x === 'object') {
73
62
  if (x === null || x === undefined) {
@@ -76,42 +65,33 @@ const has = (key, x) => {
76
65
  return key in x;
77
66
  }
78
67
  }
79
-
80
68
  return false;
81
69
  };
82
-
83
70
  function isInlineStyleTransform(transform) {
84
71
  if (!transform) {
85
72
  return false;
86
73
  }
87
-
88
74
  return transform.some(t => hasInlineStyles(t));
89
75
  }
90
-
91
76
  function hasInlineStyles(style) {
92
77
  if (!style) {
93
78
  return false;
94
79
  }
95
-
96
80
  return Object.keys(style).some(key => {
97
81
  const styleValue = style[key];
98
82
  return isSharedValue(styleValue) || key === 'transform' && isInlineStyleTransform(styleValue);
99
83
  });
100
84
  }
101
-
102
85
  function extractSharedValuesMapFromProps(props) {
103
86
  const inlineProps = {};
104
-
105
87
  for (const key in props) {
106
88
  const value = props[key];
107
-
108
89
  if (key === 'style') {
109
90
  const styles = flattenArray(props.style ?? []);
110
91
  styles.forEach(style => {
111
92
  if (!style) {
112
93
  return;
113
94
  }
114
-
115
95
  for (const [key, styleValue] of Object.entries(style)) {
116
96
  if (isSharedValue(styleValue)) {
117
97
  inlineProps[key] = styleValue;
@@ -124,27 +104,21 @@ function extractSharedValuesMapFromProps(props) {
124
104
  inlineProps[key] = value;
125
105
  }
126
106
  }
127
-
128
107
  return inlineProps;
129
108
  }
130
-
131
109
  function inlinePropsHasChanged(styles1, styles2) {
132
110
  if (Object.keys(styles1).length !== Object.keys(styles2).length) {
133
111
  return true;
134
112
  }
135
-
136
113
  for (const key of Object.keys(styles1)) {
137
114
  if (styles1[key] !== styles2[key]) return true;
138
115
  }
139
-
140
116
  return false;
141
117
  }
142
-
143
118
  function getInlinePropsUpdate(inlineProps) {
144
119
  'worklet';
145
120
 
146
121
  const update = {};
147
-
148
122
  for (const [key, styleValue] of Object.entries(inlineProps)) {
149
123
  if (key === 'transform') {
150
124
  update[key] = styleValue.map(transform => {
@@ -156,39 +130,25 @@ function getInlinePropsUpdate(inlineProps) {
156
130
  update[key] = styleValue;
157
131
  }
158
132
  }
159
-
160
133
  return update;
161
134
  }
162
-
163
135
  export default function createAnimatedComponent(Component, options) {
164
- invariant(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, '`createAnimatedComponent` does not support stateless functional components; ' + 'use a class component instead.');
165
-
136
+ 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.`);
166
137
  class AnimatedComponent extends React.Component {
167
138
  constructor(props) {
168
139
  super(props);
169
-
170
140
  _defineProperty(this, "_styles", null);
171
-
172
141
  _defineProperty(this, "_animatedProps", void 0);
173
-
174
142
  _defineProperty(this, "_viewTag", -1);
175
-
176
143
  _defineProperty(this, "_isFirstRender", true);
177
-
178
144
  _defineProperty(this, "animatedStyle", {
179
145
  value: {}
180
146
  });
181
-
182
147
  _defineProperty(this, "initialStyle", {});
183
-
184
148
  _defineProperty(this, "_component", null);
185
-
186
149
  _defineProperty(this, "_inlinePropsViewDescriptors", null);
187
-
188
150
  _defineProperty(this, "_inlinePropsMapperId", null);
189
-
190
151
  _defineProperty(this, "_inlineProps", {});
191
-
192
152
  _defineProperty(this, "_setComponentRef", setAndForwardRef({
193
153
  getForwardedRef: () => this.props.forwardedRef,
194
154
  setLocalRef: ref => {
@@ -200,91 +160,69 @@ export default function createAnimatedComponent(Component, options) {
200
160
  exiting,
201
161
  sharedTransitionTag
202
162
  } = this.props;
203
-
204
163
  if ((layout || entering || exiting || sharedTransitionTag) && tag != null) {
205
164
  if (!shouldBeUseWeb()) {
206
165
  enableLayoutAnimations(true, false);
207
166
  }
208
-
209
167
  if (layout) {
210
168
  configureLayoutAnimations(tag, LayoutAnimationType.LAYOUT, maybeBuild(layout));
211
169
  }
212
-
213
170
  if (entering) {
214
171
  configureLayoutAnimations(tag, LayoutAnimationType.ENTERING, maybeBuild(entering));
215
172
  }
216
-
217
173
  if (exiting) {
218
174
  configureLayoutAnimations(tag, LayoutAnimationType.EXITING, maybeBuild(exiting));
219
175
  }
220
-
221
176
  if (sharedTransitionTag) {
222
177
  const sharedElementTransition = this.props.sharedTransitionStyle ?? DefaultSharedTransition;
223
178
  configureLayoutAnimations(tag, LayoutAnimationType.SHARED_ELEMENT_TRANSITION, maybeBuild(sharedElementTransition), sharedTransitionTag);
224
179
  }
225
180
  }
226
-
227
181
  if (ref !== this._component) {
228
182
  this._component = ref;
229
183
  }
230
184
  }
231
185
  }));
232
-
233
186
  if (isJest()) {
234
187
  this.animatedStyle = {
235
188
  value: {}
236
189
  };
237
190
  }
238
191
  }
239
-
240
192
  componentWillUnmount() {
241
193
  this._detachNativeEvents();
242
-
243
194
  this._detachStyles();
244
-
245
195
  this._detachInlineProps();
246
196
  }
247
-
248
197
  componentDidMount() {
249
198
  this._attachNativeEvents();
250
-
251
199
  this._attachAnimatedStyles();
252
-
253
200
  this._attachInlineProps();
254
201
  }
255
-
256
202
  _getEventViewRef() {
257
203
  var _this$_component;
258
-
259
204
  // Make sure to get the scrollable node for components that implement
260
205
  // `ScrollResponder.Mixin`.
261
206
  return (_this$_component = this._component) !== null && _this$_component !== void 0 && _this$_component.getScrollableNode ? this._component.getScrollableNode() : this._component;
262
207
  }
263
-
264
208
  _attachNativeEvents() {
265
209
  const node = this._getEventViewRef();
266
-
267
210
  const viewTag = findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node);
268
-
269
211
  for (const key in this.props) {
270
212
  const prop = this.props[key];
271
-
272
213
  if (has('current', prop) && prop.current instanceof WorkletEventHandler) {
273
214
  prop.current.registerForEvents(viewTag, key);
274
215
  }
275
216
  }
276
217
  }
277
-
278
218
  _detachNativeEvents() {
279
219
  for (const key in this.props) {
280
220
  const prop = this.props[key];
281
-
282
221
  if (has('current', prop) && prop.current instanceof WorkletEventHandler) {
283
222
  prop.current.unregisterFromEvents();
284
223
  }
285
224
  }
286
225
  }
287
-
288
226
  _detachStyles() {
289
227
  if (Platform.OS === 'web' && this._styles !== null) {
290
228
  for (const style of this._styles) {
@@ -294,15 +232,12 @@ export default function createAnimatedComponent(Component, options) {
294
232
  }
295
233
  } else if (this._viewTag !== -1 && this._styles !== null) {
296
234
  var _this$props$animatedP;
297
-
298
235
  for (const style of this._styles) {
299
236
  style.viewDescriptors.remove(this._viewTag);
300
237
  }
301
-
302
238
  if ((_this$props$animatedP = this.props.animatedProps) !== null && _this$props$animatedP !== void 0 && _this$props$animatedP.viewDescriptors) {
303
239
  this.props.animatedProps.viewDescriptors.remove(this._viewTag);
304
240
  }
305
-
306
241
  if (global._IS_FABRIC) {
307
242
  const viewTag = this._viewTag;
308
243
  runOnUI(() => {
@@ -313,31 +248,24 @@ export default function createAnimatedComponent(Component, options) {
313
248
  }
314
249
  }
315
250
  }
316
-
317
251
  _reattachNativeEvents(prevProps) {
318
252
  let viewTag;
319
-
320
253
  for (const key in this.props) {
321
254
  const prop = this.props[key];
322
-
323
255
  if (has('current', prop) && prop.current instanceof WorkletEventHandler) {
324
256
  if (viewTag === undefined) {
325
257
  viewTag = prop.current.viewTag;
326
258
  }
327
259
  }
328
260
  }
329
-
330
261
  for (const key in prevProps) {
331
262
  const prop = this.props[key];
332
-
333
263
  if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) {
334
264
  prop.current.unregisterFromEvents();
335
265
  }
336
266
  }
337
-
338
267
  for (const key in this.props) {
339
268
  const prop = this.props[key];
340
-
341
269
  if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) {
342
270
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
343
271
  prop.current.registerForEvents(viewTag, key);
@@ -345,25 +273,21 @@ export default function createAnimatedComponent(Component, options) {
345
273
  }
346
274
  }
347
275
  }
348
-
349
276
  _updateFromNative(props) {
350
277
  if (options !== null && options !== void 0 && options.setNativeProps) {
351
278
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
352
279
  options.setNativeProps(this._component, props);
353
280
  } else {
354
281
  var _this$_component2, _this$_component2$set;
355
-
356
282
  // eslint-disable-next-line no-unused-expressions
357
283
  (_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);
358
284
  }
359
285
  }
360
-
361
286
  _getViewInfo() {
362
287
  let viewTag;
363
288
  let viewName;
364
289
  let shadowNodeWrapper = null;
365
290
  let viewConfig;
366
-
367
291
  if (Platform.OS === 'web') {
368
292
  viewTag = findNodeHandle(this);
369
293
  viewName = null;
@@ -371,29 +295,23 @@ export default function createAnimatedComponent(Component, options) {
371
295
  viewConfig = null;
372
296
  } else {
373
297
  var _hostInstance$viewCon;
374
-
375
298
  // 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
376
299
  const hostInstance = RNRenderer.findHostInstance_DEPRECATED(this);
377
-
378
300
  if (!hostInstance) {
379
301
  throw new Error('Cannot find host instance for this component. Maybe it renders nothing?');
380
- } // 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
381
-
382
-
302
+ }
303
+ // 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
383
304
  viewTag = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance._nativeTag;
384
305
  /**
385
306
  * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewViewConfig.js#L16).
386
307
  * The name we're looking for is in the field named uiViewClassName.
387
308
  */
388
-
389
309
  viewName = hostInstance === null || hostInstance === void 0 ? void 0 : (_hostInstance$viewCon = hostInstance.viewConfig) === null || _hostInstance$viewCon === void 0 ? void 0 : _hostInstance$viewCon.uiViewClassName;
390
310
  viewConfig = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig;
391
-
392
311
  if (global._IS_FABRIC) {
393
312
  shadowNodeWrapper = getShadowNodeWrapperFromRef(this);
394
313
  }
395
314
  }
396
-
397
315
  return {
398
316
  viewTag,
399
317
  viewName,
@@ -401,55 +319,47 @@ export default function createAnimatedComponent(Component, options) {
401
319
  viewConfig
402
320
  };
403
321
  }
404
-
405
322
  _attachAnimatedStyles() {
406
323
  var _this$props$animatedP2, _this$props$animatedP3;
407
-
408
324
  const styles = this.props.style ? onlyAnimatedStyles(flattenArray(this.props.style)) : [];
409
325
  const prevStyles = this._styles;
410
326
  this._styles = styles;
411
327
  const prevAnimatedProps = this._animatedProps;
412
328
  this._animatedProps = this.props.animatedProps;
413
-
414
329
  const {
415
330
  viewTag,
416
331
  viewName,
417
332
  shadowNodeWrapper,
418
333
  viewConfig
419
- } = this._getViewInfo(); // update UI props whitelist for this view
420
-
334
+ } = this._getViewInfo();
421
335
 
336
+ // update UI props whitelist for this view
422
337
  const hasReanimated2Props = ((_this$props$animatedP2 = this.props.animatedProps) === null || _this$props$animatedP2 === void 0 ? void 0 : _this$props$animatedP2.viewDescriptors) || styles.length;
423
-
424
338
  if (hasReanimated2Props && viewConfig) {
425
339
  adaptViewConfig(viewConfig);
426
340
  }
341
+ this._viewTag = viewTag;
427
342
 
428
- this._viewTag = viewTag; // remove old styles
429
-
343
+ // remove old styles
430
344
  if (prevStyles) {
431
345
  // in most of the cases, views have only a single animated style and it remains unchanged
432
346
  const hasOneSameStyle = styles.length === 1 && prevStyles.length === 1 && isSameAnimatedStyle(styles[0], prevStyles[0]);
433
-
434
347
  if (!hasOneSameStyle) {
435
348
  // otherwise, remove each style that is not present in new styles
436
349
  for (const prevStyle of prevStyles) {
437
350
  const isPresent = styles.some(style => isSameAnimatedStyle(style, prevStyle));
438
-
439
351
  if (!isPresent) {
440
352
  prevStyle.viewDescriptors.remove(viewTag);
441
353
  }
442
354
  }
443
355
  }
444
356
  }
445
-
446
357
  styles.forEach(style => {
447
358
  style.viewDescriptors.add({
448
359
  tag: viewTag,
449
360
  name: viewName,
450
361
  shadowNodeWrapper
451
362
  });
452
-
453
363
  if (isJest()) {
454
364
  /**
455
365
  * We need to connect Jest's TestObject instance whose contains just props object
@@ -457,18 +367,20 @@ export default function createAnimatedComponent(Component, options) {
457
367
  * We can't update props object directly because TestObject contains a copy of props - look at render function:
458
368
  * const props = this._filterNonAnimatedProps(this.props);
459
369
  */
460
- this.animatedStyle.value = { ...this.animatedStyle.value,
370
+ this.animatedStyle.value = {
371
+ ...this.animatedStyle.value,
461
372
  ...style.initial.value
462
373
  };
463
374
  style.animatedStyle.current = this.animatedStyle;
464
375
  }
465
- }); // detach old animatedProps
376
+ });
466
377
 
378
+ // detach old animatedProps
467
379
  if (prevAnimatedProps && !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)) {
468
380
  prevAnimatedProps.viewDescriptors.remove(viewTag);
469
- } // attach animatedProps property
470
-
381
+ }
471
382
 
383
+ // attach animatedProps property
472
384
  if ((_this$props$animatedP3 = this.props.animatedProps) !== null && _this$props$animatedP3 !== void 0 && _this$props$animatedP3.viewDescriptors) {
473
385
  this.props.animatedProps.viewDescriptors.add({
474
386
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -480,26 +392,21 @@ export default function createAnimatedComponent(Component, options) {
480
392
  });
481
393
  }
482
394
  }
483
-
484
395
  _attachInlineProps() {
485
396
  const newInlineProps = extractSharedValuesMapFromProps(this.props);
486
397
  const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps);
487
-
488
398
  if (hasChanged) {
489
399
  if (!this._inlinePropsViewDescriptors) {
490
400
  this._inlinePropsViewDescriptors = makeViewDescriptorsSet();
491
-
492
401
  const {
493
402
  viewTag,
494
403
  viewName,
495
404
  shadowNodeWrapper,
496
405
  viewConfig
497
406
  } = this._getViewInfo();
498
-
499
407
  if (Object.keys(newInlineProps).length && viewConfig) {
500
408
  adaptViewConfig(viewConfig);
501
409
  }
502
-
503
410
  this._inlinePropsViewDescriptors.add({
504
411
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
505
412
  tag: viewTag,
@@ -509,7 +416,6 @@ export default function createAnimatedComponent(Component, options) {
509
416
  shadowNodeWrapper: shadowNodeWrapper
510
417
  });
511
418
  }
512
-
513
419
  const sharableViewDescriptors = this._inlinePropsViewDescriptors.sharableViewDescriptors;
514
420
  const maybeViewRef = NativeReanimatedModule.native ? undefined : {
515
421
  items: new Set([this])
@@ -521,41 +427,30 @@ export default function createAnimatedComponent(Component, options) {
521
427
  const update = getInlinePropsUpdate(newInlineProps);
522
428
  updateProps(sharableViewDescriptors, update, maybeViewRef);
523
429
  };
524
-
525
430
  this._inlineProps = newInlineProps;
526
-
527
431
  if (this._inlinePropsMapperId) {
528
432
  stopMapper(this._inlinePropsMapperId);
529
433
  }
530
-
531
434
  this._inlinePropsMapperId = null;
532
-
533
435
  if (Object.keys(newInlineProps).length) {
534
436
  this._inlinePropsMapperId = startMapper(updaterFunction, Object.values(newInlineProps));
535
437
  }
536
438
  }
537
439
  }
538
-
539
440
  _detachInlineProps() {
540
441
  if (this._inlinePropsMapperId) {
541
442
  stopMapper(this._inlinePropsMapperId);
542
443
  }
543
444
  }
544
-
545
445
  componentDidUpdate(prevProps) {
546
446
  this._reattachNativeEvents(prevProps);
547
-
548
447
  this._attachAnimatedStyles();
549
-
550
448
  this._attachInlineProps();
551
449
  }
552
-
553
450
  _filterNonAnimatedProps(inputProps) {
554
451
  const props = {};
555
-
556
452
  for (const key in inputProps) {
557
453
  const value = inputProps[key];
558
-
559
454
  if (key === 'style') {
560
455
  const styleProp = inputProps.style;
561
456
  const styles = flattenArray(styleProp ?? []);
@@ -563,27 +458,23 @@ export default function createAnimatedComponent(Component, options) {
563
458
  if (style && style.viewDescriptors) {
564
459
  // this is how we recognize styles returned by useAnimatedStyle
565
460
  style.viewsRef.add(this);
566
-
567
461
  if (this._isFirstRender) {
568
- this.initialStyle = { ...style.initial.value,
462
+ this.initialStyle = {
463
+ ...style.initial.value,
569
464
  ...initialUpdaterRun(style.initial.updater)
570
465
  };
571
466
  }
572
-
573
467
  return this.initialStyle;
574
468
  } else if (hasInlineStyles(style)) {
575
469
  if (this._isFirstRender) {
576
470
  return getInlinePropsUpdate(style);
577
471
  }
578
-
579
472
  const newStyle = {};
580
-
581
473
  for (const [key, styleValue] of Object.entries(style)) {
582
474
  if (!isSharedValue(styleValue) && !(key === 'transform' && isInlineStyleTransform(styleValue))) {
583
475
  newStyle[key] = styleValue;
584
476
  }
585
477
  }
586
-
587
478
  return newStyle;
588
479
  } else {
589
480
  return style;
@@ -592,11 +483,9 @@ export default function createAnimatedComponent(Component, options) {
592
483
  props[key] = StyleSheet.flatten(processedStyle);
593
484
  } else if (key === 'animatedProps') {
594
485
  const animatedProp = inputProps.animatedProps;
595
-
596
486
  if (animatedProp.initial !== undefined) {
597
487
  Object.keys(animatedProp.initial.value).forEach(key => {
598
488
  var _animatedProp$initial, _animatedProp$viewsRe;
599
-
600
489
  props[key] = (_animatedProp$initial = animatedProp.initial) === null || _animatedProp$initial === void 0 ? void 0 : _animatedProp$initial.value[key];
601
490
  (_animatedProp$viewsRe = animatedProp.viewsRef) === null || _animatedProp$viewsRe === void 0 ? void 0 : _animatedProp$viewsRe.add(this);
602
491
  });
@@ -617,21 +506,16 @@ export default function createAnimatedComponent(Component, options) {
617
506
  props[key] = value;
618
507
  }
619
508
  }
620
-
621
509
  return props;
622
510
  }
623
-
624
511
  render() {
625
512
  const props = this._filterNonAnimatedProps(this.props);
626
-
627
513
  if (isJest()) {
628
514
  props.animatedStyle = this.animatedStyle;
629
515
  }
630
-
631
516
  if (this._isFirstRender) {
632
517
  this._isFirstRender = false;
633
518
  }
634
-
635
519
  const platformProps = Platform.select({
636
520
  web: {},
637
521
  default: {
@@ -642,11 +526,8 @@ export default function createAnimatedComponent(Component, options) {
642
526
  ref: this._setComponentRef
643
527
  }, platformProps));
644
528
  }
645
-
646
529
  }
647
-
648
530
  _defineProperty(AnimatedComponent, "displayName", void 0);
649
-
650
531
  AnimatedComponent.displayName = `AnimatedComponent(${Component.displayName || Component.name || 'Component'})`;
651
532
  return /*#__PURE__*/React.forwardRef((props, ref) => {
652
533
  return /*#__PURE__*/React.createElement(AnimatedComponent, _extends({}, props, ref === null ? null : {