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.
- package/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +13 -15
- package/Common/cpp/reanimated/Fabric/PropsRegistry.h +8 -6
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +138 -34
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +32 -3
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +27 -14
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +3 -0
- package/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +9 -1
- package/android/CMakeLists.txt +10 -3
- package/android/build.gradle +3 -3
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +19 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +37 -12
- package/android/src/main/cpp/reanimated/android/NativeProxy.h +8 -2
- package/android/src/main/java/com/swmansion/worklets/WorkletsMessageQueueThreadBase.java +1 -2
- package/lib/module/ViewDescriptorsSet.js +5 -1
- package/lib/module/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/animation/util.js +5 -3
- package/lib/module/animation/util.js.map +1 -1
- package/lib/module/component/ReducedMotionConfig.js +1 -1
- package/lib/module/createAnimatedComponent/NativeEventsManager.js +1 -1
- package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +28 -11
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/layoutReanimation/web/Easing.web.js +14 -0
- package/lib/module/layoutReanimation/web/Easing.web.js.map +1 -1
- package/lib/module/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/layoutReanimation/web/componentUtils.js +52 -14
- package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/layoutReanimation/web/createAnimation.js +12 -0
- package/lib/module/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/layoutReanimation/web/domUtils.js +1 -1
- package/lib/module/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/layoutReanimation/web/transition/Curved.web.js +1 -0
- package/lib/module/layoutReanimation/web/transition/Curved.web.js.map +1 -1
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platformFunctions/dispatchCommand.js +10 -0
- package/lib/module/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/platformFunctions/scrollTo.web.js +11 -7
- package/lib/module/platformFunctions/scrollTo.web.js.map +1 -1
- package/lib/module/runtimes.js +1 -1
- package/lib/module/threads.js +5 -5
- package/lib/typescript/ViewDescriptorsSet.d.ts +1 -0
- package/lib/typescript/ViewDescriptorsSet.d.ts.map +1 -1
- package/lib/typescript/animation/util.d.ts.map +1 -1
- package/lib/typescript/component/ReducedMotionConfig.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
- package/lib/typescript/helperTypes.d.ts +4 -1
- package/lib/typescript/helperTypes.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/Easing.web.d.ts +2 -0
- package/lib/typescript/layoutReanimation/web/Easing.web.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/animationParser.d.ts +3 -0
- package/lib/typescript/layoutReanimation/web/animationParser.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/componentUtils.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/config.d.ts +4 -4
- package/lib/typescript/layoutReanimation/web/config.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/createAnimation.d.ts.map +1 -1
- package/lib/typescript/layoutReanimation/web/transition/Curved.web.d.ts.map +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/platformFunctions/scrollTo.web.d.ts.map +1 -1
- package/lib/typescript/runtimes.d.ts +1 -1
- package/lib/typescript/threads.d.ts +5 -5
- package/package.json +1 -1
- package/scripts/reanimated_utils.rb +1 -1
- package/src/ViewDescriptorsSet.ts +9 -0
- package/src/animation/util.ts +6 -4
- package/src/component/ReducedMotionConfig.tsx +1 -1
- package/src/createAnimatedComponent/NativeEventsManager.ts +1 -1
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +35 -24
- package/src/helperTypes.ts +5 -1
- package/src/layoutReanimation/web/Easing.web.ts +32 -0
- package/src/layoutReanimation/web/animationParser.ts +3 -0
- package/src/layoutReanimation/web/componentUtils.ts +69 -16
- package/src/layoutReanimation/web/config.ts +7 -3
- package/src/layoutReanimation/web/createAnimation.ts +15 -0
- package/src/layoutReanimation/web/domUtils.ts +1 -1
- package/src/layoutReanimation/web/transition/Curved.web.ts +1 -0
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/platformFunctions/dispatchCommand.ts +23 -2
- package/src/platformFunctions/scrollTo.web.ts +9 -3
- package/src/runtimes.ts +1 -1
- 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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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:
|