react-native-reanimated 3.13.0-rc.1 → 3.13.0-rc.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 (41) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +19 -0
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +6 -0
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +717 -0
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +128 -0
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.cpp +81 -0
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +164 -0
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +63 -3
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +6 -2
  9. package/android/CMakeLists.txt +3 -0
  10. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +20 -2
  11. package/android/src/main/java/com/swmansion/reanimated/keyboard/Keyboard.java +1 -1
  12. package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +2 -1
  13. package/apple/LayoutReanimation/REASharedTransitionManager.m +8 -1
  14. package/lib/module/Colors.js +6 -2
  15. package/lib/module/Colors.js.map +1 -1
  16. package/lib/module/UpdateLayoutAnimations.js +2 -2
  17. package/lib/module/UpdateLayoutAnimations.js.map +1 -1
  18. package/lib/module/createAnimatedComponent/NativeEventsManager.js +91 -0
  19. package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -0
  20. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  21. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +46 -68
  22. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  23. package/lib/module/js-reanimated/index.js +1 -1
  24. package/lib/module/js-reanimated/index.js.map +1 -1
  25. package/lib/module/layoutReanimation/web/animationsManager.js +15 -0
  26. package/lib/module/layoutReanimation/web/animationsManager.js.map +1 -1
  27. package/lib/module/platform-specific/jsVersion.js +1 -1
  28. package/lib/module/platform-specific/jsVersion.js.map +1 -1
  29. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +15 -0
  30. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +12 -1
  31. package/lib/typescript/js-reanimated/index.d.ts +3 -1
  32. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/src/Colors.ts +5 -2
  35. package/src/UpdateLayoutAnimations.ts +2 -2
  36. package/src/createAnimatedComponent/NativeEventsManager.ts +138 -0
  37. package/src/createAnimatedComponent/commonTypes.ts +13 -1
  38. package/src/createAnimatedComponent/createAnimatedComponent.tsx +58 -94
  39. package/src/js-reanimated/index.ts +8 -2
  40. package/src/layoutReanimation/web/animationsManager.ts +35 -0
  41. package/src/platform-specific/jsVersion.ts +1 -1
@@ -20,6 +20,12 @@ void LayoutAnimationsManager::configureAnimationBatch(
20
20
  clearSharedTransitionConfig(tag);
21
21
  sharedTransitionConfigs.push_back(std::move(layoutAnimationConfig));
22
22
  } else {
23
+ #ifdef RCT_NEW_ARCH_ENABLED
24
+ if (type == ENTERING){
25
+ enteringAnimationsForNativeID_[tag] = config;
26
+ continue;
27
+ }
28
+ #endif
23
29
  if (config == nullptr) {
24
30
  getConfigsForType(type).erase(tag);
25
31
  } else {
@@ -159,6 +165,19 @@ int LayoutAnimationsManager::findPrecedingViewTagForTransition(const int tag) {
159
165
  return -1;
160
166
  }
161
167
 
168
+ #ifdef RCT_NEW_ARCH_ENABLED
169
+ void LayoutAnimationsManager::transferConfigFromNativeID(
170
+ const int nativeId,
171
+ const int tag) {
172
+ auto lock = std::unique_lock<std::recursive_mutex>(animationsMutex_);
173
+ auto config = enteringAnimationsForNativeID_[nativeId];
174
+ if (config) {
175
+ enteringAnimations_.insert_or_assign(tag, config);
176
+ }
177
+ enteringAnimationsForNativeID_.erase(nativeId);
178
+ }
179
+ #endif
180
+
162
181
  #ifndef NDEBUG
163
182
  std::string LayoutAnimationsManager::getScreenSharedTagPairString(
164
183
  const int screenTag,
@@ -42,6 +42,9 @@ class LayoutAnimationsManager {
42
42
  void clearLayoutAnimationConfig(const int tag);
43
43
  void clearSharedTransitionConfig(const int tag);
44
44
  void cancelLayoutAnimation(jsi::Runtime &rt, const int tag) const;
45
+ #ifdef RCT_NEW_ARCH_ENABLED
46
+ void transferConfigFromNativeID(const int nativeId, const int tag);
47
+ #endif
45
48
  int findPrecedingViewTagForTransition(const int tag);
46
49
  #ifndef NDEBUG
47
50
  std::string getScreenSharedTagPairString(
@@ -63,6 +66,9 @@ class LayoutAnimationsManager {
63
66
  std::unordered_map<int, std::string> viewsScreenSharedTagMap_;
64
67
  #endif
65
68
 
69
+ #ifdef RCT_NEW_ARCH_ENABLED
70
+ std::unordered_map<int, std::shared_ptr<Shareable>> enteringAnimationsForNativeID_;
71
+ #endif
66
72
  std::unordered_map<int, std::shared_ptr<Shareable>> enteringAnimations_;
67
73
  std::unordered_map<int, std::shared_ptr<Shareable>> exitingAnimations_;
68
74
  std::unordered_map<int, std::shared_ptr<Shareable>> layoutAnimations_;