react-native-reanimated 3.0.0-rc.0 → 3.0.0-rc.1

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 (634) hide show
  1. package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
  2. package/Common/cpp/Fabric/FabricUtils.cpp +7 -2
  3. package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +32 -9
  4. package/Common/cpp/Fabric/ShadowTreeCloner.cpp +92 -0
  5. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +60 -35
  6. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
  7. package/Common/cpp/Tools/RuntimeDecorator.cpp +17 -11
  8. package/Common/cpp/headers/Fabric/FabricUtils.h +3 -2
  9. package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +1 -0
  10. package/Common/cpp/headers/Fabric/ShadowTreeCloner.h +41 -0
  11. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +9 -0
  12. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
  13. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +5 -0
  14. package/RNReanimated.podspec +28 -6
  15. package/android/CMakeLists.txt +73 -53
  16. package/android/build.gradle +178 -34
  17. package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +25 -0
  18. package/android/src/main/cpp/NativeProxy.cpp +48 -13
  19. package/android/src/main/cpp/OnLoad.cpp +1 -0
  20. package/android/src/main/cpp/headers/NativeProxy.h +29 -0
  21. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +3 -1
  22. package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
  23. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
  24. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
  25. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +24 -1
  26. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +7 -5
  27. package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +25 -0
  28. package/ios/REAModule.mm +1 -1
  29. package/ios/REANodesManager.mm +31 -8
  30. package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
  31. package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
  32. package/ios/native/NativeProxy.mm +19 -68
  33. package/ios/native/REAJSIUtils.h +66 -0
  34. package/ios/sensor/ReanimatedSensor.m +27 -18
  35. package/lib/commonjs/Animated.js +70 -0
  36. package/lib/commonjs/Animated.js.map +1 -0
  37. package/lib/commonjs/ConfigHelper.js +173 -0
  38. package/lib/commonjs/ConfigHelper.js.map +1 -0
  39. package/lib/commonjs/createAnimatedComponent.js +474 -0
  40. package/lib/commonjs/createAnimatedComponent.js.map +1 -0
  41. package/lib/commonjs/index.js +44 -0
  42. package/lib/commonjs/index.js.map +1 -0
  43. package/lib/commonjs/index.web.js +32 -0
  44. package/lib/commonjs/index.web.js.map +1 -0
  45. package/lib/commonjs/reanimated2/Bezier.js +166 -0
  46. package/lib/commonjs/reanimated2/Bezier.js.map +1 -0
  47. package/lib/commonjs/reanimated2/Colors.js +673 -0
  48. package/lib/commonjs/reanimated2/Colors.js.map +1 -0
  49. package/lib/{reanimated2 → commonjs/reanimated2}/Easing.js +151 -83
  50. package/lib/commonjs/reanimated2/Easing.js.map +1 -0
  51. package/lib/commonjs/reanimated2/NativeMethods.js +100 -0
  52. package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -0
  53. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +99 -0
  54. package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
  55. package/lib/commonjs/reanimated2/NativeReanimated/index.js +26 -0
  56. package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -0
  57. package/lib/commonjs/reanimated2/PlatformChecker.js +33 -0
  58. package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -0
  59. package/lib/commonjs/reanimated2/PropAdapters.js +68 -0
  60. package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -0
  61. package/lib/commonjs/reanimated2/UpdateProps.js +82 -0
  62. package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -0
  63. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +96 -0
  64. package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -0
  65. package/lib/commonjs/reanimated2/WorkletEventHandler.js +75 -0
  66. package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -0
  67. package/lib/commonjs/reanimated2/animation/commonTypes.js +6 -0
  68. package/lib/commonjs/reanimated2/animation/commonTypes.js.map +1 -0
  69. package/lib/commonjs/reanimated2/animation/decay.js +132 -0
  70. package/lib/commonjs/reanimated2/animation/decay.js.map +1 -0
  71. package/lib/commonjs/reanimated2/animation/delay.js +89 -0
  72. package/lib/commonjs/reanimated2/animation/delay.js.map +1 -0
  73. package/lib/commonjs/reanimated2/animation/index.js +82 -0
  74. package/lib/commonjs/reanimated2/animation/index.js.map +1 -0
  75. package/lib/commonjs/reanimated2/animation/repeat.js +107 -0
  76. package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -0
  77. package/lib/commonjs/reanimated2/animation/sequence.js +103 -0
  78. package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -0
  79. package/lib/commonjs/reanimated2/animation/spring.js +121 -0
  80. package/lib/commonjs/reanimated2/animation/spring.js.map +1 -0
  81. package/lib/commonjs/reanimated2/animation/styleAnimation.js +206 -0
  82. package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -0
  83. package/lib/commonjs/reanimated2/animation/timing.js +82 -0
  84. package/lib/commonjs/reanimated2/animation/timing.js.map +1 -0
  85. package/lib/commonjs/reanimated2/animation/util.js +233 -0
  86. package/lib/commonjs/reanimated2/animation/util.js.map +1 -0
  87. package/lib/commonjs/reanimated2/commonTypes.js +17 -0
  88. package/lib/commonjs/reanimated2/commonTypes.js.map +1 -0
  89. package/lib/commonjs/reanimated2/component/FlatList.js +53 -0
  90. package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -0
  91. package/lib/commonjs/reanimated2/component/Image.js +17 -0
  92. package/lib/commonjs/reanimated2/component/Image.js.map +1 -0
  93. package/lib/commonjs/reanimated2/component/ScrollView.js +17 -0
  94. package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -0
  95. package/lib/commonjs/reanimated2/component/Text.js +17 -0
  96. package/lib/commonjs/reanimated2/component/Text.js.map +1 -0
  97. package/lib/commonjs/reanimated2/component/View.js +17 -0
  98. package/lib/commonjs/reanimated2/component/View.js.map +1 -0
  99. package/lib/commonjs/reanimated2/core.js +360 -0
  100. package/lib/commonjs/reanimated2/core.js.map +1 -0
  101. package/lib/commonjs/reanimated2/fabricUtils.js +27 -0
  102. package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -0
  103. package/lib/commonjs/reanimated2/fabricUtils.web.js +21 -0
  104. package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -0
  105. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +55 -0
  106. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
  107. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +64 -0
  108. package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
  109. package/lib/commonjs/reanimated2/globals.d.js +6 -0
  110. package/lib/commonjs/reanimated2/globals.d.js.map +1 -0
  111. package/lib/commonjs/reanimated2/hook/Hooks.js +35 -0
  112. package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -0
  113. package/lib/commonjs/reanimated2/hook/commonTypes.js +6 -0
  114. package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -0
  115. package/lib/commonjs/reanimated2/hook/index.js +118 -0
  116. package/lib/commonjs/reanimated2/hook/index.js.map +1 -0
  117. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +66 -0
  118. package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
  119. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +48 -0
  120. package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
  121. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +44 -0
  122. package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -0
  123. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +43 -0
  124. package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -0
  125. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +62 -0
  126. package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
  127. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +94 -0
  128. package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -0
  129. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +471 -0
  130. package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -0
  131. package/lib/commonjs/reanimated2/hook/useDerivedValue.js +49 -0
  132. package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -0
  133. package/lib/commonjs/reanimated2/hook/useFrameCallback.js +36 -0
  134. package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -0
  135. package/lib/commonjs/reanimated2/hook/useSharedValue.js +30 -0
  136. package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -0
  137. package/lib/commonjs/reanimated2/hook/utils.js +247 -0
  138. package/lib/commonjs/reanimated2/hook/utils.js.map +1 -0
  139. package/lib/commonjs/reanimated2/index.js +162 -0
  140. package/lib/commonjs/reanimated2/index.js.map +1 -0
  141. package/lib/commonjs/reanimated2/interpolateColor.js +154 -0
  142. package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -0
  143. package/lib/commonjs/reanimated2/interpolation.js +143 -0
  144. package/lib/commonjs/reanimated2/interpolation.js.map +1 -0
  145. package/lib/commonjs/reanimated2/jestUtils.js +239 -0
  146. package/lib/commonjs/reanimated2/jestUtils.js.map +1 -0
  147. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +160 -0
  148. package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
  149. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +74 -0
  150. package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -0
  151. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +146 -0
  152. package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
  153. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +57 -0
  154. package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -0
  155. package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js +6 -0
  156. package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js.map +1 -0
  157. package/lib/commonjs/reanimated2/js-reanimated/global.js +57 -0
  158. package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -0
  159. package/lib/commonjs/reanimated2/js-reanimated/index.js +57 -0
  160. package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -0
  161. package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js +97 -0
  162. package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
  163. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +100 -0
  164. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
  165. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +203 -0
  166. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
  167. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +244 -0
  168. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
  169. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +6 -0
  170. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
  171. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +30 -0
  172. package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
  173. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +570 -0
  174. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
  175. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js +55 -0
  176. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
  177. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +409 -0
  178. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
  179. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +559 -0
  180. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
  181. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +221 -0
  182. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
  183. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +101 -0
  184. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
  185. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +189 -0
  186. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
  187. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +403 -0
  188. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
  189. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +298 -0
  190. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
  191. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +167 -0
  192. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
  193. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +700 -0
  194. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
  195. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +136 -0
  196. package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
  197. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +120 -0
  198. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
  199. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +180 -0
  200. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
  201. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +66 -0
  202. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
  203. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +64 -0
  204. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
  205. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +52 -0
  206. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
  207. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +68 -0
  208. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
  209. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +84 -0
  210. package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
  211. package/lib/commonjs/reanimated2/layoutReanimation/index.js +47 -0
  212. package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -0
  213. package/lib/commonjs/reanimated2/mock.js +88 -0
  214. package/lib/commonjs/reanimated2/mock.js.map +1 -0
  215. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +16 -0
  216. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -0
  217. package/lib/{reanimated2 → commonjs/reanimated2}/platform-specific/RNRenderer.web.js +2 -0
  218. package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
  219. package/lib/commonjs/reanimated2/utils.js +19 -0
  220. package/lib/commonjs/reanimated2/utils.js.map +1 -0
  221. package/lib/commonjs/setAndForwardRef.js +63 -0
  222. package/lib/commonjs/setAndForwardRef.js.map +1 -0
  223. package/lib/module/Animated.js +8 -0
  224. package/lib/module/Animated.js.map +1 -0
  225. package/lib/module/ConfigHelper.js +161 -0
  226. package/lib/module/ConfigHelper.js.map +1 -0
  227. package/lib/module/createAnimatedComponent.js +452 -0
  228. package/lib/module/createAnimatedComponent.js.map +1 -0
  229. package/lib/module/index.js +15 -0
  230. package/lib/module/index.js.map +1 -0
  231. package/lib/module/index.web.js +6 -0
  232. package/lib/module/index.web.js.map +1 -0
  233. package/lib/module/reanimated2/Bezier.js +159 -0
  234. package/lib/module/reanimated2/Bezier.js.map +1 -0
  235. package/lib/module/reanimated2/Colors.js +632 -0
  236. package/lib/module/reanimated2/Colors.js.map +1 -0
  237. package/lib/{types/reanimated2/Easing.d.ts → module/reanimated2/Easing.js} +179 -40
  238. package/lib/module/reanimated2/Easing.js.map +1 -0
  239. package/lib/module/reanimated2/NativeMethods.js +82 -0
  240. package/lib/module/reanimated2/NativeMethods.js.map +1 -0
  241. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +89 -0
  242. package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
  243. package/lib/{reanimated2 → module/reanimated2}/NativeReanimated/index.js +6 -4
  244. package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -0
  245. package/lib/module/reanimated2/PlatformChecker.js +17 -0
  246. package/lib/module/reanimated2/PlatformChecker.js.map +1 -0
  247. package/lib/module/reanimated2/PropAdapters.js +56 -0
  248. package/lib/module/reanimated2/PropAdapters.js.map +1 -0
  249. package/lib/module/reanimated2/UpdateProps.js +64 -0
  250. package/lib/module/reanimated2/UpdateProps.js.map +1 -0
  251. package/lib/module/reanimated2/ViewDescriptorsSet.js +83 -0
  252. package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -0
  253. package/lib/module/reanimated2/WorkletEventHandler.js +64 -0
  254. package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -0
  255. package/lib/module/reanimated2/animation/commonTypes.js +2 -0
  256. package/lib/module/reanimated2/animation/commonTypes.js.map +1 -0
  257. package/lib/module/reanimated2/animation/decay.js +123 -0
  258. package/lib/module/reanimated2/animation/decay.js.map +1 -0
  259. package/lib/module/reanimated2/animation/delay.js +79 -0
  260. package/lib/module/reanimated2/animation/delay.js.map +1 -0
  261. package/lib/{reanimated2 → module/reanimated2}/animation/index.js +1 -0
  262. package/lib/module/reanimated2/animation/index.js.map +1 -0
  263. package/lib/module/reanimated2/animation/repeat.js +95 -0
  264. package/lib/module/reanimated2/animation/repeat.js.map +1 -0
  265. package/lib/module/reanimated2/animation/sequence.js +93 -0
  266. package/lib/module/reanimated2/animation/sequence.js.map +1 -0
  267. package/lib/module/reanimated2/animation/spring.js +113 -0
  268. package/lib/module/reanimated2/animation/spring.js.map +1 -0
  269. package/lib/module/reanimated2/animation/styleAnimation.js +191 -0
  270. package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -0
  271. package/lib/module/reanimated2/animation/timing.js +73 -0
  272. package/lib/module/reanimated2/animation/timing.js.map +1 -0
  273. package/lib/module/reanimated2/animation/util.js +216 -0
  274. package/lib/module/reanimated2/animation/util.js.map +1 -0
  275. package/lib/module/reanimated2/commonTypes.js +10 -0
  276. package/lib/module/reanimated2/commonTypes.js.map +1 -0
  277. package/lib/module/reanimated2/component/FlatList.js +33 -0
  278. package/lib/module/reanimated2/component/FlatList.js.map +1 -0
  279. package/lib/module/reanimated2/component/Image.js +5 -0
  280. package/lib/module/reanimated2/component/Image.js.map +1 -0
  281. package/lib/module/reanimated2/component/ScrollView.js +5 -0
  282. package/lib/module/reanimated2/component/ScrollView.js.map +1 -0
  283. package/lib/module/reanimated2/component/Text.js +5 -0
  284. package/lib/module/reanimated2/component/Text.js.map +1 -0
  285. package/lib/module/reanimated2/component/View.js +5 -0
  286. package/lib/module/reanimated2/component/View.js.map +1 -0
  287. package/lib/module/reanimated2/core.js +314 -0
  288. package/lib/module/reanimated2/core.js.map +1 -0
  289. package/lib/module/reanimated2/fabricUtils.js +18 -0
  290. package/lib/module/reanimated2/fabricUtils.js.map +1 -0
  291. package/lib/module/reanimated2/fabricUtils.web.js +12 -0
  292. package/lib/module/reanimated2/fabricUtils.web.js.map +1 -0
  293. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +44 -0
  294. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
  295. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +55 -0
  296. package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
  297. package/lib/module/reanimated2/globals.d.js +2 -0
  298. package/lib/module/reanimated2/globals.d.js.map +1 -0
  299. package/lib/{reanimated2 → module/reanimated2}/hook/Hooks.js +4 -3
  300. package/lib/module/reanimated2/hook/Hooks.js.map +1 -0
  301. package/lib/module/reanimated2/hook/commonTypes.js +2 -0
  302. package/lib/module/reanimated2/hook/commonTypes.js.map +1 -0
  303. package/lib/module/reanimated2/hook/index.js +12 -0
  304. package/lib/module/reanimated2/hook/index.js.map +1 -0
  305. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +56 -0
  306. package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
  307. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +34 -0
  308. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
  309. package/lib/module/reanimated2/hook/useAnimatedReaction.js +35 -0
  310. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -0
  311. package/lib/module/reanimated2/hook/useAnimatedRef.js +32 -0
  312. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -0
  313. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +54 -0
  314. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
  315. package/lib/module/reanimated2/hook/useAnimatedSensor.js +79 -0
  316. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -0
  317. package/lib/module/reanimated2/hook/useAnimatedStyle.js +450 -0
  318. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -0
  319. package/lib/module/reanimated2/hook/useDerivedValue.js +39 -0
  320. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -0
  321. package/lib/module/reanimated2/hook/useFrameCallback.js +24 -0
  322. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -0
  323. package/lib/module/reanimated2/hook/useSharedValue.js +20 -0
  324. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -0
  325. package/lib/module/reanimated2/hook/utils.js +208 -0
  326. package/lib/module/reanimated2/hook/utils.js.map +1 -0
  327. package/lib/{reanimated2 → module/reanimated2}/index.js +1 -0
  328. package/lib/module/reanimated2/index.js.map +1 -0
  329. package/lib/module/reanimated2/interpolateColor.js +135 -0
  330. package/lib/module/reanimated2/interpolateColor.js.map +1 -0
  331. package/lib/module/reanimated2/interpolation.js +135 -0
  332. package/lib/module/reanimated2/interpolation.js.map +1 -0
  333. package/lib/module/reanimated2/jestUtils.js +217 -0
  334. package/lib/module/reanimated2/jestUtils.js.map +1 -0
  335. package/lib/module/reanimated2/js-reanimated/JSReanimated.js +144 -0
  336. package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
  337. package/lib/module/reanimated2/js-reanimated/Mapper.js +62 -0
  338. package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -0
  339. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +137 -0
  340. package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
  341. package/lib/module/reanimated2/js-reanimated/MutableValue.js +48 -0
  342. package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -0
  343. package/lib/module/reanimated2/js-reanimated/commonTypes.js +2 -0
  344. package/lib/module/reanimated2/js-reanimated/commonTypes.js.map +1 -0
  345. package/lib/module/reanimated2/js-reanimated/global.js +48 -0
  346. package/lib/module/reanimated2/js-reanimated/global.js.map +1 -0
  347. package/lib/module/reanimated2/js-reanimated/index.js +43 -0
  348. package/lib/module/reanimated2/js-reanimated/index.js.map +1 -0
  349. package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js +91 -0
  350. package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
  351. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +90 -0
  352. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
  353. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +192 -0
  354. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
  355. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +233 -0
  356. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
  357. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +2 -0
  358. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
  359. package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/animationBuilder/index.js +1 -0
  360. package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
  361. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +530 -0
  362. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
  363. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js +40 -0
  364. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
  365. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +372 -0
  366. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
  367. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +516 -0
  368. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
  369. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +199 -0
  370. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
  371. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +88 -0
  372. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
  373. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +168 -0
  374. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
  375. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +372 -0
  376. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
  377. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +265 -0
  378. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
  379. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +148 -0
  380. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
  381. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +643 -0
  382. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
  383. package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/defaultAnimations/index.js +1 -0
  384. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
  385. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +108 -0
  386. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
  387. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +166 -0
  388. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
  389. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +55 -0
  390. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
  391. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +52 -0
  392. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
  393. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +41 -0
  394. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
  395. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +57 -0
  396. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
  397. package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/defaultTransitions/index.js +1 -0
  398. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
  399. package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/index.js +1 -0
  400. package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -0
  401. package/lib/module/reanimated2/mock.js +86 -0
  402. package/lib/module/reanimated2/mock.js.map +1 -0
  403. package/lib/{reanimated2 → module/reanimated2}/platform-specific/RNRenderer.js +1 -0
  404. package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -0
  405. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js +3 -0
  406. package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
  407. package/lib/module/reanimated2/utils.js +11 -0
  408. package/lib/module/reanimated2/utils.js.map +1 -0
  409. package/lib/{types/setAndForwardRef.d.ts → module/setAndForwardRef.js} +21 -6
  410. package/lib/module/setAndForwardRef.js.map +1 -0
  411. package/mock.js +1 -0
  412. package/package.json +28 -21
  413. package/plugin.js +7 -6
  414. package/src/Animated.ts +11 -0
  415. package/src/index.ts +13 -0
  416. package/src/index.web.ts +5 -0
  417. package/src/reanimated2/Colors.ts +1 -1
  418. package/src/reanimated2/NativeMethods.ts +5 -0
  419. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +10 -1
  420. package/src/reanimated2/animation/decay.ts +79 -30
  421. package/src/reanimated2/animation/index.ts +7 -4
  422. package/src/reanimated2/animation/sequence.ts +0 -5
  423. package/src/reanimated2/animation/util.ts +8 -1
  424. package/src/reanimated2/commonTypes.ts +13 -0
  425. package/src/reanimated2/component/FlatList.tsx +25 -21
  426. package/src/reanimated2/component/Image.ts +6 -0
  427. package/src/reanimated2/component/ScrollView.ts +6 -0
  428. package/src/reanimated2/component/Text.ts +6 -0
  429. package/src/reanimated2/component/View.ts +6 -0
  430. package/src/reanimated2/core.ts +8 -13
  431. package/src/reanimated2/fabricUtils.web.ts +19 -0
  432. package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
  433. package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
  434. package/src/reanimated2/globals.d.ts +3 -0
  435. package/src/reanimated2/hook/index.ts +14 -14
  436. package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
  437. package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
  438. package/src/reanimated2/hook/useFrameCallback.ts +39 -0
  439. package/src/reanimated2/jestUtils.ts +11 -3
  440. package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
  441. package/src/reanimated2/js-reanimated/global.ts +50 -0
  442. package/src/reanimated2/js-reanimated/index.ts +0 -36
  443. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
  444. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -1
  445. package/src/reanimated2/mock.ts +6 -0
  446. package/android/local.properties +0 -1
  447. package/lib/Animated.js +0 -18
  448. package/lib/ConfigHelper.js +0 -145
  449. package/lib/ReanimatedEventEmitter.js +0 -3
  450. package/lib/ReanimatedModule.js +0 -2
  451. package/lib/ReanimatedModule.macos.js +0 -2
  452. package/lib/ReanimatedModule.native.js +0 -12
  453. package/lib/ReanimatedModule.windows.js +0 -2
  454. package/lib/ReanimatedModuleCompat.js +0 -66
  455. package/lib/__mocks__/ReanimatedEventEmitter.js +0 -8
  456. package/lib/__mocks__/ReanimatedModule.native.js +0 -11
  457. package/lib/createAnimatedComponent.js +0 -375
  458. package/lib/index.js +0 -18
  459. package/lib/reanimated2/Bezier.js +0 -126
  460. package/lib/reanimated2/Colors.js +0 -522
  461. package/lib/reanimated2/NativeMethods.js +0 -59
  462. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +0 -50
  463. package/lib/reanimated2/PlatformChecker.js +0 -16
  464. package/lib/reanimated2/PropAdapters.js +0 -55
  465. package/lib/reanimated2/UpdateProps.js +0 -70
  466. package/lib/reanimated2/ViewDescriptorsSet.js +0 -75
  467. package/lib/reanimated2/WorkletEventHandler.js +0 -37
  468. package/lib/reanimated2/__mocks__/MutableValue.js +0 -13
  469. package/lib/reanimated2/__mocks__/NativeReanimated.js +0 -20
  470. package/lib/reanimated2/__mocks__/NativeReanimated.native.js +0 -20
  471. package/lib/reanimated2/animation/commonTypes.js +0 -1
  472. package/lib/reanimated2/animation/decay.js +0 -71
  473. package/lib/reanimated2/animation/delay.js +0 -64
  474. package/lib/reanimated2/animation/repeat.js +0 -69
  475. package/lib/reanimated2/animation/sequence.js +0 -72
  476. package/lib/reanimated2/animation/spring.js +0 -103
  477. package/lib/reanimated2/animation/styleAnimation.js +0 -171
  478. package/lib/reanimated2/animation/timing.js +0 -64
  479. package/lib/reanimated2/animation/util.js +0 -180
  480. package/lib/reanimated2/commonTypes.js +0 -1
  481. package/lib/reanimated2/component/FlatList.js +0 -30
  482. package/lib/reanimated2/component/WrappedComponents.js +0 -9
  483. package/lib/reanimated2/component/index.js +0 -4
  484. package/lib/reanimated2/core.js +0 -276
  485. package/lib/reanimated2/fabricUtils.js +0 -18
  486. package/lib/reanimated2/globals.d.ts +0 -76
  487. package/lib/reanimated2/hook/commonTypes.js +0 -1
  488. package/lib/reanimated2/hook/index.js +0 -9
  489. package/lib/reanimated2/hook/useAnimatedGestureHandler.js +0 -49
  490. package/lib/reanimated2/hook/useAnimatedReaction.js +0 -37
  491. package/lib/reanimated2/hook/useAnimatedRef.js +0 -29
  492. package/lib/reanimated2/hook/useAnimatedScrollHandler.js +0 -41
  493. package/lib/reanimated2/hook/useAnimatedSensor.js +0 -66
  494. package/lib/reanimated2/hook/useAnimatedStyle.js +0 -393
  495. package/lib/reanimated2/hook/useDerivedValue.js +0 -36
  496. package/lib/reanimated2/hook/useSharedValue.js +0 -17
  497. package/lib/reanimated2/hook/utils.js +0 -173
  498. package/lib/reanimated2/interpolateColor.js +0 -101
  499. package/lib/reanimated2/interpolation.js +0 -112
  500. package/lib/reanimated2/jestUtils.js +0 -160
  501. package/lib/reanimated2/js-reanimated/JSReanimated.js +0 -99
  502. package/lib/reanimated2/js-reanimated/Mapper.js +0 -43
  503. package/lib/reanimated2/js-reanimated/MapperRegistry.js +0 -101
  504. package/lib/reanimated2/js-reanimated/MutableValue.js +0 -29
  505. package/lib/reanimated2/js-reanimated/commonTypes.js +0 -1
  506. package/lib/reanimated2/js-reanimated/index.js +0 -62
  507. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +0 -67
  508. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -69
  509. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -133
  510. package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +0 -194
  511. package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +0 -1
  512. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +0 -376
  513. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
  514. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +0 -275
  515. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +0 -385
  516. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +0 -138
  517. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +0 -81
  518. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +0 -115
  519. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +0 -273
  520. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +0 -203
  521. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +0 -101
  522. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +0 -451
  523. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -90
  524. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +0 -132
  525. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +0 -37
  526. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -41
  527. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +0 -34
  528. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -46
  529. package/lib/reanimated2/mock.js +0 -69
  530. package/lib/reanimated2/utils.js +0 -9
  531. package/lib/setAndForwardRef.js +0 -19
  532. package/lib/types/ConfigHelper.d.ts +0 -12
  533. package/lib/types/ReanimatedEventEmitter.d.ts +0 -3
  534. package/lib/types/ReanimatedModule.d.ts +0 -2
  535. package/lib/types/ReanimatedModule.macos.d.ts +0 -2
  536. package/lib/types/ReanimatedModule.native.d.ts +0 -2
  537. package/lib/types/ReanimatedModule.windows.d.ts +0 -2
  538. package/lib/types/ReanimatedModuleCompat.d.ts +0 -14
  539. package/lib/types/createAnimatedComponent.d.ts +0 -33
  540. package/lib/types/reanimated2/Bezier.d.ts +0 -6
  541. package/lib/types/reanimated2/Colors.d.ts +0 -31
  542. package/lib/types/reanimated2/NativeMethods.d.ts +0 -15
  543. package/lib/types/reanimated2/NativeReanimated/NativeReanimated.d.ts +0 -20
  544. package/lib/types/reanimated2/NativeReanimated/index.d.ts +0 -3
  545. package/lib/types/reanimated2/PlatformChecker.d.ts +0 -5
  546. package/lib/types/reanimated2/PropAdapters.d.ts +0 -4
  547. package/lib/types/reanimated2/UpdateProps.d.ts +0 -9
  548. package/lib/types/reanimated2/ViewDescriptorsSet.d.ts +0 -20
  549. package/lib/types/reanimated2/WorkletEventHandler.d.ts +0 -13
  550. package/lib/types/reanimated2/__mocks__/MutableValue.d.ts +0 -5
  551. package/lib/types/reanimated2/__mocks__/NativeReanimated.d.ts +0 -13
  552. package/lib/types/reanimated2/__mocks__/NativeReanimated.native.d.ts +0 -13
  553. package/lib/types/reanimated2/animation/commonTypes.d.ts +0 -27
  554. package/lib/types/reanimated2/animation/decay.d.ts +0 -19
  555. package/lib/types/reanimated2/animation/delay.d.ts +0 -7
  556. package/lib/types/reanimated2/animation/index.d.ts +0 -9
  557. package/lib/types/reanimated2/animation/repeat.d.ts +0 -12
  558. package/lib/types/reanimated2/animation/sequence.d.ts +0 -7
  559. package/lib/types/reanimated2/animation/spring.d.ts +0 -22
  560. package/lib/types/reanimated2/animation/styleAnimation.d.ts +0 -7
  561. package/lib/types/reanimated2/animation/timing.d.ts +0 -21
  562. package/lib/types/reanimated2/animation/util.d.ts +0 -9
  563. package/lib/types/reanimated2/commonTypes.d.ts +0 -80
  564. package/lib/types/reanimated2/component/FlatList.d.ts +0 -9
  565. package/lib/types/reanimated2/component/WrappedComponents.d.ts +0 -8
  566. package/lib/types/reanimated2/component/index.d.ts +0 -9
  567. package/lib/types/reanimated2/core.d.ts +0 -24
  568. package/lib/types/reanimated2/fabricUtils.d.ts +0 -4
  569. package/lib/types/reanimated2/hook/Hooks.d.ts +0 -5
  570. package/lib/types/reanimated2/hook/commonTypes.d.ts +0 -15
  571. package/lib/types/reanimated2/hook/index.d.ts +0 -10
  572. package/lib/types/reanimated2/hook/useAnimatedGestureHandler.d.ts +0 -35
  573. package/lib/types/reanimated2/hook/useAnimatedReaction.d.ts +0 -12
  574. package/lib/types/reanimated2/hook/useAnimatedRef.d.ts +0 -3
  575. package/lib/types/reanimated2/hook/useAnimatedScrollHandler.d.ts +0 -21
  576. package/lib/types/reanimated2/hook/useAnimatedSensor.d.ts +0 -18
  577. package/lib/types/reanimated2/hook/useAnimatedStyle.d.ts +0 -11
  578. package/lib/types/reanimated2/hook/useDerivedValue.d.ts +0 -4
  579. package/lib/types/reanimated2/hook/useSharedValue.d.ts +0 -2
  580. package/lib/types/reanimated2/hook/utils.d.ts +0 -28
  581. package/lib/types/reanimated2/index.d.ts +0 -12
  582. package/lib/types/reanimated2/interpolateColor.d.ts +0 -31
  583. package/lib/types/reanimated2/interpolation.d.ts +0 -11
  584. package/lib/types/reanimated2/jestUtils.d.ts +0 -12
  585. package/lib/types/reanimated2/js-reanimated/JSReanimated.d.ts +0 -30
  586. package/lib/types/reanimated2/js-reanimated/Mapper.d.ts +0 -14
  587. package/lib/types/reanimated2/js-reanimated/MapperRegistry.d.ts +0 -14
  588. package/lib/types/reanimated2/js-reanimated/MutableValue.d.ts +0 -14
  589. package/lib/types/reanimated2/js-reanimated/commonTypes.d.ts +0 -44
  590. package/lib/types/reanimated2/js-reanimated/index.d.ts +0 -15
  591. package/lib/types/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +0 -1
  592. package/lib/types/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -22
  593. package/lib/types/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -38
  594. package/lib/types/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -25
  595. package/lib/types/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -77
  596. package/lib/types/reanimated2/layoutReanimation/animationBuilder/index.d.ts +0 -4
  597. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -62
  598. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +0 -4
  599. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +0 -42
  600. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +0 -50
  601. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -18
  602. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -10
  603. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +0 -18
  604. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -34
  605. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +0 -34
  606. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -18
  607. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -66
  608. package/lib/types/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +0 -10
  609. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -19
  610. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -13
  611. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -6
  612. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -6
  613. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -7
  614. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -9
  615. package/lib/types/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +0 -6
  616. package/lib/types/reanimated2/layoutReanimation/index.d.ts +0 -4
  617. package/lib/types/reanimated2/mock.d.ts +0 -55
  618. package/lib/types/reanimated2/platform-specific/RNRenderer.d.ts +0 -1
  619. package/lib/types/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
  620. package/lib/types/reanimated2/utils.d.ts +0 -7
  621. package/react-native-reanimated.d.ts +0 -1187
  622. package/src/Animated.js +0 -18
  623. package/src/ReanimatedEventEmitter.ts +0 -4
  624. package/src/ReanimatedModule.macos.ts +0 -3
  625. package/src/ReanimatedModule.native.ts +0 -13
  626. package/src/ReanimatedModule.ts +0 -3
  627. package/src/ReanimatedModule.windows.ts +0 -3
  628. package/src/ReanimatedModuleCompat.ts +0 -51
  629. package/src/__mocks__/ReanimatedEventEmitter.js +0 -8
  630. package/src/__mocks__/ReanimatedModule.native.js +0 -11
  631. package/src/reanimated2/__mocks__/MutableValue.ts +0 -15
  632. package/src/reanimated2/__mocks__/NativeReanimated.ts +0 -23
  633. package/src/reanimated2/component/WrappedComponents.ts +0 -11
  634. package/src/reanimated2/component/index.ts +0 -9
