react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4

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 (264) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
  5. package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
  6. package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
  7. package/Common/cpp/SharedItems/FrozenObject.cpp +17 -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 +211 -160
  12. package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
  13. package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
  14. package/Common/cpp/Tools/Mapper.cpp +30 -30
  15. package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
  16. package/Common/cpp/Tools/Scheduler.cpp +6 -5
  17. package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
  18. package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
  19. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
  20. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
  21. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
  22. package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
  23. package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
  24. package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
  25. package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
  26. package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
  27. package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
  28. package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
  29. package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
  30. package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
  31. package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
  32. package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
  33. package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
  34. package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
  35. package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
  36. package/Common/cpp/headers/Tools/Mapper.h +19 -16
  37. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
  38. package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
  39. package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
  40. package/Common/cpp/headers/Tools/Scheduler.h +30 -35
  41. package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
  42. package/Common/cpp/hidden_headers/Logger.h +14 -14
  43. package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
  44. package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
  45. package/README.md +1 -1
  46. package/RNReanimated.podspec +24 -6
  47. package/android/build.gradle +38 -29
  48. package/android/react-native-reanimated-63-hermes.aar +0 -0
  49. package/android/react-native-reanimated-63-jsc.aar +0 -0
  50. package/android/react-native-reanimated-64-hermes.aar +0 -0
  51. package/android/react-native-reanimated-64-jsc.aar +0 -0
  52. package/android/react-native-reanimated-65-hermes.aar +0 -0
  53. package/android/react-native-reanimated-65-jsc.aar +0 -0
  54. package/android/react-native-reanimated-66-hermes.aar +0 -0
  55. package/android/react-native-reanimated-66-jsc.aar +0 -0
  56. package/android/react-native-reanimated-67-hermes.aar +0 -0
  57. package/android/react-native-reanimated-67-jsc.aar +0 -0
  58. package/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
  59. package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
  60. package/ios/LayoutReanimation/REASnapshot.h +2 -2
  61. package/ios/LayoutReanimation/REASnapshot.m +8 -7
  62. package/ios/LayoutReanimation/REAUIManager.h +4 -4
  63. package/ios/LayoutReanimation/REAUIManager.mm +116 -70
  64. package/ios/Nodes/REAAlwaysNode.m +14 -15
  65. package/ios/Nodes/REABezierNode.m +8 -7
  66. package/ios/Nodes/REABlockNode.m +1 -1
  67. package/ios/Nodes/REACallFuncNode.h +0 -1
  68. package/ios/Nodes/REACallFuncNode.m +10 -8
  69. package/ios/Nodes/REAClockNodes.m +22 -20
  70. package/ios/Nodes/REAConcatNode.h +0 -1
  71. package/ios/Nodes/REAConcatNode.m +2 -2
  72. package/ios/Nodes/REACondNode.m +7 -5
  73. package/ios/Nodes/READebugNode.m +5 -4
  74. package/ios/Nodes/REAEventNode.m +1 -1
  75. package/ios/Nodes/REAFunctionNode.h +0 -1
  76. package/ios/Nodes/REAFunctionNode.m +2 -2
  77. package/ios/Nodes/REAJSCallNode.m +4 -5
  78. package/ios/Nodes/REANode.h +3 -4
  79. package/ios/Nodes/REANode.m +9 -11
  80. package/ios/Nodes/REAOperatorNode.m +68 -67
  81. package/ios/Nodes/REAParamNode.h +1 -3
  82. package/ios/Nodes/REAParamNode.m +15 -17
  83. package/ios/Nodes/REAPropsNode.h +1 -3
  84. package/ios/Nodes/REAPropsNode.m +19 -22
  85. package/ios/Nodes/REASetNode.h +0 -1
  86. package/ios/Nodes/REASetNode.m +7 -5
  87. package/ios/Nodes/REAStyleNode.h +0 -1
  88. package/ios/Nodes/REAStyleNode.m +2 -4
  89. package/ios/Nodes/REATransformNode.h +0 -1
  90. package/ios/Nodes/REATransformNode.m +3 -5
  91. package/ios/Nodes/REAValueNode.m +5 -7
  92. package/ios/REAEventDispatcher.m +4 -4
  93. package/ios/REAModule.h +0 -2
  94. package/ios/REAModule.m +29 -38
  95. package/ios/REANodesManager.h +11 -19
  96. package/ios/REANodesManager.m +106 -130
  97. package/ios/REAUtils.h +5 -3
  98. package/ios/RNGestureHandlerStateManager.h +5 -0
  99. package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
  100. package/ios/Transitioning/REAAllTransitions.h +2 -2
  101. package/ios/Transitioning/REAAllTransitions.m +14 -25
  102. package/ios/Transitioning/REATransition.h +8 -7
  103. package/ios/Transitioning/REATransition.m +19 -16
  104. package/ios/Transitioning/REATransitionAnimation.h +1 -1
  105. package/ios/Transitioning/REATransitionAnimation.m +2 -3
  106. package/ios/Transitioning/REATransitionManager.m +3 -3
  107. package/ios/native/NativeMethods.h +20 -5
  108. package/ios/native/NativeMethods.mm +14 -6
  109. package/ios/native/NativeProxy.h +4 -2
  110. package/ios/native/NativeProxy.mm +84 -63
  111. package/ios/native/REAIOSErrorHandler.h +13 -10
  112. package/ios/native/REAIOSErrorHandler.mm +19 -15
  113. package/ios/native/REAIOSLogger.h +8 -8
  114. package/ios/native/REAIOSLogger.mm +10 -6
  115. package/ios/native/REAIOSScheduler.h +5 -5
  116. package/ios/native/REAIOSScheduler.mm +17 -10
  117. package/ios/native/REAInitializer.h +5 -7
  118. package/ios/native/REAInitializer.mm +43 -31
  119. package/ios/native/UIResponder+Reanimated.mm +2 -2
  120. package/lib/Animated.js +9 -1
  121. package/lib/ConfigHelper.js +121 -138
  122. package/lib/ReanimatedEventEmitter.js +0 -1
  123. package/lib/ReanimatedModule.js +0 -1
  124. package/lib/ReanimatedModule.macos.js +0 -1
  125. package/lib/ReanimatedModule.native.js +5 -6
  126. package/lib/ReanimatedModule.windows.js +0 -1
  127. package/lib/ReanimatedModuleCompat.js +64 -35
  128. package/lib/createAnimatedComponent.js +468 -487
  129. package/lib/index.js +9 -1
  130. package/lib/reanimated2/NativeMethods.js +7 -12
  131. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
  132. package/lib/reanimated2/NativeReanimated/index.js +15 -0
  133. package/lib/reanimated2/PropAdapters.js +0 -1
  134. package/lib/reanimated2/UpdateProps.js +6 -7
  135. package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
  136. package/lib/reanimated2/WorkletEventHandler.js +15 -13
  137. package/lib/reanimated2/animation/delay.js +8 -2
  138. package/lib/reanimated2/animation/spring.js +2 -0
  139. package/lib/reanimated2/animation/styleAnimation.js +7 -3
  140. package/lib/reanimated2/animation/util.js +25 -2
  141. package/lib/reanimated2/core.js +41 -17
  142. package/lib/reanimated2/globals.d.ts +21 -1
  143. package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
  144. package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
  145. package/lib/reanimated2/index.js +1 -0
  146. package/lib/reanimated2/interpolation.js +95 -87
  147. package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
  148. package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
  149. package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
  150. package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
  151. package/lib/reanimated2/js-reanimated/index.js +10 -8
  152. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
  153. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
  154. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
  155. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
  156. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
  157. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
  158. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
  159. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
  160. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
  161. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
  162. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
  163. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
  164. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
  165. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
  166. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
  167. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
  168. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
  169. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
  170. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
  171. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
  172. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
  173. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
  174. package/lib/reanimated2/layoutReanimation/index.js +1 -0
  175. package/lib/reanimated2/mock.js +3 -1
  176. package/lib/reanimated2/utils.js +9 -0
  177. package/lib/setAndForwardRef.js +14 -48
  178. package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
  179. package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
  180. package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
  181. package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
  182. package/mock.js +1 -1
  183. package/package.json +28 -17
  184. package/plugin.js +220 -39
  185. package/react-native-reanimated.d.ts +542 -547
  186. package/src/Animated.js +9 -1
  187. package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
  188. package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
  189. package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
  190. package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
  191. package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
  192. package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
  193. package/src/ReanimatedModuleCompat.ts +51 -0
  194. package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
  195. package/src/reanimated2/NativeMethods.ts +34 -13
  196. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
  197. package/src/reanimated2/NativeReanimated/index.ts +18 -0
  198. package/src/reanimated2/PropAdapters.ts +0 -1
  199. package/src/reanimated2/UpdateProps.ts +31 -15
  200. package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
  201. package/src/reanimated2/WorkletEventHandler.ts +41 -23
  202. package/src/reanimated2/animation/commonTypes.ts +4 -4
  203. package/src/reanimated2/animation/decay.ts +2 -2
  204. package/src/reanimated2/animation/delay.ts +11 -5
  205. package/src/reanimated2/animation/index.ts +7 -7
  206. package/src/reanimated2/animation/repeat.ts +4 -4
  207. package/src/reanimated2/animation/sequence.ts +2 -2
  208. package/src/reanimated2/animation/spring.ts +6 -5
  209. package/src/reanimated2/animation/styleAnimation.ts +27 -15
  210. package/src/reanimated2/animation/timing.ts +5 -5
  211. package/src/reanimated2/animation/util.ts +47 -8
  212. package/src/reanimated2/commonTypes.ts +3 -0
  213. package/src/reanimated2/core.ts +80 -34
  214. package/src/reanimated2/globals.d.ts +21 -1
  215. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
  216. package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
  217. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
  218. package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
  219. package/src/reanimated2/hook/utils.ts +4 -3
  220. package/src/reanimated2/index.ts +1 -0
  221. package/src/reanimated2/interpolation.ts +170 -103
  222. package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
  223. package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
  224. package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
  225. package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
  226. package/src/reanimated2/js-reanimated/index.ts +31 -14
  227. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
  228. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
  229. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
  230. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
  231. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
  232. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
  233. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
  234. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
  235. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
  236. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
  237. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
  238. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
  239. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
  240. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
  241. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
  242. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
  243. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
  244. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
  245. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
  246. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
  247. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
  248. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
  249. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
  250. package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
  251. package/src/reanimated2/layoutReanimation/index.ts +1 -0
  252. package/src/reanimated2/mock.ts +3 -1
  253. package/src/reanimated2/utils.ts +21 -0
  254. package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
  255. package/android/react-native-reanimated-62-hermes.aar +0 -0
  256. package/android/react-native-reanimated-62-jsc.aar +0 -0
  257. package/lib/reanimated2/NativeReanimated.js +0 -48
  258. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
  259. package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
  260. package/src/ReanimatedModuleCompat.js +0 -37
  261. package/src/reanimated2/NativeReanimated.ts +0 -70
  262. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
  263. package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
  264. package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
