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
@@ -35,10 +35,10 @@ jsi::Value AnimatedSensorModule::registerSensor(
35
35
  setter = [&, mutableObject](double newValues[]) {
36
36
  jsi::Runtime &runtime = *runtimeManager_->runtime.get();
37
37
  jsi::Object value(runtime);
38
- value.setProperty(runtime, "qw", newValues[0]);
39
- value.setProperty(runtime, "qx", newValues[1]);
40
- value.setProperty(runtime, "qy", newValues[2]);
41
- value.setProperty(runtime, "qz", newValues[3]);
38
+ value.setProperty(runtime, "qx", newValues[0]);
39
+ value.setProperty(runtime, "qy", newValues[1]);
40
+ value.setProperty(runtime, "qz", newValues[2]);
41
+ value.setProperty(runtime, "qw", newValues[3]);
42
42
  value.setProperty(runtime, "yaw", newValues[4]);
43
43
  value.setProperty(runtime, "pitch", newValues[5]);
44
44
  value.setProperty(runtime, "roll", newValues[6]);
@@ -1,5 +1,10 @@
1
1
  #ifdef RCT_NEW_ARCH_ENABLED
2
2
 
3
+ #if RNVERSION < 69
4
+ #error \
5
+ "Reanimated 3 does not support React Native 0.68.x when Fabric is enabled. Please upgrade to React Native 0.69.0 or newer if you want to use Reanimated with the new architecture."
6
+ #endif
7
+
3
8
  #include "FabricUtils.h"
4
9
 
5
10
  #include <react/renderer/uimanager/UIManagerBinding.h>
@@ -84,10 +89,10 @@ LayoutMetrics UIManager_getRelativeLayoutMetrics(
84
89
  shadowNode.getFamily(), *layoutableAncestorShadowNode, policy);
85
90
  }
86
91
 
87
- SharedShadowNode UIManager_cloneNode(
92
+ ShadowNode::Shared UIManager_cloneNode(
88
93
  const UIManager *uiManager,
89
94
  const ShadowNode::Shared &shadowNode,
90
- const SharedShadowNodeSharedList &children,
95
+ const ShadowNode::SharedListOfShared &children,
91
96
  const RawProps *rawProps) {
92
97
  auto delegate_ = getDelegateFromUIManager(uiManager);
93
98
  auto contextContainer_ = getContextContainerFromUIManager(uiManager);
@@ -17,31 +17,54 @@ void ReanimatedUIManagerBinding::createAndInstallIfNeeded(
17
17
  &newestShadowNodesRegistry) {
18
18
  // adapted from UIManagerBinding.cpp
19
19
  auto uiManagerModuleName = "nativeFabricUIManager";
20
- auto uiManagerBinding = std::make_shared<ReanimatedUIManagerBinding>(
21
- uiManager, runtimeExecutor, newestShadowNodesRegistry);
22
- auto object = jsi::Object::createFromHostObject(runtime, uiManagerBinding);
20
+
21
+ auto eventHandler = [&]() -> std::unique_ptr<EventHandler const> {
22
+ auto uiManagerValue =
23
+ runtime.global().getProperty(runtime, uiManagerModuleName);
24
+ if (uiManagerValue.isUndefined()) {
25
+ return nullptr;
26
+ }
27
+
28
+ auto uiManagerBinding =
29
+ uiManagerValue.asObject(runtime).asHostObject<UIManagerBinding>(
30
+ runtime);
31
+ auto uiManagerBindingPublic =
32
+ reinterpret_cast<UIManagerBindingPublic *>(&*uiManagerBinding);
33
+ return std::move(uiManagerBindingPublic->eventHandler_);
34
+ }();
35
+
36
+ auto reanimatedUiManagerBinding =
37
+ std::make_shared<ReanimatedUIManagerBinding>(
38
+ uiManager,
39
+ runtimeExecutor,
40
+ std::move(eventHandler),
41
+ newestShadowNodesRegistry);
42
+ auto object =
43
+ jsi::Object::createFromHostObject(runtime, reanimatedUiManagerBinding);
23
44
  runtime.global().setProperty(runtime, uiManagerModuleName, std::move(object));
24
45
  }
25
46
 
26
47
  ReanimatedUIManagerBinding::ReanimatedUIManagerBinding(
27
48
  std::shared_ptr<UIManager> uiManager,
28
49
  RuntimeExecutor runtimeExecutor,
50
+ std::unique_ptr<EventHandler const> eventHandler,
29
51
  std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry)
30
52
  : UIManagerBinding(uiManager, runtimeExecutor),
31
53
  uiManager_(std::move(uiManager)),
32
- newestShadowNodesRegistry_(newestShadowNodesRegistry) {}
54
+ newestShadowNodesRegistry_(newestShadowNodesRegistry) {
55
+ if (eventHandler != nullptr) {
56
+ reinterpret_cast<UIManagerBindingPublic *>(this)->eventHandler_ =
57
+ std::move(eventHandler);
58
+ }
59
+ }
33
60
 
34
61
  ReanimatedUIManagerBinding::~ReanimatedUIManagerBinding() {}
35
62
 
36
- void ReanimatedUIManagerBinding::invalidate() const {
37
- uiManager_->setDelegate(nullptr);
38
- }
39
-
40
63
  static inline ShadowNode::Shared cloneNode(
41
64
  UIManager *uiManager,
42
65
  NewestShadowNodesRegistry *newestShadowNodesRegistry,
43
66
  const ShadowNode::Shared &shadowNode,
44
- const SharedShadowNodeSharedList &children = nullptr,
67
+ const ShadowNode::SharedListOfShared &children = nullptr,
45
68
  const RawProps *rawProps = nullptr) {
46
69
  {
47
70
  auto lock = newestShadowNodesRegistry->createLock();
@@ -0,0 +1,92 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #include "ShadowTreeCloner.h"
4
+ #include "FabricUtils.h"
5
+
6
+ namespace reanimated {
7
+
8
+ ShadowTreeCloner::ShadowTreeCloner(
9
+ std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry,
10
+ std::shared_ptr<UIManager> uiManager,
11
+ SurfaceId surfaceId)
12
+ : newestShadowNodesRegistry_{newestShadowNodesRegistry},
13
+ propsParserContext_{
14
+ surfaceId,
15
+ *getContextContainerFromUIManager(&*uiManager)} {}
16
+
17
+ ShadowTreeCloner::~ShadowTreeCloner() {
18
+ #ifdef DEBUG
19
+ react_native_assert(
20
+ yogaChildrenUpdates_.empty() &&
21
+ "Deallocating `ShadowTreeCloner` without calling `updateYogaChildren`.");
22
+ #endif
23
+ }
24
+
25
+ ShadowNode::Unshared ShadowTreeCloner::cloneWithNewProps(
26
+ const ShadowNode::Shared &oldRootNode,
27
+ const ShadowNodeFamily &family,
28
+ RawProps &&rawProps) {
29
+ // adapted from ShadowNode::cloneTree
30
+
31
+ auto ancestors = family.getAncestors(*oldRootNode);
32
+
33
+ if (ancestors.empty()) {
34
+ return ShadowNode::Unshared{nullptr};
35
+ }
36
+
37
+ auto &parent = ancestors.back();
38
+ auto &oldShadowNode = parent.first.get().getChildren().at(parent.second);
39
+
40
+ const auto newest = newestShadowNodesRegistry_->get(oldShadowNode->getTag());
41
+
42
+ const auto &source = newest == nullptr ? oldShadowNode : newest;
43
+
44
+ const auto props = source->getComponentDescriptor().cloneProps(
45
+ propsParserContext_, source->getProps(), rawProps);
46
+
47
+ auto newChildNode = source->clone({/* .props = */ props});
48
+
49
+ for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
50
+ auto &parentNode = it->first.get();
51
+ auto childIndex = it->second;
52
+
53
+ auto children = parentNode.getChildren();
54
+ const auto &oldChildNode = *children.at(childIndex);
55
+ react_native_assert(ShadowNode::sameFamily(oldChildNode, *newChildNode));
56
+
57
+ newestShadowNodesRegistry_->set(newChildNode, parentNode.getTag());
58
+
59
+ if (!parentNode.getSealed()) {
60
+ // Optimization: if a ShadowNode is unsealed, we can directly update its
61
+ // children instead of cloning the whole path to the root node.
62
+ auto &parentNodeNonConst = const_cast<ShadowNode &>(parentNode);
63
+ parentNodeNonConst.replaceChild(oldChildNode, newChildNode, childIndex);
64
+ yogaChildrenUpdates_.insert(&parentNodeNonConst);
65
+ return std::const_pointer_cast<ShadowNode>(oldRootNode);
66
+ }
67
+
68
+ children[childIndex] = newChildNode;
69
+
70
+ newChildNode = parentNode.clone({
71
+ ShadowNodeFragment::propsPlaceholder(),
72
+ std::make_shared<ShadowNode::ListOfShared>(children),
73
+ });
74
+ }
75
+
76
+ return std::const_pointer_cast<ShadowNode>(newChildNode);
77
+ }
78
+
79
+ void ShadowTreeCloner::updateYogaChildren() {
80
+ // Unfortunately, `replaceChild` does not update Yoga nodes, so we need to
81
+ // update them manually here.
82
+ for (ShadowNode *shadowNode : yogaChildrenUpdates_) {
83
+ static_cast<YogaLayoutableShadowNode *>(shadowNode)->updateYogaChildren();
84
+ }
85
+ #ifdef DEBUG
86
+ yogaChildrenUpdates_.clear();
87
+ #endif
88
+ }
89
+
90
+ } // namespace reanimated
91
+
92
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -13,6 +13,7 @@
13
13
  #include "FabricUtils.h"
14
14
  #include "NewestShadowNodesRegistry.h"
15
15
  #include "ReanimatedUIManagerBinding.h"
16
+ #include "ShadowTreeCloner.h"
16
17
  #endif
17
18
 
18
19
  #include "EventHandlerRegistry.h"
@@ -163,6 +164,10 @@ NativeReanimatedModule::NativeReanimatedModule(
163
164
  #else
164
165
  updatePropsFunction = platformDepMethodsHolder.updatePropsFunction;
165
166
  #endif
167
+ subscribeForKeyboardEventsFunction =
168
+ platformDepMethodsHolder.subscribeForKeyboardEvents;
169
+ unsubscribeFromKeyboardEventsFunction =
170
+ platformDepMethodsHolder.unsubscribeFromKeyboardEvents;
166
171
  }
167
172
 
168
173
  void NativeReanimatedModule::installCoreFunctions(
@@ -503,56 +508,42 @@ void NativeReanimatedModule::performOperations() {
503
508
 
504
509
  react_native_assert(uiManager_ != nullptr);
505
510
  const auto &shadowTreeRegistry = uiManager_->getShadowTreeRegistry();
506
- auto contextContainer = getContextContainerFromUIManager(
507
- &*uiManager_); // TODO: use Scheduler::getContextContainer
508
- PropsParserContext propsParserContext{surfaceId_, *contextContainer};
509
511
  jsi::Runtime &rt = *runtime.get();
510
512
 
511
513
  shadowTreeRegistry.visit(surfaceId_, [&](ShadowTree const &shadowTree) {
512
514
  shadowTree.commit([&](RootShadowNode const &oldRootShadowNode) {
513
- // lock once due to performance reasons
514
- auto lock = newestShadowNodesRegistry_->createLock();
515
-
516
515
  auto rootNode = oldRootShadowNode.ShadowNode::clone(ShadowNodeFragment{});
517
516
 
518
- for (const auto &pair : copiedOperationsQueue) {
519
- const ShadowNodeFamily &family = pair.first->getFamily();
520
- react_native_assert(family.getSurfaceId() == surfaceId_);
521
-
522
- auto newRootNode =
523
- rootNode->cloneTree(family, [&](ShadowNode const &oldShadowNode) {
524
- const auto newest =
525
- newestShadowNodesRegistry_->get(oldShadowNode.getTag());
517
+ ShadowTreeCloner shadowTreeCloner{
518
+ newestShadowNodesRegistry_, uiManager_, surfaceId_};
526
519
 
527
- const auto &source = newest == nullptr ? oldShadowNode : *newest;
520
+ {
521
+ // lock once due to performance reasons
522
+ auto lock = newestShadowNodesRegistry_->createLock();
528
523
 
529
- const auto newProps = source.getComponentDescriptor().cloneProps(
530
- propsParserContext,
531
- source.getProps(),
532
- RawProps(rt, *pair.second));
524
+ for (const auto &pair : copiedOperationsQueue) {
525
+ const ShadowNodeFamily &family = pair.first->getFamily();
526
+ react_native_assert(family.getSurfaceId() == surfaceId_);
533
527
 
534
- return source.clone({/* .props = */ newProps});
535
- });
528
+ auto newRootNode = shadowTreeCloner.cloneWithNewProps(
529
+ rootNode, family, RawProps(rt, *pair.second));
536
530
 
537
- if (newRootNode == nullptr) {
538
- // this happens when React removed the component but Reanimated still
539
- // tries to animate it, let's skip update for this specific component
540
- continue;
531
+ if (newRootNode == nullptr) {
532
+ // this happens when React removed the component but Reanimated
533
+ // still tries to animate it, let's skip update for this specific
534
+ // component
535
+ continue;
536
+ }
537
+ rootNode = newRootNode;
541
538
  }
542
- rootNode = newRootNode;
543
539
 
544
- auto ancestors = family.getAncestors(*rootNode);
545
- for (const auto &pair : ancestors) {
546
- const auto &parent = pair.first.get();
547
- const auto &child = parent.getChildren().at(pair.second);
548
- newestShadowNodesRegistry_->set(child, parent.getTag());
540
+ // remove ShadowNodes and its ancestors from NewestShadowNodesRegistry
541
+ for (auto tag : copiedTagsToRemove) {
542
+ newestShadowNodesRegistry_->remove(tag);
549
543
  }
550
544
  }
551
545
 
552
- // remove ShadowNodes and its ancestors from NewestShadowNodesRegistry
553
- for (auto tag : copiedTagsToRemove) {
554
- newestShadowNodesRegistry_->remove(tag);
555
- }
546
+ shadowTreeCloner.updateYogaChildren();
556
547
 
557
548
  return std::static_pointer_cast<RootShadowNode>(rootNode);
558
549
  });
@@ -632,4 +623,38 @@ void NativeReanimatedModule::setNewestShadowNodesRegistry(
632
623
  }
633
624
  #endif // RCT_NEW_ARCH_ENABLED
634
625
 
626
+ jsi::Value NativeReanimatedModule::subscribeForKeyboardEvents(
627
+ jsi::Runtime &rt,
628
+ const jsi::Value &keyboardEventContainer) {
629
+ jsi::Object keyboardEventObj = keyboardEventContainer.getObject(rt);
630
+ std::unordered_map<std::string, std::shared_ptr<ShareableValue>>
631
+ sharedProperties;
632
+ std::shared_ptr<ShareableValue> keyboardStateShared = ShareableValue::adapt(
633
+ rt, keyboardEventObj.getProperty(rt, "state"), this);
634
+ std::shared_ptr<ShareableValue> heightShared = ShareableValue::adapt(
635
+ rt, keyboardEventObj.getProperty(rt, "height"), this);
636
+
637
+ auto keyboardEventDataUpdater =
638
+ [this, &rt, keyboardStateShared, heightShared](
639
+ int keyboardState, int height) {
640
+ auto &keyboardStateValue =
641
+ ValueWrapper::asMutableValue(keyboardStateShared->valueContainer);
642
+ keyboardStateValue->setValue(rt, jsi::Value(keyboardState));
643
+
644
+ auto &heightMutableValue =
645
+ ValueWrapper::asMutableValue(heightShared->valueContainer);
646
+ heightMutableValue->setValue(rt, jsi::Value(height));
647
+
648
+ this->mapperRegistry->execute(*this->runtime);
649
+ };
650
+
651
+ return subscribeForKeyboardEventsFunction(keyboardEventDataUpdater);
652
+ }
653
+
654
+ void NativeReanimatedModule::unsubscribeFromKeyboardEvents(
655
+ jsi::Runtime &rt,
656
+ const jsi::Value &listenerId) {
657
+ unsubscribeFromKeyboardEventsFunction(listenerId.asNumber());
658
+ }
659
+
635
660
  } // namespace reanimated
@@ -138,6 +138,25 @@ static jsi::Value SPEC_PREFIX(configureProps)(
138
138
  return jsi::Value::undefined();
139
139
  }
140
140
 
141
+ static jsi::Value SPEC_PREFIX(subscribeForKeyboardEvents)(
142
+ jsi::Runtime &rt,
143
+ TurboModule &turboModule,
144
+ const jsi::Value *args,
145
+ size_t count) {
146
+ return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
147
+ ->subscribeForKeyboardEvents(rt, std::move(args[0]));
148
+ }
149
+
150
+ static jsi::Value SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
151
+ jsi::Runtime &rt,
152
+ TurboModule &turboModule,
153
+ const jsi::Value *args,
154
+ size_t count) {
155
+ static_cast<NativeReanimatedModuleSpec *>(&turboModule)
156
+ ->unsubscribeFromKeyboardEvents(rt, std::move(args[0]));
157
+ return jsi::Value::undefined();
158
+ }
159
+
141
160
  NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
142
161
  std::shared_ptr<CallInvoker> jsInvoker)
143
162
  : TurboModule("NativeReanimated", jsInvoker) {
@@ -163,5 +182,9 @@ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
163
182
  methodMap_["unregisterSensor"] =
164
183
  MethodMetadata{1, SPEC_PREFIX(unregisterSensor)};
165
184
  methodMap_["configureProps"] = MethodMetadata{2, SPEC_PREFIX(configureProps)};
185
+ methodMap_["subscribeForKeyboardEvents"] =
186
+ MethodMetadata{1, SPEC_PREFIX(subscribeForKeyboardEvents)};
187
+ methodMap_["unsubscribeFromKeyboardEvents"] =
188
+ MethodMetadata{1, SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
166
189
  }
167
190
  } // namespace reanimated
@@ -71,21 +71,27 @@ void RuntimeDecorator::decorateRuntime(
71
71
  1,
72
72
  setGlobalConsole));
73
73
 
74
+ auto chronoNow = [](jsi::Runtime &rt,
75
+ const jsi::Value &thisValue,
76
+ const jsi::Value *args,
77
+ size_t count) -> jsi::Value {
78
+ double now = std::chrono::system_clock::now().time_since_epoch() /
79
+ std::chrono::milliseconds(1);
80
+ return jsi::Value(now);
81
+ };
82
+
74
83
  rt.global().setProperty(
75
84
  rt,
76
85
  "_chronoNow",
77
86
  jsi::Function::createFromHostFunction(
78
- rt,
79
- jsi::PropNameID::forAscii(rt, "_chronoNow"),
80
- 0,
81
- [](jsi::Runtime &rt,
82
- const jsi::Value &thisValue,
83
- const jsi::Value *args,
84
- size_t count) -> jsi::Value {
85
- double now = std::chrono::system_clock::now().time_since_epoch() /
86
- std::chrono::milliseconds(1);
87
- return jsi::Value(now);
88
- }));
87
+ rt, jsi::PropNameID::forAscii(rt, "_chronoNow"), 0, chronoNow));
88
+ jsi::Object performance(rt);
89
+ performance.setProperty(
90
+ rt,
91
+ "now",
92
+ jsi::Function::createFromHostFunction(
93
+ rt, jsi::PropNameID::forAscii(rt, "now"), 0, chronoNow));
94
+ rt.global().setProperty(rt, "performance", performance);
89
95
  }
90
96
 
91
97
  void RuntimeDecorator::decorateUIRuntime(
@@ -17,6 +17,7 @@ namespace reanimated {
17
17
  struct UIManagerBindingPublic {
18
18
  void *vtable;
19
19
  std::shared_ptr<UIManager> uiManager_;
20
+ std::unique_ptr<EventHandler const> eventHandler_;
20
21
  };
21
22
 
22
23
  struct UIManagerPublic {
@@ -63,10 +64,10 @@ LayoutMetrics UIManager_getRelativeLayoutMetrics(
63
64
  ShadowNode const *ancestorShadowNode,
64
65
  LayoutableShadowNode::LayoutInspectingPolicy policy);
65
66
 
66
- SharedShadowNode UIManager_cloneNode(
67
+ ShadowNode::Shared UIManager_cloneNode(
67
68
  const UIManager *uiManager,
68
69
  const ShadowNode::Shared &shadowNode,
69
- const SharedShadowNodeSharedList &children = nullptr,
70
+ const ShadowNode::SharedListOfShared &children = nullptr,
70
71
  const RawProps *rawProps = nullptr);
71
72
 
72
73
  void UIManager_appendChild(
@@ -28,6 +28,7 @@ class ReanimatedUIManagerBinding : public UIManagerBinding {
28
28
  ReanimatedUIManagerBinding(
29
29
  std::shared_ptr<UIManager> uiManager,
30
30
  RuntimeExecutor runtimeExecutor,
31
+ std::unique_ptr<EventHandler const> eventHandler,
31
32
  std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry);
32
33
 
33
34
  ~ReanimatedUIManagerBinding();
@@ -0,0 +1,41 @@
1
+ #pragma once
2
+ #ifdef RCT_NEW_ARCH_ENABLED
3
+
4
+ #include <react/renderer/core/PropsParserContext.h>
5
+ #include <react/renderer/uimanager/UIManager.h>
6
+
7
+ #include <memory>
8
+ #include <set>
9
+
10
+ #include "NewestShadowNodesRegistry.h"
11
+
12
+ using namespace facebook;
13
+ using namespace react;
14
+
15
+ namespace reanimated {
16
+
17
+ class ShadowTreeCloner {
18
+ public:
19
+ ShadowTreeCloner(
20
+ std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry,
21
+ std::shared_ptr<UIManager> uiManager,
22
+ SurfaceId surfaceId);
23
+
24
+ ~ShadowTreeCloner();
25
+
26
+ ShadowNode::Unshared cloneWithNewProps(
27
+ const ShadowNode::Shared &oldRootNode,
28
+ const ShadowNodeFamily &family,
29
+ RawProps &&rawProps);
30
+
31
+ void updateYogaChildren();
32
+
33
+ private:
34
+ PropsParserContext propsParserContext_;
35
+ std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry_;
36
+ std::set<ShadowNode *> yogaChildrenUpdates_;
37
+ };
38
+
39
+ } // namespace reanimated
40
+
41
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -136,6 +136,12 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
136
136
  const jsi::Value &interval,
137
137
  const jsi::Value &sensorDataContainer) override;
138
138
  void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;
139
+ jsi::Value subscribeForKeyboardEvents(
140
+ jsi::Runtime &rt,
141
+ const jsi::Value &keyboardEventContainer) override;
142
+ void unsubscribeFromKeyboardEvents(
143
+ jsi::Runtime &rt,
144
+ const jsi::Value &listenerId) override;
139
145
 
140
146
  private:
141
147
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -173,6 +179,9 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
173
179
  #endif
174
180
 
175
181
  std::unordered_set<std::string> nativePropNames_; // filled by configureProps
182
+
183
+ KeyboardEventSubscribeFunction subscribeForKeyboardEventsFunction;
184
+ KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction;
176
185
  };
177
186
 
178
187
  } // namespace reanimated
@@ -69,6 +69,14 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
69
69
  jsi::Runtime &rt,
70
70
  const jsi::Value &sensorId) = 0;
71
71
 
72
+ // keyboard
73
+ virtual jsi::Value subscribeForKeyboardEvents(
74
+ jsi::Runtime &rt,
75
+ const jsi::Value &keyboardEventContainer) = 0;
76
+ virtual void unsubscribeFromKeyboardEvents(
77
+ jsi::Runtime &rt,
78
+ const jsi::Value &listenerId) = 0;
79
+
72
80
  // other
73
81
  virtual jsi::Value enableLayoutAnimations(
74
82
  jsi::Runtime &rt,
@@ -61,6 +61,9 @@ using ConfigurePropsFunction = std::function<void(
61
61
  jsi::Runtime &rt,
62
62
  const jsi::Value &uiProps,
63
63
  const jsi::Value &nativeProps)>;
64
+ using KeyboardEventSubscribeFunction =
65
+ std::function<int(std::function<void(int, int)>)>;
66
+ using KeyboardEventUnsubscribeFunction = std::function<void(int)>;
64
67
 
65
68
  struct PlatformDepMethodsHolder {
66
69
  RequestRender requestRender;
@@ -76,6 +79,8 @@ struct PlatformDepMethodsHolder {
76
79
  RegisterSensorFunction registerSensor;
77
80
  UnregisterSensorFunction unregisterSensor;
78
81
  SetGestureStateFunction setGestureStateFunction;
82
+ KeyboardEventSubscribeFunction subscribeForKeyboardEvents;
83
+ KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEvents;
79
84
  };
80
85
 
81
86
  } // namespace reanimated
@@ -4,14 +4,16 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  reactVersion = '0.0.0'
6
6
  reactTargetTvOS = false
7
+ isUserApp = false
7
8
 
8
9
  begin
9
- # standard app
10
+ # user app
10
11
  # /appName/node_modules/react-native-reanimated/RNReanimated.podspec
11
12
  # /appName/node_modules/react-native/package.json
12
13
  reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
13
14
  reactVersion = reactJson["version"]
14
15
  reactTargetTvOS = reactJson["name"] == "react-native-tvos"
16
+ isUserApp = true
15
17
  rescue
16
18
  begin
17
19
  # monorepo
@@ -24,18 +26,39 @@ rescue
24
26
  begin
25
27
  # Example app in reanimated repo
26
28
  # /react-native-reanimated/RNReanimated.podspec
27
- # /react-native-reanimated/node_modules/react-native/package.json
28
- reactJson = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))
29
+ # /react-native-reanimated/{Example,FabricExample,TVOSExample}/node_modules/react-native/package.json
30
+ if ENV["ReanimatedTVOSExample"] == "1" then
31
+ appName = "TVOSExample"
32
+ elsif ENV["RCT_NEW_ARCH_ENABLED"] == "1" then
33
+ appName = "FabricExample"
34
+ else
35
+ appName = "Example"
36
+ end
37
+ reactJson = JSON.parse(File.read(File.join(__dir__, appName, "node_modules", "react-native", "package.json")))
29
38
  reactVersion = reactJson["version"]
30
39
  reactTargetTvOS = ENV["ReanimatedTVOSExample"] == "1"
31
40
  rescue
32
41
  # should never happen
33
42
  reactVersion = '0.68.0'
34
- puts "[RNReanimated] Unable to recognized your `react-native` version! Default `react-native` version: " + reactVersion
43
+ puts "[RNReanimated] Unable to recognize your `react-native` version! Default `react-native` version: " + reactVersion
35
44
  end
36
45
  end
37
46
  end
38
47
 
48
+ if isUserApp
49
+ libInstances = %x[find ../../ -name "package.json" | grep "/react-native-reanimated/package.json"]
50
+ libInstancesArray = libInstances.split("\n")
51
+ if libInstancesArray.length() > 1
52
+ parsedLocation = ''
53
+ for location in libInstancesArray
54
+ location['../../'] = '- '
55
+ location['/package.json'] = ''
56
+ parsedLocation += location + "\n"
57
+ end
58
+ raise "[Reanimated] Multiple 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
59
+ end
60
+ end
61
+
39
62
  rnVersion = reactVersion.split('.')[1]
40
63
 
41
64
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
@@ -47,7 +70,6 @@ end
47
70
 
48
71
  folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRNVERSION=' + rnVersion
49
72
  folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
50
- folly_version = '2021.06.28.00-v2'
51
73
  boost_compiler_flags = '-Wno-documentation'
52
74
  fabric_flags = ''
53
75
  if fabric_enabled
@@ -94,7 +116,7 @@ Pod::Spec.new do |s|
94
116
  if fabric_enabled
95
117
  s.dependency "React-RCTFabric"
96
118
  s.dependency "React-Codegen"
97
- s.dependency "RCT-Folly", folly_version
119
+ s.dependency "RCT-Folly"
98
120
  else
99
121
  s.dependency "#{folly_prefix}Folly"
100
122
  end