react-native-reanimated 2.3.0-alpha.1 → 2.3.0-beta.2

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 (328) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +170 -166
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +36 -34
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +13 -6
  5. package/Common/cpp/Registries/MapperRegistry.cpp +19 -15
  6. package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
  7. package/Common/cpp/SharedItems/FrozenObject.cpp +19 -8
  8. package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
  9. package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
  10. package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
  11. package/Common/cpp/SharedItems/ShareableValue.cpp +216 -143
  12. package/Common/cpp/Tools/JSIStoreValueUser.cpp +36 -24
  13. package/Common/cpp/Tools/Mapper.cpp +41 -29
  14. package/Common/cpp/Tools/RuntimeDecorator.cpp +103 -84
  15. package/Common/cpp/Tools/Scheduler.cpp +14 -6
  16. package/Common/cpp/Tools/WorkletEventHandler.cpp +1 -1
  17. package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
  18. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +45 -34
  19. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +28 -16
  20. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +14 -8
  21. package/Common/cpp/headers/Registries/MapperRegistry.h +4 -4
  22. package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
  23. package/Common/cpp/headers/SharedItems/FrozenObject.h +15 -11
  24. package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +6 -4
  25. package/Common/cpp/headers/SharedItems/MutableValue.h +21 -12
  26. package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +10 -7
  27. package/Common/cpp/headers/SharedItems/RemoteObject.h +16 -8
  28. package/Common/cpp/headers/SharedItems/RuntimeManager.h +39 -21
  29. package/Common/cpp/headers/SharedItems/ShareableValue.h +31 -27
  30. package/Common/cpp/headers/SharedItems/SharedParent.h +7 -4
  31. package/Common/cpp/headers/SharedItems/ValueWrapper.h +80 -61
  32. package/Common/cpp/headers/SpecTools/ErrorHandler.h +17 -19
  33. package/Common/cpp/headers/Tools/JSIStoreValueUser.h +18 -13
  34. package/Common/cpp/headers/Tools/Mapper.h +24 -18
  35. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +12 -7
  36. package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -7
  37. package/Common/cpp/headers/Tools/RuntimeDecorator.h +29 -23
  38. package/Common/cpp/headers/Tools/Scheduler.h +28 -33
  39. package/Common/cpp/headers/Tools/WorkletEventHandler.h +9 -7
  40. package/Common/cpp/hidden_headers/Logger.h +14 -14
  41. package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
  42. package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
  43. package/README.md +1 -1
  44. package/RNReanimated.podspec +4 -4
  45. package/android/build.gradle +80 -3
  46. package/android/react-native-reanimated-63-hermes.aar +0 -0
  47. package/android/react-native-reanimated-63-jsc.aar +0 -0
  48. package/android/react-native-reanimated-64-hermes.aar +0 -0
  49. package/android/react-native-reanimated-64-jsc.aar +0 -0
  50. package/android/react-native-reanimated-65-hermes.aar +0 -0
  51. package/android/react-native-reanimated-65-jsc.aar +0 -0
  52. package/android/react-native-reanimated-66-hermes.aar +0 -0
  53. package/android/react-native-reanimated-66-jsc.aar +0 -0
  54. package/ios/LayoutReanimation/REAAnimationsManager.h +19 -10
  55. package/ios/LayoutReanimation/REAAnimationsManager.m +195 -200
  56. package/ios/LayoutReanimation/REASnapshot.h +13 -0
  57. package/ios/LayoutReanimation/REASnapshot.m +29 -0
  58. package/ios/LayoutReanimation/REAUIManager.h +16 -0
  59. package/ios/LayoutReanimation/REAUIManager.mm +348 -0
  60. package/ios/Nodes/REAAlwaysNode.m +14 -15
  61. package/ios/Nodes/REABezierNode.m +8 -7
  62. package/ios/Nodes/REABlockNode.m +1 -1
  63. package/ios/Nodes/REACallFuncNode.h +0 -1
  64. package/ios/Nodes/REACallFuncNode.m +10 -8
  65. package/ios/Nodes/REAClockNodes.m +22 -20
  66. package/ios/Nodes/REAConcatNode.h +0 -1
  67. package/ios/Nodes/REAConcatNode.m +2 -2
  68. package/ios/Nodes/REACondNode.m +7 -5
  69. package/ios/Nodes/READebugNode.m +5 -4
  70. package/ios/Nodes/REAEventNode.m +1 -1
  71. package/ios/Nodes/REAFunctionNode.h +0 -1
  72. package/ios/Nodes/REAFunctionNode.m +2 -2
  73. package/ios/Nodes/REAJSCallNode.m +4 -5
  74. package/ios/Nodes/REANode.h +3 -4
  75. package/ios/Nodes/REANode.m +9 -11
  76. package/ios/Nodes/REAOperatorNode.m +68 -67
  77. package/ios/Nodes/REAParamNode.h +1 -3
  78. package/ios/Nodes/REAParamNode.m +15 -17
  79. package/ios/Nodes/REAPropsNode.h +1 -3
  80. package/ios/Nodes/REAPropsNode.m +19 -22
  81. package/ios/Nodes/REASetNode.h +0 -1
  82. package/ios/Nodes/REASetNode.m +7 -5
  83. package/ios/Nodes/REAStyleNode.h +0 -1
  84. package/ios/Nodes/REAStyleNode.m +2 -4
  85. package/ios/Nodes/REATransformNode.h +0 -1
  86. package/ios/Nodes/REATransformNode.m +3 -5
  87. package/ios/Nodes/REAValueNode.m +5 -7
  88. package/ios/REAEventDispatcher.m +3 -3
  89. package/ios/REAModule.h +0 -2
  90. package/ios/REAModule.m +29 -40
  91. package/ios/REANodesManager.h +11 -19
  92. package/ios/REANodesManager.m +105 -130
  93. package/ios/REAUtils.h +5 -3
  94. package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
  95. package/ios/Transitioning/REAAllTransitions.h +2 -2
  96. package/ios/Transitioning/REAAllTransitions.m +14 -25
  97. package/ios/Transitioning/REATransition.h +8 -7
  98. package/ios/Transitioning/REATransition.m +19 -16
  99. package/ios/Transitioning/REATransitionAnimation.h +1 -1
  100. package/ios/Transitioning/REATransitionAnimation.m +2 -3
  101. package/ios/Transitioning/REATransitionManager.m +3 -3
  102. package/ios/native/NativeMethods.h +15 -5
  103. package/ios/native/NativeProxy.h +4 -3
  104. package/ios/native/NativeProxy.mm +19 -5
  105. package/ios/native/REAIOSErrorHandler.h +13 -10
  106. package/ios/native/REAIOSLogger.h +8 -8
  107. package/ios/native/REAIOSScheduler.h +5 -5
  108. package/ios/native/REAIOSScheduler.mm +7 -5
  109. package/ios/native/REAInitializer.h +37 -0
  110. package/ios/native/REAInitializer.mm +63 -0
  111. package/ios/native/UIResponder+Reanimated.mm +9 -48
  112. package/lib/ConfigHelper.js +1 -0
  113. package/lib/ReanimatedModule.native.js +10 -2
  114. package/lib/createAnimatedComponent.js +64 -30
  115. package/lib/reanimated1/core/AnimatedAlways.js +1 -1
  116. package/lib/reanimated1/core/AnimatedBezier.js +1 -1
  117. package/lib/reanimated1/core/AnimatedBlock.js +1 -1
  118. package/lib/reanimated1/core/AnimatedCall.js +1 -1
  119. package/lib/reanimated1/core/AnimatedCallFunc.js +1 -1
  120. package/lib/reanimated1/core/AnimatedConcat.js +1 -1
  121. package/lib/reanimated1/core/AnimatedCond.js +1 -1
  122. package/lib/reanimated1/core/AnimatedDebug.js +1 -1
  123. package/lib/reanimated1/core/AnimatedEvent.js +1 -1
  124. package/lib/reanimated1/core/AnimatedFunction.js +1 -1
  125. package/lib/reanimated1/core/AnimatedOperator.js +1 -1
  126. package/lib/reanimated1/core/AnimatedParam.js +1 -1
  127. package/lib/reanimated1/core/AnimatedProps.js +2 -2
  128. package/lib/reanimated1/core/AnimatedSet.js +1 -1
  129. package/lib/reanimated1/core/AnimatedStartClock.js +1 -1
  130. package/lib/reanimated1/core/AnimatedStopClock.js +1 -1
  131. package/lib/reanimated1/core/AnimatedStyle.js +1 -1
  132. package/lib/reanimated1/core/AnimatedTransform.js +1 -1
  133. package/lib/reanimated1/core/Core.test.js +30 -0
  134. package/lib/reanimated1/core/InternalAnimatedValue.js +1 -1
  135. package/lib/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
  136. package/lib/reanimated1/derived/interpolate.js +1 -1
  137. package/lib/reanimated2/Colors.js +16 -12
  138. package/lib/reanimated2/NativeMethods.js +3 -14
  139. package/lib/reanimated2/{NativeReanimated.native.js → NativeReanimated/NativeReanimated.js} +19 -24
  140. package/lib/reanimated2/NativeReanimated/index.js +15 -0
  141. package/lib/reanimated2/PlatformChecker.js +16 -0
  142. package/lib/reanimated2/PropAdapters.js +14 -4
  143. package/lib/reanimated2/UpdateProps.js +14 -11
  144. package/lib/reanimated2/ViewDescriptorsSet.js +73 -0
  145. package/lib/reanimated2/WorkletEventHandler.js +15 -13
  146. package/lib/reanimated2/animation/commonTypes.js +1 -0
  147. package/lib/reanimated2/animation/decay.js +71 -0
  148. package/lib/reanimated2/animation/delay.js +64 -0
  149. package/lib/reanimated2/animation/index.js +8 -0
  150. package/lib/reanimated2/animation/repeat.js +69 -0
  151. package/lib/reanimated2/animation/sequence.js +72 -0
  152. package/lib/reanimated2/animation/spring.js +101 -0
  153. package/lib/reanimated2/animation/styleAnimation.js +166 -0
  154. package/lib/reanimated2/animation/timing.js +64 -0
  155. package/lib/reanimated2/animation/util.js +157 -0
  156. package/lib/reanimated2/commonTypes.js +1 -0
  157. package/lib/reanimated2/core.js +35 -39
  158. package/lib/reanimated2/globals.d.ts +47 -1
  159. package/lib/reanimated2/hook/Hooks.js +9 -0
  160. package/lib/reanimated2/hook/commonTypes.js +1 -0
  161. package/lib/reanimated2/hook/index.js +8 -0
  162. package/lib/reanimated2/hook/useAnimatedGestureHandler.js +50 -0
  163. package/lib/reanimated2/hook/useAnimatedReaction.js +37 -0
  164. package/lib/reanimated2/hook/useAnimatedRef.js +25 -0
  165. package/lib/reanimated2/hook/useAnimatedScrollHandler.js +41 -0
  166. package/lib/reanimated2/hook/useAnimatedStyle.js +376 -0
  167. package/lib/reanimated2/hook/useDerivedValue.js +36 -0
  168. package/lib/reanimated2/hook/useSharedValue.js +17 -0
  169. package/lib/reanimated2/hook/utils.js +175 -0
  170. package/lib/reanimated2/index.js +3 -2
  171. package/lib/reanimated2/interpolation.js +95 -86
  172. package/lib/reanimated2/jestUtils.js +0 -12
  173. package/lib/reanimated2/js-reanimated/JSReanimated.js +9 -10
  174. package/lib/reanimated2/js-reanimated/index.js +57 -1
  175. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +58 -0
  176. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +69 -0
  177. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
  178. package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +193 -0
  179. package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +1 -0
  180. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +3 -0
  181. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +325 -207
  182. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
  183. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +235 -187
  184. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +327 -269
  185. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +146 -0
  186. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +85 -0
  187. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +119 -0
  188. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +289 -0
  189. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +159 -121
  190. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +83 -65
  191. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +371 -277
  192. package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +4 -0
  193. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
  194. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
  195. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
  196. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
  197. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
  198. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
  199. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
  200. package/lib/reanimated2/layoutReanimation/index.js +3 -2
  201. package/lib/reanimated2/platform-specific/RNRenderer.web.js +2 -0
  202. package/lib/reanimated2/utils.js +9 -0
  203. package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
  204. package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
  205. package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
  206. package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
  207. package/package.json +21 -10
  208. package/plugin.js +244 -85
  209. package/react-native-reanimated.d.ts +531 -453
  210. package/src/ConfigHelper.js +1 -0
  211. package/src/ReanimatedModule.native.js +10 -2
  212. package/src/createAnimatedComponent.js +64 -30
  213. package/src/reanimated1/core/AnimatedAlways.js +1 -1
  214. package/src/reanimated1/core/AnimatedBezier.js +1 -1
  215. package/src/reanimated1/core/AnimatedBlock.js +1 -1
  216. package/src/reanimated1/core/AnimatedCall.js +1 -1
  217. package/src/reanimated1/core/AnimatedCallFunc.js +1 -1
  218. package/src/reanimated1/core/AnimatedConcat.js +1 -1
  219. package/src/reanimated1/core/AnimatedCond.js +1 -1
  220. package/src/reanimated1/core/AnimatedDebug.js +1 -1
  221. package/src/reanimated1/core/AnimatedEvent.js +1 -1
  222. package/src/reanimated1/core/AnimatedFunction.js +1 -1
  223. package/src/reanimated1/core/AnimatedOperator.js +1 -1
  224. package/src/reanimated1/core/AnimatedParam.js +1 -1
  225. package/src/reanimated1/core/AnimatedProps.js +2 -2
  226. package/src/reanimated1/core/AnimatedSet.js +1 -1
  227. package/src/reanimated1/core/AnimatedStartClock.js +1 -1
  228. package/src/reanimated1/core/AnimatedStopClock.js +1 -1
  229. package/src/reanimated1/core/AnimatedStyle.js +1 -1
  230. package/src/reanimated1/core/AnimatedTransform.js +1 -1
  231. package/src/reanimated1/core/Core.test.js +30 -0
  232. package/src/reanimated1/core/InternalAnimatedValue.js +1 -1
  233. package/src/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
  234. package/src/reanimated1/derived/interpolate.js +1 -1
  235. package/src/reanimated2/Colors.ts +30 -27
  236. package/src/reanimated2/Easing.ts +3 -1
  237. package/src/reanimated2/NativeMethods.ts +26 -16
  238. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +78 -0
  239. package/src/reanimated2/NativeReanimated/index.ts +18 -0
  240. package/src/reanimated2/PlatformChecker.ts +21 -0
  241. package/src/reanimated2/PropAdapters.ts +52 -34
  242. package/src/reanimated2/UpdateProps.ts +40 -20
  243. package/src/reanimated2/ViewDescriptorsSet.ts +108 -0
  244. package/src/reanimated2/WorkletEventHandler.ts +41 -23
  245. package/src/reanimated2/animation/commonTypes.ts +48 -0
  246. package/src/reanimated2/animation/decay.ts +141 -0
  247. package/src/reanimated2/animation/delay.ts +103 -0
  248. package/src/reanimated2/animation/index.ts +16 -0
  249. package/src/reanimated2/animation/repeat.ts +128 -0
  250. package/src/reanimated2/animation/sequence.ts +110 -0
  251. package/src/reanimated2/animation/spring.ts +165 -0
  252. package/src/reanimated2/animation/styleAnimation.ts +253 -0
  253. package/src/reanimated2/animation/timing.ts +109 -0
  254. package/src/reanimated2/animation/util.ts +242 -0
  255. package/src/reanimated2/commonTypes.ts +81 -0
  256. package/src/reanimated2/core.ts +128 -82
  257. package/src/reanimated2/globals.d.ts +47 -1
  258. package/src/reanimated2/hook/Hooks.ts +16 -0
  259. package/src/reanimated2/hook/commonTypes.ts +12 -0
  260. package/src/reanimated2/hook/index.ts +25 -0
  261. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +110 -0
  262. package/src/reanimated2/hook/useAnimatedReaction.ts +49 -0
  263. package/src/reanimated2/hook/useAnimatedRef.ts +34 -0
  264. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +83 -0
  265. package/src/reanimated2/hook/useAnimatedStyle.ts +538 -0
  266. package/src/reanimated2/hook/useDerivedValue.ts +48 -0
  267. package/src/reanimated2/hook/useSharedValue.ts +22 -0
  268. package/src/reanimated2/hook/utils.ts +259 -0
  269. package/src/reanimated2/index.ts +3 -2
  270. package/src/reanimated2/interpolation.ts +170 -101
  271. package/src/reanimated2/jestUtils.ts +0 -12
  272. package/src/reanimated2/js-reanimated/JSReanimated.ts +47 -22
  273. package/src/reanimated2/js-reanimated/Mapper.ts +1 -1
  274. package/src/reanimated2/js-reanimated/index.ts +71 -0
  275. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +62 -0
  276. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +91 -0
  277. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
  278. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +263 -0
  279. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +78 -0
  280. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +16 -0
  281. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +243 -121
  282. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +43 -0
  283. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +95 -53
  284. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +114 -64
  285. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +179 -0
  286. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +93 -0
  287. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +132 -0
  288. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +333 -0
  289. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +84 -50
  290. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +41 -23
  291. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +234 -154
  292. package/src/reanimated2/layoutReanimation/defaultAnimations/index.ts +4 -0
  293. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
  294. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
  295. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
  296. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
  297. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
  298. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
  299. package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
  300. package/src/reanimated2/layoutReanimation/index.ts +3 -2
  301. package/src/reanimated2/platform-specific/RNRenderer.web.ts +2 -0
  302. package/src/reanimated2/utils.ts +21 -0
  303. package/android/react-native-reanimated-62-hermes.aar +0 -0
  304. package/android/react-native-reanimated-62-jsc.aar +0 -0
  305. package/ios/LayoutReanimation/REAAnimationRootView.h +0 -12
  306. package/ios/LayoutReanimation/REAAnimationRootView.m +0 -16
  307. package/ios/LayoutReanimation/REAAnimationRootViewManager.h +0 -9
  308. package/ios/LayoutReanimation/REAAnimationRootViewManager.m +0 -49
  309. package/ios/LayoutReanimation/REAReactBatchObserver.h +0 -20
  310. package/ios/LayoutReanimation/REAReactBatchObserver.m +0 -125
  311. package/ios/LayoutReanimation/REASnapshooter.h +0 -19
  312. package/ios/LayoutReanimation/REASnapshooter.m +0 -64
  313. package/ios/LayoutReanimation/REAViewTraverser.h +0 -13
  314. package/ios/LayoutReanimation/REAViewTraverser.m +0 -40
  315. package/lib/reanimated2/Hooks.js +0 -732
  316. package/lib/reanimated2/NativeReanimated.js +0 -4
  317. package/lib/reanimated2/animations.js +0 -713
  318. package/lib/reanimated2/js-reanimated/index.web.js +0 -20
  319. package/lib/reanimated2/layoutReanimation/AnimatedRoot.js +0 -55
  320. package/lib/reanimated2/layoutReanimation/defaultAnimationsBuilder.js +0 -374
  321. package/src/reanimated2/Hooks.ts +0 -918
  322. package/src/reanimated2/NativeReanimated.native.ts +0 -61
  323. package/src/reanimated2/NativeReanimated.ts +0 -5
  324. package/src/reanimated2/animations.ts +0 -868
  325. package/src/reanimated2/js-reanimated/index.js +0 -0
  326. package/src/reanimated2/js-reanimated/index.web.ts +0 -29
  327. package/src/reanimated2/layoutReanimation/AnimatedRoot.tsx +0 -68
  328. package/src/reanimated2/layoutReanimation/defaultAnimationsBuilder.ts +0 -440