@@ -1,16 +1,21 @@
1
1
  #import "REAUIManager.h"
2
2
  #import <Foundation/Foundation.h>
3
+ #include "FeaturesConfig.h"
3
4
  #import "RCTComponentData.h"
4
- #import "RCTUIManagerObserverCoordinator.h"
5
- #import "RCTRootShadowView.h"
6
- #import "RCTRootViewInternal.h"
7
5
  #import "RCTLayoutAnimation.h"
8
6
  #import "RCTLayoutAnimationGroup.h"
7
+ #import "RCTModalHostView.h"
8
+ #import "RCTRootShadowView.h"
9
+ #import "RCTRootViewInternal.h"
10
+ #import "RCTUIManagerObserverCoordinator.h"
9
11
  #import "REAIOSScheduler.h"
10
12
  #include "Scheduler.h"
13
+
14
+ #if __has_include(<RNScreens/RNSScreen.h>)
11
15
  #import <RNScreens/RNSScreen.h>
16
+ #endif
12
17
 
13
- @interface RCTUIManager(REA)
18
+ @interface RCTUIManager (REA)
14
19
  - (void)_manageChildren:(NSNumber *)containerTag
15
20
  moveFromIndices:(NSArray<NSNumber *> *)moveFromIndices
16
21
  moveToIndices:(NSArray<NSNumber *> *)moveToIndices
@@ -26,32 +31,35 @@
26
31
  @implementation REAUIManager
27
32
 
28
33
  BOOL blockSetter = false;
29
- NSMutableDictionary<NSNumber*, NSMutableSet<id<RCTComponent>>*>* _toBeRemovedRegister;
30
- NSMutableDictionary<NSNumber*, NSNumber*>* _parentMapper;
31
- REAAnimationsManager* _animationsManager;
34
+ NSMutableDictionary<NSNumber *, NSMutableSet<id<RCTComponent>> *> *_toBeRemovedRegister;
35
+ NSMutableDictionary<NSNumber *, NSNumber *> *_parentMapper;
36
+ REAAnimationsManager *_animationsManager;
32
37
  std::weak_ptr<reanimated::Scheduler> _scheduler;
33
38
 
34
- + (NSString*)moduleName
39
+ + (NSString *)moduleName
35
40
  {
36
41
  return NSStringFromClass([RCTUIManager class]);
37
42
  }
38
43
 
39
44
  - (void)setBridge:(RCTBridge *)bridge
40
45
  {
41
- if(!_blockSetter) {
46
+ if (!_blockSetter) {
42
47
  _blockSetter = true;
43
-
48
+
44
49
  self.bridge = bridge;
50
+ [super setValue:bridge forKey:@"_bridge"];
45
51
  [self setValue:[bridge.uiManager valueForKey:@"_shadowViewRegistry"] forKey:@"_shadowViewRegistry"];
46
52
  [self setValue:[bridge.uiManager valueForKey:@"_viewRegistry"] forKey:@"_viewRegistry"];
47
53
  [self setValue:[bridge.uiManager valueForKey:@"_nativeIDRegistry"] forKey:@"_nativeIDRegistry"];
48
- [self setValue:[bridge.uiManager valueForKey:@"_shadowViewsWithUpdatedProps"] forKey:@"_shadowViewsWithUpdatedProps"];
49
- [self setValue:[bridge.uiManager valueForKey:@"_shadowViewsWithUpdatedChildren"] forKey:@"_shadowViewsWithUpdatedChildren"];
54
+ [self setValue:[bridge.uiManager valueForKey:@"_shadowViewsWithUpdatedProps"]
55
+ forKey:@"_shadowViewsWithUpdatedProps"];
56
+ [self setValue:[bridge.uiManager valueForKey:@"_shadowViewsWithUpdatedChildren"]
57
+ forKey:@"_shadowViewsWithUpdatedChildren"];
50
58
  [self setValue:[bridge.uiManager valueForKey:@"_pendingUIBlocks"] forKey:@"_pendingUIBlocks"];
51
59
  [self setValue:[bridge.uiManager valueForKey:@"_rootViewTags"] forKey:@"_rootViewTags"];
52
60
  [self setValue:[bridge.uiManager valueForKey:@"_observerCoordinator"] forKey:@"_observerCoordinator"];
53
61
  [self setValue:[bridge.uiManager valueForKey:@"_componentDataByName"] forKey:@"_componentDataByName"];
54
-
62
+
55
63
  _blockSetter = false;
56
64
  }
57
65
  }
@@ -64,26 +72,40 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
64
72
  removeAtIndices:(NSArray<NSNumber *> *)removeAtIndices
65
73
  registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry
66
74
  {
75
+ if (!reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
76
+ [super _manageChildren:containerTag
77
+ moveFromIndices:moveFromIndices
78
+ moveToIndices:moveToIndices
79
+ addChildReactTags:addChildReactTags
80
+ addAtIndices:addAtIndices
81
+ removeAtIndices:removeAtIndices
82
+ registry:registry];
83
+ return;
84
+ }
85
+
86
+ // Reanimated changes /start
67
87
  BOOL isUIViewRegistry = ((id)registry == (id)[self valueForKey:@"_viewRegistry"]);
68
88
  id<RCTComponent> container;
69
- NSArray<id<RCTComponent>> *permanentlyRemovedChildren;
70
- if(isUIViewRegistry) {
71
- container = registry[containerTag];
72
- for(id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
89
+ NSMutableArray<id<RCTComponent>> *permanentlyRemovedChildren;
90
+ if (isUIViewRegistry) {
91
+ container = registry[containerTag];
92
+ for (id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
73
93
  [container removeReactSubview:toRemoveChild];
74
94
  }
75
-
76
- permanentlyRemovedChildren = [super _childrenToRemoveFromContainer:container atIndices:removeAtIndices];
77
- if(permanentlyRemovedChildren != nil) {
78
- for(id<RCTComponent> permanentlyRemovedChild in permanentlyRemovedChildren) {
79
- if(_toBeRemovedRegister[containerTag] == nil) {
95
+
96
+ permanentlyRemovedChildren = (NSMutableArray *)[super _childrenToRemoveFromContainer:container
97
+ atIndices:removeAtIndices];
98
+ if (permanentlyRemovedChildren != nil) {
99
+ for (id<RCTComponent> permanentlyRemovedChild in permanentlyRemovedChildren) {
100
+ if (_toBeRemovedRegister[containerTag] == nil) {
80
101
  _toBeRemovedRegister[containerTag] = [[NSMutableSet<id<RCTComponent>> alloc] init];
81
102
  }
82
103
  [_toBeRemovedRegister[containerTag] addObject:permanentlyRemovedChild];
83
104
  }
84
105
  }
85
106
  }
86
-
107
+ // Reanimated changes /end
108
+
87
109
  [super _manageChildren:containerTag
88
110
  moveFromIndices:moveFromIndices
89
111
  moveToIndices:moveToIndices
@@ -91,38 +113,52 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
91
113
  addAtIndices:addAtIndices
92
114
  removeAtIndices:removeAtIndices
93
115
  registry:registry];
94
-
95
- if(isUIViewRegistry) {
116
+
117
+ // Reanimated changes /start
118
+ if (isUIViewRegistry) {
96
119
  NSMutableDictionary<NSNumber *, id<RCTComponent>> *viewRegistry = [self valueForKey:@"_viewRegistry"];
97
- for(id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
120
+ for (id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
98
121
  NSInteger lastIndex = [container reactSubviews].count - 1;
99
- if(lastIndex < 0) {
122
+ if (lastIndex < 0) {
100
123
  lastIndex = 0;
101
124
  }
102
- [container insertReactSubview:toRemoveChild atIndex:lastIndex];
103
- viewRegistry[toRemoveChild.reactTag] = toRemoveChild;
125
+ if ([toRemoveChild isKindOfClass:[RCTModalHostView class]]
126
+ #if __has_include(<RNScreens/RNSScreen.h>)
127
+ || ([toRemoveChild isKindOfClass:[RNSScreenView class]])
128
+ #endif
129
+ ) {
130
+ // we don't want layout animations when removing modals or Screens of native-stack since it brings buggy
131
+ // behavior
132
+ [_toBeRemovedRegister[container.reactTag] removeObject:toRemoveChild];
133
+ [permanentlyRemovedChildren removeObject:toRemoveChild];
134
+
135
+ } else {
136
+ [container insertReactSubview:toRemoveChild atIndex:lastIndex];
137
+ viewRegistry[toRemoveChild.reactTag] = toRemoveChild;
138
+ }
104
139
  }
105
-
140
+
106
141
  for (UIView *removedChild in permanentlyRemovedChildren) {
107
- [self callAnimationForTree: removedChild parentTag:containerTag];
142
+ [self callAnimationForTree:removedChild parentTag:containerTag];
108
143
  }
109
144
  }
145
+ // Reanimated changes /end
110
146
  }
111
147
 
112
- - (void) callAnimationForTree:(UIView*) view parentTag:(NSNumber*) parentTag
148
+ - (void)callAnimationForTree:(UIView *)view parentTag:(NSNumber *)parentTag
113
149
  {
114
- REASnapshot* snapshot = [[REASnapshot alloc] init:view];
150
+ REASnapshot *snapshot = [[REASnapshot alloc] init:view];
115
151
  _parentMapper[view.reactTag] = parentTag;
116
152
  [_animationsManager onViewRemoval:view before:snapshot];
117
-
118
- for(UIView* subView in view.reactSubviews) {
153
+
154
+ for (UIView *subView in view.reactSubviews) {
119
155
  [self callAnimationForTree:subView parentTag:view.reactTag];
120
156
  }
121
157
  }
122
158
 
123
159
  // Overrided https://github.com/facebook/react-native/blob/v0.65.0/React/Modules/RCTUIManager.m#L530
124
160
  - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView *)rootShadowView
125
- {
161
+ {
126
162
  NSHashTable<RCTShadowView *> *affectedShadowViews = [NSHashTable weakObjectsHashTable];
127
163
  [rootShadowView layoutWithAffectedShadowViews:affectedShadowViews];
128
164
 
@@ -149,11 +185,12 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
149
185
  for (RCTShadowView *shadowView in affectedShadowViews) {
150
186
  reactTags[index] = shadowView.reactTag;
151
187
  RCTLayoutMetrics layoutMetrics = shadowView.layoutMetrics;
152
- frameDataArray[index++] = (RCTFrameData){layoutMetrics.frame,
153
- layoutMetrics.layoutDirection,
154
- shadowView.isNewView,
155
- shadowView.superview.isNewView,
156
- layoutMetrics.displayType};
188
+ frameDataArray[index++] = (RCTFrameData){
189
+ layoutMetrics.frame,
190
+ layoutMetrics.layoutDirection,
191
+ shadowView.isNewView,
192
+ shadowView.superview.isNewView,
193
+ layoutMetrics.displayType};
157
194
  }
158
195
  }
159
196
 
@@ -179,7 +216,7 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
179
216
  CGSize contentSize = shadowView.layoutMetrics.frame.size;
180
217
 
181
218
  RCTExecuteOnMainQueue(^{
182
- NSMutableDictionary<NSNumber *, UIView *>* viewRegistry = [self valueForKey:@"_viewRegistry"];
219
+ NSMutableDictionary<NSNumber *, UIView *> *viewRegistry = [self valueForKey:@"_viewRegistry"];
183
220
  UIView *view = viewRegistry[reactTag];
184
221
  RCTAssert(view != nil, @"view (for ID %@) not found", reactTag);
185
222
 
@@ -231,8 +268,14 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
231
268
  if (view.isHidden != isHidden) {
232
269
  view.hidden = isHidden;
233
270
  }
234
-
235
- REASnapshot* snapshotBefore = [[REASnapshot alloc] init:view];
271
+
272
+ // Reanimated changes /start
273
+ REASnapshot *snapshotBefore;
274
+ if (reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
275
+ snapshotBefore = [[REASnapshot alloc] init:view];
276
+ }
277
+ // Reanimated changes /end
278
+
236
279
  if (creatingLayoutAnimation) {
237
280
  // Animate view creation
238
281
  [view reactSetFrame:frame];
@@ -277,65 +320,68 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
277
320
  [view reactSetFrame:frame];
278
321
  completion(YES);
279
322
  }
280
-
281
- if(isNew) {
282
- REASnapshot* snapshot = [[REASnapshot alloc] init:view];
283
- [_animationsManager onViewCreate:view after:snapshot];
284
- }
285
- else {
286
- REASnapshot* snapshotAfter = [[REASnapshot alloc] init:view];
287
- [_animationsManager onViewUpdate:view before:snapshotBefore after:snapshotAfter];
323
+
324
+ // Reanimated changes /start
325
+ if (reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
326
+ if (isNew) {
327
+ REASnapshot *snapshot = [[REASnapshot alloc] init:view];
328
+ [_animationsManager onViewCreate:view after:snapshot];
329
+ } else {
330
+ REASnapshot *snapshotAfter = [[REASnapshot alloc] init:view];
331
+ [_animationsManager onViewUpdate:view before:snapshotBefore after:snapshotAfter];
332
+ }
288
333
  }
289
-
290
334
  }
291
335
 
336
+ [_animationsManager removeLeftovers];
292
337
  // Clean up
338
+ // uiManager->_layoutAnimationGroup = nil;
293
339
  [uiManager setValue:nil forKey:@"_layoutAnimationGroup"];
340
+ // Reanimated changes /end
294
341
  };
295
342
  }
296
343
 
297
344
  - (Class)class
298
345
  {
299
- return [RCTUIManager class];
346
+ return [RCTUIManager class];
300
347
  }
301
348
 
302
349
  + (Class)class
303
350
  {
304
- return [RCTUIManager class];
351
+ return [RCTUIManager class];
305
352
  }
306
353
 
307
- - (void)setUp:(REAAnimationsManager*) animationsManager
354
+ - (void)setUp:(REAAnimationsManager *)animationsManager
308
355
  {
309
356
  _animationsManager = animationsManager;
310
- _toBeRemovedRegister = [[NSMutableDictionary<NSNumber*, NSMutableSet<id<RCTComponent>>*> alloc] init];
311
- _parentMapper = [[NSMutableDictionary<NSNumber*, NSNumber*> alloc] init];
357
+ _toBeRemovedRegister = [[NSMutableDictionary<NSNumber *, NSMutableSet<id<RCTComponent>> *> alloc] init];
358
+ _parentMapper = [[NSMutableDictionary<NSNumber *, NSNumber *> alloc] init];
312
359
  }
313
360
 
314
- - (void)unregisterView:(id<RCTComponent>) view
361
+ - (void)unregisterView:(id<RCTComponent>)view
315
362
  {
316
- NSNumber* tag = _parentMapper[view.reactTag];
317
- if(tag == nil) {
363
+ NSNumber *tag = _parentMapper[view.reactTag];
364
+ if (tag == nil) {
318
365
  return;
319
366
  }
320
-
367
+
321
368
  [_toBeRemovedRegister[tag] removeObject:view];
322
- if(_toBeRemovedRegister[tag].count == 0) {
369
+ if (_toBeRemovedRegister[tag].count == 0) {
323
370
  [_toBeRemovedRegister removeObjectForKey:tag];
324
371
  }
325
372
  NSMutableDictionary<NSNumber *, id<RCTComponent>> *viewRegistry = [self valueForKey:@"_viewRegistry"];
326
373
  [view.reactSuperview removeReactSubview:view];
327
374
  id<RCTComponent> parentView = viewRegistry[tag];
328
- [parentView removeReactSubview:view];
375
+ @try {
376
+ [parentView removeReactSubview:view];
377
+ } @catch (id anException) {
378
+ }
379
+ #if __has_include(<RNScreens/RNSScreen.h>)
329
380
  if ([view isKindOfClass:[RNSScreenView class]]) {
330
381
  [parentView didUpdateReactSubviews];
331
382
  }
383
+ #endif
332
384
  [viewRegistry removeObjectForKey:view.reactTag];
333
385
  }
334
386
 
335
- - (void)batchDidComplete
336
- {
337
- self.flushUiOperations();
338
- [super batchDidComplete];
339
- }
340
-
341
387
  @end
@@ -1,24 +1,24 @@
1
1
  #import "REAAlwaysNode.h"
2
- #import "REAUtils.h"
3
- #import "REANodesManager.h"
4
- #import "REAStyleNode.h"
5
- #import "REAModule.h"
6
- #import <React/RCTLog.h>
7
2
  #import <React/RCTConvert.h>
3
+ #import <React/RCTLog.h>
8
4
  #import <React/RCTUIManager.h>
5
+ #import "REAModule.h"
6
+ #import "REANodesManager.h"
7
+ #import "REAStyleNode.h"
8
+ #import "REAUtils.h"
9
9
 
10
- @implementation REAAlwaysNode
11
- {
12
- NSNumber * _nodeToBeEvaluated;
10
+ @implementation REAAlwaysNode {
11
+ NSNumber *_nodeToBeEvaluated;
13
12
  }
14
13
 
15
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
14
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
16
15
  {
17
- if ((self = [super initWithID:nodeID config:config])) {
18
- _nodeToBeEvaluated = [RCTConvert NSNumber:config[@"what"]];
19
- REA_LOG_ERROR_IF_NIL(_nodeToBeEvaluated, @"Reanimated: First argument passed to always node is either of wrong type or is missing.");
20
- }
21
- return self;
16
+ if ((self = [super initWithID:nodeID config:config])) {
17
+ _nodeToBeEvaluated = [RCTConvert NSNumber:config[@"what"]];
18
+ REA_LOG_ERROR_IF_NIL(
19
+ _nodeToBeEvaluated, @"Reanimated: First argument passed to always node is either of wrong type or is missing.");
20
+ }
21
+ return self;
22
22
  }
23
23
 
24
24
  - (id)evaluate
@@ -33,4 +33,3 @@
33
33
  }
34
34
 
35
35
  @end
36
-
@@ -1,10 +1,10 @@
1
1
  #include <tgmath.h>
2
2
 
3
- #import "REABezierNode.h"
4
- #import "REAUtils.h"
5
- #import "REANodesManager.h"
6
3
  #import <React/RCTConvert.h>
7
4
  #import <React/RCTLog.h>
5
+ #import "REABezierNode.h"
6
+ #import "REANodesManager.h"
7
+ #import "REAUtils.h"
8
8
 
9
9
  #define EPS 1e-5
10
10
 
@@ -13,11 +13,12 @@
13
13
  NSNumber *_inputNodeID;
14
14
  }
15
15
 
16
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
16
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
17
17
  {
18
18
  if ((self = [super initWithID:nodeID config:config])) {
19
19
  _inputNodeID = [RCTConvert NSNumber:config[@"input"]];
20
- REA_LOG_ERROR_IF_NIL(_inputNodeID, @"Reanimated: First argument passed to bezier node is either of wrong type or is missing.");
20
+ REA_LOG_ERROR_IF_NIL(
21
+ _inputNodeID, @"Reanimated: First argument passed to bezier node is either of wrong type or is missing.");
21
22
 
22
23
  CGFloat mX1 = [config[@"mX1"] doubleValue];
23
24
  CGFloat mY1 = [config[@"mY1"] doubleValue];
@@ -27,7 +28,7 @@
27
28
  // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
28
29
  cx = 3.0 * mX1;
29
30
  bx = 3.0 * (mX2 - mX1) - cx;
30
- ax = 1.0 - cx -bx;
31
+ ax = 1.0 - cx - bx;
31
32
 
32
33
  cy = 3.0 * mY1;
33
34
  by = 3.0 * (mY2 - mY1) - cy;
@@ -60,7 +61,7 @@
60
61
  // First try a few iterations of Newton's method -- normally very fast.
61
62
  for (t2 = x, i = 0; i < 8; i++) {
62
63
  x2 = [self sampleCurveX:t2] - x;
63
- if (fabs (x2) < epsilon)
64
+ if (fabs(x2) < epsilon)
64
65
  return t2;
65
66
  d2 = [self sampleCurveDerivativeX:t2];
66
67
  if (fabs(d2) < 1e-6)
@@ -5,7 +5,7 @@
5
5
  NSArray<NSNumber *> *_block;
6
6
  }
7
7
 
8
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
8
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
9
9
  {
10
10
  if ((self = [super initWithID:nodeID config:config])) {
11
11
  _block = config[@"block"];
@@ -4,4 +4,3 @@
4
4
  @interface REACallFuncNode : REANode
5
5
 
6
6
  @end
7
-
@@ -2,22 +2,23 @@
2
2
 
3
3
  #import "REACallFuncNode.h"
4
4
  #import "REAFunctionNode.h"
5
- #import "REAUtils.h"
6
- #import "REAParamNode.h"
7
5
  #import "REANodesManager.h"
6
+ #import "REAParamNode.h"
7
+ #import "REAUtils.h"
8
8
 
9
9
  @implementation REACallFuncNode {
10
10
  NSNumber *_whatNodeID;
11
11
  NSArray<NSNumber *> *_args;
12
12
  NSArray<NSNumber *> *_params;
13
- NSString* _prevCallID;
13
+ NSString *_prevCallID;
14
14
  }
15
15
 
16
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
16
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
17
17
  {
18
18
  if ((self = [super initWithID:nodeID config:config])) {
19
19
  _whatNodeID = config[@"what"];
20
- REA_LOG_ERROR_IF_NIL(_whatNodeID, @"Reanimated: First argument passed to callFunc node is either of wrong type or is missing.");
20
+ REA_LOG_ERROR_IF_NIL(
21
+ _whatNodeID, @"Reanimated: First argument passed to callFunc node is either of wrong type or is missing.");
21
22
  _args = config[@"args"];
22
23
  _params = config[@"params"];
23
24
  _prevCallID = NULL;
@@ -27,13 +28,14 @@
27
28
 
28
29
  - (void)beginContext
29
30
  {
30
- // To ensure that functions can be called multiple times in the same animation frame
31
+ // To ensure that functions can be called multiple times in the same animation frame
31
32
  // (functions might have different parameters and might be called multiple times)
32
33
  // we inform the current update context about where we are called from by setting the
33
34
  // current call id - this will ensure that memoization is correct for function nodes.
34
35
  _prevCallID = self.updateContext.callID;
35
- self.updateContext.callID = [NSString stringWithFormat:@"%@/%@", self.updateContext.callID, [self.nodeID stringValue]];
36
-
36
+ self.updateContext.callID =
37
+ [NSString stringWithFormat:@"%@/%@", self.updateContext.callID, [self.nodeID stringValue]];
38
+
37
39
  // A CallFuncNode has a reference to a function node which holds the node graph that should
38
40
  // be updated. A Function node has a list of ParamNodes which are basically nodes that can
39
41
  // reference other nodes. When we start a new function call we update the parameter nodes
@@ -1,9 +1,9 @@
1
1
  #import "REAClockNodes.h"
2
- #import "REAUtils.h"
3
- #import "REANodesManager.h"
4
- #import "REAParamNode.h"
5
2
  #import <React/RCTConvert.h>
6
3
  #import <React/RCTLog.h>
4
+ #import "REANodesManager.h"
5
+ #import "REAParamNode.h"
6
+ #import "REAUtils.h"
7
7
 
8
8
  @interface REAClockNode ()
9
9
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  @implementation REAClockNode
15
15
 
16
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
16
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
17
17
  {
18
18
  if ((self = [super initWithID:nodeID config:config])) {
19
19
  _isRunning = NO;
@@ -23,7 +23,8 @@
23
23
 
24
24
  - (void)start
25
25
  {
26
- if (_isRunning) return;
26
+ if (_isRunning)
27
+ return;
27
28
  _isRunning = YES;
28
29
 
29
30
  __block __weak void (^weak_animationClb)(CADisplayLink *displayLink);
@@ -31,7 +32,8 @@
31
32
  __weak REAClockNode *weakSelf = self;
32
33
 
33
34
  weak_animationClb = animationClb = ^(CADisplayLink *displayLink) {
34
- if (!weakSelf.isRunning) return;
35
+ if (!weakSelf.isRunning)
36
+ return;
35
37
  [weakSelf markUpdated];
36
38
  [weakSelf.nodesManager postOnAnimation:weak_animationClb];
37
39
  };
@@ -55,18 +57,19 @@
55
57
  NSNumber *_clockNodeID;
56
58
  }
57
59
 
58
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
60
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
59
61
  {
60
62
  if ((self = [super initWithID:nodeID config:config])) {
61
63
  _clockNodeID = [RCTConvert NSNumber:config[@"clock"]];
62
- REA_LOG_ERROR_IF_NIL(_clockNodeID, @"Reanimated: First argument passed to clock node is either of wrong type or is missing.");
64
+ REA_LOG_ERROR_IF_NIL(
65
+ _clockNodeID, @"Reanimated: First argument passed to clock node is either of wrong type or is missing.");
63
66
  }
64
67
  return self;
65
68
  }
66
69
 
67
- - (REANode*)clockNode
70
+ - (REANode *)clockNode
68
71
  {
69
- return (REANode*)[self.nodesManager findNodeByID:_clockNodeID];
72
+ return (REANode *)[self.nodesManager findNodeByID:_clockNodeID];
70
73
  }
71
74
 
72
75
  @end
@@ -75,11 +78,11 @@
75
78
 
76
79
  - (id)evaluate
77
80
  {
78
- REANode* node = [self clockNode];
81
+ REANode *node = [self clockNode];
79
82
  if ([node isKindOfClass:[REAParamNode class]]) {
80
- [(REAParamNode* )node start];
83
+ [(REAParamNode *)node start];
81
84
  } else {
82
- [(REAClockNode* )node start];
85
+ [(REAClockNode *)node start];
83
86
  }
84
87
  return @(0);
85
88
  }
@@ -90,27 +93,26 @@
90
93
 
91
94
  - (id)evaluate
92
95
  {
93
- REANode* node = [self clockNode];
96
+ REANode *node = [self clockNode];
94
97
  if ([node isKindOfClass:[REAParamNode class]]) {
95
- [(REAParamNode* )node stop];
98
+ [(REAParamNode *)node stop];
96
99
  } else {
97
- [(REAClockNode* )node stop];
100
+ [(REAClockNode *)node stop];
98
101
  }
99
102
  return @(0);
100
103
  }
101
104
 
102
-
103
105
  @end
104
106
 
105
107
  @implementation REAClockTestNode
106
108
 
107
109
  - (id)evaluate
108
110
  {
109
- REANode* node = [self clockNode];
111
+ REANode *node = [self clockNode];
110
112
  if ([node isKindOfClass:[REAParamNode class]]) {
111
- return @(((REAParamNode* )node).isRunning ? 1 : 0);
113
+ return @(((REAParamNode *)node).isRunning ? 1 : 0);
112
114
  }
113
- return @([(REAClockNode* )node isRunning] ? 1 : 0);
115
+ return @([(REAClockNode *)node isRunning] ? 1 : 0);
114
116
  }
115
117
 
116
118
  @end
@@ -3,4 +3,3 @@
3
3
  @interface REAConcatNode : REANode
4
4
 
5
5
  @end
6
-
@@ -1,12 +1,12 @@
1
1
  #import "REAConcatNode.h"
2
- #import "REAValueNode.h"
3
2
  #import "REANodesManager.h"
3
+ #import "REAValueNode.h"
4
4
 
5
5
  @implementation REAConcatNode {
6
6
  NSArray<NSNumber *> *_input;
7
7
  }
8
8
 
9
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
9
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
10
10
  {
11
11
  if ((self = [super initWithID:nodeID config:config])) {
12
12
  _input = config[@"input"];
@@ -1,8 +1,8 @@
1
1
  #import "REACondNode.h"
2
- #import "REANodesManager.h"
3
2
  #import <React/RCTConvert.h>
4
- #import "REAUtils.h"
5
3
  #import <React/RCTLog.h>
4
+ #import "REANodesManager.h"
5
+ #import "REAUtils.h"
6
6
 
7
7
  @implementation REACondNode {
8
8
  NSNumber *_condNodeID;
@@ -10,13 +10,15 @@
10
10
  NSNumber *_elseBlockID;
11
11
  }
12
12
 
13
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
13
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
14
14
  {
15
15
  if ((self = [super initWithID:nodeID config:config])) {
16
16
  _condNodeID = [RCTConvert NSNumber:config[@"cond"]];
17
- REA_LOG_ERROR_IF_NIL(_condNodeID, @"Reanimated: First argument passed to cond node is either of wrong type or is missing.");
17
+ REA_LOG_ERROR_IF_NIL(
18
+ _condNodeID, @"Reanimated: First argument passed to cond node is either of wrong type or is missing.");
18
19
  _ifBlockID = [RCTConvert NSNumber:config[@"ifBlock"]];
19
- REA_LOG_ERROR_IF_NIL(_ifBlockID, @"Reanimated: Second argument passed to cond node is either of wrong type or is missing.");
20
+ REA_LOG_ERROR_IF_NIL(
21
+ _ifBlockID, @"Reanimated: Second argument passed to cond node is either of wrong type or is missing.");
20
22
  _elseBlockID = [RCTConvert NSNumber:config[@"elseBlock"]];
21
23
  }
22
24
  return self;
@@ -1,20 +1,21 @@
1
1
  #import "READebugNode.h"
2
- #import "REAUtils.h"
3
- #import "REANodesManager.h"
4
2
  #import <React/RCTConvert.h>
5
3
  #import <React/RCTLog.h>
4
+ #import "REANodesManager.h"
5
+ #import "REAUtils.h"
6
6
 
7
7
  @implementation READebugNode {
8
8
  NSNumber *_valueNodeID;
9
9
  NSString *_message;
10
10
  }
11
11
 
12
- - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *,id> *)config
12
+ - (instancetype)initWithID:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
13
13
  {
14
14
  if ((self = [super initWithID:nodeID config:config])) {
15
15
  _message = [RCTConvert NSString:config[@"message"]];
16
16
  _valueNodeID = [RCTConvert NSNumber:config[@"value"]];
17
- REA_LOG_ERROR_IF_NIL(_valueNodeID, @"Reanimated: Second argument passed to debug node is either of wrong type or is missing.");
17
+ REA_LOG_ERROR_IF_NIL(
18
+ _valueNodeID, @"Reanimated: Second argument passed to debug node is either of wrong type or is missing.");
18
19
  }
19
20
  return self;
20
21
  }