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,6 +1,6 @@
1
- #import <UIKit/UIKit.h>
2
1
  #import <QuartzCore/QuartzCore.h>
3
2
  #import <React/RCTView.h>
3
+ #import <UIKit/UIKit.h>
4
4
 
5
5
  #import "REATransitionAnimation.h"
6
6
  #import "REATransitionValues.h"
@@ -53,12 +53,13 @@ typedef NS_ENUM(NSInteger, REATransitionPropagationType) {
53
53
  - (void)playInRoot:(UIView *)root;
54
54
  - (REATransitionValues *)findStartValuesForKey:(NSNumber *)key;
55
55
  - (REATransitionValues *)findEndValuesForKey:(NSNumber *)key;
56
- - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues*)startValues
57
- endValues:(REATransitionValues*)endValues
58
- forRoot:(UIView *)root;
59
- - (NSArray<REATransitionAnimation*> *)animationsForTransitioning:(NSMutableDictionary<NSNumber*, REATransitionValues*> *)startValues
60
- endValues:(NSMutableDictionary<NSNumber*, REATransitionValues*> *)endValues
61
- forRoot:(UIView *)root;
56
+ - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
57
+ endValues:(REATransitionValues *)endValues
58
+ forRoot:(UIView *)root;
59
+ - (NSArray<REATransitionAnimation *> *)
60
+ animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
61
+ endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
62
+ forRoot:(UIView *)root;
62
63
 
63
64
  + (REATransition *)inflate:(NSDictionary *)config;
64
65
  @end
@@ -1,11 +1,11 @@
1
- #import <UIKit/UIKit.h>
2
1
  #import <QuartzCore/QuartzCore.h>
3
2
  #import <React/RCTConvert.h>
4
3
  #import <React/RCTViewManager.h>
4
+ #import <UIKit/UIKit.h>
5
5
 
6
+ #import "RCTConvert+REATransition.h"
6
7
  #import "REATransition.h"
7
8
  #import "REATransitionValues.h"
8
- #import "RCTConvert+REATransition.h"
9
9
 
10
10
  #define DEFAULT_PROPAGATION_SPEED 3
11
11
 
@@ -17,8 +17,8 @@
17
17
 
18
18
  @interface REAVisibilityTransition : REATransition
19
19
  @property (nonatomic) REATransitionAnimationType animationType;
20
- - (REATransitionAnimation *)appearView:(UIView*)view inParent:(UIView*)parent;
21
- - (REATransitionAnimation *)disappearView:(UIView*)view fromParent:(UIView*)parent;
20
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent;
21
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent;
22
22
  - (instancetype)initWithConfig:(NSDictionary *)config;
23
23
  @end
24
24
 
@@ -36,8 +36,8 @@
36
36
 
37
37
  @implementation REATransition {
38
38
  __weak UIView *_root;
39
- NSMutableDictionary<NSNumber*, REATransitionValues*> *_startValues;
40
- NSMutableDictionary<NSNumber*, REATransitionValues*> *_endValues;
39
+ NSMutableDictionary<NSNumber *, REATransitionValues *> *_startValues;
40
+ NSMutableDictionary<NSNumber *, REATransitionValues *> *_endValues;
41
41
  }
42
42
 
43
43
  + (REATransition *)inflate:(NSDictionary *)config
@@ -70,7 +70,9 @@
70
70
  return self;
71
71
  }
72
72
 
