react-native-reanimated 3.6.0 → 3.6.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/lib/module/createAnimatedComponent/createAnimatedComponent.js +12 -0
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +2 -0
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -3
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/decay.js +9 -0
- package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/utils.js +13 -0
- package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js +9 -0
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +11 -0
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +10 -0
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js +9 -0
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/springUtils.js +16 -0
- package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +18 -0
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +7 -0
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +30 -7
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js +7 -0
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/helperTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +8 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedProps.js +9 -0
- package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +6 -4
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +7 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +10 -2
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +10 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +8 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +14 -8
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useEvent.js +7 -6
- package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js +17 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useHandler.js +8 -2
- package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useReducedMotion.js +9 -0
- package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +8 -0
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js +11 -3
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useWorkletCallback.js +3 -0
- package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/reanimated2/index.js +1 -1
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +21 -0
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +51 -21
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +29 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +67 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +6 -3
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +80 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +79 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +96 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +31 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +15 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +31 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +63 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +64 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +32 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +128 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +8 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +9 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +8 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +8 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +10 -3
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +49 -3
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js +0 -2
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +9 -0
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +14 -4
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.js +7 -0
- package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.js +9 -0
- package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js +8 -0
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
- package/lib/module/reanimated2/runtimes.js +8 -0
- package/lib/module/reanimated2/runtimes.js.map +1 -1
- package/lib/module/reanimated2/threads.js +16 -6
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +12 -0
- package/lib/typescript/reanimated2/Easing.d.ts +3 -3
- package/lib/typescript/reanimated2/animation/decay/decay.d.ts +8 -0
- package/lib/typescript/reanimated2/animation/decay/utils.d.ts +12 -0
- package/lib/typescript/reanimated2/animation/delay.d.ts +9 -0
- package/lib/typescript/reanimated2/animation/repeat.d.ts +11 -0
- package/lib/typescript/reanimated2/animation/sequence.d.ts +8 -0
- package/lib/typescript/reanimated2/animation/spring.d.ts +9 -0
- package/lib/typescript/reanimated2/animation/springUtils.d.ts +15 -0
- package/lib/typescript/reanimated2/animation/timing.d.ts +17 -0
- package/lib/typescript/reanimated2/animation/util.d.ts +6 -0
- package/lib/typescript/reanimated2/commonTypes.d.ts +25 -7
- package/lib/typescript/reanimated2/component/FlatList.d.ts +6 -0
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +7 -0
- package/lib/typescript/reanimated2/component/ScrollView.d.ts +3 -2
- package/lib/typescript/reanimated2/helperTypes.d.ts +45 -3
- package/lib/typescript/reanimated2/hook/useAnimatedKeyboard.d.ts +7 -0
- package/lib/typescript/reanimated2/hook/useAnimatedProps.d.ts +9 -0
- package/lib/typescript/reanimated2/hook/useAnimatedReaction.d.ts +6 -4
- package/lib/typescript/reanimated2/hook/useAnimatedRef.d.ts +6 -0
- package/lib/typescript/reanimated2/hook/useAnimatedScrollHandler.d.ts +10 -0
- package/lib/typescript/reanimated2/hook/useAnimatedSensor.d.ts +8 -0
- package/lib/typescript/reanimated2/hook/useAnimatedStyle.d.ts +8 -0
- package/lib/typescript/reanimated2/hook/useDerivedValue.d.ts +9 -1
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +8 -5
- package/lib/typescript/reanimated2/hook/useFrameCallback.d.ts +14 -0
- package/lib/typescript/reanimated2/hook/useHandler.d.ts +8 -0
- package/lib/typescript/reanimated2/hook/useReducedMotion.d.ts +8 -0
- package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +7 -0
- package/lib/typescript/reanimated2/hook/useSharedValue.d.ts +8 -1
- package/lib/typescript/reanimated2/hook/useWorkletCallback.d.ts +3 -0
- package/lib/typescript/reanimated2/index.d.ts +1 -1
- package/lib/typescript/reanimated2/interpolateColor.d.ts +17 -0
- package/lib/typescript/reanimated2/interpolation.d.ts +30 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +25 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +56 -1
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +4 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +70 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +70 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +84 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +28 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +14 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +28 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +56 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +56 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +28 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +112 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +7 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +8 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +7 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +7 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +10 -0
- package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +7 -0
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +43 -1
- package/lib/typescript/reanimated2/layoutReanimation/web/createAnimation.d.ts +4 -4
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/reanimated2/platformFunctions/dispatchCommand.d.ts +8 -0
- package/lib/typescript/reanimated2/platformFunctions/getRelativeCoords.d.ts +11 -3
- package/lib/typescript/reanimated2/platformFunctions/measure.d.ts +7 -0
- package/lib/typescript/reanimated2/platformFunctions/scrollTo.d.ts +9 -0
- package/lib/typescript/reanimated2/platformFunctions/setNativeProps.d.ts +7 -0
- package/lib/typescript/reanimated2/runtimes.d.ts +8 -0
- package/lib/typescript/reanimated2/threads.d.ts +17 -2
- package/package.json +2 -1
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +18 -0
- package/src/createAnimatedComponent/setAndForwardRef.ts +2 -0
- package/src/reanimated2/Easing.ts +3 -3
- package/src/reanimated2/PlatformChecker.ts +1 -1
- package/src/reanimated2/animation/decay/decay.ts +8 -0
- package/src/reanimated2/animation/decay/utils.ts +12 -0
- package/src/reanimated2/animation/delay.ts +9 -0
- package/src/reanimated2/animation/repeat.ts +11 -0
- package/src/reanimated2/animation/sequence.ts +8 -0
- package/src/reanimated2/animation/spring.ts +9 -0
- package/src/reanimated2/animation/springUtils.ts +15 -0
- package/src/reanimated2/animation/timing.ts +17 -0
- package/src/reanimated2/animation/util.ts +6 -0
- package/src/reanimated2/commonTypes.ts +25 -7
- package/src/reanimated2/component/FlatList.tsx +6 -0
- package/src/reanimated2/component/LayoutAnimationConfig.tsx +7 -0
- package/src/reanimated2/component/ScrollView.tsx +3 -1
- package/src/reanimated2/globals.d.ts +1 -1
- package/src/reanimated2/helperTypes.ts +45 -3
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +7 -0
- package/src/reanimated2/hook/useAnimatedProps.ts +9 -0
- package/src/reanimated2/hook/useAnimatedReaction.ts +6 -4
- package/src/reanimated2/hook/useAnimatedRef.ts +6 -0
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +10 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +8 -0
- package/src/reanimated2/hook/useAnimatedStyle.ts +8 -0
- package/src/reanimated2/hook/useDerivedValue.ts +15 -7
- package/src/reanimated2/hook/useEvent.ts +9 -6
- package/src/reanimated2/hook/useFrameCallback.ts +14 -0
- package/src/reanimated2/hook/useHandler.ts +8 -0
- package/src/reanimated2/hook/useReducedMotion.ts +8 -0
- package/src/reanimated2/hook/useScrollViewOffset.ts +7 -0
- package/src/reanimated2/hook/useSharedValue.ts +12 -3
- package/src/reanimated2/hook/useWorkletCallback.ts +3 -0
- package/src/reanimated2/index.ts +1 -1
- package/src/reanimated2/interpolateColor.ts +17 -0
- package/src/reanimated2/interpolation.ts +48 -22
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +26 -3
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +57 -2
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +7 -6
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +4 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +71 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +70 -1
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +84 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +28 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +14 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +28 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +56 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +56 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +28 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +112 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +7 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +8 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +7 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +8 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +10 -3
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +7 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +45 -3
- package/src/reanimated2/layoutReanimation/web/createAnimation.ts +4 -4
- package/src/reanimated2/platform-specific/checkCppVersion.ts +0 -4
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/platformFunctions/dispatchCommand.ts +8 -0
- package/src/reanimated2/platformFunctions/getRelativeCoords.ts +12 -4
- package/src/reanimated2/platformFunctions/measure.ts +7 -0
- package/src/reanimated2/platformFunctions/scrollTo.ts +9 -0
- package/src/reanimated2/platformFunctions/setNativeProps.ts +7 -0
- package/src/reanimated2/runtimes.ts +8 -0
- package/src/reanimated2/threads.ts +18 -7
|
@@ -29,6 +29,12 @@ type AnimationFactory = (
|
|
|
29
29
|
values: SharedTransitionAnimationsValues
|
|
30
30
|
) => StyleProps;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A SharedTransition builder class.
|
|
34
|
+
*
|
|
35
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
36
|
+
* @experimental
|
|
37
|
+
*/
|
|
32
38
|
export class SharedTransition {
|
|
33
39
|
private _customAnimationFactory: AnimationFactory | null = null;
|
|
34
40
|
private _animation: SharedTransitionAnimationsFunction | null = null;
|
|
@@ -224,31 +230,67 @@ export class SharedTransition {
|
|
|
224
230
|
};
|
|
225
231
|
}
|
|
226
232
|
|
|
227
|
-
// static builder methods
|
|
233
|
+
// static builder methods i.e. shared transition modifiers
|
|
228
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Lets you create a custom shared transition animation. Other shared transition modifiers can be chained alongside this modifier.
|
|
237
|
+
*
|
|
238
|
+
* @param customAnimationFactory - Callback function that have to return an object with styles for the custom shared transition.
|
|
239
|
+
* @returns A {@link SharedTransition} object. Styles returned from this function need to be to the `sharedTransitionStyle` prop.
|
|
240
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
241
|
+
* @experimental
|
|
242
|
+
*/
|
|
229
243
|
public static custom(
|
|
230
244
|
customAnimationFactory: AnimationFactory
|
|
231
245
|
): SharedTransition {
|
|
232
246
|
return new SharedTransition().custom(customAnimationFactory);
|
|
233
247
|
}
|
|
234
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Lets you change the duration of the shared transition. Other shared transition modifiers can be chained alongside this modifier.
|
|
251
|
+
*
|
|
252
|
+
* @param duration - The duration of the shared transition animation in milliseconds.
|
|
253
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
254
|
+
* @experimental
|
|
255
|
+
*/
|
|
235
256
|
public static duration(duration: number): SharedTransition {
|
|
236
257
|
return new SharedTransition().duration(duration);
|
|
237
258
|
}
|
|
238
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Lets you create a shared transition animation bound to the progress between navigation screens. Other shared transition modifiers can be chained alongside this modifier.
|
|
262
|
+
*
|
|
263
|
+
* @param progressAnimationCallback - A callback called with the current progress value on every animation frame. It should return an object with styles for the shared transition.
|
|
264
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
265
|
+
* @experimental
|
|
266
|
+
*/
|
|
239
267
|
public static progressAnimation(
|
|
240
268
|
progressAnimationCallback: CustomProgressAnimation
|
|
241
269
|
): SharedTransition {
|
|
242
270
|
return new SharedTransition().progressAnimation(progressAnimationCallback);
|
|
243
271
|
}
|
|
244
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Whether the transition is progress-bound or not. Other shared transition modifiers can be chained alongside this modifier.
|
|
275
|
+
*
|
|
276
|
+
* @param transitionType - Type of the transition. Configured with {@link SharedTransitionType} enum.
|
|
277
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
278
|
+
* @experimental
|
|
279
|
+
*/
|
|
245
280
|
public static defaultTransitionType(
|
|
246
281
|
transitionType: SharedTransitionType
|
|
247
282
|
): SharedTransition {
|
|
248
283
|
return new SharedTransition().defaultTransitionType(transitionType);
|
|
249
284
|
}
|
|
250
285
|
|
|
251
|
-
|
|
252
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Lets you adjust the behavior when the device's reduced motion accessibility setting is turned on. Other shared transition modifiers can be chained alongside this modifier.
|
|
288
|
+
*
|
|
289
|
+
* @param reduceMotion - Determines how the animation responds to the device's reduced motion accessibility setting. Default to `ReduceMotion.System` - {@link ReduceMotion}.
|
|
290
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
|
|
291
|
+
* @experimental
|
|
292
|
+
*/
|
|
293
|
+
public static reduceMotion(reduceMotion: ReduceMotion): SharedTransition {
|
|
294
|
+
return new SharedTransition().reduceMotion(reduceMotion);
|
|
253
295
|
}
|
|
254
296
|
}
|
|
@@ -65,8 +65,8 @@ function addExistingTransform(
|
|
|
65
65
|
/**
|
|
66
66
|
* Modifies default animation by preserving transformations that given element already contains.
|
|
67
67
|
*
|
|
68
|
-
* @param animationName Name of the animation to be modified (e.g. `FadeIn`).
|
|
69
|
-
* @param existingTransform Transform values that element already contains.
|
|
68
|
+
* @param animationName - Name of the animation to be modified (e.g. `FadeIn`).
|
|
69
|
+
* @param existingTransform - Transform values that element already contains.
|
|
70
70
|
* @returns Animation parsed to keyframe string.
|
|
71
71
|
*/
|
|
72
72
|
export function createAnimationWithExistingTransform(
|
|
@@ -109,8 +109,8 @@ function generateNextCustomKeyframeName() {
|
|
|
109
109
|
/**
|
|
110
110
|
* Creates transition of given type, appends it to stylesheet and returns keyframe name.
|
|
111
111
|
*
|
|
112
|
-
* @param transitionType Type of transition (e.g. LINEAR).
|
|
113
|
-
* @param transitionData Object containing data for transforms (translateX, scaleX,...).
|
|
112
|
+
* @param transitionType - Type of transition (e.g. LINEAR).
|
|
113
|
+
* @param transitionData - Object containing data for transforms (translateX, scaleX,...).
|
|
114
114
|
* @returns Keyframe name that represents transition.
|
|
115
115
|
*/
|
|
116
116
|
export function TransitionGenerator(
|
|
@@ -4,10 +4,6 @@ import { jsVersion } from './jsVersion';
|
|
|
4
4
|
export function checkCppVersion() {
|
|
5
5
|
const cppVersion = global._REANIMATED_VERSION_CPP;
|
|
6
6
|
if (cppVersion === undefined) {
|
|
7
|
-
console.warn(
|
|
8
|
-
`[Reanimated] Couldn't determine the version of the native part of Reanimated.
|
|
9
|
-
See \`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-reanimated\` for more details.`
|
|
10
|
-
);
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
9
|
const ok = matchVersion(jsVersion, cppVersion);
|
|
@@ -55,6 +55,14 @@ function dispatchCommandDefault() {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Lets you synchronously call a command of a native component.
|
|
60
|
+
*
|
|
61
|
+
* @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to call the command on.
|
|
62
|
+
* @param commandName - The name of the command to dispatch (e.g. `"focus"` or `"scrollToEnd"`).
|
|
63
|
+
* @param args - An optional array of arguments for the command.
|
|
64
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand
|
|
65
|
+
*/
|
|
58
66
|
export let dispatchCommand: <T extends Component>(
|
|
59
67
|
animatedRef: AnimatedRef<T>,
|
|
60
68
|
commandName: string,
|
|
@@ -3,22 +3,30 @@ import type { Component } from 'react';
|
|
|
3
3
|
import { measure } from './measure';
|
|
4
4
|
import type { AnimatedRef } from '../hook/commonTypes';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* An object which contains relative coordinates.
|
|
8
|
+
*/
|
|
6
9
|
export interface ComponentCoords {
|
|
7
10
|
x: number;
|
|
8
11
|
y: number;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
15
|
+
* Lets you determines the location on the screen, relative to the given view.
|
|
16
|
+
*
|
|
17
|
+
* @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the coordinates from.
|
|
18
|
+
* @param absoluteX - A number which is an absolute x coordinate.
|
|
19
|
+
* @param absoluteY - A number which is an absolute y coordinate.
|
|
20
|
+
* @returns An object which contains relative coordinates - {@link ComponentCoords}.
|
|
21
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords
|
|
14
22
|
*/
|
|
15
23
|
export function getRelativeCoords(
|
|
16
|
-
|
|
24
|
+
animatedRef: AnimatedRef<Component>,
|
|
17
25
|
absoluteX: number,
|
|
18
26
|
absoluteY: number
|
|
19
27
|
): ComponentCoords | null {
|
|
20
28
|
'worklet';
|
|
21
|
-
const parentCoords = measure(
|
|
29
|
+
const parentCoords = measure(animatedRef);
|
|
22
30
|
if (parentCoords === null) {
|
|
23
31
|
return null;
|
|
24
32
|
}
|
|
@@ -9,6 +9,13 @@ import {
|
|
|
9
9
|
import type { AnimatedRef } from '../hook/commonTypes';
|
|
10
10
|
import type { Component } from 'react';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Lets you synchronously get the dimensions and position of a view on the screen.
|
|
14
|
+
*
|
|
15
|
+
* @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the measurements from.
|
|
16
|
+
* @returns An object containing component measurements or null when the measurement couldn't be performed- {@link MeasuredDimensions}.
|
|
17
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure/
|
|
18
|
+
*/
|
|
12
19
|
export let measure: <T extends Component>(
|
|
13
20
|
animatedRef: AnimatedRef<T>
|
|
14
21
|
) => MeasuredDimensions | null;
|
|
@@ -9,6 +9,15 @@ import { dispatchCommand } from './dispatchCommand';
|
|
|
9
9
|
import type { AnimatedRef } from '../hook/commonTypes';
|
|
10
10
|
import type { Component } from 'react';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Lets you synchronously scroll to a given position of a `ScrollView`.
|
|
14
|
+
*
|
|
15
|
+
* @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an `Animated.ScrollView` component.
|
|
16
|
+
* @param x - The x position you want to scroll to.
|
|
17
|
+
* @param y - The y position you want to scroll to.
|
|
18
|
+
* @param animated - Whether the scrolling should be smooth or instant.
|
|
19
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/scrollTo
|
|
20
|
+
*/
|
|
12
21
|
export let scrollTo: <T extends Component>(
|
|
13
22
|
animatedRef: AnimatedRef<T>,
|
|
14
23
|
x: number,
|
|
@@ -10,6 +10,13 @@ import type { AnimatedRef } from '../hook/commonTypes';
|
|
|
10
10
|
import type { Component } from 'react';
|
|
11
11
|
import { processColorsInProps } from '../Colors';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Lets you imperatively update component properties. You should always reach for [useAnimatedStyle](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle) and [useAnimatedProps](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps) first when animating styles or properties.
|
|
15
|
+
*
|
|
16
|
+
* @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to update.
|
|
17
|
+
* @param updates - An object with properties you want to update.
|
|
18
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/setNativeProps
|
|
19
|
+
*/
|
|
13
20
|
export let setNativeProps: <T extends Component>(
|
|
14
21
|
animatedRef: AnimatedRef<T>,
|
|
15
22
|
updates: StyleProps
|
|
@@ -15,6 +15,14 @@ export type WorkletRuntime = {
|
|
|
15
15
|
readonly name: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Lets you create a new JS runtime which can be used to run worklets possibly on different threads than JS or UI thread.
|
|
20
|
+
*
|
|
21
|
+
* @param name - A name used to identify the runtime which will appear in devices list in Chrome DevTools.
|
|
22
|
+
* @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.
|
|
23
|
+
* @returns WorkletRuntime which is a jsi::HostObject\<reanimated::WorkletRuntime\> - {@link WorkletRuntime}
|
|
24
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime
|
|
25
|
+
*/
|
|
18
26
|
export function createWorkletRuntime(
|
|
19
27
|
name: string,
|
|
20
28
|
initializer?: __ComplexWorkletFunction<[], void>
|
|
@@ -53,16 +53,23 @@ export const callMicrotasks = SHOULD_BE_USE_WEB
|
|
|
53
53
|
}
|
|
54
54
|
: callMicrotasksOnUIThread;
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Lets you asynchronously run [workletized](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#to-workletize) functions on the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI).
|
|
58
|
+
*
|
|
59
|
+
* This method does not schedule the work immediately but instead waits for other worklets
|
|
60
|
+
* to be scheduled within the same JS loop. It uses queueMicrotask to schedule all the worklets
|
|
61
|
+
* at once making sure they will run within the same frame boundaries on the UI thread.
|
|
62
|
+
*
|
|
63
|
+
* @param fun - A reference to a function you want to execute on the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI) from the [JavaScript thread](https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI).
|
|
64
|
+
* @returns A function that accepts arguments for the function passed as the first argument.
|
|
65
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnUI
|
|
66
|
+
*/
|
|
56
67
|
// @ts-expect-error This overload is correct since it's what user sees in his code
|
|
57
68
|
// before it's transformed by Reanimated Babel plugin.
|
|
58
69
|
export function runOnUI<Args extends unknown[], ReturnValue>(
|
|
59
70
|
worklet: (...args: Args) => ReturnValue
|
|
60
71
|
): (...args: Args) => void;
|
|
61
|
-
|
|
62
|
-
* Schedule a worklet to execute on the UI runtime. This method does not schedule the work immediately but instead
|
|
63
|
-
* waits for other worklets to be scheduled within the same JS loop. It uses queueMicrotask to schedule all the worklets
|
|
64
|
-
* at once making sure they will run within the same frame boundaries on the UI thread.
|
|
65
|
-
*/
|
|
72
|
+
|
|
66
73
|
export function runOnUI<Args extends unknown[], ReturnValue>(
|
|
67
74
|
worklet: WorkletFunction<Args, ReturnValue>
|
|
68
75
|
): (...args: Args) => void {
|
|
@@ -175,8 +182,12 @@ function runWorkletOnJS<Args extends unknown[], ReturnValue>(
|
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
185
|
+
* Lets you asynchronously run non-[workletized](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#to-workletize) functions that couldn't otherwise run on the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#ui-thread).
|
|
186
|
+
* This applies to most external libraries as they don't have their functions marked with "worklet"; directive.
|
|
187
|
+
*
|
|
188
|
+
* @param fun - A reference to a function you want to execute on the JavaScript thread from the UI thread.
|
|
189
|
+
* @returns A function that accepts arguments for the function passed as the first argument.
|
|
190
|
+
* @see https://docs.swmansion.com/react-native-reanimated/docs/threading/runOnJS
|
|
180
191
|
*/
|
|
181
192
|
export function runOnJS<Args extends unknown[], ReturnValue>(
|
|
182
193
|
fun:
|