@@ -2,27 +2,27 @@
2
2
 
3
3
  #import <React/RCTConvert.h>
4
4
 
5
+ #import <React/RCTShadowView.h>
6
+ #import "Nodes/REAAlwaysNode.h"
7
+ #import "Nodes/REABezierNode.h"
8
+ #import "Nodes/REABlockNode.h"
9
+ #import "Nodes/REACallFuncNode.h"
10
+ #import "Nodes/REAClockNodes.h"
11
+ #import "Nodes/REAConcatNode.h"
12
+ #import "Nodes/REACondNode.h"
13
+ #import "Nodes/READebugNode.h"
14
+ #import "Nodes/REAEventNode.h"
15
+ #import "Nodes/REAFunctionNode.h"
16
+ #import "Nodes/REAJSCallNode.h"
5
17
  #import "Nodes/REANode.h"
18
+ #import "Nodes/REAOperatorNode.h"
19
+ #import "Nodes/REAParamNode.h"
6
20
  #import "Nodes/REAPropsNode.h"
21
+ #import "Nodes/REASetNode.h"
7
22
  #import "Nodes/REAStyleNode.h"
8
23
  #import "Nodes/REATransformNode.h"
9
24
  #import "Nodes/REAValueNode.h"
10
- #import "Nodes/REABlockNode.h"
11
- #import "Nodes/REACondNode.h"
12
- #import "Nodes/REAOperatorNode.h"
13
- #import "Nodes/REASetNode.h"
14
- #import "Nodes/READebugNode.h"
15
- #import "Nodes/REAClockNodes.h"
16
- #import "Nodes/REAJSCallNode.h"
17
- #import "Nodes/REABezierNode.h"
18
- #import "Nodes/REAEventNode.h"
19
25
  #import "REAModule.h"
