react-native-reanimated 3.17.0-rc.0 → 3.17.0

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 (682) hide show
  1. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +23 -13
  2. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +5 -1
  3. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +3 -0
  4. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +162 -91
  5. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +9 -2
  6. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +7 -1
  7. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +0 -1
  8. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.cpp → ReanimatedModuleProxy.cpp} +221 -156
  9. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModule.h → ReanimatedModuleProxy.h} +24 -28
  10. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModuleSpec.cpp → ReanimatedModuleProxySpec.cpp} +53 -63
  11. package/Common/cpp/reanimated/NativeModules/{NativeReanimatedModuleSpec.h → ReanimatedModuleProxySpec.h} +2 -9
  12. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +6 -8
  13. package/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +2 -2
  14. package/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +1 -1
  15. package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +135 -0
  16. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +47 -0
  17. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +59 -0
  18. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +27 -0
  19. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +25 -0
  20. package/Common/cpp/worklets/SharedItems/Shareables.cpp +12 -2
  21. package/Common/cpp/worklets/Tools/Defs.h +10 -0
  22. package/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
  23. package/Common/cpp/worklets/Tools/JSScheduler.h +0 -12
  24. package/Common/cpp/{reanimated → worklets}/Tools/PlatformLogger.h +2 -2
  25. package/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +1 -1
  26. package/Common/cpp/{reanimated → worklets}/Tools/SingleInstanceChecker.h +10 -9
  27. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +4 -2
  28. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +2 -2
  29. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -6
  30. package/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +2 -13
  31. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +1 -0
  32. package/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -8
  33. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +8 -2
  34. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +8 -2
  35. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +6 -0
  36. package/README.md +3 -4
  37. package/RNReanimated.podspec +21 -53
  38. package/android/CMakeLists.txt +20 -12
  39. package/android/build.gradle +11 -45
  40. package/android/src/{reactNativeVersionPatch/NativeProxyFabric/74 → fabric/java}/com/swmansion/reanimated/NativeProxy.java +24 -40
  41. package/android/src/fabric/java/com/swmansion/reanimated/ReaCompatibility.java +6 -0
  42. package/android/src/main/cpp/reanimated/CMakeLists.txt +22 -41
  43. package/android/src/main/cpp/reanimated/android/LayoutAnimations.cpp +4 -0
  44. package/android/src/main/cpp/reanimated/android/LayoutAnimations.h +2 -0
  45. package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +70 -120
  46. package/android/src/main/cpp/reanimated/android/NativeProxy.h +12 -36
  47. package/android/src/main/cpp/reanimated/android/OnLoad.cpp +0 -2
  48. package/android/src/main/cpp/worklets/CMakeLists.txt +52 -106
  49. package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.cpp +15 -5
  50. package/android/src/main/cpp/{reanimated → worklets}/android/AndroidUIScheduler.h +5 -3
  51. package/android/src/main/cpp/{reanimated → worklets}/android/PlatformLogger.cpp +4 -4
  52. package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +39 -11
  53. package/android/src/main/cpp/worklets/android/WorkletsModule.h +22 -12
  54. package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +5 -2
  55. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +26 -11
  56. package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedModule.java +11 -0
  57. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +3 -3
  58. package/android/src/main/java/com/swmansion/reanimated/Utils.java +10 -0
  59. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +4 -2
  60. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/TabNavigatorObserver.java +1 -1
  61. package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +3 -11
  62. package/android/src/main/java/com/swmansion/{reanimated → worklets}/AndroidUIScheduler.java +16 -4
  63. package/android/src/main/java/com/swmansion/worklets/JSCallInvokerResolver.java +27 -0
  64. package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThread.java → worklets/WorkletsMessageQueueThread.java} +2 -2
  65. package/android/src/main/java/com/swmansion/{reanimated/ReanimatedMessageQueueThreadBase.java → worklets/WorkletsMessageQueueThreadBase.java} +3 -3
  66. package/android/src/main/java/com/swmansion/worklets/WorkletsModule.java +39 -9
  67. package/android/src/{reactNativeVersionPatch/NativeProxyPaper/latest → paper/java}/com/swmansion/reanimated/NativeProxy.java +13 -7
  68. package/android/src/paper/java/com/swmansion/reanimated/ReaCompatibility.java +2 -0
  69. package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +16 -0
  70. package/apple/reanimated/apple/REAModule.h +6 -9
  71. package/apple/reanimated/apple/REAModule.mm +50 -126
  72. package/apple/reanimated/apple/REANodesManager.h +0 -1
  73. package/apple/reanimated/apple/REANodesManager.mm +1 -8
  74. package/apple/reanimated/apple/keyboardObserver/REAKeyboardEventObserver.mm +91 -45
  75. package/apple/reanimated/apple/native/NativeProxy.h +5 -14
  76. package/apple/reanimated/apple/native/NativeProxy.mm +41 -92
  77. package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.h +1 -1
  78. package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +3 -6
  79. package/apple/{reanimated/apple/native/REAIOSUIScheduler.h → worklets/apple/IOSUIScheduler.h} +3 -3
  80. package/apple/{reanimated/apple/native/REAIOSUIScheduler.mm → worklets/apple/IOSUIScheduler.mm} +4 -4
  81. package/apple/{reanimated/apple/native → worklets/apple}/PlatformLogger.mm +3 -3
  82. package/apple/{reanimated/apple/native/REAMessageThread.h → worklets/apple/WorkletsMessageThread.h} +1 -1
  83. package/apple/{reanimated/apple/native/REAMessageThread.mm → worklets/apple/WorkletsMessageThread.mm} +7 -7
  84. package/apple/worklets/apple/WorkletsModule.h +2 -2
  85. package/apple/worklets/apple/WorkletsModule.mm +31 -6
  86. package/lib/module/Animated.js +4 -4
  87. package/lib/module/Animated.js.map +1 -1
  88. package/lib/module/Colors.js +18 -0
  89. package/lib/module/Colors.js.map +1 -1
  90. package/lib/module/ConfigHelper.js +1 -1
  91. package/lib/module/ConfigHelper.js.map +1 -1
  92. package/lib/module/PropAdapters.js.map +1 -1
  93. package/lib/module/ReanimatedModule/NativeReanimated.js +2 -5
  94. package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
  95. package/lib/module/ReanimatedModule/index.web.js.map +1 -1
  96. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js +3 -6
  97. package/lib/module/ReanimatedModule/js-reanimated/JSReanimated.js.map +1 -1
  98. package/lib/module/ReanimatedModule/js-reanimated/index.js +11 -4
  99. package/lib/module/ReanimatedModule/js-reanimated/index.js.map +1 -1
  100. package/lib/module/ReanimatedModule/reanimatedModuleInstance.js +1 -1
  101. package/lib/module/ReanimatedModule/reanimatedModuleInstance.js.map +1 -1
  102. package/lib/module/ReducedMotion.js +1 -1
  103. package/lib/module/ReducedMotion.js.map +1 -1
  104. package/lib/module/Sensor.js +1 -1
  105. package/lib/module/Sensor.js.map +1 -1
  106. package/lib/module/UpdateLayoutAnimations.js +1 -1
  107. package/lib/module/UpdateLayoutAnimations.js.map +1 -1
  108. package/lib/module/UpdateProps.js +2 -2
  109. package/lib/module/UpdateProps.js.map +1 -1
  110. package/lib/module/ViewDescriptorsSet.js.map +1 -1
  111. package/lib/module/WorkletEventHandler.js.map +1 -1
  112. package/lib/module/animation/clamp.js +1 -1
  113. package/lib/module/animation/clamp.js.map +1 -1
  114. package/lib/module/animation/decay/decay.js +10 -4
  115. package/lib/module/animation/decay/decay.js.map +1 -1
  116. package/lib/module/animation/decay/rigidDecay.js.map +1 -1
  117. package/lib/module/animation/delay.js.map +1 -1
  118. package/lib/module/animation/index.js +4 -4
  119. package/lib/module/animation/index.js.map +1 -1
  120. package/lib/module/animation/repeat.js.map +1 -1
  121. package/lib/module/animation/sequence.js +1 -1
  122. package/lib/module/animation/sequence.js.map +1 -1
  123. package/lib/module/animation/spring.js +1 -1
  124. package/lib/module/animation/spring.js.map +1 -1
  125. package/lib/module/animation/styleAnimation.js +2 -2
  126. package/lib/module/animation/styleAnimation.js.map +1 -1
  127. package/lib/module/animation/timing.js.map +1 -1
  128. package/lib/module/animation/util.js +12 -6
  129. package/lib/module/animation/util.js.map +1 -1
  130. package/lib/module/commonTypes.js.map +1 -1
  131. package/lib/module/component/FlatList.js +12 -14
  132. package/lib/module/component/FlatList.js.map +1 -1
  133. package/lib/module/component/Image.js.map +1 -1
  134. package/lib/module/component/LayoutAnimationConfig.js +9 -13
  135. package/lib/module/component/LayoutAnimationConfig.js.map +1 -1
  136. package/lib/module/component/PerformanceMonitor.js +25 -28
  137. package/lib/module/component/PerformanceMonitor.js.map +1 -1
  138. package/lib/module/component/ReducedMotionConfig.js +1 -1
  139. package/lib/module/component/ReducedMotionConfig.js.map +1 -1
  140. package/lib/module/component/ScrollView.js +5 -5
  141. package/lib/module/component/ScrollView.js.map +1 -1
  142. package/lib/module/component/Text.js.map +1 -1
  143. package/lib/module/component/View.js.map +1 -1
  144. package/lib/module/core.js +16 -10
  145. package/lib/module/core.js.map +1 -1
  146. package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
  147. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  148. package/lib/module/createAnimatedComponent/JSPropsUpdater.js +5 -6
  149. package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
  150. package/lib/module/createAnimatedComponent/NativeEventsManager.js +37 -10
  151. package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
  152. package/lib/module/createAnimatedComponent/PropsFilter.js +3 -3
  153. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  154. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +112 -84
  155. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  156. package/lib/module/culori/Colors.js +2 -0
  157. package/lib/module/culori/Colors.js.map +1 -0
  158. package/lib/module/culori/index.js +11 -0
  159. package/lib/module/culori/index.js.map +1 -0
  160. package/lib/module/culori/lrgb.js +65 -0
  161. package/lib/module/culori/lrgb.js.map +1 -0
  162. package/lib/module/culori/oklab.js +83 -0
  163. package/lib/module/culori/oklab.js.map +1 -0
  164. package/lib/module/fabricUtils.js +4 -11
  165. package/lib/module/fabricUtils.js.map +1 -1
  166. package/lib/module/hook/index.js +10 -10
  167. package/lib/module/hook/index.js.map +1 -1
  168. package/lib/module/hook/useAnimatedGestureHandler.js +1 -1
  169. package/lib/module/hook/useAnimatedGestureHandler.js.map +1 -1
  170. package/lib/module/hook/useAnimatedKeyboard.js +3 -3
  171. package/lib/module/hook/useAnimatedKeyboard.js.map +1 -1
  172. package/lib/module/hook/useAnimatedProps.js +1 -1
  173. package/lib/module/hook/useAnimatedProps.js.map +1 -1
  174. package/lib/module/hook/useAnimatedReaction.js +1 -1
  175. package/lib/module/hook/useAnimatedReaction.js.map +1 -1
  176. package/lib/module/hook/useAnimatedRef.js +5 -5
  177. package/lib/module/hook/useAnimatedRef.js.map +1 -1
  178. package/lib/module/hook/useAnimatedScrollHandler.js +1 -1
  179. package/lib/module/hook/useAnimatedScrollHandler.js.map +1 -1
  180. package/lib/module/hook/useAnimatedSensor.js +1 -1
  181. package/lib/module/hook/useAnimatedSensor.js.map +1 -1
  182. package/lib/module/hook/useAnimatedStyle.js +40 -10
  183. package/lib/module/hook/useAnimatedStyle.js.map +1 -1
  184. package/lib/module/hook/useComposedEventHandler.js +1 -1
  185. package/lib/module/hook/useComposedEventHandler.js.map +1 -1
  186. package/lib/module/hook/useDerivedValue.js.map +1 -1
  187. package/lib/module/hook/useEvent.js.map +1 -1
  188. package/lib/module/hook/useFrameCallback.js.map +1 -1
  189. package/lib/module/hook/useHandler.js +2 -2
  190. package/lib/module/hook/useHandler.js.map +1 -1
  191. package/lib/module/hook/useScrollViewOffset.js +2 -2
  192. package/lib/module/hook/useScrollViewOffset.js.map +1 -1
  193. package/lib/module/hook/useSharedValue.js.map +1 -1
  194. package/lib/module/hook/useWorkletCallback.js.map +1 -1
  195. package/lib/module/index.js +36 -36
  196. package/lib/module/index.js.map +1 -1
  197. package/lib/module/initializers.js +11 -4
  198. package/lib/module/initializers.js.map +1 -1
  199. package/lib/module/interpolateColor.js +108 -39
  200. package/lib/module/interpolateColor.js.map +1 -1
  201. package/lib/module/jestUtils.js +2 -2
  202. package/lib/module/jestUtils.js.map +1 -1
  203. package/lib/module/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +1 -1
  204. package/lib/module/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  205. package/lib/module/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +2 -2
  206. package/lib/module/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  207. package/lib/module/layoutReanimation/animationBuilder/Keyframe.js +7 -3
  208. package/lib/module/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  209. package/lib/module/layoutReanimation/animationsManager.js.map +1 -1
  210. package/lib/module/layoutReanimation/defaultAnimations/index.js +6 -6
  211. package/lib/module/layoutReanimation/defaultAnimations/index.js.map +1 -1
  212. package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js +2 -2
  213. package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  214. package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js +2 -2
  215. package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  216. package/lib/module/layoutReanimation/defaultTransitions/index.js +4 -4
  217. package/lib/module/layoutReanimation/defaultTransitions/index.js.map +1 -1
  218. package/lib/module/layoutReanimation/index.js.map +1 -1
  219. package/lib/module/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +3 -3
  220. package/lib/module/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
  221. package/lib/module/layoutReanimation/sharedTransitions/SharedTransition.js +3 -3
  222. package/lib/module/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  223. package/lib/module/layoutReanimation/sharedTransitions/index.js +1 -1
  224. package/lib/module/layoutReanimation/sharedTransitions/index.js.map +1 -1
  225. package/lib/module/layoutReanimation/web/animationParser.js.map +1 -1
  226. package/lib/module/layoutReanimation/web/animationsManager.js +10 -8
  227. package/lib/module/layoutReanimation/web/animationsManager.js.map +1 -1
  228. package/lib/module/layoutReanimation/web/componentStyle.js.map +1 -1
  229. package/lib/module/layoutReanimation/web/componentUtils.js +8 -8
  230. package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
  231. package/lib/module/layoutReanimation/web/config.js.map +1 -1
  232. package/lib/module/layoutReanimation/web/createAnimation.js +6 -6
  233. package/lib/module/layoutReanimation/web/createAnimation.js.map +1 -1
  234. package/lib/module/layoutReanimation/web/domUtils.js +2 -2
  235. package/lib/module/layoutReanimation/web/domUtils.js.map +1 -1
  236. package/lib/module/layoutReanimation/web/index.js.map +1 -1
  237. package/lib/module/layoutReanimation/web/transition/Curved.web.js.map +1 -1
  238. package/lib/module/layoutReanimation/web/transition/Jumping.web.js.map +1 -1
  239. package/lib/module/logger/index.js +1 -1
  240. package/lib/module/logger/logger.js +3 -3
  241. package/lib/module/logger/logger.js.map +1 -1
  242. package/lib/module/mappers.js +1 -1
  243. package/lib/module/mappers.js.map +1 -1
  244. package/lib/module/mock.js +40 -8
  245. package/lib/module/mock.js.map +1 -1
  246. package/lib/module/mutables.js +3 -3
  247. package/lib/module/mutables.js.map +1 -1
  248. package/lib/module/platform-specific/checkCppVersion.js +2 -2
  249. package/lib/module/platform-specific/checkCppVersion.js.map +1 -1
  250. package/lib/module/platform-specific/findHostInstance.js +58 -0
  251. package/lib/module/platform-specific/findHostInstance.js.map +1 -0
  252. package/lib/module/platform-specific/findHostInstance.web.js +4 -0
  253. package/lib/module/platform-specific/findHostInstance.web.js.map +1 -0
  254. package/lib/module/platform-specific/jsVersion.js +1 -1
  255. package/lib/module/platform-specific/jsVersion.js.map +1 -1
  256. package/lib/module/platformFunctions/dispatchCommand.js +1 -1
  257. package/lib/module/platformFunctions/dispatchCommand.js.map +1 -1
  258. package/lib/module/platformFunctions/getRelativeCoords.js.map +1 -1
  259. package/lib/module/platformFunctions/index.js +1 -1
  260. package/lib/module/platformFunctions/index.js.map +1 -1
  261. package/lib/module/platformFunctions/measure.js +1 -1
  262. package/lib/module/platformFunctions/measure.js.map +1 -1
  263. package/lib/module/platformFunctions/measure.web.js.map +1 -1
  264. package/lib/module/platformFunctions/scrollTo.js +1 -1
  265. package/lib/module/platformFunctions/scrollTo.js.map +1 -1
  266. package/lib/module/platformFunctions/scrollTo.web.js.map +1 -1
  267. package/lib/module/platformFunctions/setGestureState.js +1 -1
  268. package/lib/module/platformFunctions/setGestureState.js.map +1 -1
  269. package/lib/module/platformFunctions/setNativeProps.js +1 -1
  270. package/lib/module/platformFunctions/setNativeProps.js.map +1 -1
  271. package/lib/module/platformFunctions/setNativeProps.web.js.map +1 -1
  272. package/lib/module/processBoxShadow.js +150 -0
  273. package/lib/module/processBoxShadow.js.map +1 -0
  274. package/lib/module/propsAllowlists.js +1 -0
  275. package/lib/module/propsAllowlists.js.map +1 -1
  276. package/lib/module/runtimes.js +1 -1
  277. package/lib/module/runtimes.js.map +1 -1
  278. package/lib/module/screenTransition/RNScreensTurboModule.js.map +1 -1
  279. package/lib/module/screenTransition/animationManager.js.map +1 -1
  280. package/lib/module/screenTransition/index.js +1 -1
  281. package/lib/module/screenTransition/index.js.map +1 -1
  282. package/lib/module/screenTransition/styleUpdater.js.map +1 -1
  283. package/lib/module/screenTransition/swipeSimulator.js +1 -1
  284. package/lib/module/screenTransition/swipeSimulator.js.map +1 -1
  285. package/lib/module/shareableMappingCache.js.map +1 -1
  286. package/lib/module/shareables.js +217 -143
  287. package/lib/module/shareables.js.map +1 -1
  288. package/lib/module/specs/index.js +2 -2
  289. package/lib/module/specs/index.js.map +1 -1
  290. package/lib/module/threads.js +2 -2
  291. package/lib/module/threads.js.map +1 -1
  292. package/lib/module/worklets/WorkletsModule/JSWorklets.js +6 -1
  293. package/lib/module/worklets/WorkletsModule/JSWorklets.js.map +1 -1
  294. package/lib/module/worklets/WorkletsModule/NativeWorklets.js +5 -2
  295. package/lib/module/worklets/WorkletsModule/NativeWorklets.js.map +1 -1
  296. package/lib/module/worklets/WorkletsModule/workletsModuleInstance.js +1 -1
  297. package/lib/module/worklets/WorkletsModule/workletsModuleInstance.js.map +1 -1
  298. package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js +1 -1
  299. package/lib/module/worklets/WorkletsModule/workletsModuleProxy.js.map +1 -1
  300. package/lib/module/worklets/index.js.map +1 -1
  301. package/lib/module/worklets/valueUnpacker.js +1 -1
  302. package/lib/module/worklets/valueUnpacker.js.map +1 -1
  303. package/lib/typescript/Animated.d.ts +9 -9
  304. package/lib/typescript/Animated.d.ts.map +1 -1
  305. package/lib/typescript/Colors.d.ts +1 -0
  306. package/lib/typescript/Colors.d.ts.map +1 -1
  307. package/lib/typescript/ConfigHelper.d.ts.map +1 -1
  308. package/lib/typescript/PropAdapters.d.ts.map +1 -1
  309. package/lib/typescript/ReanimatedModule/NativeReanimated.d.ts.map +1 -1
  310. package/lib/typescript/ReanimatedModule/index.web.d.ts.map +1 -1
  311. package/lib/typescript/ReanimatedModule/js-reanimated/JSReanimated.d.ts.map +1 -1
  312. package/lib/typescript/ReanimatedModule/js-reanimated/index.d.ts +1 -1
  313. package/lib/typescript/ReanimatedModule/js-reanimated/index.d.ts.map +1 -1
  314. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +2 -3
  315. package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
  316. package/lib/typescript/Sensor.d.ts +1 -1
  317. package/lib/typescript/Sensor.d.ts.map +1 -1
  318. package/lib/typescript/SensorContainer.d.ts +1 -1
  319. package/lib/typescript/SensorContainer.d.ts.map +1 -1
  320. package/lib/typescript/UpdateLayoutAnimations.d.ts +1 -1
  321. package/lib/typescript/UpdateLayoutAnimations.d.ts.map +1 -1
  322. package/lib/typescript/UpdateProps.d.ts +1 -1
  323. package/lib/typescript/UpdateProps.d.ts.map +1 -1
  324. package/lib/typescript/ViewDescriptorsSet.d.ts.map +1 -1
  325. package/lib/typescript/WorkletEventHandler.d.ts +1 -1
  326. package/lib/typescript/WorkletEventHandler.d.ts.map +1 -1
  327. package/lib/typescript/animation/commonTypes.d.ts +1 -1
  328. package/lib/typescript/animation/commonTypes.d.ts.map +1 -1
  329. package/lib/typescript/animation/decay/decay.d.ts.map +1 -1
  330. package/lib/typescript/animation/decay/rigidDecay.d.ts.map +1 -1
  331. package/lib/typescript/animation/decay/rubberBandDecay.d.ts +1 -1
  332. package/lib/typescript/animation/decay/rubberBandDecay.d.ts.map +1 -1
  333. package/lib/typescript/animation/decay/utils.d.ts +2 -2
  334. package/lib/typescript/animation/decay/utils.d.ts.map +1 -1
  335. package/lib/typescript/animation/delay.d.ts.map +1 -1
  336. package/lib/typescript/animation/index.d.ts +8 -8
  337. package/lib/typescript/animation/index.d.ts.map +1 -1
  338. package/lib/typescript/animation/repeat.d.ts +1 -1
  339. package/lib/typescript/animation/repeat.d.ts.map +1 -1
  340. package/lib/typescript/animation/sequence.d.ts.map +1 -1
  341. package/lib/typescript/animation/spring.d.ts +1 -1
  342. package/lib/typescript/animation/spring.d.ts.map +1 -1
  343. package/lib/typescript/animation/springUtils.d.ts +1 -1
  344. package/lib/typescript/animation/springUtils.d.ts.map +1 -1
  345. package/lib/typescript/animation/styleAnimation.d.ts.map +1 -1
  346. package/lib/typescript/animation/timing.d.ts +1 -1
  347. package/lib/typescript/animation/timing.d.ts.map +1 -1
  348. package/lib/typescript/animation/util.d.ts +2 -2
  349. package/lib/typescript/animation/util.d.ts.map +1 -1
  350. package/lib/typescript/commonTypes.d.ts +9 -21
  351. package/lib/typescript/commonTypes.d.ts.map +1 -1
  352. package/lib/typescript/component/FlatList.d.ts.map +1 -1
  353. package/lib/typescript/component/Image.d.ts.map +1 -1
  354. package/lib/typescript/component/LayoutAnimationConfig.d.ts +2 -2
  355. package/lib/typescript/component/LayoutAnimationConfig.d.ts.map +1 -1
  356. package/lib/typescript/component/ReducedMotionConfig.d.ts.map +1 -1
  357. package/lib/typescript/component/ScrollView.d.ts.map +1 -1
  358. package/lib/typescript/component/Text.d.ts.map +1 -1
  359. package/lib/typescript/component/View.d.ts.map +1 -1
  360. package/lib/typescript/core.d.ts +3 -3
  361. package/lib/typescript/core.d.ts.map +1 -1
  362. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
  363. package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts.map +1 -1
  364. package/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts.map +1 -1
  365. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts +1 -1
  366. package/lib/typescript/createAnimatedComponent/NativeEventsManager.d.ts.map +1 -1
  367. package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts.map +1 -1
  368. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +13 -10
  369. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
  370. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +2 -2
  371. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
  372. package/lib/typescript/culori/Colors.d.ts +13 -0
  373. package/lib/typescript/culori/Colors.d.ts.map +1 -0
  374. package/lib/typescript/culori/index.d.ts +10 -0
  375. package/lib/typescript/culori/index.d.ts.map +1 -0
  376. package/lib/typescript/culori/lrgb.d.ts +14 -0
  377. package/lib/typescript/culori/lrgb.d.ts.map +1 -0
  378. package/lib/typescript/culori/oklab.d.ts +11 -0
  379. package/lib/typescript/culori/oklab.d.ts.map +1 -0
  380. package/lib/typescript/fabricUtils.d.ts +2 -1
  381. package/lib/typescript/fabricUtils.d.ts.map +1 -1
  382. package/lib/typescript/helperTypes.d.ts.map +1 -1
  383. package/lib/typescript/hook/commonTypes.d.ts +3 -3
  384. package/lib/typescript/hook/commonTypes.d.ts.map +1 -1
  385. package/lib/typescript/hook/index.d.ts +16 -16
  386. package/lib/typescript/hook/index.d.ts.map +1 -1
  387. package/lib/typescript/hook/useAnimatedKeyboard.d.ts.map +1 -1
  388. package/lib/typescript/hook/useAnimatedProps.d.ts +1 -1
  389. package/lib/typescript/hook/useAnimatedProps.d.ts.map +1 -1
  390. package/lib/typescript/hook/useAnimatedReaction.d.ts.map +1 -1
  391. package/lib/typescript/hook/useAnimatedRef.d.ts.map +1 -1
  392. package/lib/typescript/hook/useAnimatedScrollHandler.d.ts +1 -1
  393. package/lib/typescript/hook/useAnimatedScrollHandler.d.ts.map +1 -1
  394. package/lib/typescript/hook/useAnimatedSensor.d.ts +1 -1
  395. package/lib/typescript/hook/useAnimatedSensor.d.ts.map +1 -1
  396. package/lib/typescript/hook/useAnimatedStyle.d.ts.map +1 -1
  397. package/lib/typescript/hook/useComposedEventHandler.d.ts.map +1 -1
  398. package/lib/typescript/hook/useDerivedValue.d.ts.map +1 -1
  399. package/lib/typescript/hook/useEvent.d.ts.map +1 -1
  400. package/lib/typescript/hook/useFrameCallback.d.ts.map +1 -1
  401. package/lib/typescript/hook/useHandler.d.ts.map +1 -1
  402. package/lib/typescript/hook/useScrollViewOffset.d.ts.map +1 -1
  403. package/lib/typescript/hook/useSharedValue.d.ts.map +1 -1
  404. package/lib/typescript/hook/useWorkletCallback.d.ts.map +1 -1
  405. package/lib/typescript/index.d.ts +30 -30
  406. package/lib/typescript/index.d.ts.map +1 -1
  407. package/lib/typescript/initializers.d.ts +2 -1
  408. package/lib/typescript/initializers.d.ts.map +1 -1
  409. package/lib/typescript/interpolateColor.d.ts +11 -4
  410. package/lib/typescript/interpolateColor.d.ts.map +1 -1
  411. package/lib/typescript/jestUtils.d.ts.map +1 -1
  412. package/lib/typescript/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +1 -1
  413. package/lib/typescript/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts.map +1 -1
  414. package/lib/typescript/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +1 -1
  415. package/lib/typescript/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts.map +1 -1
  416. package/lib/typescript/layoutReanimation/animationBuilder/Keyframe.d.ts.map +1 -1
  417. package/lib/typescript/layoutReanimation/animationsManager.d.ts.map +1 -1
  418. package/lib/typescript/layoutReanimation/defaultAnimations/Bounce.d.ts +1 -1
  419. package/lib/typescript/layoutReanimation/defaultAnimations/Bounce.d.ts.map +1 -1
  420. package/lib/typescript/layoutReanimation/defaultAnimations/Fade.d.ts +1 -1
  421. package/lib/typescript/layoutReanimation/defaultAnimations/Flip.d.ts +1 -1
  422. package/lib/typescript/layoutReanimation/defaultAnimations/Flip.d.ts.map +1 -1
  423. package/lib/typescript/layoutReanimation/defaultAnimations/Lightspeed.d.ts +1 -1
  424. package/lib/typescript/layoutReanimation/defaultAnimations/Lightspeed.d.ts.map +1 -1
  425. package/lib/typescript/layoutReanimation/defaultAnimations/Pinwheel.d.ts +1 -1
  426. package/lib/typescript/layoutReanimation/defaultAnimations/Roll.d.ts +1 -1
  427. package/lib/typescript/layoutReanimation/defaultAnimations/Roll.d.ts.map +1 -1
  428. package/lib/typescript/layoutReanimation/defaultAnimations/Rotate.d.ts +1 -1
  429. package/lib/typescript/layoutReanimation/defaultAnimations/Rotate.d.ts.map +1 -1
  430. package/lib/typescript/layoutReanimation/defaultAnimations/Slide.d.ts +1 -1
  431. package/lib/typescript/layoutReanimation/defaultAnimations/Slide.d.ts.map +1 -1
  432. package/lib/typescript/layoutReanimation/defaultAnimations/Stretch.d.ts +1 -1
  433. package/lib/typescript/layoutReanimation/defaultAnimations/Zoom.d.ts +1 -1
  434. package/lib/typescript/layoutReanimation/defaultAnimations/Zoom.d.ts.map +1 -1
  435. package/lib/typescript/layoutReanimation/defaultAnimations/index.d.ts +6 -6
  436. package/lib/typescript/layoutReanimation/defaultAnimations/index.d.ts.map +1 -1
  437. package/lib/typescript/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +1 -1
  438. package/lib/typescript/layoutReanimation/defaultTransitions/CurvedTransition.d.ts.map +1 -1
  439. package/lib/typescript/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +1 -1
  440. package/lib/typescript/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts.map +1 -1
  441. package/lib/typescript/layoutReanimation/defaultTransitions/index.d.ts +4 -4
  442. package/lib/typescript/layoutReanimation/defaultTransitions/index.d.ts.map +1 -1
  443. package/lib/typescript/layoutReanimation/index.d.ts.map +1 -1
  444. package/lib/typescript/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts.map +1 -1
  445. package/lib/typescript/layoutReanimation/sharedTransitions/SharedTransition.d.ts.map +1 -1
  446. package/lib/typescript/layoutReanimation/sharedTransitions/index.d.ts +1 -1
  447. package/lib/typescript/layoutReanimation/sharedTransitions/index.d.ts.map +1 -1
  448. package/lib/typescript/layoutReanimation/web/animationsManager.d.ts +2 -2
  449. package/lib/typescript/layoutReanimation/web/animationsManager.d.ts.map +1 -1
  450. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts +2 -2
  451. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
  452. package/lib/typescript/layoutReanimation/web/config.d.ts.map +1 -1
  453. package/lib/typescript/layoutReanimation/web/createAnimation.d.ts +2 -2
  454. package/lib/typescript/layoutReanimation/web/createAnimation.d.ts.map +1 -1
  455. package/lib/typescript/layoutReanimation/web/index.d.ts.map +1 -1
  456. package/lib/typescript/layoutReanimation/web/transition/Curved.web.d.ts.map +1 -1
  457. package/lib/typescript/layoutReanimation/web/transition/Jumping.web.d.ts.map +1 -1
  458. package/lib/typescript/logger/index.d.ts +1 -1
  459. package/lib/typescript/logger/logger.d.ts.map +1 -1
  460. package/lib/typescript/mappers.d.ts +1 -1
  461. package/lib/typescript/mappers.d.ts.map +1 -1
  462. package/lib/typescript/mutables.d.ts.map +1 -1
  463. package/lib/typescript/platform-specific/findHostInstance.d.ts +15 -0
  464. package/lib/typescript/platform-specific/findHostInstance.d.ts.map +1 -0
  465. package/lib/typescript/platform-specific/findHostInstance.web.d.ts +2 -0
  466. package/lib/typescript/platform-specific/findHostInstance.web.d.ts.map +1 -0
  467. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  468. package/lib/typescript/platform-specific/jsVersion.d.ts.map +1 -1
  469. package/lib/typescript/platformFunctions/dispatchCommand.d.ts +1 -1
  470. package/lib/typescript/platformFunctions/dispatchCommand.d.ts.map +1 -1
  471. package/lib/typescript/platformFunctions/getRelativeCoords.d.ts.map +1 -1
  472. package/lib/typescript/platformFunctions/index.d.ts +2 -2
  473. package/lib/typescript/platformFunctions/index.d.ts.map +1 -1
  474. package/lib/typescript/platformFunctions/measure.d.ts +1 -1
  475. package/lib/typescript/platformFunctions/measure.d.ts.map +1 -1
  476. package/lib/typescript/platformFunctions/measure.web.d.ts +1 -1
  477. package/lib/typescript/platformFunctions/measure.web.d.ts.map +1 -1
  478. package/lib/typescript/platformFunctions/scrollTo.d.ts +1 -1
  479. package/lib/typescript/platformFunctions/scrollTo.d.ts.map +1 -1
  480. package/lib/typescript/platformFunctions/scrollTo.web.d.ts +1 -1
  481. package/lib/typescript/platformFunctions/scrollTo.web.d.ts.map +1 -1
  482. package/lib/typescript/platformFunctions/setNativeProps.d.ts +1 -1
  483. package/lib/typescript/platformFunctions/setNativeProps.d.ts.map +1 -1
  484. package/lib/typescript/platformFunctions/setNativeProps.web.d.ts +1 -1
  485. package/lib/typescript/platformFunctions/setNativeProps.web.d.ts.map +1 -1
  486. package/lib/typescript/processBoxShadow.d.ts +13 -0
  487. package/lib/typescript/processBoxShadow.d.ts.map +1 -0
  488. package/lib/typescript/propsAllowlists.d.ts.map +1 -1
  489. package/lib/typescript/runtimes.d.ts.map +1 -1
  490. package/lib/typescript/screenTransition/RNScreensTurboModule.d.ts.map +1 -1
  491. package/lib/typescript/screenTransition/animationManager.d.ts.map +1 -1
  492. package/lib/typescript/screenTransition/index.d.ts +2 -2
  493. package/lib/typescript/screenTransition/index.d.ts.map +1 -1
  494. package/lib/typescript/screenTransition/swipeSimulator.d.ts +1 -1
  495. package/lib/typescript/screenTransition/swipeSimulator.d.ts.map +1 -1
  496. package/lib/typescript/shareableMappingCache.d.ts.map +1 -1
  497. package/lib/typescript/shareables.d.ts +5 -2
  498. package/lib/typescript/shareables.d.ts.map +1 -1
  499. package/lib/typescript/specs/index.d.ts +2 -2
  500. package/lib/typescript/specs/index.d.ts.map +1 -1
  501. package/lib/typescript/threads.d.ts.map +1 -1
  502. package/lib/typescript/worklets/WorkletsModule/JSWorklets.d.ts.map +1 -1
  503. package/lib/typescript/worklets/WorkletsModule/NativeWorklets.d.ts.map +1 -1
  504. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts +2 -0
  505. package/lib/typescript/worklets/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
  506. package/lib/typescript/worklets/index.d.ts +1 -1
  507. package/lib/typescript/worklets/index.d.ts.map +1 -1
  508. package/package.json +23 -17
  509. package/plugin/index.js +2 -2
  510. package/scripts/reanimated_utils.rb +1 -1
  511. package/src/Animated.ts +11 -12
  512. package/src/Colors.ts +24 -0
  513. package/src/ConfigHelper.ts +2 -2
  514. package/src/PropAdapters.ts +1 -1
  515. package/src/ReanimatedModule/NativeReanimated.ts +11 -21
  516. package/src/ReanimatedModule/index.web.ts +1 -0
  517. package/src/ReanimatedModule/js-reanimated/JSReanimated.ts +12 -17
  518. package/src/ReanimatedModule/js-reanimated/index.ts +13 -6
  519. package/src/ReanimatedModule/reanimatedModuleInstance.ts +1 -1
  520. package/src/ReanimatedModule/reanimatedModuleProxy.ts +4 -9
  521. package/src/ReducedMotion.ts +1 -1
  522. package/src/Sensor.ts +4 -3
  523. package/src/SensorContainer.ts +3 -3
  524. package/src/UpdateLayoutAnimations.ts +3 -3
  525. package/src/UpdateProps.ts +5 -4
  526. package/src/ViewDescriptorsSet.ts +1 -1
  527. package/src/WorkletEventHandler.ts +2 -1
  528. package/src/animation/clamp.ts +8 -8
  529. package/src/animation/commonTypes.ts +4 -4
  530. package/src/animation/decay/decay.ts +13 -7
  531. package/src/animation/decay/rigidDecay.ts +1 -1
  532. package/src/animation/decay/rubberBandDecay.ts +1 -1
  533. package/src/animation/decay/utils.ts +3 -3
  534. package/src/animation/delay.ts +3 -3
  535. package/src/animation/index.ts +8 -8
  536. package/src/animation/repeat.ts +3 -3
  537. package/src/animation/sequence.ts +3 -3
  538. package/src/animation/spring.ts +8 -8
  539. package/src/animation/springUtils.ts +2 -2
  540. package/src/animation/styleAnimation.ts +6 -6
  541. package/src/animation/timing.ts +8 -8
  542. package/src/animation/util.ts +25 -19
  543. package/src/commonTypes.ts +20 -62
  544. package/src/component/FlatList.tsx +4 -3
  545. package/src/component/Image.ts +1 -0
  546. package/src/component/LayoutAnimationConfig.tsx +2 -1
  547. package/src/component/PerformanceMonitor.tsx +5 -4
  548. package/src/component/ReducedMotionConfig.tsx +3 -2
  549. package/src/component/ScrollView.tsx +3 -2
  550. package/src/component/Text.ts +1 -0
  551. package/src/component/View.ts +1 -0
  552. package/src/core.ts +33 -15
  553. package/src/createAnimatedComponent/InlinePropManager.ts +7 -7
  554. package/src/createAnimatedComponent/JSPropsUpdater.ts +8 -8
  555. package/src/createAnimatedComponent/NativeEventsManager.ts +49 -18
  556. package/src/createAnimatedComponent/PropsFilter.tsx +5 -4
  557. package/src/createAnimatedComponent/commonTypes.ts +15 -10
  558. package/src/createAnimatedComponent/createAnimatedComponent.tsx +144 -107
  559. package/src/culori/Colors.ts +15 -0
  560. package/src/culori/index.ts +12 -0
  561. package/src/culori/lrgb.ts +57 -0
  562. package/src/culori/oklab.ts +109 -0
  563. package/src/fabricUtils.ts +9 -15
  564. package/src/helperTypes.ts +1 -0
  565. package/src/hook/commonTypes.ts +10 -9
  566. package/src/hook/index.ts +19 -19
  567. package/src/hook/useAnimatedGestureHandler.ts +1 -1
  568. package/src/hook/useAnimatedKeyboard.ts +8 -7
  569. package/src/hook/useAnimatedProps.ts +3 -3
  570. package/src/hook/useAnimatedReaction.ts +2 -1
  571. package/src/hook/useAnimatedRef.ts +8 -7
  572. package/src/hook/useAnimatedScrollHandler.ts +2 -2
  573. package/src/hook/useAnimatedSensor.ts +5 -4
  574. package/src/hook/useAnimatedStyle.ts +65 -28
  575. package/src/hook/useComposedEventHandler.ts +4 -4
  576. package/src/hook/useDerivedValue.ts +2 -1
  577. package/src/hook/useEvent.ts +1 -0
  578. package/src/hook/useFrameCallback.ts +1 -0
  579. package/src/hook/useHandler.ts +3 -2
  580. package/src/hook/useScrollViewOffset.ts +7 -6
  581. package/src/hook/useSharedValue.ts +1 -0
  582. package/src/hook/useWorkletCallback.ts +1 -0
  583. package/src/index.ts +217 -216
  584. package/src/initializers.ts +25 -10
  585. package/src/interpolateColor.ts +148 -48
  586. package/src/jestUtils.ts +6 -4
  587. package/src/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +2 -3
  588. package/src/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +5 -5
  589. package/src/layoutReanimation/animationBuilder/Keyframe.ts +15 -9
  590. package/src/layoutReanimation/animationsManager.ts +1 -1
  591. package/src/layoutReanimation/defaultAnimations/Bounce.ts +1 -1
  592. package/src/layoutReanimation/defaultAnimations/Fade.ts +1 -1
  593. package/src/layoutReanimation/defaultAnimations/Flip.ts +3 -3
  594. package/src/layoutReanimation/defaultAnimations/Lightspeed.ts +1 -1
  595. package/src/layoutReanimation/defaultAnimations/Pinwheel.ts +1 -1
  596. package/src/layoutReanimation/defaultAnimations/Roll.ts +1 -1
  597. package/src/layoutReanimation/defaultAnimations/Rotate.ts +2 -2
  598. package/src/layoutReanimation/defaultAnimations/Slide.ts +2 -2
  599. package/src/layoutReanimation/defaultAnimations/Stretch.ts +1 -1
  600. package/src/layoutReanimation/defaultAnimations/Zoom.ts +4 -4
  601. package/src/layoutReanimation/defaultAnimations/index.ts +6 -6
  602. package/src/layoutReanimation/defaultTransitions/CurvedTransition.ts +3 -3
  603. package/src/layoutReanimation/defaultTransitions/EntryExitTransition.ts +2 -2
  604. package/src/layoutReanimation/defaultTransitions/index.ts +4 -4
  605. package/src/layoutReanimation/index.ts +1 -0
  606. package/src/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +5 -4
  607. package/src/layoutReanimation/sharedTransitions/SharedTransition.ts +3 -3
  608. package/src/layoutReanimation/sharedTransitions/index.ts +1 -1
  609. package/src/layoutReanimation/web/animationParser.ts +1 -1
  610. package/src/layoutReanimation/web/animationsManager.ts +22 -20
  611. package/src/layoutReanimation/web/componentStyle.ts +1 -1
  612. package/src/layoutReanimation/web/componentUtils.ts +13 -13
  613. package/src/layoutReanimation/web/config.ts +0 -1
  614. package/src/layoutReanimation/web/createAnimation.ts +10 -9
  615. package/src/layoutReanimation/web/domUtils.ts +4 -4
  616. package/src/layoutReanimation/web/index.ts +0 -2
  617. package/src/layoutReanimation/web/transition/Curved.web.ts +3 -3
  618. package/src/layoutReanimation/web/transition/Jumping.web.ts +1 -1
  619. package/src/logger/index.ts +1 -1
  620. package/src/logger/logger.ts +4 -4
  621. package/src/mappers.ts +2 -2
  622. package/src/mock.ts +54 -19
  623. package/src/mutables.ts +3 -3
  624. package/src/platform-specific/checkCppVersion.ts +2 -2
  625. package/src/platform-specific/findHostInstance.ts +93 -0
  626. package/src/platform-specific/findHostInstance.web.ts +3 -0
  627. package/src/platform-specific/jsVersion.ts +1 -1
  628. package/src/platformFunctions/dispatchCommand.ts +8 -7
  629. package/src/platformFunctions/getRelativeCoords.ts +2 -1
  630. package/src/platformFunctions/index.ts +2 -2
  631. package/src/platformFunctions/measure.ts +8 -7
  632. package/src/platformFunctions/measure.web.ts +2 -1
  633. package/src/platformFunctions/scrollTo.ts +8 -7
  634. package/src/platformFunctions/scrollTo.web.ts +2 -1
  635. package/src/platformFunctions/setGestureState.ts +1 -1
  636. package/src/platformFunctions/setNativeProps.ts +9 -8
  637. package/src/platformFunctions/setNativeProps.web.ts +3 -2
  638. package/src/privateGlobals.d.ts +11 -11
  639. package/src/processBoxShadow.ts +195 -0
  640. package/src/propsAllowlists.ts +1 -0
  641. package/src/runtimes.ts +2 -2
  642. package/src/screenTransition/RNScreensTurboModule.ts +1 -2
  643. package/src/screenTransition/animationManager.ts +1 -1
  644. package/src/screenTransition/index.ts +2 -2
  645. package/src/screenTransition/styleUpdater.ts +2 -2
  646. package/src/screenTransition/swipeSimulator.ts +2 -2
  647. package/src/shareableMappingCache.ts +1 -1
  648. package/src/shareables.ts +319 -168
  649. package/src/specs/index.ts +2 -2
  650. package/src/threads.ts +4 -4
  651. package/src/worklets/WorkletsModule/JSWorklets.ts +9 -2
  652. package/src/worklets/WorkletsModule/NativeWorklets.ts +15 -3
  653. package/src/worklets/WorkletsModule/workletsModuleInstance.ts +1 -1
  654. package/src/worklets/WorkletsModule/workletsModuleProxy.ts +9 -1
  655. package/src/worklets/index.ts +1 -1
  656. package/src/worklets/valueUnpacker.ts +2 -2
  657. package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.cpp +0 -19
  658. package/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.h +0 -14
  659. package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.cpp +0 -25
  660. package/Common/cpp/worklets/NativeModules/NativeWorkletsModule.h +0 -23
  661. package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.cpp +0 -9
  662. package/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.h +0 -18
  663. package/android/src/reactNativeVersionPatch/BorderRadiiDrawableUtils/74/com/swmansion/reanimated/BorderRadiiDrawableUtils.java +0 -22
  664. package/android/src/reactNativeVersionPatch/NativeProxyFabric/latest/com/swmansion/reanimated/NativeProxy.java +0 -149
  665. package/android/src/reactNativeVersionPatch/NativeProxyPaper/74/com/swmansion/reanimated/NativeProxy.java +0 -153
  666. package/android/src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/74/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java +0 -10
  667. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/ReanimatedModule.java +0 -180
  668. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/74/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -245
  669. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.h +0 -12
  670. package/apple/reanimated/apple/Fabric/REAInitializerRCTFabricSurface.mm +0 -73
  671. package/lib/module/platform-specific/RNRenderer.js +0 -6
  672. package/lib/module/platform-specific/RNRenderer.js.map +0 -1
  673. package/lib/module/platform-specific/RNRenderer.web.js +0 -6
  674. package/lib/module/platform-specific/RNRenderer.web.js.map +0 -1
  675. package/lib/typescript/platform-specific/RNRenderer.d.ts +0 -2
  676. package/lib/typescript/platform-specific/RNRenderer.d.ts.map +0 -1
  677. package/lib/typescript/platform-specific/RNRenderer.web.d.ts +0 -3
  678. package/lib/typescript/platform-specific/RNRenderer.web.d.ts.map +0 -1
  679. package/src/platform-specific/RNRenderer.ts +0 -4
  680. package/src/platform-specific/RNRenderer.web.ts +0 -4
  681. /package/android/src/{reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest → fabric/java}/com/swmansion/reanimated/ReactFeatureFlagsWrapper.java +0 -0
  682. /package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -0
@@ -27,23 +27,33 @@ ReanimatedCommitHook::~ReanimatedCommitHook() noexcept {
27
27
  uiManager_->unregisterCommitHook(*this);
28
28
  }
29
29
 
30
+ void ReanimatedCommitHook::maybeInitializeLayoutAnimations(
31
+ SurfaceId surfaceId) {
32
+ auto lock = std::unique_lock<std::mutex>(mutex_);
33
+ if (surfaceId > currentMaxSurfaceId_) {
34
+ // when a new surfaceId is observed we call setMountingOverrideDelegate
35
+ // for all yet unseen surfaces
36
+ uiManager_->getShadowTreeRegistry().enumerate(
37
+ [strongThis = shared_from_this()](
38
+ const ShadowTree &shadowTree, bool &stop) {
39
+ // Executed synchronously.
40
+ if (shadowTree.getSurfaceId() <= strongThis->currentMaxSurfaceId_) {
41
+ // the set function actually adds our delegate to a list, so we
42
+ // shouldn't invoke it twice for the same surface
43
+ return;
44
+ }
45
+ shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
46
+ strongThis->layoutAnimationsProxy_);
47
+ });
48
+ currentMaxSurfaceId_ = surfaceId;
49
+ }
50
+ }
51
+
30
52
  RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit(
31
53
  ShadowTree const &,
32
54
  RootShadowNode::Shared const &,
33
55
  RootShadowNode::Unshared const &newRootShadowNode) noexcept {
34
- auto surfaceId = newRootShadowNode->getSurfaceId();
35
-
36
- {
37
- auto lock = std::unique_lock<std::mutex>(mutex_);
38
- if (surfaceId > currentMaxSurfaceId_) {
39
- uiManager_->getShadowTreeRegistry().enumerate(
40
- [this](const ShadowTree &shadowTree, bool &stop) {
41
- shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
42
- layoutAnimationsProxy_);
43
- });
44
- currentMaxSurfaceId_ = surfaceId;
45
- }
46
- }
56
+ maybeInitializeLayoutAnimations(newRootShadowNode->getSurfaceId());
47
57
 
