react-native-reanimated 3.19.0 → 3.19.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 (81) hide show
  1. package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +13 -15
  2. package/Common/cpp/reanimated/Fabric/PropsRegistry.h +8 -6
  3. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +138 -34
  4. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +32 -3
  5. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +27 -14
  6. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +3 -0
  7. package/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +9 -1
  8. package/android/CMakeLists.txt +10 -3
  9. package/android/build.gradle +3 -3
  10. package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +19 -0
  11. package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +37 -12
  12. package/android/src/main/cpp/reanimated/android/NativeProxy.h +8 -2
  13. package/android/src/main/java/com/swmansion/worklets/WorkletsMessageQueueThreadBase.java +1 -2
  14. package/lib/module/ViewDescriptorsSet.js +5 -1
  15. package/lib/module/ViewDescriptorsSet.js.map +1 -1
  16. package/lib/module/animation/util.js +5 -3
  17. package/lib/module/animation/util.js.map +1 -1
  18. package/lib/module/component/ReducedMotionConfig.js +1 -1
  19. package/lib/module/createAnimatedComponent/NativeEventsManager.js +1 -1
  20. package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
  21. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +28 -11
  22. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  23. package/lib/module/layoutReanimation/web/Easing.web.js +14 -0
  24. package/lib/module/layoutReanimation/web/Easing.web.js.map +1 -1
  25. package/lib/module/layoutReanimation/web/animationParser.js.map +1 -1
  26. package/lib/module/layoutReanimation/web/componentUtils.js +52 -14
  27. package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
  28. package/lib/module/layoutReanimation/web/config.js.map +1 -1
  29. package/lib/module/layoutReanimation/web/createAnimation.js +12 -0
  30. package/lib/module/layoutReanimation/web/createAnimation.js.map +1 -1
  31. package/lib/module/layoutReanimation/web/domUtils.js +1 -1
  32. package/lib/module/layoutReanimation/web/domUtils.js.map +1 -1
  33. package/lib/module/layoutReanimation/web/transition/Curved.web.js +1 -0
  34. package/lib/module/layoutReanimation/web/transition/Curved.web.js.map +1 -1
  35. package/lib/module/platform-specific/jsVersion.js +1 -1
  36. package/lib/module/platformFunctions/dispatchCommand.js +10 -0
  37. package/lib/module/platformFunctions/dispatchCommand.js.map +1 -1
  38. package/lib/module/platformFunctions/scrollTo.web.js +11 -7
  39. package/lib/module/platformFunctions/scrollTo.web.js.map +1 -1
  40. package/lib/module/runtimes.js +1 -1
  41. package/lib/module/threads.js +5 -5
  42. package/lib/typescript/ViewDescriptorsSet.d.ts +1 -0
  43. package/lib/typescript/ViewDescriptorsSet.d.ts.map +1 -1
  44. package/lib/typescript/animation/util.d.ts.map +1 -1
  45. package/lib/typescript/component/ReducedMotionConfig.d.ts +1 -1
  46. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
  47. package/lib/typescript/helperTypes.d.ts +4 -1
  48. package/lib/typescript/helperTypes.d.ts.map +1 -1
  49. package/lib/typescript/layoutReanimation/web/Easing.web.d.ts +2 -0
  50. package/lib/typescript/layoutReanimation/web/Easing.web.d.ts.map +1 -1
  51. package/lib/typescript/layoutReanimation/web/animationParser.d.ts +3 -0
  52. package/lib/typescript/layoutReanimation/web/animationParser.d.ts.map +1 -1
  53. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
  54. package/lib/typescript/layoutReanimation/web/config.d.ts +4 -4
  55. package/lib/typescript/layoutReanimation/web/config.d.ts.map +1 -1
  56. package/lib/typescript/layoutReanimation/web/createAnimation.d.ts.map +1 -1
  57. package/lib/typescript/layoutReanimation/web/transition/Curved.web.d.ts.map +1 -1
  58. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  59. package/lib/typescript/platformFunctions/scrollTo.web.d.ts.map +1 -1
  60. package/lib/typescript/runtimes.d.ts +1 -1
  61. package/lib/typescript/threads.d.ts +5 -5
  62. package/package.json +1 -1
  63. package/scripts/reanimated_utils.rb +1 -1
  64. package/src/ViewDescriptorsSet.ts +9 -0
  65. package/src/animation/util.ts +6 -4
  66. package/src/component/ReducedMotionConfig.tsx +1 -1
  67. package/src/createAnimatedComponent/NativeEventsManager.ts +1 -1
  68. package/src/createAnimatedComponent/createAnimatedComponent.tsx +35 -24
  69. package/src/helperTypes.ts +5 -1
  70. package/src/layoutReanimation/web/Easing.web.ts +32 -0
  71. package/src/layoutReanimation/web/animationParser.ts +3 -0
  72. package/src/layoutReanimation/web/componentUtils.ts +69 -16
  73. package/src/layoutReanimation/web/config.ts +7 -3
  74. package/src/layoutReanimation/web/createAnimation.ts +15 -0
  75. package/src/layoutReanimation/web/domUtils.ts +1 -1
  76. package/src/layoutReanimation/web/transition/Curved.web.ts +1 -0
  77. package/src/platform-specific/jsVersion.ts +1 -1
  78. package/src/platformFunctions/dispatchCommand.ts +23 -2
  79. package/src/platformFunctions/scrollTo.web.ts +9 -3
  80. package/src/runtimes.ts +1 -1
  81. package/src/threads.ts +5 -5