73
- - (void)captureRecursiveIn:(UIView *)view to:(NSMutableDictionary<NSNumber*, REATransitionValues*> *)map forRoot:(UIView *)root
73
+ - (void)captureRecursiveIn:(UIView *)view
74
+ to:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)map
75
+ forRoot:(UIView *)root
74
76
  {
75
77
  NSNumber *tag = view.reactTag;
76
78
  if (tag != nil) {
@@ -91,9 +93,7 @@
91
93
  {
92
94
  _endValues = [NSMutableDictionary new];
93
95
  [self captureRecursiveIn:root to:_endValues forRoot:root];
94
- NSArray *animations = [self animationsForTransitioning:_startValues
95
- endValues:_endValues
96
- forRoot:root];
96
+ NSArray *animations = [self animationsForTransitioning:_startValues endValues:_endValues forRoot:root];
97
97
  for (REATransitionAnimation *animation in animations) {
98
98
  [animation play];
99
99
  }
@@ -164,15 +164,16 @@
164
164
  }
165
165
 
166
166
  - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
167
- endValues:(REATransitionValues *)endValues
168
- forRoot:(UIView *)root
167
+ endValues:(REATransitionValues *)endValues
168
+ forRoot:(UIView *)root
169
169
  {
170
170
  return nil;
171
171
  }
172
172
 
173
- - (NSArray<REATransitionAnimation*> *)animationsForTransitioning:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)startValues
174
- endValues:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)endValues
175
- forRoot:(UIView *)root
173
+ - (NSArray<REATransitionAnimation *> *)
174
+ animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
175
+ endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
176
+ forRoot:(UIView *)root
176
177
  {
177
178
  NSMutableArray *animations = [NSMutableArray new];
178
179
  [startValues enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, REATransitionValues *startValue, BOOL *stop) {
@@ -182,7 +183,9 @@
182
183
  animation.animation.timingFunction = self.mediaTiming;
183
184
  animation.animation.duration = self.duration;
184
185
  [animation delayBy:self.delay];
185
- CFTimeInterval propagationDelay = [self propagationDelayForTransitioning:startValue endValues:endValue forRoot:root];
186
+ CFTimeInterval propagationDelay = [self propagationDelayForTransitioning:startValue
187
+ endValues:endValue
188
+ forRoot:root];
186
189
  [animation delayBy:propagationDelay];
187
190
  // animation.animation.duration -= propagationDelay;
188
191
  [animations addObject:animation];
@@ -8,7 +8,7 @@
8
8
 
9
9
  + (REATransitionAnimation *)transitionWithAnimation:(CAAnimation *)animation
10
10
  layer:(CALayer *)layer
11
- andKeyPath:(NSString*)keyPath;
11
+ andKeyPath:(NSString *)keyPath;
12
12
  - (void)play;
13
13
  - (void)delayBy:(CFTimeInterval)delay;
14
14
  - (CFTimeInterval)finishTime;
@@ -2,7 +2,6 @@
2
2
 
3
3
  #import "REATransitionAnimation.h"
4
4
 
5
-
6
5
  #define DEFAULT_DURATION 0.25
7
6
 
8
7
  #if TARGET_IPHONE_SIMULATOR
@@ -31,7 +30,7 @@ CGFloat SimAnimationDragCoefficient()
31
30
 
32
31
  + (REATransitionAnimation *)transitionWithAnimation:(CAAnimation *)animation
33
32
  layer:(CALayer *)layer
34
- andKeyPath:(NSString*)keyPath;
33
+ andKeyPath:(NSString *)keyPath;
35
34
  {
36
35
  REATransitionAnimation *anim = [REATransitionAnimation new];
37
36
  anim.animation = animation;
@@ -47,7 +46,7 @@ CGFloat SimAnimationDragCoefficient()
47
46
  it calls mach_absolute_time() which is based on the last time the device booted
48
47
  which might cause the delay
49
48
  */
50
- if (_delay > 0){
49
+ if (_delay > 0) {
51
50
  _animation.beginTime = CACurrentMediaTime() + _delay * SimAnimationDragCoefficient();
52
51
  }
53
52
  _animation.duration = self.duration * SimAnimationDragCoefficient();
@@ -35,7 +35,7 @@
35
35
 
36
36
  - (void)uiManagerWillPerformMounting:(RCTUIManager *)manager
37
37
  {
38
- [manager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
38
+ [manager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
39
39
  [_pendingTransition playInRoot:_pendingTransitionRoot];
40
40
  _pendingTransitionRoot = nil;
41
41
  _pendingTransition = nil;
@@ -45,7 +45,7 @@
45
45
  - (void)animateNextTransitionInRoot:(NSNumber *)reactTag withConfig:(NSDictionary *)config
46
46
  {
47
47
  [_uiManager.observerCoordinator addObserver:self];
48
- [_uiManager prependUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
48
+ [_uiManager prependUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
49
49
  UIView *view = viewRegistry[reactTag];
50
50
  NSArray *transitionConfigs = [RCTConvert NSArray:config[@"transitions"]];
51
51
  for (id transitionConfig in transitionConfigs) {
@@ -54,7 +54,7 @@
54
54
  }
55
55
  }];
56
56
  __weak id weakSelf = self;
57
- [_uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) {
57
+ [_uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
58
58
  [uiManager.observerCoordinator removeObserver:weakSelf];
59
59
  }];
60
60
  }
@@ -1,11 +1,26 @@
1
1
  #import <Foundation/Foundation.h>
2
- #import <vector>
3
- #import <string>
4
2
  #import <React/RCTUIManager.h>
3
+ #include <string>
4
+ #import <string>
5
+ #include <utility>
6
+ #include <vector>
7
+ #import <vector>
8
+ #import "RNGestureHandlerStateManager.h"
5
9
 
6
10
  namespace reanimated {
7
11
 
8
- std::vector<std::pair<std::string,double>> measure(int viewTag, RCTUIManager *uiManager);
9
- void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bool animated);
12
+ std::vector<std::pair<std::string, double>> measure(
13
+ int viewTag,
14
+ RCTUIManager *uiManager);
15
+ void scrollTo(
16
+ int scrollViewTag,
17
+ RCTUIManager *uiManager,
18
+ double x,
19
+ double y,
20
+ bool animated);
21
+ void setGestureState(
22
+ id<RNGestureHandlerStateManager> gestureHandlerStateManager,
23
+ int handlerTag,
24
+ int newState);
10
25
 
11
- }
26
+ } // namespace reanimated
@@ -1,10 +1,11 @@
1
1
  #import "NativeMethods.h"
2
- #import <React/RCTScrollView.h>
3
2
  #import <React/RCTEventDispatcher.h>
3
+ #import <React/RCTScrollView.h>
4
4
 
5
5
  namespace reanimated {
6
6
 
7
- std::vector<std::pair<std::string,double>> measure(int viewTag, RCTUIManager *uiManager) {
7
+ std::vector<std::pair<std::string, double>> measure(int viewTag, RCTUIManager *uiManager)
8
+ {
8
9
  UIView *view = [uiManager viewForReactTag:@(viewTag)];
9
10
 
10
11
  UIView *rootView = view;
@@ -17,7 +18,7 @@ std::vector<std::pair<std::string,double>> measure(int viewTag, RCTUIManager *ui
17
18
  rootView = rootView.superview;
18
19
  }
19
20
 
20
- if (rootView == nil || (![rootView isReactRootView])) {
21
+ if (rootView == nil) {
21
22
  return std::vector<std::pair<std::string, double>>(1, std::make_pair("x", -1234567.0));
22
23
  }
23
24
 
@@ -36,11 +37,18 @@ std::vector<std::pair<std::string,double>> measure(int viewTag, RCTUIManager *ui
36
37
  return result;
37
38
  }
38
39
 
39
-
40
- void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bool animated) {
40
+ void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bool animated)
41
+ {
41
42
  UIView *view = [uiManager viewForReactTag:@(scrollViewTag)];
42
- RCTScrollView *scrollView = (RCTScrollView *) view;
43
+ RCTScrollView *scrollView = (RCTScrollView *)view;
43
44
  [scrollView scrollToOffset:(CGPoint){(CGFloat)x, (CGFloat)y} animated:animated];
44
45
  }
45
46
 
47
+ void setGestureState(id<RNGestureHandlerStateManager> gestureHandlerStateManager, int handlerTag, int newState)
48
+ {
49
+ if (gestureHandlerStateManager != nil) {
50
+ [gestureHandlerStateManager setGestureState:newState forHandler:handlerTag];
51
+ }
52
+ }
53
+
46
54
  }
@@ -1,12 +1,14 @@
1
1
  #import <React/RCTEventDispatcher.h>
2
2
 
3
3
  #if __cplusplus
4
-
5
4
  #import <RNReanimated/NativeReanimatedModule.h>
5
+ #include <memory>
6
6
 
7
7
  namespace reanimated {
8
8
 
9
- std::shared_ptr<reanimated::NativeReanimatedModule> createReanimatedModule(std::shared_ptr<facebook::react::CallInvoker> jsInvoker);
9
+ std::shared_ptr<reanimated::NativeReanimatedModule> createReanimatedModule(
10
+ RCTBridge *bridge,
11
+ std::shared_ptr<facebook::react::CallInvoker> jsInvoker);
10
12
 
11
13
  }
12
14
 
@@ -1,15 +1,18 @@
1
- #import "NativeProxy.h"
2
- #import "REAIOSScheduler.h"
3
- #import "REAIOSErrorHandler.h"
4
- #import "REAModule.h"
5
- #import "REANodesManager.h"
6
- #import "NativeMethods.h"
7
- #import <folly/json.h>
1
+
8
2
  #import <React/RCTFollyConvert.h>
9
3
  #import <React/RCTUIManager.h>
4
+ #import <folly/json.h>
5
+
10
6
  #import "LayoutAnimationsProxy.h"
7
+ #import "NativeMethods.h"
8
+ #import "NativeProxy.h"
11
9
  #import "REAAnimationsManager.h"
10
+ #import "REAIOSErrorHandler.h"
11
+ #import "REAIOSScheduler.h"
12
+ #import "REAModule.h"
13
+ #import "REANodesManager.h"
12
14
  #import "REAUIManager.h"
15
+ #import "RNGestureHandlerStateManager.h"
13
16
 
14
17
  #if __has_include(<reacthermes/HermesExecutorFactory.h>)
15
18
  #import <reacthermes/HermesExecutorFactory.h>
@@ -24,7 +27,6 @@ namespace reanimated {
24
27
  using namespace facebook;
25
28
  using namespace react;
26
29
 
27
-
28
30
  // COPIED FROM RCTTurboModule.mm
29
31
  static id convertJSIValueToObjCObject(jsi::Runtime &runtime, const jsi::Value &value);
30
32
 
@@ -49,15 +51,13 @@ static NSDictionary *convertJSIObjectToNSDictionary(jsi::Runtime &runtime, const
49
51
  return [result copy];
50
52
  }
51
53
 
52
- static NSArray *
53
- convertJSIArrayToNSArray(jsi::Runtime &runtime, const jsi::Array &value)
54
+ static NSArray *convertJSIArrayToNSArray(jsi::Runtime &runtime, const jsi::Array &value)
54
55
  {
55
56
  size_t size = value.size(runtime);
56
57
  NSMutableArray *result = [NSMutableArray new];
57
58
  for (size_t i = 0; i < size; i++) {
58
59
  // Insert kCFNull when it's `undefined` value to preserve the indices.
59
- [result
60
- addObject:convertJSIValueToObjCObject(runtime, value.getValueAtIndex(runtime, i)) ?: (id)kCFNull];
60
+ [result addObject:convertJSIValueToObjCObject(runtime, value.getValueAtIndex(runtime, i)) ?: (id)kCFNull];
61
61
  }
62
62
  return [result copy];
63
63
  }
@@ -87,18 +87,23 @@ static id convertJSIValueToObjCObject(jsi::Runtime &runtime, const jsi::Value &v
87
87
  throw std::runtime_error("Unsupported jsi::jsi::Value kind");
88
88
  }
89
89
 
90
- std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<CallInvoker> jsInvoker) {
91
- RCTBridge *bridge = _bridge_reanimated;
90
+ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(
91
+ RCTBridge *bridge,
92
+ std::shared_ptr<CallInvoker> jsInvoker)
93
+ {
92
94
  REAModule *reanimatedModule = [bridge moduleForClass:[REAModule class]];
93
95
 
94
- auto propUpdater = [reanimatedModule](jsi::Runtime &rt, int viewTag, const jsi::Value& viewName, const jsi::Object &props) -> void {
95
- NSString *nsViewName = [NSString stringWithCString:viewName.asString(rt).utf8(rt).c_str() encoding:[NSString defaultCStringEncoding]];
96
+ auto propUpdater = [reanimatedModule](
97
+ jsi::Runtime &rt, int viewTag, const jsi::Value &viewName, const jsi::Object &props) -> void {
98
+ NSString *nsViewName = [NSString stringWithCString:viewName.asString(rt).utf8(rt).c_str()
99
+ encoding:[NSString defaultCStringEncoding]];
96
100
 
97
101
  NSDictionary *propsDict = convertJSIObjectToNSDictionary(rt, props);
98
- [reanimatedModule.nodesManager updateProps:propsDict ofViewWithTag:[NSNumber numberWithInt:viewTag] withName:nsViewName];
102
+ [reanimatedModule.nodesManager updateProps:propsDict
103
+ ofViewWithTag:[NSNumber numberWithInt:viewTag]
104
+ withName:nsViewName];
99
105
  };
100
106
 
101
-
102
107
  RCTUIManager *uiManager = reanimatedModule.nodesManager.uiManager;
103
108
  auto measuringFunction = [uiManager](int viewTag) -> std::vector<std::pair<std::string, double>> {
104
109
  return measure(viewTag, uiManager);
@@ -108,11 +113,18 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
108
113
  scrollTo(viewTag, uiManager, x, y, animated);
109
114
  };
110
115
 
111
- auto propObtainer = [reanimatedModule](jsi::Runtime &rt, const int viewTag, const jsi::String &propName) -> jsi::Value {
112
- NSString* propNameConverted = [NSString stringWithFormat:@"%s",propName.utf8(rt).c_str()];
113
- std::string resultStr = std::string([[reanimatedModule.nodesManager obtainProp:[NSNumber numberWithInt:viewTag] propName:propNameConverted] UTF8String]);
114
- jsi::Value val = jsi::String::createFromUtf8(rt, resultStr);
115
- return val;
116
+ id<RNGestureHandlerStateManager> gestureHandlerStateManager = [bridge moduleForName:@"RNGestureHandlerModule"];
117
+ auto setGestureStateFunction = [gestureHandlerStateManager](int handlerTag, int newState) {
118
+ setGestureState(gestureHandlerStateManager, handlerTag, newState);
119
+ };
120
+
121
+ auto propObtainer = [reanimatedModule](
122
+ jsi::Runtime &rt, const int viewTag, const jsi::String &propName) -> jsi::Value {
123
+ NSString *propNameConverted = [NSString stringWithFormat:@"%s", propName.utf8(rt).c_str()];
124
+ std::string resultStr = std::string([[reanimatedModule.nodesManager obtainProp:[NSNumber numberWithInt:viewTag]
125
+ propName:propNameConverted] UTF8String]);
126
+ jsi::Value val = jsi::String::createFromUtf8(rt, resultStr);
127
+ return val;
116
128
  };
117
129
 
118
130
  #if __has_include(<reacthermes/HermesExecutorFactory.h>)
@@ -128,13 +140,13 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
128
140
  std::shared_ptr<NativeReanimatedModule> module;
129
141
 
130
142
  __block std::weak_ptr<Scheduler> weakScheduler = scheduler;
131
- ((REAUIManager*)uiManager).flushUiOperations = ^void() {
143
+ ((REAUIManager *)uiManager).flushUiOperations = ^void() {
132
144
  std::shared_ptr<Scheduler> scheduler = weakScheduler.lock();
133
145
  if (scheduler != nullptr) {
134
146
  scheduler->triggerUI();
135
147
  }
136
148
  };
137
-
149
+
138
150
  auto requestRender = [reanimatedModule, &module](std::function<void(double)> onRender, jsi::Runtime &rt) {
139
151
  [reanimatedModule.nodesManager postOnAnimation:^(CADisplayLink *displayLink) {
140
152
  double frameTimestamp = displayLink.targetTimestamp * 1000;
@@ -146,80 +158,89 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
146
158
  }];
147
159
  };
148
160
 
149
- auto getCurrentTime = []() {
150
- return CACurrentMediaTime() * 1000;
151
- };
152
-
161
+ auto getCurrentTime = []() { return CACurrentMediaTime() * 1000; };
162
+
153
163
  // Layout Animations start
154
- REAUIManager* reaUiManagerNoCast = [bridge moduleForClass:[REAUIManager class]];
155
- RCTUIManager* reaUiManager = reaUiManagerNoCast;
164
+ REAUIManager *reaUiManagerNoCast = [bridge moduleForClass:[REAUIManager class]];
165
+ RCTUIManager *reaUiManager = reaUiManagerNoCast;
156
166
  REAAnimationsManager *animationsManager = [[REAAnimationsManager alloc] initWithUIManager:reaUiManager];
157
167
  [reaUiManagerNoCast setUp:animationsManager];
158
-
168
+
159
169
  auto notifyAboutProgress = [=](int tag, jsi::Object newStyle) {
160
170
  if (animationsManager) {
161
171
  NSDictionary *propsDict = convertJSIObjectToNSDictionary(*animatedRuntime, newStyle);
162
- [animationsManager notifyAboutProgress:propsDict tag:[NSNumber numberWithInt: tag]];
172
+ [animationsManager notifyAboutProgress:propsDict tag:[NSNumber numberWithInt:tag]];
163
173
  }
164
174
  };
165
-
175
+
166
176
  auto notifyAboutEnd = [=](int tag, bool isCancelled) {
167
177
  if (animationsManager) {
168
- [animationsManager notifyAboutEnd:[NSNumber numberWithInt: tag] cancelled:isCancelled];
178
+ [animationsManager notifyAboutEnd:[NSNumber numberWithInt:tag] cancelled:isCancelled];
169
179
  }
170
180
  };
171
-
172
- std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy = std::make_shared<LayoutAnimationsProxy>(notifyAboutProgress, notifyAboutEnd);
181
+
182
+ std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy =
183
+ std::make_shared<LayoutAnimationsProxy>(notifyAboutProgress, notifyAboutEnd);
173
184
  std::weak_ptr<jsi::Runtime> wrt = animatedRuntime;
174
- [animationsManager setAnimationStartingBlock:^(NSNumber * _Nonnull tag, NSString * type, NSDictionary* _Nonnull values, NSNumber* depth) {
185
+ [animationsManager setAnimationStartingBlock:^(
186
+ NSNumber *_Nonnull tag, NSString *type, NSDictionary *_Nonnull values, NSNumber *depth) {
175
187
  std::shared_ptr<jsi::Runtime> rt = wrt.lock();
176
188
  if (wrt.expired()) {
177
189
  return;
178
190
  }
179
191
  jsi::Object yogaValues(*rt);
180
192
  for (NSString *key in values.allKeys) {
181
- NSNumber* value = values[key];
193
+ NSNumber *value = values[key];
182
194
  yogaValues.setProperty(*rt, [key UTF8String], [value doubleValue]);
183
195
  }
184
-
185
- jsi::Value layoutAnimationRepositoryAsValue = rt->global().getPropertyAsObject(*rt, "global").getProperty(*rt, "LayoutAnimationRepository");
196
+
197
+ jsi::Value layoutAnimationRepositoryAsValue =
198
+ rt->global().getPropertyAsObject(*rt, "global").getProperty(*rt, "LayoutAnimationRepository");
186
199
  if (!layoutAnimationRepositoryAsValue.isUndefined()) {
187
- jsi::Function startAnimationForTag = layoutAnimationRepositoryAsValue.getObject(*rt).getPropertyAsFunction(*rt, "startAnimationForTag");
188
- startAnimationForTag.call(*rt, jsi::Value([tag intValue]), jsi::String::createFromAscii(*rt, std::string([type UTF8String])), yogaValues, jsi::Value([depth intValue]));
200
+ jsi::Function startAnimationForTag =
201
+ layoutAnimationRepositoryAsValue.getObject(*rt).getPropertyAsFunction(*rt, "startAnimationForTag");
202
+ startAnimationForTag.call(
203
+ *rt,
204
+ jsi::Value([tag intValue]),
205
+ jsi::String::createFromAscii(*rt, std::string([type UTF8String])),
206
+ yogaValues,
207
+ jsi::Value([depth intValue]));
189
208
  }
190
209
  }];
191
210
 
192
-
193
- [animationsManager setRemovingConfigBlock:^(NSNumber* _Nonnull tag) {
211
+ [animationsManager setRemovingConfigBlock:^(NSNumber *_Nonnull tag) {
194
212
  std::shared_ptr<jsi::Runtime> rt = wrt.lock();
195
213
  if (wrt.expired()) {
196
214
  return;
197
215
  }
198
- jsi::Value layoutAnimationRepositoryAsValue = rt->global().getPropertyAsObject(*rt, "global").getProperty(*rt, "LayoutAnimationRepository");
216
+ jsi::Value layoutAnimationRepositoryAsValue =
217
+ rt->global().getPropertyAsObject(*rt, "global").getProperty(*rt, "LayoutAnimationRepository");
199
218
  if (!layoutAnimationRepositoryAsValue.isUndefined()) {
200
- jsi::Function removeConfig = layoutAnimationRepositoryAsValue.getObject(*rt).getPropertyAsFunction(*rt, "removeConfig");
219
+ jsi::Function removeConfig =
220
+ layoutAnimationRepositoryAsValue.getObject(*rt).getPropertyAsFunction(*rt, "removeConfig");
201
221
  removeConfig.call(*rt, jsi::Value([tag intValue]));
202
222
  }
203
223
  }];
204
-
224
+
205
225
  // Layout Animations end
206
-
226
+
207
227
  PlatformDepMethodsHolder platformDepMethodsHolder = {
208
- requestRender,
209
- propUpdater,
210
- scrollToFunction,
211
- measuringFunction,
212
- getCurrentTime,
228
+ requestRender,
229
+ propUpdater,
230
+ scrollToFunction,
231
+ measuringFunction,
232
+ getCurrentTime,
233
+ setGestureStateFunction,
213
234
  };
214
235
 
215
- module = std::make_shared<NativeReanimatedModule>(jsInvoker,
216
- scheduler,
217
- animatedRuntime,
218
- errorHandler,
219
- propObtainer,
220
- layoutAnimationsProxy,
221
- platformDepMethodsHolder
222
- );
236
+ module = std::make_shared<NativeReanimatedModule>(
237
+ jsInvoker,
238
+ scheduler,
239
+ animatedRuntime,
240
+ errorHandler,
241
+ propObtainer,
242
+ layoutAnimationsProxy,
243
+ platformDepMethodsHolder);
223
244
 
224
245
  scheduler->setRuntimeManager(module);
225
246
 
@@ -227,7 +248,7 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
227
248
  std::string eventNameString([eventName UTF8String]);
228
249
  std::string eventAsString = folly::toJson(convertIdToFollyDynamic([event arguments][2]));
229
250
 
230
- eventAsString = "{ NativeMap:" + eventAsString + "}";
251
+ eventAsString = "{ NativeMap:" + eventAsString + "}";
231
252
  jsi::Object global = module->runtime->global();
232
253
  jsi::String eventTimestampName = jsi::String::createFromAscii(*module->runtime, "_eventTimestamp");
233
254
  global.setProperty(*module->runtime, eventTimestampName, CACurrentMediaTime() * 1000);
@@ -1,20 +1,23 @@
1
1
  #pragma once
2
2
 
3
+ #include <memory>
4
+ #include <string>
3
5
  #include "ErrorHandler.h"
4
6
  #include "Scheduler.h"
5
7
 
6
8
  namespace reanimated {
7
9
 
8
10
  class REAIOSErrorHandler : public ErrorHandler {
9
- std::shared_ptr<Scheduler> scheduler;
10
- void raiseSpec() override;
11
- std::shared_ptr<ErrorWrapper> error;
12
- public:
13
- REAIOSErrorHandler(std::shared_ptr<Scheduler> scheduler);
14
- std::shared_ptr<Scheduler> getScheduler() override;
15
- std::shared_ptr<ErrorWrapper> getError() override;
16
- void setError(std::string message) override;
17
- virtual ~REAIOSErrorHandler() {}
11
+ std::shared_ptr<Scheduler> scheduler;
12
+ void raiseSpec() override;
13
+ std::shared_ptr<ErrorWrapper> error;
14
+
15
+ public:
16
+ REAIOSErrorHandler(std::shared_ptr<Scheduler> scheduler);
17
+ std::shared_ptr<Scheduler> getScheduler() override;
18
+ std::shared_ptr<ErrorWrapper> getError() override;
19
+ void setError(std::string message) override;
20
+ virtual ~REAIOSErrorHandler() {}
18
21
  };
19
22
 
20
- }
23
+ } // namespace reanimated
@@ -2,31 +2,35 @@
2
2
  #import <Foundation/Foundation.h>
3
3
  #import <React/RCTLog.h>
4
4
 
5
-
6
5
  namespace reanimated {
7
6
 
8
- REAIOSErrorHandler::REAIOSErrorHandler(std::shared_ptr<Scheduler> scheduler) {
9
- this->scheduler = scheduler;
10
- error = std::make_shared<ErrorWrapper>();
7
+ REAIOSErrorHandler::REAIOSErrorHandler(std::shared_ptr<Scheduler> scheduler)
8
+ {
9
+ this->scheduler = scheduler;
10
+ error = std::make_shared<ErrorWrapper>();
11
11
  }
12
12
 
13
- void REAIOSErrorHandler::raiseSpec() {
14
- if (error->handled) {
15
- return;
16
- }
17
- RCTLogError(@(error->message.c_str()));
18
- this->error->handled = true;
13
+ void REAIOSErrorHandler::raiseSpec()
14
+ {
15
+ if (error->handled) {
16
+ return;
17
+ }
18
+ RCTLogError(@(error->message.c_str()));
19
+ this->error->handled = true;
19
20
  }
20
21
 
21
- std::shared_ptr<Scheduler> REAIOSErrorHandler::getScheduler() {
22
- return this->scheduler;
22
+ std::shared_ptr<Scheduler> REAIOSErrorHandler::getScheduler()
23
+ {
24
+ return this->scheduler;
23
25
  }
24
26
 
25
- std::shared_ptr<ErrorWrapper> REAIOSErrorHandler::getError() {
26
- return this->error;
27
+ std::shared_ptr<ErrorWrapper> REAIOSErrorHandler::getError()
28
+ {
29
+ return this->error;
27
30
  }
28
31
 
29
- void REAIOSErrorHandler::setError(std::string message) {
32
+ void REAIOSErrorHandler::setError(std::string message)
33
+ {
30
34
  if (error->handled) {
31
35
  error->message = message;
32
36
  error->handled = false;
@@ -1,17 +1,17 @@
1
1
  #pragma once
2
2
 
3
- #include "ReanimatedHiddenHeaders.h"
4
3
  #include <stdio.h>
4
+ #include "ReanimatedHiddenHeaders.h"
5
5
 
6
6
  namespace reanimated {
7
7
 
8
8
  class REAIOSLogger : public LoggerInterface {
9
- public:
10
- void log(const char* str) override;
11
- void log(double d) override;
12
- void log(int i) override;
13
- void log(bool b) override;
14
- virtual ~REAIOSLogger() {}
9
+ public:
10
+ void log(const char *str) override;
11
+ void log(double d) override;
12
+ void log(int i) override;
13
+ void log(bool b) override;
14
+ virtual ~REAIOSLogger() {}
15
15
  };
16
16
 
17
- }
17
+ } // namespace reanimated