48
58
  auto reaShadowNode =
49
59
  std::reinterpret_pointer_cast<ReanimatedCommitShadowNode>(
@@ -12,7 +12,9 @@ using namespace facebook::react;
12
12
 
13
13
  namespace reanimated {
14
14
 
15
- class ReanimatedCommitHook : public UIManagerCommitHook {
15
+ class ReanimatedCommitHook
16
+ : public UIManagerCommitHook,
17
+ public std::enable_shared_from_this<ReanimatedCommitHook> {
16
18
  public:
17
19
  ReanimatedCommitHook(
18
20
  const std::shared_ptr<PropsRegistry> &propsRegistry,
@@ -25,6 +27,8 @@ class ReanimatedCommitHook : public UIManagerCommitHook {
25
27
 
26
28
  void commitHookWasUnregistered(UIManager const &) noexcept override {}
27
29
 
30
+ void maybeInitializeLayoutAnimations(SurfaceId surfaceId);
31
+
28
32
  RootShadowNode::Unshared shadowTreeWillCommit(
29
33
  ShadowTree const &shadowTree,
30
34
  RootShadowNode::Shared const &oldRootShadowNode,
@@ -116,6 +116,9 @@ void LayoutAnimationsManager::startLayoutAnimation(
116
116
  std::shared_ptr<Shareable> config, viewShareable;
117
117
  {
118
118
  auto lock = std::unique_lock<std::recursive_mutex>(animationsMutex_);
119
+ if (!collection::contains(getConfigsForType(type), tag)) {
120
+ return;
121
+ }
119
122
  config = getConfigsForType(type)[tag];
120
123
  }
121
124
  // TODO: cache the following!!
@@ -1,7 +1,7 @@
1
1
  #ifdef RCT_NEW_ARCH_ENABLED
2
2
 
3
3
  #include <reanimated/LayoutAnimations/LayoutAnimationsProxy.h>
4
- #include <reanimated/NativeModules/NativeReanimatedModule.h>
4
+ #include <reanimated/NativeModules/ReanimatedModuleProxy.h>
5
5
 
6
6
  #include <react/renderer/animations/utils.h>
7
7
  #include <react/renderer/mounting/ShadowViewMutation.h>
@@ -153,7 +153,11 @@ void LayoutAnimationsProxy::parseRemoveMutations(
153
153
  if (mutation.type == ShadowViewMutation::Remove) {
154
154
  updateIndexForMutation(mutation);
155
155
  auto tag = mutation.oldChildShadowView.tag;
156
+ #if REACT_NATIVE_MINOR_VERSION >= 78
157
+ auto parentTag = mutation.parentTag;
158
+ #else
156
159
  auto parentTag = mutation.parentShadowView.tag;
160
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
157
161
  auto unflattenedParentTag = parentTag; // temporary
158
162
 
159
163
  std::shared_ptr<MutationNode> mutationNode;
@@ -287,9 +291,16 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
287
291
  }
288
292
  case ShadowViewMutation::Type::Insert: {
289
293
  updateIndexForMutation(mutation);
290
- if (nodeForTag_.contains(mutation.parentShadowView.tag)) {
291
- nodeForTag_[mutation.parentShadowView.tag]->applyMutationToIndices(
292
- mutation);
294
+
295
+ #if REACT_NATIVE_MINOR_VERSION >= 78
296
+ const auto parentTag = mutation.parentTag;
297
+ const auto mutationParent = parentTag;
298
+ #else
299
+ const auto parentTag = mutation.parentShadowView.tag;
300
+ const auto mutationParent = mutation.parentShadowView;
301
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
302
+ if (nodeForTag_.contains(parentTag)) {
303
+ nodeForTag_[parentTag]->applyMutationToIndices(mutation);
293
304
  }
294
305
 
295
306
  if (movedViews.contains(tag)) {
@@ -297,7 +308,7 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
297
308
  if (layoutAnimationIt == layoutAnimations_.end()) {
298
309
  if (oldShadowViewsForReparentings.contains(tag)) {
299
310
  filteredMutations.push_back(ShadowViewMutation::InsertMutation(
300
- mutation.parentShadowView,
311
+ mutationParent,
301
312
  oldShadowViewsForReparentings[tag],
302
313
  mutation.index));
303
314
  } else {
@@ -308,7 +319,7 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
308
319
 
309
320
  auto oldView = *layoutAnimationIt->second.currentView;
310
321
  filteredMutations.push_back(ShadowViewMutation::InsertMutation(
311
- mutation.parentShadowView, oldView, mutation.index));
322
+ mutationParent, oldView, mutation.index));
312
323
  continue;
313
324
  }
314
325
 
@@ -328,7 +339,7 @@ void LayoutAnimationsProxy::handleUpdatesAndEnterings(
328
339
  cloneViewWithoutOpacity(mutation, propsParserContext);
329
340
 
330
341
  filteredMutations.push_back(ShadowViewMutation::UpdateMutation(
331
- mutation.newChildShadowView, *newView, mutation.parentShadowView));
342
+ mutation.newChildShadowView, *newView, mutationParent));
332
343
  break;
333
344
  }
334
345
 
@@ -386,7 +397,14 @@ void LayoutAnimationsProxy::addOngoingAnimations(
386
397
  updateLayoutMetrics(newView->layoutMetrics, updateValues.frame);
387
398
 
388
399
  mutations.push_back(ShadowViewMutation::UpdateMutation(
389
- *layoutAnimation.currentView, *newView, *layoutAnimation.parentView));
400
+ *layoutAnimation.currentView,
401
+ *newView,
402
+ #if REACT_NATIVE_MINOR_VERSION >= 78
403
+ layoutAnimation.parentTag
404
+ #else
405
+ *layoutAnimation.parentView
406
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
407
+ ));
390
408
  layoutAnimation.currentView = newView;
391
409
  }
392
410
  updateMap.clear();
@@ -426,9 +444,8 @@ void LayoutAnimationsProxy::maybeDropAncestors(
426
444
  }
427
445
 
428
446
  auto node = std::static_pointer_cast<MutationNode>(parent);
429
- node->animatedChildren.erase(child->tag);
430
447
 
431
- if (node->animatedChildren.empty() && node->state != ANIMATING) {
448
+ if (node->children.size() == 0 && node->state != ANIMATING) {
432
449
  nodeForTag_.erase(node->tag);
433
450
  cleanupMutations.push_back(node->mutation);
434
451
  maybeCancelAnimation(node->tag);
@@ -482,7 +499,6 @@ bool LayoutAnimationsProxy::startAnimationsRecursively(
482
499
  #endif
483
500
  if (subNode->state != UNDEFINED && subNode->state != MOVED) {
484
501
  if (shouldAnimate && subNode->state != DEAD) {
485
- node->animatedChildren.insert(subNode->tag);
486
502
  hasAnimatedChildren = true;
487
503
  } else {
488
504
  endAnimationsRecursively(subNode, mutations);
@@ -498,7 +514,6 @@ bool LayoutAnimationsProxy::startAnimationsRecursively(
498
514
  LOG(INFO) << "child " << subNode->tag
499
515
  << " start animations returned true " << std::endl;
500
516
  #endif
501
- node->animatedChildren.insert(subNode->tag);
502
517
  hasAnimatedChildren = true;
503
518
  } else if (subNode->state == MOVED) {
504
519
  mutations.push_back(subNode->mutation);
@@ -544,11 +559,7 @@ bool LayoutAnimationsProxy::startAnimationsRecursively(
544
559
  layoutAnimationsManager_->clearLayoutAnimationConfig(node->tag);
545
560
  }
546
561
 
547
- if (!wantAnimateExit) {
548
- return false;
549
- }
550
-
551
- return true;
562
+ return wantAnimateExit;
552
563
  }
553
564
 
554
565
  void LayoutAnimationsProxy::updateIndexForMutation(
@@ -556,12 +567,18 @@ void LayoutAnimationsProxy::updateIndexForMutation(
556
567
  if (mutation.index == -1) {
557
568
  return;
558
569
  }
559
- if (!nodeForTag_.contains(mutation.parentShadowView.tag)) {
570
+
571
+ #if REACT_NATIVE_MINOR_VERSION >= 78
572
+ const auto parentTag = mutation.parentTag;
573
+ #else
574
+ const auto parentTag = mutation.parentShadowView.tag;
575
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
576
+
577
+ if (!nodeForTag_.contains(parentTag)) {
560
578
  return;
561
579
  }
562
580
 
563
- auto parent = nodeForTag_[mutation.parentShadowView.tag];
564
-
581
+ auto parent = nodeForTag_[parentTag];
565
582
  int size = 0, prevIndex = -1, offset = 0;
566
583
 
567
584
  for (auto &subNode : parent->children) {
@@ -576,9 +593,8 @@ void LayoutAnimationsProxy::updateIndexForMutation(
576
593
  int tag = mutation.type == ShadowViewMutation::Insert
577
594
  ? mutation.newChildShadowView.tag
578
595
  : mutation.oldChildShadowView.tag;
579
- LOG(INFO) << "update index for " << tag << " in "
580
- << mutation.parentShadowView.tag << ": " << mutation.index << " -> "
581
- << mutation.index + offset << std::endl;
596
+ LOG(INFO) << "update index for " << tag << " in " << parentTag << ": "
597
+ << mutation.index << " -> " << mutation.index + offset << std::endl;
582
598
  #endif
583
599
  mutation.index += offset;
584
600
  }
@@ -606,9 +622,16 @@ void LayoutAnimationsProxy::createLayoutAnimation(
606
622
  ? mutation.oldChildShadowView
607
623
  : mutation.newChildShadowView);
608
624
  auto currentView = std::make_shared<ShadowView>(oldView);
625
+
626
+ #if REACT_NATIVE_MINOR_VERSION >= 78
627
+ layoutAnimations_.insert_or_assign(
628
+ tag,
629
+ LayoutAnimation{finalView, currentView, mutation.parentTag, {}, count});
630
+ #else
609
631
  auto parentView = std::make_shared<ShadowView>(mutation.parentShadowView);
610
632
  layoutAnimations_.insert_or_assign(
611
633
  tag, LayoutAnimation{finalView, currentView, parentView, {}, count});
634
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
612
635
  }
613
636
 
614
637
  void LayoutAnimationsProxy::startEnteringAnimation(
@@ -619,36 +642,60 @@ void LayoutAnimationsProxy::startEnteringAnimation(
619
642
  #endif
620
643
  auto finalView = std::make_shared<ShadowView>(mutation.newChildShadowView);
621
644
  auto current = std::make_shared<ShadowView>(mutation.newChildShadowView);
645
+ #if REACT_NATIVE_MINOR_VERSION < 78
622
646
  auto parent = std::make_shared<ShadowView>(mutation.parentShadowView);
647
+ #endif
623
648
 
624
649
  auto &viewProps =
625
650
  static_cast<const ViewProps &>(*mutation.newChildShadowView.props);
626
651
  auto opacity = viewProps.opacity;
627
652
 
628
- uiScheduler_->scheduleOnUI(
629
- [finalView, current, parent, mutation, opacity, this, tag]() {
630
- Rect window{};
631
- {
632
- auto lock = std::unique_lock<std::recursive_mutex>(mutex);
633
- layoutAnimations_.insert_or_assign(
634
- tag, LayoutAnimation{finalView, current, parent, opacity});
635
- window =
636
- surfaceManager.getWindow(mutation.newChildShadowView.surfaceId);
637
- }
653
+ uiScheduler_->scheduleOnUI([weakThis = weak_from_this(),
654
+ finalView,
655
+ current,
656
+ #if REACT_NATIVE_MINOR_VERSION < 78
657
+ parent,
658
+ #endif // RE
659
+ mutation,
660
+ opacity,
661
+ tag]() {
662
+ auto strongThis = weakThis.lock();
663
+ if (!strongThis) {
664
+ return;
665
+ }
638
666
 
639
- Snapshot values(mutation.newChildShadowView, window);
640
- jsi::Object yogaValues(uiRuntime_);
641
- yogaValues.setProperty(uiRuntime_, "targetOriginX", values.x);
642
- yogaValues.setProperty(uiRuntime_, "targetGlobalOriginX", values.x);
643
- yogaValues.setProperty(uiRuntime_, "targetOriginY", values.y);
644
- yogaValues.setProperty(uiRuntime_, "targetGlobalOriginY", values.y);
645
- yogaValues.setProperty(uiRuntime_, "targetWidth", values.width);
646
- yogaValues.setProperty(uiRuntime_, "targetHeight", values.height);
647
- yogaValues.setProperty(uiRuntime_, "windowWidth", values.windowWidth);
648
- yogaValues.setProperty(uiRuntime_, "windowHeight", values.windowHeight);
649
- layoutAnimationsManager_->startLayoutAnimation(
650
- uiRuntime_, tag, LayoutAnimationType::ENTERING, yogaValues);
651
- });
667
+ Rect window{};
668
+ {
669
+ auto &mutex = strongThis->mutex;
670
+ auto lock = std::unique_lock<std::recursive_mutex>(mutex);
671
+ strongThis->layoutAnimations_.insert_or_assign(
672
+ tag, LayoutAnimation {
673
+ finalView, current,
674
+ #if REACT_NATIVE_MINOR_VERSION >= 78
675
+ mutation.parentTag,
676
+ #else
677
+ parent,
678
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
679
+ opacity
680
+ });
681
+ window = strongThis->surfaceManager.getWindow(
682
+ mutation.newChildShadowView.surfaceId);
683
+ }
684
+
685
+ Snapshot values(mutation.newChildShadowView, window);
686
+ auto &uiRuntime = strongThis->uiRuntime_;
687
+ jsi::Object yogaValues(uiRuntime);
688
+ yogaValues.setProperty(uiRuntime, "targetOriginX", values.x);
689
+ yogaValues.setProperty(uiRuntime, "targetGlobalOriginX", values.x);
690
+ yogaValues.setProperty(uiRuntime, "targetOriginY", values.y);
691
+ yogaValues.setProperty(uiRuntime, "targetGlobalOriginY", values.y);
692
+ yogaValues.setProperty(uiRuntime, "targetWidth", values.width);
693
+ yogaValues.setProperty(uiRuntime, "targetHeight", values.height);
694
+ yogaValues.setProperty(uiRuntime, "windowWidth", values.windowWidth);
695
+ yogaValues.setProperty(uiRuntime, "windowHeight", values.windowHeight);
696
+ strongThis->layoutAnimationsManager_->startLayoutAnimation(
697
+ uiRuntime, tag, LayoutAnimationType::ENTERING, yogaValues);
698
+ });
652
699
  }
653
700
 
654
701
  void LayoutAnimationsProxy::startExitingAnimation(
@@ -659,30 +706,38 @@ void LayoutAnimationsProxy::startExitingAnimation(
659
706
  #endif
660
707
  auto surfaceId = mutation.oldChildShadowView.surfaceId;
661
708
 
662
- uiScheduler_->scheduleOnUI([this, tag, mutation, surfaceId]() {
663
- auto oldView = mutation.oldChildShadowView;
664
- Rect window{};
665
- {
666
- auto lock = std::unique_lock<std::recursive_mutex>(mutex);
667
- createLayoutAnimation(mutation, oldView, surfaceId, tag);
668
- window = surfaceManager.getWindow(surfaceId);
669
- }
709
+ uiScheduler_->scheduleOnUI(
710
+ [weakThis = weak_from_this(), tag, mutation, surfaceId]() {
711
+ auto strongThis = weakThis.lock();
712
+ if (!strongThis) {
713
+ return;
714
+ }
670
715
 
671
- Snapshot values(oldView, window);
672
-
673
- jsi::Object yogaValues(uiRuntime_);
674
- yogaValues.setProperty(uiRuntime_, "currentOriginX", values.x);
675
- yogaValues.setProperty(uiRuntime_, "currentGlobalOriginX", values.x);
676
- yogaValues.setProperty(uiRuntime_, "currentOriginY", values.y);
677
- yogaValues.setProperty(uiRuntime_, "currentGlobalOriginY", values.y);
678
- yogaValues.setProperty(uiRuntime_, "currentWidth", values.width);
679
- yogaValues.setProperty(uiRuntime_, "currentHeight", values.height);
680
- yogaValues.setProperty(uiRuntime_, "windowWidth", values.windowWidth);
681
- yogaValues.setProperty(uiRuntime_, "windowHeight", values.windowHeight);
682
- layoutAnimationsManager_->startLayoutAnimation(
683
- uiRuntime_, tag, LayoutAnimationType::EXITING, yogaValues);
684
- layoutAnimationsManager_->clearLayoutAnimationConfig(tag);
685
- });
716
+ auto oldView = mutation.oldChildShadowView;
717
+ Rect window{};
718
+ {
719
+ auto &mutex = strongThis->mutex;
720
+ auto lock = std::unique_lock<std::recursive_mutex>(mutex);
721
+ strongThis->createLayoutAnimation(mutation, oldView, surfaceId, tag);
722
+ window = strongThis->surfaceManager.getWindow(surfaceId);
723
+ }
724
+
725
+ Snapshot values(oldView, window);
726
+
727
+ auto &uiRuntime = strongThis->uiRuntime_;
728
+ jsi::Object yogaValues(uiRuntime);
729
+ yogaValues.setProperty(uiRuntime, "currentOriginX", values.x);
730
+ yogaValues.setProperty(uiRuntime, "currentGlobalOriginX", values.x);
731
+ yogaValues.setProperty(uiRuntime, "currentOriginY", values.y);
732
+ yogaValues.setProperty(uiRuntime, "currentGlobalOriginY", values.y);
733
+ yogaValues.setProperty(uiRuntime, "currentWidth", values.width);
734
+ yogaValues.setProperty(uiRuntime, "currentHeight", values.height);
735
+ yogaValues.setProperty(uiRuntime, "windowWidth", values.windowWidth);
736
+ yogaValues.setProperty(uiRuntime, "windowHeight", values.windowHeight);
737
+ strongThis->layoutAnimationsManager_->startLayoutAnimation(
738
+ uiRuntime, tag, LayoutAnimationType::EXITING, yogaValues);
739
+ strongThis->layoutAnimationsManager_->clearLayoutAnimationConfig(tag);
740
+ });
686
741
  }
687
742
 
688
743
  void LayoutAnimationsProxy::startLayoutAnimation(
@@ -693,36 +748,46 @@ void LayoutAnimationsProxy::startLayoutAnimation(
693
748
  #endif
694
749
  auto surfaceId = mutation.oldChildShadowView.surfaceId;
695
750
 
696
- uiScheduler_->scheduleOnUI([this, mutation, surfaceId, tag]() {
751
+ uiScheduler_->scheduleOnUI([weakThis = weak_from_this(),
752
+ mutation,
753
+ surfaceId,
754
+ tag]() {
755
+ auto strongThis = weakThis.lock();
756
+ if (!strongThis) {
757
+ return;
758
+ }
759
+
697
760
  auto oldView = mutation.oldChildShadowView;
698
761
  Rect window{};
699
762
  {
763
+ auto &mutex = strongThis->mutex;
700
764
  auto lock = std::unique_lock<std::recursive_mutex>(mutex);
701
- createLayoutAnimation(mutation, oldView, surfaceId, tag);
702
- window = surfaceManager.getWindow(surfaceId);
765
+ strongThis->createLayoutAnimation(mutation, oldView, surfaceId, tag);
766
+ window = strongThis->surfaceManager.getWindow(surfaceId);
703
767
  }
704
768
 
705
769
  Snapshot currentValues(oldView, window);
706
770
  Snapshot targetValues(mutation.newChildShadowView, window);
707
771
 
708
- jsi::Object yogaValues(uiRuntime_);
709
- yogaValues.setProperty(uiRuntime_, "currentOriginX", currentValues.x);
710
- yogaValues.setProperty(uiRuntime_, "currentGlobalOriginX", currentValues.x);
711
- yogaValues.setProperty(uiRuntime_, "currentOriginY", currentValues.y);
712
- yogaValues.setProperty(uiRuntime_, "currentGlobalOriginY", currentValues.y);
713
- yogaValues.setProperty(uiRuntime_, "currentWidth", currentValues.width);
714
- yogaValues.setProperty(uiRuntime_, "currentHeight", currentValues.height);
715
- yogaValues.setProperty(uiRuntime_, "targetOriginX", targetValues.x);
716
- yogaValues.setProperty(uiRuntime_, "targetGlobalOriginX", targetValues.x);
717
- yogaValues.setProperty(uiRuntime_, "targetOriginY", targetValues.y);
718
- yogaValues.setProperty(uiRuntime_, "targetGlobalOriginY", targetValues.y);
719
- yogaValues.setProperty(uiRuntime_, "targetWidth", targetValues.width);
720
- yogaValues.setProperty(uiRuntime_, "targetHeight", targetValues.height);
721
- yogaValues.setProperty(uiRuntime_, "windowWidth", targetValues.windowWidth);
772
+ auto &uiRuntime = strongThis->uiRuntime_;
773
+ jsi::Object yogaValues(uiRuntime);
774
+ yogaValues.setProperty(uiRuntime, "currentOriginX", currentValues.x);
775
+ yogaValues.setProperty(uiRuntime, "currentGlobalOriginX", currentValues.x);
776
+ yogaValues.setProperty(uiRuntime, "currentOriginY", currentValues.y);
777
+ yogaValues.setProperty(uiRuntime, "currentGlobalOriginY", currentValues.y);
778
+ yogaValues.setProperty(uiRuntime, "currentWidth", currentValues.width);
779
+ yogaValues.setProperty(uiRuntime, "currentHeight", currentValues.height);
780
+ yogaValues.setProperty(uiRuntime, "targetOriginX", targetValues.x);
781
+ yogaValues.setProperty(uiRuntime, "targetGlobalOriginX", targetValues.x);
782
+ yogaValues.setProperty(uiRuntime, "targetOriginY", targetValues.y);
783
+ yogaValues.setProperty(uiRuntime, "targetGlobalOriginY", targetValues.y);
784
+ yogaValues.setProperty(uiRuntime, "targetWidth", targetValues.width);
785
+ yogaValues.setProperty(uiRuntime, "targetHeight", targetValues.height);
786
+ yogaValues.setProperty(uiRuntime, "windowWidth", targetValues.windowWidth);
722
787
  yogaValues.setProperty(
723
- uiRuntime_, "windowHeight", targetValues.windowHeight);
724
- layoutAnimationsManager_->startLayoutAnimation(
725
- uiRuntime_, tag, LayoutAnimationType::LAYOUT, yogaValues);
788
+ uiRuntime, "windowHeight", targetValues.windowHeight);
789
+ strongThis->layoutAnimationsManager_->startLayoutAnimation(
790
+ uiRuntime, tag, LayoutAnimationType::LAYOUT, yogaValues);
726
791
  });
727
792
  }
728
793
 
@@ -738,8 +803,14 @@ void LayoutAnimationsProxy::maybeCancelAnimation(const int tag) const {
738
803
  return;
739
804
  }
740
805
  layoutAnimations_.erase(tag);
741
- uiScheduler_->scheduleOnUI([this, tag]() {
742
- layoutAnimationsManager_->cancelLayoutAnimation(uiRuntime_, tag);
806
+ uiScheduler_->scheduleOnUI([weakThis = weak_from_this(), tag]() {
807
+ auto strongThis = weakThis.lock();
808
+ if (!strongThis) {
809
+ return;
810
+ }
811
+
812
+ auto &uiRuntime = strongThis->uiRuntime_;
813
+ strongThis->layoutAnimationsManager_->cancelLayoutAnimation(uiRuntime, tag);
743
814
  });
744
815
  }
745
816
 
@@ -19,18 +19,25 @@
19
19
 
20
20
  namespace reanimated {
21
21
 
22
- class NativeReanimatedModule;
22
+ class ReanimatedModuleProxy;
23
23
 
24
24
  using namespace facebook;
25
25
 
26
26
  struct LayoutAnimation {
27
+ #if REACT_NATIVE_MINOR_VERSION >= 78
28
+ std::shared_ptr<ShadowView> finalView, currentView;
29
+ Tag parentTag;
30
+ #else
27
31
  std::shared_ptr<ShadowView> finalView, currentView, parentView;
32
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
28
33
  std::optional<double> opacity;
29
34
  int count = 1;
30
35
  LayoutAnimation &operator=(const LayoutAnimation &other) = default;
31
36
  };
32
37
 
33
- struct LayoutAnimationsProxy : public MountingOverrideDelegate {
38
+ struct LayoutAnimationsProxy
39
+ : public MountingOverrideDelegate,
40
+ public std::enable_shared_from_this<LayoutAnimationsProxy> {
34
41
  mutable std::unordered_map<Tag, std::shared_ptr<Node>> nodeForTag_;
35
42
  mutable std::unordered_map<Tag, LayoutAnimation> layoutAnimations_;
36
43
  mutable std::recursive_mutex mutex;
@@ -31,7 +31,13 @@ Rect SurfaceManager::getWindow(SurfaceId surfaceId) {
31
31
  }
32
32
 
33
33
  void Node::applyMutationToIndices(ShadowViewMutation mutation) {
34
- if (tag != mutation.parentShadowView.tag) {
34
+ #if REACT_NATIVE_MINOR_VERSION >= 78
35
+ const auto parentTag = mutation.parentTag;
36
+ #else
37
+ const auto parentTag = mutation.parentShadowView.tag;
38
+ #endif // REACT_NATIVE_MINOR_VERSION >= 78
39
+
40
+ if (tag != parentTag) {
35
41
  return;
36
42
  }
37
43
 
@@ -96,7 +96,6 @@ struct Node {
96
96
  */
97
97
  struct MutationNode : public Node {
98
98
  ShadowViewMutation mutation;
99
- std::unordered_set<Tag> animatedChildren;
100
99
  ExitingState state = UNDEFINED;
101
100
  explicit MutationNode(ShadowViewMutation &mutation)
102
101
  : Node(mutation.oldChildShadowView.tag), mutation(mutation) {}