20
- #import "Nodes/REAAlwaysNode.h"
21
- #import "Nodes/REAConcatNode.h"
22
- #import "Nodes/REAParamNode.h"
23
- #import "Nodes/REAFunctionNode.h"
24
- #import "Nodes/REACallFuncNode.h"
25
- #import <React/RCTShadowView.h>
26
26
 
27
27
  // Interface below has been added in order to use private methods of RCTUIManager,
28
28
  // RCTUIManager#UpdateView is a React Method which is exported to JS but in
@@ -32,9 +32,7 @@
32
32
 
33
33
  @interface RCTUIManager ()
34
34
 
35
- - (void)updateView:(nonnull NSNumber *)reactTag
36
- viewName:(NSString *)viewName
37
- props:(NSDictionary *)props;
35
+ - (void)updateView:(nonnull NSNumber *)reactTag viewName:(NSString *)viewName props:(NSDictionary *)props;
38
36
 
39
37
  - (void)setNeedsLayout;
40
38
 
@@ -84,13 +82,11 @@
84
82
 
85
83
  @end
86
84
 
87
- @interface REANodesManager() <RCTUIManagerObserver>
85
+ @interface REANodesManager () <RCTUIManagerObserver>
88
86
 
89
87
  @end
90
88
 
91
-
92
- @implementation REANodesManager
93
- {
89
+ @implementation REANodesManager {
94
90
  NSMutableDictionary<REANodeID, REANode *> *_nodes;
95
91
  NSMapTable<NSString *, REANode *> *_eventMapping;
96
92
  NSMutableArray<id<RCTEvent>> *_eventQueue;
@@ -105,8 +101,7 @@
105
101
  volatile void (^_mounting)(void);
106
102
  }
107
103
 
108
- - (instancetype)initWithModule:(REAModule *)reanimatedModule
109
- uiManager:(RCTUIManager *)uiManager
104
+ - (instancetype)initWithModule:(REAModule *)reanimatedModule uiManager:(RCTUIManager *)uiManager
110
105
  {
111
106
  if ((self = [super init])) {
112
107
  _reanimatedModule = reanimatedModule;
@@ -119,7 +114,7 @@
119
114
  _onAnimationCallbacks = [NSMutableArray new];
120
115
  _operationsInBatch = [NSMutableArray new];
121
116
  }
122
-
117
+
123
118
  _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
124
119
  [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
125
120
  [_displayLink setPaused:true];
@@ -172,14 +167,14 @@
172
167
 
173
168
  - (void)startUpdatingOnAnimationFrame
174
169
  {
175
- // Setting _currentAnimationTimestamp here is connected with manual triggering of performOperations
176
- // in operationsBatchDidComplete. If new node has been created and clock has not been started,
177
- // _displayLink won't be initialized soon enough and _displayLink.timestamp will be 0.
178
- // However, CADisplayLink is using CACurrentMediaTime so if there's need to perform one more
179
- // evaluation, it could be used it here. In usual case, CACurrentMediaTime is not being used in
180
- // favor of setting it with _displayLink.timestamp in onAnimationFrame method.
181
- _currentAnimationTimestamp = CACurrentMediaTime();
182
- [_displayLink setPaused:false];
170
+ // Setting _currentAnimationTimestamp here is connected with manual triggering of performOperations
171
+ // in operationsBatchDidComplete. If new node has been created and clock has not been started,
172
+ // _displayLink won't be initialized soon enough and _displayLink.timestamp will be 0.
173
+ // However, CADisplayLink is using CACurrentMediaTime so if there's need to perform one more
174
+ // evaluation, it could be used it here. In usual case, CACurrentMediaTime is not being used in
175
+ // favor of setting it with _displayLink.timestamp in onAnimationFrame method.
176
+ _currentAnimationTimestamp = CACurrentMediaTime();
177
+ [_displayLink setPaused:false];
183
178
  }
184
179
 
185
180
  - (void)stopUpdatingOnAnimationFrame
@@ -217,7 +212,8 @@
217
212
  }
218
213
  }
219
214
 
220
- - (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block {
215
+ - (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block
216
+ {
221
217
  RCTAssert(_mounting == nil, @"Mouting block is expected to not be set");
222
218
  _mounting = block;
223
219
  return YES;
@@ -234,7 +230,7 @@
234
230
 
235
231
  BOOL trySynchronously = _tryRunBatchUpdatesSynchronously;
236
232
  _tryRunBatchUpdatesSynchronously = NO;
237
-
233
+
238
234
  __weak typeof(self) weakSelf = self;
239
235
  dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
240
236
  RCTExecuteOnUIManagerQueue(^{
@@ -243,27 +239,27 @@
243
239
  return;
244
240
  }
245
241
  BOOL canUpdateSynchronously = trySynchronously && ![strongSelf.uiManager hasEnqueuedUICommands];
246
-
242
+
247
243
  if (!canUpdateSynchronously) {
248
244
  dispatch_semaphore_signal(semaphore);
249
245
  }
250
-
246
+
251
247
  for (int i = 0; i < copiedOperationsQueue.count; i++) {
252
248
  copiedOperationsQueue[i](strongSelf.uiManager);
253
249
  }
254
-
250
+
255
251
  if (canUpdateSynchronously) {
256
252
  [strongSelf.uiManager runSyncUIUpdatesWithObserver:self];
257
253
  dispatch_semaphore_signal(semaphore);
258
254
  }
259
- //In case canUpdateSynchronously=true we still have to send uiManagerWillPerformMounting event
260
- //to observers because some components (e.g. TextInput) update their UIViews only on that event.
255
+ // In case canUpdateSynchronously=true we still have to send uiManagerWillPerformMounting event
256
+ // to observers because some components (e.g. TextInput) update their UIViews only on that event.
261
257
  [strongSelf.uiManager setNeedsLayout];
262
258
  });
263
259
  if (trySynchronously) {
264
260
  dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
265
261
  }
266
-
262
+
267
263
  if (_mounting) {
268
264
  _mounting();
269
265
  _mounting = nil;
@@ -273,9 +269,10 @@
273
269
  }
274
270
 
275
271
  - (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag
276
- viewName:(NSString *) viewName
272
+ viewName:(NSString *)viewName
277
273
  nativeProps:(NSMutableDictionary *)nativeProps
278
- trySynchronously:(BOOL)trySync {
274
+ trySynchronously:(BOOL)trySync
275
+ {
279
276
  if (trySync) {
280
277
  _tryRunBatchUpdatesSynchronously = YES;
281
278
  }
@@ -284,49 +281,48 @@
284
281
  }];
285
282
  }
286
283
 
287
- - (void)getValue:(REANodeID)nodeID
288
- callback:(RCTResponseSenderBlock)callback
284
+ - (void)getValue:(REANodeID)nodeID callback:(RCTResponseSenderBlock)callback
289
285
  {
290
286
  id val = _nodes[nodeID].value;
291
287
  if (val) {
292
- callback(@[val]);
288
+ callback(@[ val ]);
293
289
  } else {
294
290
  // NULL is not an object and it's not possible to pass it as callback's argument
295
- callback(@[[NSNull null]]);
291
+ callback(@[ [NSNull null] ]);
296
292
  }
297
293
  }
298
294
 
299
- #pragma mark -- Graph
295
+ #pragma mark-- Graph
300
296
 
301
- - (void)createNode:(REANodeID)nodeID
302
- config:(NSDictionary<NSString *, id> *)config
297
+ - (void)createNode:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
303
298
  {
304
299
  static NSDictionary *map;
305
300
  static dispatch_once_t mapToken;
306
301
  dispatch_once(&mapToken, ^{
307
- map = @{@"props": [REAPropsNode class],
308
- @"style": [REAStyleNode class],
309
- @"transform": [REATransformNode class],
310
- @"value": [REAValueNode class],
311
- @"block": [REABlockNode class],
312
- @"cond": [REACondNode class],
313
- @"op": [REAOperatorNode class],
314
- @"set": [REASetNode class],
315
- @"debug": [READebugNode class],
316
- @"clock": [REAClockNode class],
317
- @"clockStart": [REAClockStartNode class],
318
- @"clockStop": [REAClockStopNode class],
319
- @"clockTest": [REAClockTestNode class],
320
- @"call": [REAJSCallNode class],
321
- @"bezier": [REABezierNode class],
322
- @"event": [REAEventNode class],
323
- @"always": [REAAlwaysNode class],
324
- @"concat": [REAConcatNode class],
325
- @"param": [REAParamNode class],
326
- @"func": [REAFunctionNode class],
327
- @"callfunc": [REACallFuncNode class]
328
- // @"listener": nil,
329
- };
302
+ map = @{
303
+ @"props" : [REAPropsNode class],
304
+ @"style" : [REAStyleNode class],
305
+ @"transform" : [REATransformNode class],
306
+ @"value" : [REAValueNode class],
307
+ @"block" : [REABlockNode class],
308
+ @"cond" : [REACondNode class],
309
+ @"op" : [REAOperatorNode class],
310
+ @"set" : [REASetNode class],
311
+ @"debug" : [READebugNode class],
312
+ @"clock" : [REAClockNode class],
313
+ @"clockStart" : [REAClockStartNode class],
314
+ @"clockStop" : [REAClockStopNode class],
315
+ @"clockTest" : [REAClockTestNode class],
316
+ @"call" : [REAJSCallNode class],
317
+ @"bezier" : [REABezierNode class],
318
+ @"event" : [REAEventNode class],
319
+ @"always" : [REAAlwaysNode class],
320
+ @"concat" : [REAConcatNode class],
321
+ @"param" : [REAParamNode class],
322
+ @"func" : [REAFunctionNode class],
323
+ @"callfunc" : [REACallFuncNode class]
324
+ // @"listener": nil,
325
+ };
330
326
  });
331
327
 
332
328
  NSString *nodeType = [RCTConvert NSString:config[@"type"]];
@@ -378,9 +374,7 @@
378
374
  [parentNode removeChild:childNode];
379
375
  }
380
376
 
381
- - (void)connectNodeToView:(REANodeID)nodeID
382
- viewTag:(NSNumber *)viewTag
383
- viewName:(NSString *)viewName
377
+ - (void)connectNodeToView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag viewName:(NSString *)viewName
384
378
  {
385
379
  RCTAssertParam(nodeID);
386
380
  REANode *node = _nodes[nodeID];
@@ -391,8 +385,7 @@
391
385
  }
392
386
  }
393
387
 
394
- - (void)disconnectNodeFromView:(REANodeID)nodeID
395
- viewTag:(NSNumber *)viewTag
388
+ - (void)disconnectNodeFromView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag
396
389
  {
397
390
  RCTAssertParam(nodeID);
398
391
  REANode *node = _nodes[nodeID];
@@ -403,36 +396,26 @@
403
396
  }
404
397
  }
405
398
 
406
- - (void)attachEvent:(NSNumber *)viewTag
407
- eventName:(NSString *)eventName
408
- eventNodeID:(REANodeID)eventNodeID
399
+ - (void)attachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
409
400
  {
410
401
  RCTAssertParam(eventNodeID);
411
402
  REANode *eventNode = _nodes[eventNodeID];
412
403
  RCTAssert([eventNode isKindOfClass:[REAEventNode class]], @"Event node is of an invalid type");
413
404
 
414
- NSString *key = [NSString stringWithFormat:@"%@%@",
415
- viewTag,
416
- RCTNormalizeInputEventName(eventName)];
405
+ NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
417
406
  RCTAssert([_eventMapping objectForKey:key] == nil, @"Event handler already set for the given view and event type");
418
407
  [_eventMapping setObject:eventNode forKey:key];
419
408
  }
420
409
 
421
- - (void)detachEvent:(NSNumber *)viewTag
422
- eventName:(NSString *)eventName
423
- eventNodeID:(REANodeID)eventNodeID
410
+ - (void)detachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
424
411
  {
425
- NSString *key = [NSString stringWithFormat:@"%@%@",
426
- viewTag,
427
- RCTNormalizeInputEventName(eventName)];
412
+ NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
428
413
  [_eventMapping removeObjectForKey:key];
429
414
  }
430
415
 
431
416
  - (void)processEvent:(id<RCTEvent>)event
432
417
  {
433
- NSString *key = [NSString stringWithFormat:@"%@%@",
434
- event.viewTag,
435
- RCTNormalizeInputEventName(event.eventName)];
418
+ NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeInputEventName(event.eventName)];
436
419
  REAEventNode *eventNode = [_eventMapping objectForKey:key];
437
420
  [eventNode processEvent:event];
438
421
  }
@@ -465,18 +448,14 @@
465
448
 
466
449
  - (void)dispatchEvent:(id<RCTEvent>)event
467
450
  {
468
- NSString *key = [NSString stringWithFormat:@"%@%@",
469
- event.viewTag,
470
- RCTNormalizeInputEventName(event.eventName)];
451
+ NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeInputEventName(event.eventName)];
471
452
 
472
- NSString *eventHash = [NSString stringWithFormat:@"%@%@",
473
- event.viewTag,
474
- event.eventName];
453
+ NSString *eventHash = [NSString stringWithFormat:@"%@%@", event.viewTag, event.eventName];
475
454
 
476
455
  if (_eventHandler != nil) {
477
456
  __weak REAEventHandler eventHandler = _eventHandler;
478
457
  __weak typeof(self) weakSelf = self;
479
- RCTExecuteOnMainQueue(^void(){
458
+ RCTExecuteOnMainQueue(^void() {
480
459
  __typeof__(self) strongSelf = weakSelf;
481
460
  if (strongSelf == nil) {
482
461
  return;
@@ -506,8 +485,7 @@
506
485
  }
507
486
  }
508
487
 
509
- - (void)configureProps:(NSSet<NSString *> *)nativeProps
510
- uiProps:(NSSet<NSString *> *)uiProps
488
+ - (void)configureProps:(NSSet<NSString *> *)nativeProps uiProps:(NSSet<NSString *> *)uiProps
511
489
  {
512
490
  _uiProps = uiProps;
513
491
  _nativeProps = nativeProps;
@@ -532,7 +510,7 @@
532
510
  NSMutableDictionary *nativeProps = [NSMutableDictionary new];
533
511
  NSMutableDictionary *jsProps = [NSMutableDictionary new];
534
512
 
535
- void (^addBlock)(NSString *key, id obj, BOOL * stop) = ^(NSString *key, id obj, BOOL * stop){
513
+ void (^addBlock)(NSString *key, id obj, BOOL *stop) = ^(NSString *key, id obj, BOOL *stop) {
536
514
  if ([self.uiProps containsObject:key]) {
537
515
  uiProps[key] = obj;
538
516
  } else if ([self.nativeProps containsObject:key]) {
@@ -545,36 +523,33 @@
545
523
  [props enumerateKeysAndObjectsUsingBlock:addBlock];
546
524
 
547
525
  if (uiProps.count > 0) {
548
- [self.uiManager
549
- synchronouslyUpdateViewOnUIThread:viewTag
550
- viewName:viewName
551
- props:uiProps];
552
- }
553
- if (nativeProps.count > 0) {
554
- [self enqueueUpdateViewOnNativeThread:viewTag viewName:viewName nativeProps:nativeProps trySynchronously:YES];
555
- }
556
- if (jsProps.count > 0) {
557
- [self.reanimatedModule sendEventWithName:@"onReanimatedPropsChange"
558
- body:@{@"viewTag": viewTag, @"props": jsProps }];
559
- }
526
+ [self.uiManager synchronouslyUpdateViewOnUIThread:viewTag viewName:viewName props:uiProps];
527
+ }
528
+ if (nativeProps.count > 0) {
529
+ [self enqueueUpdateViewOnNativeThread:viewTag viewName:viewName nativeProps:nativeProps trySynchronously:YES];
530
+ }
531
+ if (jsProps.count > 0) {
532
+ [self.reanimatedModule sendEventWithName:@"onReanimatedPropsChange"
533
+ body:@{@"viewTag" : viewTag, @"props" : jsProps}];
534
+ }
560
535
  }
561
536
 
562
- - (NSString*)obtainProp:(nonnull NSNumber *)viewTag
563
- propName:(nonnull NSString *)propName
537
+ - (NSString *)obtainProp:(nonnull NSNumber *)viewTag propName:(nonnull NSString *)propName
564
538
  {
565
- UIView* view = [self.uiManager viewForReactTag:viewTag];
566
-
567
- NSString* result = [NSString stringWithFormat:@"error: unknown propName %@, currently supported: opacity, zIndex", propName];
568
-
569
- if ([propName isEqualToString:@"opacity"]) {
570
- CGFloat alpha = view.alpha;
571
- result = [@(alpha) stringValue];
572
- } else if ([propName isEqualToString:@"zIndex"]) {
573
- NSInteger zIndex = view.reactZIndex;
574
- result = [@(zIndex) stringValue];
575
- }
576
-
577
- return result;
539
+ UIView *view = [self.uiManager viewForReactTag:viewTag];
540
+
541
+ NSString *result =
542
+ [NSString stringWithFormat:@"error: unknown propName %@, currently supported: opacity, zIndex", propName];
543
+
544
+ if ([propName isEqualToString:@"opacity"]) {
545
+ CGFloat alpha = view.alpha;
546
+ result = [@(alpha) stringValue];
547
+ } else if ([propName isEqualToString:@"zIndex"]) {
548
+ NSInteger zIndex = view.reactZIndex;
549
+ result = [@(zIndex) stringValue];
550
+ }
551
+
552
+ return result;
578
553
  }
579
554
 
580
555
  @end
package/ios/REAUtils.h CHANGED
@@ -1,5 +1,7 @@
1
1
  #import <Foundation/Foundation.h>
2
2
 
3
- #define REA_LOG_ERROR_IF_NIL(value, errorMsg) ({\
4
- if (value == nil) RCTLogError(errorMsg);\
5
- })
3
+ #define REA_LOG_ERROR_IF_NIL(value, errorMsg) \
4
+ ({ \
5
+ if (value == nil) \
6
+ RCTLogError(errorMsg); \
7
+ })
@@ -2,36 +2,52 @@
2
2
 
3
3
  @implementation RCTConvert (REATransition)
4
4
 
5
- RCT_ENUM_CONVERTER(REATransitionType, (@{
6
- @"none": @(REATransitionTypeNone),
7
- @"group": @(REATransitionTypeGroup),
8
- @"in": @(REATransitionTypeIn),
9
- @"out": @(REATransitionTypeOut),
10
- @"change": @(REATransitionTypeChange),
11
- }), REATransitionTypeNone, integerValue)
5
+ RCT_ENUM_CONVERTER(
6
+ REATransitionType,
7
+ (@{
8
+ @"none" : @(REATransitionTypeNone),
9
+ @"group" : @(REATransitionTypeGroup),
10
+ @"in" : @(REATransitionTypeIn),
11
+ @"out" : @(REATransitionTypeOut),
12
+ @"change" : @(REATransitionTypeChange),
13
+ }),
14
+ REATransitionTypeNone,
15
+ integerValue)
12
16
 
13
- RCT_ENUM_CONVERTER(REATransitionAnimationType, (@{
14
- @"none": @(REATransitionAnimationTypeNone),
15
- @"fade": @(REATransitionAnimationTypeFade),
16
- @"scale": @(REATransitionAnimationTypeScale),
17
- @"slide-top": @(REATransitionAnimationTypeSlideTop),
18
- @"slide-bottom": @(REATransitionAnimationTypeSlideBottom),
19
- @"slide-right": @(REATransitionAnimationTypeSlideRight),
20
- @"slide-left": @(REATransitionAnimationTypeSlideLeft)
21
- }), REATransitionAnimationTypeNone, integerValue)
17
+ RCT_ENUM_CONVERTER(
18
+ REATransitionAnimationType,
19
+ (@{
20
+ @"none" : @(REATransitionAnimationTypeNone),
21
+ @"fade" : @(REATransitionAnimationTypeFade),
22
+ @"scale" : @(REATransitionAnimationTypeScale),
23
+ @"slide-top" : @(REATransitionAnimationTypeSlideTop),
24
+ @"slide-bottom" : @(REATransitionAnimationTypeSlideBottom),
25
+ @"slide-right" : @(REATransitionAnimationTypeSlideRight),
26
+ @"slide-left" : @(REATransitionAnimationTypeSlideLeft)
27
+ }),
28
+ REATransitionAnimationTypeNone,
29
+ integerValue)
22
30
 
23
- RCT_ENUM_CONVERTER(REATransitionInterpolationType, (@{
24
- @"linear": @(REATransitionInterpolationLinear),
25
- @"easeIn": @(REATransitionInterpolationEaseIn),
26
- @"easeOut": @(REATransitionInterpolationEaseOut),
27
- @"easeInOut": @(REATransitionInterpolationEaseInOut),
28
- }), REATransitionInterpolationLinear, integerValue)
31
+ RCT_ENUM_CONVERTER(
32
+ REATransitionInterpolationType,
33
+ (@{
34
+ @"linear" : @(REATransitionInterpolationLinear),
35
+ @"easeIn" : @(REATransitionInterpolationEaseIn),
36
+ @"easeOut" : @(REATransitionInterpolationEaseOut),
37
+ @"easeInOut" : @(REATransitionInterpolationEaseInOut),
38
+ }),
39
+ REATransitionInterpolationLinear,
40
+ integerValue)
29
41
 
30
- RCT_ENUM_CONVERTER(REATransitionPropagationType, (@{
31
- @"none": @(REATransitionPropagationNone),
32
- @"top": @(REATransitionPropagationTop),
33
- @"bottom": @(REATransitionPropagationBottom),
34
- @"left": @(REATransitionPropagationLeft),
35
- @"right": @(REATransitionPropagationRight)
36
- }), REATransitionPropagationNone, integerValue)
42
+ RCT_ENUM_CONVERTER(
43
+ REATransitionPropagationType,
44
+ (@{
45
+ @"none" : @(REATransitionPropagationNone),
46
+ @"top" : @(REATransitionPropagationTop),
47
+ @"bottom" : @(REATransitionPropagationBottom),
48
+ @"left" : @(REATransitionPropagationLeft),
49
+ @"right" : @(REATransitionPropagationRight)
50
+ }),
51
+ REATransitionPropagationNone,
52
+ integerValue)
37
53
  @end
@@ -8,8 +8,8 @@
8
8
 
9
9
  @interface REAVisibilityTransition : REATransition
10
10
  @property (nonatomic) REATransitionAnimationType animationType;
11
- - (REATransitionAnimation *)appearView:(UIView*)view inParent:(UIView*)parent;
12
- - (REATransitionAnimation *)disappearView:(UIView*)view fromParent:(UIView*)parent;
11
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent;
12
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent;
13
13
  - (instancetype)initWithConfig:(NSDictionary *)config;
14
14
  @end
15
15
 
@@ -1,7 +1,7 @@
1
1
  #import <React/RCTViewManager.h>
2
2
 
3
- #import "REAAllTransitions.h"
4
3
  #import "RCTConvert+REATransition.h"
4
+ #import "REAAllTransitions.h"
5
5
 
6
6
  @interface REASnapshotRemover : NSObject <CAAnimationDelegate>
7
7
  @end
@@ -33,7 +33,7 @@
33
33
  if (self = [super initWithConfig:config]) {
34
34
  _sequence = [RCTConvert BOOL:config[@"sequence"]];
35
35
  NSArray *transitions = [RCTConvert NSArray:config[@"transitions"]];
36
- NSMutableArray<REATransition*> *inflated = [NSMutableArray new];
36
+ NSMutableArray<REATransition *> *inflated = [NSMutableArray new];
37
37
  for (NSDictionary *transitionConfig in transitions) {
38
38
  [inflated addObject:[REATransition inflate:transitionConfig]];
39
39
  inflated.lastObject.parent = self;
@@ -51,9 +51,10 @@
51
51
  return self;
52
52
  }
53
53
 
54
- - (NSArray<REATransitionAnimation *> *)animationsForTransitioning:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)startValues
55
- endValues:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)endValues
56
- forRoot:(UIView *)root
54
+ - (NSArray<REATransitionAnimation *> *)
55
+ animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
56
+ endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
57
+ forRoot:(UIView *)root
57
58
  {
58
59
  CFTimeInterval delay = self.delay;
59
60
  NSMutableArray *animations = [NSMutableArray new];
@@ -74,7 +75,6 @@
74
75
 
75
76
  @end
76
77
 
77
-
78
78
  @implementation REAVisibilityTransition
79
79
 
80
80
  - (instancetype)initWithConfig:(NSDictionary *)config
@@ -85,23 +85,19 @@
85
85
  return self;
86
86
  }
87
87
 
88
- - (REATransitionAnimation *)appearView:(UIView *)view
89
- inParent:(UIView *)parent
90
- forRoot:(UIView *)root
88
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
91
89
  {
92
90
  return nil;
93
91
  }
94
92
 
95
- - (REATransitionAnimation *)disappearView:(UIView *)view
96
- fromParent:(UIView *)parent
97
- forRoot:(UIView *)root
93
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
98
94
  {
99
95
  return nil;
100
96
  }
101
97
 
102
98
  - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
103
- endValues:(REATransitionValues *)endValues
104
- forRoot:(UIView *)root
99
+ endValues:(REATransitionValues *)endValues
100
+ forRoot:(UIView *)root
105
101
  {
106
102
  BOOL isViewAppearing = (startValues == nil);
107
103
  if (isViewAppearing && !IS_LAYOUT_ONLY(endValues.view)) {
@@ -123,7 +119,6 @@
123
119
 
124
120
  @end
125
121
 
126
-
127
122
  @implementation REAInTransition
128
123
  - (instancetype)initWithConfig:(NSDictionary *)config
129
124
  {
@@ -132,9 +127,7 @@
132
127
  return self;
133
128
  }
134
129
 
135
- - (REATransitionAnimation *)appearView:(UIView *)view
136
- inParent:(UIView *)parent
137
- forRoot:(UIView *)root
130
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
138
131
  {
139
132
  CABasicAnimation *animation;
140
133
  switch (self.animationType) {
@@ -186,7 +179,6 @@
186
179
  }
187
180
  @end
188
181
 
189
-
190
182
  @implementation REAOutTransition
191
183
  - (instancetype)initWithConfig:(NSDictionary *)config
192
184
  {
@@ -195,9 +187,7 @@
195
187
  return self;
196
188
  }
197
189
 
198
- - (REATransitionAnimation *)disappearView:(UIView *)view
199
- fromParent:(UIView *)parent
200
- forRoot:(UIView *)root
190
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
201
191
  {
202
192
  if (self.animationType == REATransitionAnimationTypeNone) {
203
193
  return nil;
@@ -262,12 +252,11 @@
262
252
  }
263
253
  @end
264
254
 
265
-
266
255
  @implementation REAChangeTransition
267
256
 
268
257
  - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
269
- endValues:(REATransitionValues *)endValues
270
- forRoot:(UIView *)root
258
+ endValues:(REATransitionValues *)endValues
259
+ forRoot:(UIView *)root
271
260
  {
272
261
  if (startValues == nil || endValues == nil || endValues.view.window == nil) {
273
262
  return nil;