@@ -1,8 +1,9 @@
1
- cmake_minimum_required(VERSION 3.5.1)
1
+ project(Reanimated)
2
+ cmake_minimum_required(VERSION 3.12.0)
2
3
 
3
4
  set (CMAKE_VERBOSE_MAKEFILE ON)
4
5
  set (CMAKE_CXX_STANDARD 17)
5
- set (DEFAULT_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DON_ANDROID -DONANDROID -DANDROID -DFOR_HERMES=${FOR_HERMES} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall")
6
+ set (DEFAULT_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DON_ANDROID -DONANDROID -DANDROID -DRNVERSION=${RNVERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -std=c++17 -Wall")
6
7
  if(${IS_NEW_ARCHITECTURE_ENABLED})
7
8
  set (ALL_FLAGS "${DEFAULT_FLAGS} -DRCT_NEW_ARCH_ENABLED")
8
9
  else()
@@ -22,11 +23,11 @@ set (PACKAGE_NAME "reanimated")
22
23
  set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
23
24
  set (SRC_DIR ${CMAKE_SOURCE_DIR}/src)
24
25
 
26
+ set (ignoreMe "${PLAYGROUND_APP_NAME}")
27
+
25
28
  if(${CLIENT_SIDE_BUILD})
26
- set (NODE_MODULES_DIR "${CMAKE_SOURCE_DIR}/../../")
27
29
  set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common")
28
30
  else()
29
- set (NODE_MODULES_DIR "../${PLAYGROUND_APP_NAME}/node_modules")
30
31
  set (COMMON_SRC_DIR "${SRC_DIR}/main/Common")
31
32
  endif()
32
33
 
@@ -44,13 +45,9 @@ else()
44
45
  endif()
45
46
 
46
47
  file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
47
- file (GLOB HERMES_DIR "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}")
48
48
 
49
- file(GLOB sources_tools "${COMMON_SRC_DIR}/cpp/Tools/*.cpp")
50
- file(GLOB sources_native_modules "${COMMON_SRC_DIR}/cpp/NativeModules/*.cpp")
51
- file(GLOB sources_shared_items "${COMMON_SRC_DIR}/cpp/SharedItems/*.cpp")
52
- file(GLOB sources_registries "${COMMON_SRC_DIR}/cpp/Registries/*.cpp")
53
- file(GLOB sources_android "${SRC_DIR}/main/cpp/*.cpp")
49
+ file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp")
50
+ file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp")
54
51
 
55
52
  if(${REACT_NATIVE_TARGET_VERSION} LESS 66)
56
53
  set (
@@ -77,21 +74,10 @@ endif()
77
74
  add_library(
78
75
  ${PACKAGE_NAME}
79
76
  SHARED
80
- ${sources_native_modules}
81
- ${sources_shared_items}
82
- ${sources_registries}
83
- ${sources_android}
84
- ${source_tools}
77
+ ${SOURCES_COMMON}
78
+ ${SOURCES_ANDROID}
85
79
  ${INCLUDE_JSI_CPP}
86
80
  ${INCLUDE_JSIDYNAMIC_CPP}
87
- "${COMMON_SRC_DIR}/cpp/Tools/JSIStoreValueUser.cpp"
88
- "${COMMON_SRC_DIR}/cpp/Tools/Mapper.cpp"
89
- "${COMMON_SRC_DIR}/cpp/Tools/RuntimeDecorator.cpp"
90
- "${COMMON_SRC_DIR}/cpp/Tools/Scheduler.cpp"
91
- "${COMMON_SRC_DIR}/cpp/Tools/WorkletEventHandler.cpp"
92
- "${COMMON_SRC_DIR}/cpp/Tools/FeaturesConfig.cpp"
93
- "${COMMON_SRC_DIR}/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp"
94
- "${COMMON_SRC_DIR}/cpp/AnimatedSensor/AnimatedSensorModule.cpp"
95
81
  ${FABRIC_UTILS_CPP}
96
82
  ${REANIMATED_UI_MANAGER_BINDING_CPP}
97
83
  )
@@ -121,7 +107,6 @@ target_include_directories(
121
107
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule/core"
122
108
  "${NODE_MODULES_DIR}/react-native/ReactCommon/turbomodule"
123
109
  "${NODE_MODULES_DIR}/react-native/ReactCommon/yoga"
124
- "${NODE_MODULES_DIR}/hermes-engine/android/include/"
125
110
  "${COMMON_SRC_DIR}/cpp/headers/Tools"
126
111
  "${COMMON_SRC_DIR}/cpp/headers/SpecTools"
127
112
  "${COMMON_SRC_DIR}/cpp/headers/NativeModules"
@@ -138,18 +123,6 @@ find_library(
138
123
  LOG_LIB
139
124
  log
140
125
  )
141
- find_library(
142
- HERMES_LIB
143
- hermes
144
- PATHS ${HERMES_DIR}
145
- NO_CMAKE_FIND_ROOT_PATH
146
- )
147
- find_library(
148
- JSEXECUTOR_LIB
149
- jscexecutor
150
- PATHS ${LIBRN_DIR}
151
- NO_CMAKE_FIND_ROOT_PATH
152
- )
153
126
  find_library(
154
127
  REACT_NATIVE_JNI_LIB
155
128
  reactnativejni
@@ -239,6 +212,12 @@ if(${IS_NEW_ARCHITECTURE_ENABLED})
239
212
  PATHS ${LIBRN_DIR}
240
213
  NO_CMAKE_FIND_ROOT_PATH
241
214
  )
215
+ find_library(
216
+ RRC_VIEW
217
+ rrc_view
218
+ PATHS ${LIBRN_DIR}
219
+ NO_CMAKE_FIND_ROOT_PATH
220
+ )
242
221
  find_library(
243
222
  REACT_RENDER_SCHEDULER
244
223
  react_render_scheduler
@@ -257,30 +236,70 @@ endif()
257
236
 
258
237
  set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
259
238
 
260
- if(${FOR_HERMES})
239
+
240
+ target_link_libraries(
241
+ ${PACKAGE_NAME}
242
+ ${LOG_LIB}
243
+ ${JSI_LIB}
244
+ ${GLOG_LIB}
245
+ ${FBJNI_LIB}
246
+ ${FOLLY_LIB}
247
+ ${REACT_NATIVE_JNI_LIB}
248
+ android
249
+ )
250
+
251
+ if(${JS_RUNTIME} STREQUAL "hermes")
252
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
253
+ if(${REACT_NATIVE_TARGET_VERSION} LESS 69)
254
+ # From `hermes-engine` npm package
255
+ target_include_directories(
256
+ ${PACKAGE_NAME}
257
+ PRIVATE
258
+ "${JS_RUNTIME_DIR}/android/include"
259
+ )
260
+ else()
261
+ # Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine`
262
+ target_include_directories(
263
+ ${PACKAGE_NAME}
264
+ PRIVATE
265
+ "${JS_RUNTIME_DIR}/API"
266
+ "${JS_RUNTIME_DIR}/public"
267
+ )
268
+ endif()
269
+ target_link_libraries(
270
+ ${PACKAGE_NAME}
271
+ "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so"
272
+ )
273
+ elseif(${JS_RUNTIME} STREQUAL "v8")
274
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1")
275
+ target_include_directories(
276
+ ${PACKAGE_NAME}
277
+ PRIVATE
278
+ "${JS_RUNTIME_DIR}/src"
279
+ )
280
+ file (GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/*/jni/${ANDROID_ABI}")
281
+ find_library(
282
+ V8EXECUTOR_LIB
283
+ v8executor
284
+ PATHS ${V8_SO_DIR}
285
+ NO_CMAKE_FIND_ROOT_PATH
286
+ )
261
287
  target_link_libraries(
262
288
  ${PACKAGE_NAME}
263
- ${LOG_LIB}
264
- ${JSI_LIB}
265
- ${HERMES_LIB}
266
- ${GLOG_LIB}
267
- ${FBJNI_LIB}
268
- ${FOLLY_LIB}
269
- ${REACT_NATIVE_JNI_LIB}
270
- android
289
+ ${V8EXECUTOR_LIB}
271
290
  )
272
291
  else()
292
+ set (ignoreMe "${JS_RUNTIME_DIR}")
293
+ string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1")
294
+ find_library(
295
+ JSEXECUTOR_LIB
296
+ jscexecutor
297
+ PATHS ${LIBRN_DIR}
298
+ NO_CMAKE_FIND_ROOT_PATH
299
+ )
273
300
  target_link_libraries(
274
301
  ${PACKAGE_NAME}
275
- ${LOG_LIB}
276
- ${JSI_LIB}
277
- ${FOLLY_LIB}
278
302
  ${JSEXECUTOR_LIB}
279
- ${GLOG_LIB}
280
- ${FBJNI_LIB}
281
- ${FOLLY_JSON_LIB}
282
- ${REACT_NATIVE_JNI_LIB}
283
- android
284
303
  )
285
304
  endif()
286
305
 
@@ -294,6 +313,7 @@ if(${IS_NEW_ARCHITECTURE_ENABLED})
294
313
  ${REACT_DEBUG}
295
314
  ${REACT_RENDER_DEBUG}
296
315
  ${RRC_ROOT}
316
+ ${RRC_VIEW}
297
317
  ${FABRICJNI}
298
318
  ${REACT_RENDER_SCHEDULER}
299
319
  )
@@ -1,8 +1,11 @@
1
1
  import com.android.Version
2
2
 
3
+ import java.nio.file.Files
3
4
  import java.nio.file.Paths
5
+ import java.nio.file.Path
4
6
  import org.apache.tools.ant.filters.ReplaceTokens
5
7
  import groovy.json.JsonSlurper
8
+ import java.util.stream.Stream
6
9
 
7
10
  /**
8
11
  * Finds the path of the installed npm package with the given name using Node's
@@ -44,9 +47,19 @@ def safeExtGet(prop, fallback) {
44
47
  }
45
48
 
46
49
  def resolveBuildType() {
47
- def buildType = System.getenv("CLIENT_SIDE_BUILD")
48
- if (buildType != null) {
49
- return buildType == "True"
50
+ def buildType = "debug"
51
+ tasks.all({ task ->
52
+ if (task.name == "buildCMakeRelease") {
53
+ buildType = "release"
54
+ }
55
+ })
56
+ return buildType
57
+ }
58
+
59
+ def resolveClientSideBuild() {
60
+ def clientSideBuild = System.getenv("CLIENT_SIDE_BUILD")
61
+ if (clientSideBuild != null) {
62
+ return clientSideBuild == "True"
50
63
  }
51
64
 
52
65
  if (hasProperty("clientSideBuild")) {
@@ -96,9 +109,26 @@ def getPlaygroundAppName() { // only for the development
96
109
  return playgroundAppName
97
110
  }
98
111
 
99
- boolean CLIENT_SIDE_BUILD = resolveBuildType()
112
+ boolean CLIENT_SIDE_BUILD = resolveClientSideBuild()
100
113
  if (CLIENT_SIDE_BUILD) {
101
114
  configurations.maybeCreate("default")
115
+
116
+ Stream<Path> pathStream = Files.find(
117
+ Paths.get(rootDir.parent),
118
+ Integer.MAX_VALUE,
119
+ (path, basicFileAttributes) -> { path.toString().endsWith("/react-native-reanimated/package.json") }
120
+ )
121
+
122
+ String parsedLocation = ""
123
+ def libInstancesCount = 0
124
+ pathStream.forEach(path -> {
125
+ parsedLocation += "- " + path.toString().replace("/package.json", "\n")
126
+ libInstancesCount++
127
+ })
128
+ if (libInstancesCount > 1) {
129
+ String exceptionMessage = "\nMultiple versions of Reanimated were detected. Only one instance of react-native-reanimated can be installed in a project. You need to resolve the conflict manually. Check out the documentation: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict between: \n" + parsedLocation + "\n";
130
+ throw new Exception(exceptionMessage)
131
+ }
102
132
  }
103
133
  def reactNative = resolveReactNativeDirectory()
104
134
  def reactNativeManifest = file("$reactNative/package.json")
@@ -134,13 +164,40 @@ def thirdPartyNdkDir = new File("$buildDir/third-party-ndk")
134
164
  def reactNativeThirdParty = new File("$reactNative/ReactAndroid/src/main/jni/third-party")
135
165
 
136
166
  def _stackProtectorFlag = true
137
- def FOR_HERMES = ""
138
167
 
139
- if (findProject(":app")) {
140
- FOR_HERMES = project(":app").ext.react.enableHermes
141
- } else {
142
- FOR_HERMES = System.getenv("FOR_HERMES") == "True"
143
- }
168
+ def CMAKE_NODE_MODULES_DIR = CLIENT_SIDE_BUILD
169
+ ? project.getProjectDir().getParentFile().getParent()
170
+ : Paths.get(project.getProjectDir().getParent(), getPlaygroundAppName(), "node_modules").toString()
171
+
172
+ def JS_RUNTIME = {
173
+ // Returns the js runtime explicitly requested in the environment variable
174
+ if (System.getenv("JS_RUNTIME")) {
175
+ return System.getenv("JS_RUNTIME")
176
+ }
177
+
178
+ // Detect js runtime from project setup
179
+ def defaultRuntimeType = "jsc";
180
+ def v8Project = rootProject.getSubprojects().find { project -> project.name == "react-native-v8" }
181
+ if (v8Project != null) {
182
+ return "v8"
183
+ }
184
+ def appProject = findProject(":app") ? project(":app") : null
185
+ return appProject?.ext?.react?.enableHermes ? "hermes" : defaultRuntimeType
186
+ }.call()
187
+
188
+ def jsRuntimeDir = {
189
+ if (JS_RUNTIME == "hermes") {
190
+ if (rnMinorVersion >= 69) {
191
+ return Paths.get(CMAKE_NODE_MODULES_DIR, "react-native", "sdks", "hermes")
192
+ } else {
193
+ return Paths.get(CMAKE_NODE_MODULES_DIR, "hermes-engine")
194
+ }
195
+ } else if (JS_RUNTIME == "v8") {
196
+ return findProject(":react-native-v8").getProjectDir().getParent()
197
+ } else {
198
+ return Paths.get(CMAKE_NODE_MODULES_DIR, "react-native", "ReactCommon", "jsi")
199
+ }
200
+ }.call()
144
201
 
145
202
  def reactNativeArchitectures() {
146
203
  def value = project.getProperties().get("reactNativeArchitectures")
@@ -205,10 +262,13 @@ android {
205
262
  "-DREACT_NATIVE_TARGET_VERSION=${REACT_VERSION}",
206
263
  "-DANDROID_TOOLCHAIN=clang",
207
264
  "-DBOOST_VERSION=${BOOST_VERSION}",
208
- "-DFOR_HERMES=${FOR_HERMES}",
265
+ "-DNODE_MODULES_DIR=${CMAKE_NODE_MODULES_DIR}",
266
+ "-DJS_RUNTIME=${JS_RUNTIME}",
267
+ "-DJS_RUNTIME_DIR=${jsRuntimeDir}",
209
268
  "-DCLIENT_SIDE_BUILD=${CLIENT_SIDE_BUILD}",
210
269
  "-DIS_NEW_ARCHITECTURE_ENABLED=${isNewArchitectureEnabled()}",
211
- "-DPLAYGROUND_APP_NAME=${getPlaygroundAppName()}"
270
+ "-DPLAYGROUND_APP_NAME=${getPlaygroundAppName()}",
271
+ "-DRNVERSION=${rnMinorVersion}"
212
272
  abiFilters (*reactNativeArchitectures())
213
273
  _stackProtectorFlag ? (cppFlags("-fstack-protector-all")) : null
214
274
  }
@@ -216,10 +276,12 @@ android {
216
276
 
217
277
  buildConfigField("boolean", "IS_INTERNAL_BUILD", "false")
218
278
  buildConfigField("int", "EXOPACKAGE_FLAGS", "0")
279
+ buildConfigField("int", "REACT_NATIVE_VERSION", rnMinorVersion.toString())
219
280
  }
220
281
  externalNativeBuild {
221
282
  cmake {
222
283
  path "CMakeLists.txt"
284
+ version "3.18.1"
223
285
  }
224
286
  }
225
287
  lintOptions {
@@ -233,10 +295,12 @@ android {
233
295
  "**/libfbjni.so",
234
296
  "**/libjsi.so",
235
297
  "**/libfolly_json.so",
298
+ "**/libfolly_runtime.so",
236
299
  "**/libglog.so",
237
300
  "**/libhermes.so",
238
301
  "**/libreactnativejni.so",
239
302
  "**/libjscexecutor.so",
303
+ "**/libv8executor.so",
240
304
  ]
241
305
  }
242
306
  tasks.withType(JavaCompile) {
@@ -252,11 +316,12 @@ android {
252
316
  targetCompatibility JavaVersion.VERSION_1_8
253
317
  }
254
318
  packagingOptions {
255
- // For some reason gradle only complains about the duplicated version of libreact_render libraries
256
- // while there are more libraries copied in intermediates folder of the lib build directory, we exlude
257
- // only the ones that make the build fail (ideally we should only include librnscreens_modules but we
319
+ // For some reason gradle only complains about the duplicated version of librrc_root and libreact_render libraries
320
+ // while there are more libraries copied in intermediates folder of the lib build directory, we exclude
321
+ // only the ones that make the build fail (ideally we should only include libreanimated but we
258
322
  // are only allowed to specify exlude patterns)
259
323
  exclude "**/libreact_render*.so"
324
+ exclude "**/librrc_root.so"
260
325
  }
261
326
  sourceSets.main {
262
327
  java {
@@ -408,23 +473,94 @@ task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy)
408
473
  }
409
474
  }
410
475
 
411
- task prepareHermes() {
412
- def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine")
413
- if (!hermesPackagePath) {
414
- throw new GradleScriptException("Could not find the hermes-engine npm package", null)
476
+ /*
477
+ Reanimated includes "hermes/hermes.h" header file in `NativeProxy.cpp`.
478
+ Previously, we used header files from `hermes-engine` package in `node_modules`.
479
+ Starting from React Native 0.69, Hermes is no longer distributed as package on NPM.
480
+ On the new architecture, Hermes is downloaded from GitHub and then compiled from sources.
481
+ However, on the old architecture, we need to download Hermes header files on our own
482
+ as well as unzip Hermes AAR in order to obtain `libhermes.so` shared library.
483
+ For more details, see https://reactnative.dev/architecture/bundled-hermes
484
+ or https://github.com/reactwg/react-native-new-architecture/discussions/4
485
+ */
486
+ if (rnMinorVersion >= 69 && !isNewArchitectureEnabled()) {
487
+ // copied from `react-native/ReactAndroid/hermes-engine/build.gradle`
488
+
489
+ def reactNativeRootDir = resolveReactNativeDirectory()
490
+ def customDownloadDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR")
491
+ def downloadDir = customDownloadDir ? new File(customDownloadDir) : new File(reactNativeRootDir, "sdks/download")
492
+
493
+ // By default we are going to download and unzip hermes inside the /sdks/hermes folder
494
+ // but you can provide an override for where the hermes source code is located.
495
+ def hermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") ?: new File(reactNativeRootDir, "sdks/hermes")
496
+
497
+ def hermesVersion = "main"
498
+ def hermesVersionFile = new File(reactNativeRootDir, "sdks/.hermesversion")
499
+ if (hermesVersionFile.exists()) {
500
+ hermesVersion = hermesVersionFile.text
501
+ }
502
+
503
+ task downloadHermes(type: Download) {
504
+ src("https://github.com/facebook/hermes/tarball/${hermesVersion}")
505
+ onlyIfNewer(true)
506
+ overwrite(false)
507
+ dest(new File(downloadDir, "hermes.tar.gz"))
508
+ }
509
+
510
+ task unzipHermes(dependsOn: downloadHermes, type: Copy) {
511
+ from(tarTree(downloadHermes.dest)) {
512
+ eachFile { file ->
513
+ // We flatten the unzip as the tarball contains a `facebook-hermes-<SHA>`
514
+ // folder at the top level.
515
+ if (file.relativePath.segments.size() > 1) {
516
+ file.relativePath = new org.gradle.api.file.RelativePath(!file.isDirectory(), file.relativePath.segments.drop(1))
517
+ }
518
+ }
519
+ }
520
+ into(hermesDir)
415
521
  }
522
+ }
416
523
 
417
- def hermesAAR = file("$hermesPackagePath/android/hermes-debug.aar")
418
- if (!hermesAAR.exists()) {
419
- throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"", null)
420
- }
524
+ task prepareHermes() {
525
+ if (rnMinorVersion >= 69) {
526
+ if (!isNewArchitectureEnabled()) {
527
+ dependsOn(unzipHermes)
528
+ }
421
529
 
422
- def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
530
+ doLast {
531
+ def hermesAAR = file("$reactNative/android/com/facebook/react/hermes-engine/$reactNativeVersion/hermes-engine-$reactNativeVersion-${resolveBuildType()}.aar") // e.g. hermes-engine-0.70.0-rc.1-debug.aar
532
+ if (!hermesAAR.exists()) {
533
+ throw new GradleScriptException("Could not find hermes-engine AAR", null)
534
+ }
423
535
 
424
- copy {
425
- from soFiles
426
- from "$reactNative/ReactAndroid/src/main/jni/first-party/hermes/Android.mk"
427
- into "$thirdPartyNdkDir/hermes"
536
+ def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
537
+
538
+ copy {
539
+ from soFiles
540
+ from "$reactNative/ReactAndroid/src/main/jni/first-party/hermes/Android.mk"
541
+ into "$thirdPartyNdkDir/hermes"
542
+ }
543
+ }
544
+ } else {
545
+ doLast {
546
+ def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine")
547
+ if (!hermesPackagePath) {
548
+ throw new GradleScriptException("Could not find the hermes-engine npm package", null)
549
+ }
550
+
551
+ def hermesAAR = file("$hermesPackagePath/android/hermes-debug.aar")
552
+ if (!hermesAAR.exists()) {
553
+ throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"", null)
554
+ }
555
+
556
+ def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
557
+
558
+ copy {
559
+ from soFiles
560
+ from "$reactNative/ReactAndroid/src/main/jni/first-party/hermes/Android.mk"
561
+ into "$thirdPartyNdkDir/hermes"
562
+ }
563
+ }
428
564
  }
429
565
  }
430
566
 
@@ -520,6 +656,7 @@ dependencies {
520
656
  }
521
657
  implementation "com.facebook.react:react-native:+" // From node_modules
522
658
  implementation "androidx.transition:transition:1.1.0"
659
+ implementation "androidx.core:core:1.7.0"
523
660
  extractHeaders("com.facebook.fbjni:fbjni:" + FBJNI_VERSION + ":headers")
524
661
  extractSO("com.facebook.fbjni:fbjni:" + FBJNI_VERSION)
525
662
 
@@ -528,12 +665,7 @@ dependencies {
528
665
  }
529
666
 
530
667
  task unpackReactNativeAAR {
531
- def buildType = "debug"
532
- tasks.all({ task ->
533
- if (task.name == "buildCMakeRelease") {
534
- buildType = "release"
535
- }
536
- })
668
+ def buildType = resolveBuildType()
537
669
  def rnAarMatcher = "**/react-native/**/*${buildType}.aar"
538
670
  if (rnMinorVersion < 69) {
539
671
  rnAarMatcher = "**/**/*.aar"
@@ -579,6 +711,18 @@ afterEvaluate {
579
711
  task.dependsOn(packageNdkLibs)
580
712
  }
581
713
  })
714
+
715
+ if (JS_RUNTIME == "hermes") {
716
+ extractAARHeaders.dependsOn(prepareHermes)
717
+ extractSOFiles.dependsOn(prepareHermes)
718
+ } else if (JS_RUNTIME == "v8") {
719
+ def buildTasks = tasks.findAll({ task ->
720
+ !task.name.contains("Clean") && (task.name.contains("externalNative") || task.name.contains("CMake") || task.name.startsWith("generateJsonModel")) })
721
+ buildTasks.forEach { task ->
722
+ def buildType = task.name.endsWith('Debug') ? 'Debug' : 'Release'
723
+ task.dependsOn(":react-native-v8:copy${buildType}JniLibsProjectOnly")
724
+ }
725
+ }
582
726
  }
583
727
 
584
728
  if (CLIENT_SIDE_BUILD) {
@@ -21,6 +21,7 @@ import com.facebook.react.uimanager.common.UIManagerType;
21
21
  import com.facebook.react.uimanager.events.RCTEventEmitter;
22
22
  import com.facebook.soloader.SoLoader;
23
23
  import com.swmansion.common.GestureHandlerStateManager;
24
+ import com.swmansion.reanimated.keyboardObserver.ReanimatedKeyboardEventListener;
24
25
  import com.swmansion.reanimated.layoutReanimation.AnimationsManager;
25
26
  import com.swmansion.reanimated.layoutReanimation.LayoutAnimations;
26
27
  import com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder;
@@ -92,6 +93,18 @@ public class NativeProxy {
92
93
  public native void sensorSetter(float[] value);
93
94
  }
94
95
 
96
+ @DoNotStrip
97
+ public static class KeyboardEventDataUpdater {
98
+ @DoNotStrip private final HybridData mHybridData;
99
+
100
+ @DoNotStrip
101
+ private KeyboardEventDataUpdater(HybridData hybridData) {
102
+ mHybridData = hybridData;
103
+ }
104
+
105
+ public native void keyboardEventDataUpdater(int keyboardState, int height);
106
+ }
107
+
95
108
  @DoNotStrip
96
109
  @SuppressWarnings("unused")
97
110
  private final HybridData mHybridData;
@@ -101,6 +114,7 @@ public class NativeProxy {
101
114
  private Scheduler mScheduler = null;
102
115
  private ReanimatedSensorContainer reanimatedSensorContainer;
103
116
  private final GestureHandlerStateManager gestureHandlerStateManager;
117
+ private ReanimatedKeyboardEventListener reanimatedKeyboardEventListener;
104
118
  private Long firstUptime = SystemClock.uptimeMillis();
105
119
  private boolean slowAnimationsEnabled = false;
106
120
 
@@ -122,6 +136,7 @@ public class NativeProxy {
122
136
  mContext = new WeakReference<>(context);
123
137
  prepare(LayoutAnimations);
124
138
  reanimatedSensorContainer = new ReanimatedSensorContainer(mContext);
139
+ reanimatedKeyboardEventListener = new ReanimatedKeyboardEventListener(mContext);
125
140
  addDevMenuOption();
126
141
 
127
142
  GestureHandlerStateManager tempHandlerStateManager;
@@ -257,6 +272,16 @@ public class NativeProxy {
257
272
  reanimatedSensorContainer.unregisterSensor(sensorId);
258
273
  }
259
274
 
275
+ @DoNotStrip
276
+ private int subscribeForKeyboardEvents(KeyboardEventDataUpdater keyboardEventDataUpdater) {
277
+ return reanimatedKeyboardEventListener.subscribeForKeyboardEvents(keyboardEventDataUpdater);
278
+ }
279
+
280
+ @DoNotStrip
281
+ private void unsubscribeFromKeyboardEvents(int listenerId) {
282
+ reanimatedKeyboardEventListener.unsubscribeFromKeyboardEvents(listenerId);
283
+ }
284
+
260
285
  public void onCatalystInstanceDestroy() {
261
286
  mScheduler.deactivate();
262
287
  mHybridData.resetNative();
@@ -7,8 +7,10 @@
7
7
  #include <memory>
8
8
  #include <string>
9
9
 
10
- #if FOR_HERMES
10
+ #if JS_RUNTIME_HERMES
11
11
  #include <hermes/hermes.h>
12
+ #elif JS_RUNTIME_V8
13
+ #include <v8runtime/V8RuntimeFactory.h>
12
14
  #else
13
15
  #include <jsi/JSCRuntime.h>
14
16
  #endif
@@ -65,10 +67,6 @@ NativeProxy::NativeProxy(
65
67
  }
66
68
 
67
69
  NativeProxy::~NativeProxy() {
68
- runtime_->global().setProperty(
69
- *runtime_,
70
- jsi::PropNameID::forAscii(*runtime_, "__reanimatedModuleProxy"),
71
- jsi::Value::undefined());
72
70
  // removed temporary, new event listener mechanism need fix on the RN side
73
71
  // reactScheduler_->removeEventListener(eventListener_);
74
72
  }
@@ -178,6 +176,12 @@ void NativeProxy::installJSIBindings(
178
176
  std::string str = result->toStdString();
179
177
  return jsi::Value(rt, jsi::String::createFromAscii(rt, str.c_str()));
180
178
  };
179
+
180
+ auto configurePropsFunction = [=](jsi::Runtime &rt,
181
+ const jsi::Value &uiProps,
182
+ const jsi::Value &nativeProps) {
183
+ this->configureProps(rt, uiProps, nativeProps);
184
+ };
181
185
  #endif
182
186
 
183
187
  auto registerSensorFunction =
@@ -192,11 +196,27 @@ void NativeProxy::installJSIBindings(
192
196
  auto setGestureStateFunction = [this](int handlerTag, int newState) -> void {
193
197
  setGestureState(handlerTag, newState);
194
198
  };
195
- #if FOR_HERMES
199
+
200
+ auto subscribeForKeyboardEventsFunction =
201
+ [this](std::function<void(int, int)> keyboardEventDataUpdater) -> int {
202
+ return subscribeForKeyboardEvents(std::move(keyboardEventDataUpdater));
203
+ };
204
+
205
+ auto unsubscribeFromKeyboardEventsFunction = [this](int listenerId) -> void {
206
+ unsubscribeFromKeyboardEvents(listenerId);
207
+ };
208
+
209
+ #if JS_RUNTIME_HERMES
196
210
  auto config =
197
211
  ::hermes::vm::RuntimeConfig::Builder().withEnableSampleProfiling(false);
198
212
  std::shared_ptr<jsi::Runtime> animatedRuntime =
199
213
  facebook::hermes::makeHermesRuntime(config.build());
214
+ #elif JS_RUNTIME_V8
215
+ auto config = std::make_unique<rnv8::V8RuntimeConfig>();
216
+ config->enableInspector = false;
217
+ config->appName = "reanimated";
218
+ std::shared_ptr<jsi::Runtime> animatedRuntime =
219
+ rnv8::createSharedV8Runtime(runtime_, std::move(config));
200
220
  #else
201
221
  std::shared_ptr<jsi::Runtime> animatedRuntime =
202
222
  facebook::jsc::makeJSCRuntime();
@@ -234,12 +254,6 @@ void NativeProxy::installJSIBindings(
234
254
  this->layoutAnimations->cthis()->notifyAboutEnd(tag, (isCancelled) ? 1 : 0);
235
255
  };
236
256
 
237
- auto configurePropsFunction = [=](jsi::Runtime &rt,
238
- const jsi::Value &uiProps,
239
- const jsi::Value &nativeProps) {
240
- this->configureProps(rt, uiProps, nativeProps);
241
- };
242
-
243
257
  std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy =
244
258
  std::make_shared<LayoutAnimationsProxy>(
245
259
  notifyAboutProgress, notifyAboutEnd);
@@ -261,7 +275,10 @@ void NativeProxy::installJSIBindings(
261
275
  getCurrentTime,
262
276
  registerSensorFunction,
263
277
  unregisterSensorFunction,
264
- setGestureStateFunction};
278
+ setGestureStateFunction,
279
+ subscribeForKeyboardEventsFunction,
280
+ unsubscribeFromKeyboardEventsFunction,
281
+ };
265
282
 
266
283
  auto module = std::make_shared<NativeReanimatedModule>(
267
284
  jsCallInvoker_,
@@ -479,4 +496,22 @@ void NativeProxy::configureProps(
479
496
  .get());
480
497
  }
481
498
 
499
+ int NativeProxy::subscribeForKeyboardEvents(
500
+ std::function<void(int, int)> keyboardEventDataUpdater) {
501
+ auto method = javaPart_->getClass()
502
+ ->getMethod<int(KeyboardEventDataUpdater::javaobject)>(
503
+ "subscribeForKeyboardEvents");
504
+ return method(
505
+ javaPart_.get(),
506
+ KeyboardEventDataUpdater::newObjectCxxArgs(
507
+ std::move(keyboardEventDataUpdater))
508
+ .get());
509
+ }
510
+
511
+ void NativeProxy::unsubscribeFromKeyboardEvents(int listenerId) {
512
+ auto method = javaPart_->getClass()->getMethod<void(int)>(
513
+ "unsubscribeFromKeyboardEvents");
514
+ method(javaPart_.get(), listenerId);
515
+ }
516
+
482
517
  } // namespace reanimated