@@ -3,6 +3,7 @@ import type { Component } from 'react';
3
3
  import type { ScrollView } from 'react-native';
4
4
 
5
5
  import type { AnimatedRef } from '../hook/commonTypes';
6
+ import { logger } from '../logger';
6
7
 
7
8
  export function scrollTo<T extends Component>(
8
9
  animatedRef: AnimatedRef<T>,
@@ -14,8 +15,13 @@ export function scrollTo<T extends Component>(
14
15
 
15
16
  // This prevents crashes if ref has not been set yet
16
17
  if (element !== -1) {
17
- // By ScrollView we mean any scrollable component
18
- const scrollView = element as HTMLElement as unknown as ScrollView;
19
- scrollView?.scrollTo({ x, y, animated });
18
+ logger.warn(
19
+ 'Called scrollTo() with an uninitialized ref. Make sure to pass the animated ref to the scrollable component before calling scrollTo().'
20
+ );
21
+ return;
20
22
  }
23
+
24
+ // By ScrollView we mean any scrollable component
25
+ const scrollView = element as unknown as ScrollView;
26
+ scrollView?.scrollTo({ x, y, animated });
21
27
  }
package/src/runtimes.ts CHANGED
@@ -28,7 +28,7 @@ export type WorkletRuntime = {
28
28
  * the same thread immediately after the runtime is created.
29
29
  * @returns WorkletRuntime which is a
30
30
  * `jsi::HostObject<reanimated::WorkletRuntime>` - {@link WorkletRuntime}
31
- * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime
31
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/createWorkletRuntime
32
32
  */
33
33
  // @ts-expect-error Check `runOnUI` overload.
34
34
  export function createWorkletRuntime(
package/src/threads.ts CHANGED
@@ -57,7 +57,7 @@ export const callMicrotasks = SHOULD_BE_USE_WEB
57
57
  * Lets you asynchronously run
58
58
  * [workletized](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#to-workletize)
59
59
  * functions on the [UI
60
- * thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI).
60
+ * thread](https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/runOnUI).
61
61
  *
62
62
  * This method does not schedule the work immediately but instead waits for
63
63
  * other worklets to be scheduled within the same JS loop. It uses
@@ -65,12 +65,12 @@ export const callMicrotasks = SHOULD_BE_USE_WEB
65
65
  * within the same frame boundaries on the UI thread.
66
66
  *
67
67
  * @param fun - A reference to a function you want to execute on the [UI
68
- * thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI)
68
+ * thread](https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/runOnUI)
69
69
  * from the [JavaScript
70
- * thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI).
70
+ * thread](https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/runOnUI).
71
71
  * @returns A function that accepts arguments for the function passed as the
72
72
  * first argument.
73
- * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI
73
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/runOnUI
74
74
  */
75
75
  // @ts-expect-error This overload is correct since it's what user sees in his code
76
76
  // before it's transformed by Reanimated Babel plugin.
@@ -218,7 +218,7 @@ function runWorkletOnJS<Args extends unknown[], ReturnValue>(
218
218
  * thread from the UI thread.
219
219
  * @returns A function that accepts arguments for the function passed as the
220
220
  * first argument.
221
- * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnJS
221
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/3.x/threading/runOnJS
222
222
  */
223
223
  export function runOnJS<Args extends unknown[], ReturnValue>(
224
224
  fun: