react-native-reanimated 2.3.3 → 2.5.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.
- package/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +72 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +30 -1
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +64 -39
- package/Common/cpp/Tools/RuntimeDecorator.cpp +2 -0
- package/Common/cpp/headers/AnimatedSensor/AnimatedSensorModule.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +14 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +14 -0
- package/Common/cpp/headers/SharedItems/MutableValue.h +4 -1
- package/Common/cpp/headers/SharedItems/ShareableValue.h +3 -0
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +3 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +11 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +2 -0
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/CMakeLists.txt +198 -0
- package/android/README.md +15 -0
- package/android/build.gradle +686 -73
- package/android/empty.cpp +1 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +25 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/rnVersionPatch/62/layoutReanimation/ReanimatedNativeHierarchyManager.java +412 -0
- package/android/rnVersionPatch/62/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/63/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/64/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/65/.gitkeep +0 -0
- package/android/rnVersionPatch/66/.gitkeep +0 -0
- package/android/rnVersionPatch/67/.gitkeep +0 -0
- package/android/rnVersionPatch/68/.gitkeep +0 -0
- package/android/rnVersionPatch/backup/.gitkeep +0 -0
- package/android/settings.gradle +1 -0
- package/android/spotless.gradle +9 -0
- package/android/src/{AndroidManifest.xml → main/AndroidManifest.xml} +0 -0
- package/android/src/main/cpp/AndroidErrorHandler.cpp +42 -0
- package/android/src/main/cpp/AndroidLogger.cpp +27 -0
- package/android/src/main/cpp/AndroidScheduler.cpp +59 -0
- package/android/src/main/cpp/JNIHelper.cpp +59 -0
- package/android/src/main/cpp/LayoutAnimations.cpp +103 -0
- package/android/src/main/cpp/NativeProxy.cpp +327 -0
- package/android/src/main/cpp/OnLoad.cpp +17 -0
- package/android/src/main/cpp/TurboModule.cpp +44 -0
- package/android/src/main/cpp/headers/AndroidErrorHandler.h +30 -0
- package/android/src/main/cpp/headers/AndroidLogger.h +16 -0
- package/android/src/main/cpp/headers/AndroidScheduler.h +41 -0
- package/android/src/main/cpp/headers/JNIHelper.h +30 -0
- package/android/src/main/cpp/headers/LayoutAnimations.h +42 -0
- package/android/src/main/cpp/headers/NativeProxy.h +170 -0
- package/android/src/main/cpp/headers/TurboModule.h +70 -0
- package/android/src/main/java/com/facebook/react/uimanager/UIManagerReanimatedHelper.java +15 -0
- package/android/src/main/java/com/swmansion/common/GestureHandlerStateManager.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/AndroidErrorHandler.java +8 -0
- package/android/src/main/java/com/swmansion/reanimated/CopiedEvent.java +43 -0
- package/android/src/main/java/com/swmansion/reanimated/MapUtils.java +26 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +117 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +285 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +682 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedJSIModulePackage.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +251 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +96 -0
- package/android/src/main/java/com/swmansion/reanimated/Scheduler.java +51 -0
- package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +517 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +56 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +410 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +292 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +121 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ViewHierarchyObserver.java +12 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +87 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +24 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +49 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +38 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +73 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +36 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +33 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +83 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +20 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +139 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +37 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +377 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +71 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +153 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +31 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +35 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +25 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +86 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +161 -0
- package/ios/LayoutReanimation/REAAnimationsManager.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +18 -4
- package/ios/REAModule.m +8 -9
- package/ios/REANodesManager.h +4 -1
- package/ios/REANodesManager.m +75 -3
- package/ios/native/NativeMethods.h +1 -1
- package/ios/native/NativeProxy.mm +85 -5
- package/ios/sensor/ReanimatedSensor.h +21 -0
- package/ios/sensor/ReanimatedSensor.m +169 -0
- package/ios/sensor/ReanimatedSensorContainer.h +13 -0
- package/ios/sensor/ReanimatedSensorContainer.m +41 -0
- package/ios/sensor/ReanimatedSensorType.h +7 -0
- package/lib/ConfigHelper.js +2 -2
- package/lib/createAnimatedComponent.js +3 -4
- package/lib/reanimated1/core/AnimatedFunction.js +1 -1
- package/lib/reanimated1/derived/interpolate.js +2 -4
- package/lib/reanimated2/Colors.js +3 -98
- package/lib/reanimated2/Easing.js +5 -0
- package/lib/reanimated2/NativeMethods.js +15 -5
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +25 -12
- package/lib/reanimated2/NativeReanimated/index.js +2 -6
- package/lib/reanimated2/ViewDescriptorsSet.js +2 -2
- package/lib/reanimated2/animation/styleAnimation.js +2 -1
- package/lib/reanimated2/core.js +30 -24
- package/lib/reanimated2/globals.d.ts +6 -0
- package/lib/reanimated2/hook/index.js +1 -0
- package/lib/reanimated2/hook/useAnimatedGestureHandler.js +1 -2
- package/lib/reanimated2/hook/useAnimatedSensor.js +66 -0
- package/lib/reanimated2/hook/useAnimatedStyle.js +31 -14
- package/lib/reanimated2/hook/utils.js +14 -11
- package/lib/reanimated2/index.js +2 -0
- package/lib/reanimated2/interpolateColor.js +98 -0
- package/lib/reanimated2/interpolation.js +1 -1
- package/lib/reanimated2/jestUtils.js +9 -4
- package/lib/reanimated2/js-reanimated/JSReanimated.js +24 -3
- package/lib/reanimated2/js-reanimated/commonTypes.js +1 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +8 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +2 -1
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +32 -42
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +20 -38
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +32 -44
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -16
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -10
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +8 -12
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +20 -36
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +16 -20
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +8 -12
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +32 -48
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +22 -18
- package/lib/reanimated2/mock.js +3 -2
- package/mock.js +6 -4
- package/package.json +44 -36
- package/plugin.js +3 -0
- package/react-native-reanimated.d.ts +102 -15
- package/src/ConfigHelper.ts +4 -4
- package/src/createAnimatedComponent.tsx +3 -3
- package/src/reanimated1/core/AnimatedFunction.js +1 -1
- package/src/reanimated1/derived/interpolate.js +2 -4
- package/src/reanimated2/Colors.ts +8 -151
- package/src/reanimated2/Easing.ts +11 -0
- package/src/reanimated2/NativeMethods.ts +19 -6
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +42 -14
- package/src/reanimated2/NativeReanimated/index.ts +2 -8
- package/src/reanimated2/ViewDescriptorsSet.ts +2 -3
- package/src/reanimated2/animation/commonTypes.ts +44 -40
- package/src/reanimated2/animation/decay.ts +1 -1
- package/src/reanimated2/animation/delay.ts +2 -16
- package/src/reanimated2/animation/index.ts +8 -8
- package/src/reanimated2/animation/repeat.ts +2 -12
- package/src/reanimated2/animation/sequence.ts +3 -10
- package/src/reanimated2/animation/spring.ts +1 -1
- package/src/reanimated2/animation/styleAnimation.ts +11 -25
- package/src/reanimated2/animation/timing.ts +4 -2
- package/src/reanimated2/animation/util.ts +22 -20
- package/src/reanimated2/commonTypes.ts +68 -1
- package/src/reanimated2/component/FlatList.tsx +2 -1
- package/src/reanimated2/core.ts +35 -29
- package/src/reanimated2/globals.d.ts +6 -0
- package/src/reanimated2/hook/commonTypes.ts +5 -0
- package/src/reanimated2/hook/index.ts +1 -0
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -2
- package/src/reanimated2/hook/useAnimatedRef.ts +1 -5
- package/src/reanimated2/hook/useAnimatedSensor.ts +91 -0
- package/src/reanimated2/hook/useAnimatedStyle.ts +35 -16
- package/src/reanimated2/hook/utils.ts +20 -18
- package/src/reanimated2/index.ts +2 -0
- package/src/reanimated2/interpolateColor.ts +178 -0
- package/src/reanimated2/interpolation.ts +2 -6
- package/src/reanimated2/jestUtils.ts +9 -4
- package/src/reanimated2/js-reanimated/JSReanimated.ts +28 -6
- package/src/reanimated2/js-reanimated/Mapper.ts +1 -1
- package/src/reanimated2/js-reanimated/MapperRegistry.ts +1 -1
- package/src/reanimated2/js-reanimated/commonTypes.ts +51 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +13 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -3
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +51 -21
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +40 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +48 -12
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +32 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +64 -16
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +32 -21
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +2 -1
- package/src/reanimated2/mock.ts +3 -2
- package/src/reanimated2/utils.ts +1 -1
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedProxyPackage.java +0 -15
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
|
@@ -14,7 +14,8 @@ const { width, height } = Dimensions.get('window');
|
|
|
14
14
|
|
|
15
15
|
export class ZoomIn
|
|
16
16
|
extends ComplexAnimationBuilder
|
|
17
|
-
implements IEntryExitAnimationBuilder
|
|
17
|
+
implements IEntryExitAnimationBuilder
|
|
18
|
+
{
|
|
18
19
|
static createInstance(): ZoomIn {
|
|
19
20
|
return new ZoomIn();
|
|
20
21
|
}
|
|
@@ -24,6 +25,7 @@ export class ZoomIn
|
|
|
24
25
|
const [animation, config] = this.getAnimationAndConfig();
|
|
25
26
|
const delay = this.getDelay();
|
|
26
27
|
const callback = this.callbackV;
|
|
28
|
+
const initialValues = this.initialValues;
|
|
27
29
|
|
|
28
30
|
return () => {
|
|
29
31
|
'worklet';
|
|
@@ -33,6 +35,7 @@ export class ZoomIn
|
|
|
33
35
|
},
|
|
34
36
|
initialValues: {
|
|
35
37
|
transform: [{ scale: 0 }],
|
|
38
|
+
...initialValues,
|
|
36
39
|
},
|
|
37
40
|
callback: callback,
|
|
38
41
|
};
|
|
@@ -42,7 +45,8 @@ export class ZoomIn
|
|
|
42
45
|
|
|
43
46
|
export class ZoomInRotate
|
|
44
47
|
extends ComplexAnimationBuilder
|
|
45
|
-
implements IEntryExitAnimationBuilder
|
|
48
|
+
implements IEntryExitAnimationBuilder
|
|
49
|
+
{
|
|
46
50
|
static createInstance(): ZoomInRotate {
|
|
47
51
|
return new ZoomInRotate();
|
|
48
52
|
}
|
|
@@ -53,6 +57,7 @@ export class ZoomInRotate
|
|
|
53
57
|
const delay = this.getDelay();
|
|
54
58
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
55
59
|
const callback = this.callbackV;
|
|
60
|
+
const initialValues = this.initialValues;
|
|
56
61
|
|
|
57
62
|
return () => {
|
|
58
63
|
'worklet';
|
|
@@ -65,6 +70,7 @@ export class ZoomInRotate
|
|
|
65
70
|
},
|
|
66
71
|
initialValues: {
|
|
67
72
|
transform: [{ scale: 0 }, { rotate: rotate }],
|
|
73
|
+
...initialValues,
|
|
68
74
|
},
|
|
69
75
|
callback: callback,
|
|
70
76
|
};
|
|
@@ -74,7 +80,8 @@ export class ZoomInRotate
|
|
|
74
80
|
|
|
75
81
|
export class ZoomInLeft
|
|
76
82
|
extends ComplexAnimationBuilder
|
|
77
|
-
implements IEntryExitAnimationBuilder
|
|
83
|
+
implements IEntryExitAnimationBuilder
|
|
84
|
+
{
|
|
78
85
|
static createInstance(): ZoomInLeft {
|
|
79
86
|
return new ZoomInLeft();
|
|
80
87
|
}
|
|
@@ -84,6 +91,7 @@ export class ZoomInLeft
|
|
|
84
91
|
const [animation, config] = this.getAnimationAndConfig();
|
|
85
92
|
const delay = this.getDelay();
|
|
86
93
|
const callback = this.callbackV;
|
|
94
|
+
const initialValues = this.initialValues;
|
|
87
95
|
|
|
88
96
|
return () => {
|
|
89
97
|
'worklet';
|
|
@@ -96,6 +104,7 @@ export class ZoomInLeft
|
|
|
96
104
|
},
|
|
97
105
|
initialValues: {
|
|
98
106
|
transform: [{ translateX: -width }, { scale: 0 }],
|
|
107
|
+
...initialValues,
|
|
99
108
|
},
|
|
100
109
|
callback: callback,
|
|
101
110
|
};
|
|
@@ -105,7 +114,8 @@ export class ZoomInLeft
|
|
|
105
114
|
|
|
106
115
|
export class ZoomInRight
|
|
107
116
|
extends ComplexAnimationBuilder
|
|
108
|
-
implements IEntryExitAnimationBuilder
|
|
117
|
+
implements IEntryExitAnimationBuilder
|
|
118
|
+
{
|
|
109
119
|
static createInstance(): ZoomInRight {
|
|
110
120
|
return new ZoomInRight();
|
|
111
121
|
}
|
|
@@ -115,6 +125,7 @@ export class ZoomInRight
|
|
|
115
125
|
const [animation, config] = this.getAnimationAndConfig();
|
|
116
126
|
const delay = this.getDelay();
|
|
117
127
|
const callback = this.callbackV;
|
|
128
|
+
const initialValues = this.initialValues;
|
|
118
129
|
|
|
119
130
|
return () => {
|
|
120
131
|
'worklet';
|
|
@@ -127,6 +138,7 @@ export class ZoomInRight
|
|
|
127
138
|
},
|
|
128
139
|
initialValues: {
|
|
129
140
|
transform: [{ translateX: width }, { scale: 0 }],
|
|
141
|
+
...initialValues,
|
|
130
142
|
},
|
|
131
143
|
callback: callback,
|
|
132
144
|
};
|
|
@@ -136,7 +148,8 @@ export class ZoomInRight
|
|
|
136
148
|
|
|
137
149
|
export class ZoomInUp
|
|
138
150
|
extends ComplexAnimationBuilder
|
|
139
|
-
implements IEntryExitAnimationBuilder
|
|
151
|
+
implements IEntryExitAnimationBuilder
|
|
152
|
+
{
|
|
140
153
|
static createInstance(): ZoomInUp {
|
|
141
154
|
return new ZoomInUp();
|
|
142
155
|
}
|
|
@@ -146,6 +159,7 @@ export class ZoomInUp
|
|
|
146
159
|
const [animation, config] = this.getAnimationAndConfig();
|
|
147
160
|
const delay = this.getDelay();
|
|
148
161
|
const callback = this.callbackV;
|
|
162
|
+
const initialValues = this.initialValues;
|
|
149
163
|
|
|
150
164
|
return () => {
|
|
151
165
|
'worklet';
|
|
@@ -158,6 +172,7 @@ export class ZoomInUp
|
|
|
158
172
|
},
|
|
159
173
|
initialValues: {
|
|
160
174
|
transform: [{ translateY: -height }, { scale: 0 }],
|
|
175
|
+
...initialValues,
|
|
161
176
|
},
|
|
162
177
|
callback: callback,
|
|
163
178
|
};
|
|
@@ -167,7 +182,8 @@ export class ZoomInUp
|
|
|
167
182
|
|
|
168
183
|
export class ZoomInDown
|
|
169
184
|
extends ComplexAnimationBuilder
|
|
170
|
-
implements IEntryExitAnimationBuilder
|
|
185
|
+
implements IEntryExitAnimationBuilder
|
|
186
|
+
{
|
|
171
187
|
static createInstance(): ZoomInDown {
|
|
172
188
|
return new ZoomInDown();
|
|
173
189
|
}
|
|
@@ -177,6 +193,7 @@ export class ZoomInDown
|
|
|
177
193
|
const [animation, config] = this.getAnimationAndConfig();
|
|
178
194
|
const delay = this.getDelay();
|
|
179
195
|
const callback = this.callbackV;
|
|
196
|
+
const initialValues = this.initialValues;
|
|
180
197
|
|
|
181
198
|
return () => {
|
|
182
199
|
'worklet';
|
|
@@ -189,6 +206,7 @@ export class ZoomInDown
|
|
|
189
206
|
},
|
|
190
207
|
initialValues: {
|
|
191
208
|
transform: [{ translateY: height }, { scale: 0 }],
|
|
209
|
+
...initialValues,
|
|
192
210
|
},
|
|
193
211
|
callback: callback,
|
|
194
212
|
};
|
|
@@ -198,7 +216,8 @@ export class ZoomInDown
|
|
|
198
216
|
|
|
199
217
|
export class ZoomInEasyUp
|
|
200
218
|
extends ComplexAnimationBuilder
|
|
201
|
-
implements IEntryAnimationBuilder
|
|
219
|
+
implements IEntryAnimationBuilder
|
|
220
|
+
{
|
|
202
221
|
static createInstance(): ZoomInEasyUp {
|
|
203
222
|
return new ZoomInEasyUp();
|
|
204
223
|
}
|
|
@@ -208,6 +227,7 @@ export class ZoomInEasyUp
|
|
|
208
227
|
const [animation, config] = this.getAnimationAndConfig();
|
|
209
228
|
const delay = this.getDelay();
|
|
210
229
|
const callback = this.callbackV;
|
|
230
|
+
const initialValues = this.initialValues;
|
|
211
231
|
|
|
212
232
|
return (values) => {
|
|
213
233
|
'worklet';
|
|
@@ -220,6 +240,7 @@ export class ZoomInEasyUp
|
|
|
220
240
|
},
|
|
221
241
|
initialValues: {
|
|
222
242
|
transform: [{ translateY: -values.targetHeight }, { scale: 0 }],
|
|
243
|
+
...initialValues,
|
|
223
244
|
},
|
|
224
245
|
callback: callback,
|
|
225
246
|
};
|
|
@@ -229,7 +250,8 @@ export class ZoomInEasyUp
|
|
|
229
250
|
|
|
230
251
|
export class ZoomInEasyDown
|
|
231
252
|
extends ComplexAnimationBuilder
|
|
232
|
-
implements IEntryAnimationBuilder
|
|
253
|
+
implements IEntryAnimationBuilder
|
|
254
|
+
{
|
|
233
255
|
static createInstance(): ZoomInEasyDown {
|
|
234
256
|
return new ZoomInEasyDown();
|
|
235
257
|
}
|
|
@@ -239,6 +261,7 @@ export class ZoomInEasyDown
|
|
|
239
261
|
const [animation, config] = this.getAnimationAndConfig();
|
|
240
262
|
const delay = this.getDelay();
|
|
241
263
|
const callback = this.callbackV;
|
|
264
|
+
const initialValues = this.initialValues;
|
|
242
265
|
|
|
243
266
|
return (values) => {
|
|
244
267
|
'worklet';
|
|
@@ -251,6 +274,7 @@ export class ZoomInEasyDown
|
|
|
251
274
|
},
|
|
252
275
|
initialValues: {
|
|
253
276
|
transform: [{ translateY: values.targetHeight }, { scale: 0 }],
|
|
277
|
+
...initialValues,
|
|
254
278
|
},
|
|
255
279
|
callback: callback,
|
|
256
280
|
};
|
|
@@ -260,7 +284,8 @@ export class ZoomInEasyDown
|
|
|
260
284
|
|
|
261
285
|
export class ZoomOut
|
|
262
286
|
extends ComplexAnimationBuilder
|
|
263
|
-
implements IEntryExitAnimationBuilder
|
|
287
|
+
implements IEntryExitAnimationBuilder
|
|
288
|
+
{
|
|
264
289
|
static createInstance(): ZoomOut {
|
|
265
290
|
return new ZoomOut();
|
|
266
291
|
}
|
|
@@ -270,6 +295,7 @@ export class ZoomOut
|
|
|
270
295
|
const [animation, config] = this.getAnimationAndConfig();
|
|
271
296
|
const delay = this.getDelay();
|
|
272
297
|
const callback = this.callbackV;
|
|
298
|
+
const initialValues = this.initialValues;
|
|
273
299
|
|
|
274
300
|
return () => {
|
|
275
301
|
'worklet';
|
|
@@ -279,6 +305,7 @@ export class ZoomOut
|
|
|
279
305
|
},
|
|
280
306
|
initialValues: {
|
|
281
307
|
transform: [{ scale: 1 }],
|
|
308
|
+
...initialValues,
|
|
282
309
|
},
|
|
283
310
|
callback: callback,
|
|
284
311
|
};
|
|
@@ -288,7 +315,8 @@ export class ZoomOut
|
|
|
288
315
|
|
|
289
316
|
export class ZoomOutRotate
|
|
290
317
|
extends ComplexAnimationBuilder
|
|
291
|
-
implements IEntryExitAnimationBuilder
|
|
318
|
+
implements IEntryExitAnimationBuilder
|
|
319
|
+
{
|
|
292
320
|
static createInstance(): ZoomOutRotate {
|
|
293
321
|
return new ZoomOutRotate();
|
|
294
322
|
}
|
|
@@ -299,6 +327,7 @@ export class ZoomOutRotate
|
|
|
299
327
|
const delay = this.getDelay();
|
|
300
328
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
301
329
|
const callback = this.callbackV;
|
|
330
|
+
const initialValues = this.initialValues;
|
|
302
331
|
|
|
303
332
|
return () => {
|
|
304
333
|
'worklet';
|
|
@@ -311,6 +340,7 @@ export class ZoomOutRotate
|
|
|
311
340
|
},
|
|
312
341
|
initialValues: {
|
|
313
342
|
transform: [{ scale: 1 }, { rotate: '0' }],
|
|
343
|
+
...initialValues,
|
|
314
344
|
},
|
|
315
345
|
callback: callback,
|
|
316
346
|
};
|
|
@@ -320,7 +350,8 @@ export class ZoomOutRotate
|
|
|
320
350
|
|
|
321
351
|
export class ZoomOutLeft
|
|
322
352
|
extends ComplexAnimationBuilder
|
|
323
|
-
implements IEntryExitAnimationBuilder
|
|
353
|
+
implements IEntryExitAnimationBuilder
|
|
354
|
+
{
|
|
324
355
|
static createInstance(): ZoomOutLeft {
|
|
325
356
|
return new ZoomOutLeft();
|
|
326
357
|
}
|
|
@@ -330,6 +361,7 @@ export class ZoomOutLeft
|
|
|
330
361
|
const [animation, config] = this.getAnimationAndConfig();
|
|
331
362
|
const delay = this.getDelay();
|
|
332
363
|
const callback = this.callbackV;
|
|
364
|
+
const initialValues = this.initialValues;
|
|
333
365
|
|
|
334
366
|
return () => {
|
|
335
367
|
'worklet';
|
|
@@ -342,6 +374,7 @@ export class ZoomOutLeft
|
|
|
342
374
|
},
|
|
343
375
|
initialValues: {
|
|
344
376
|
transform: [{ translateX: 0 }, { scale: 1 }],
|
|
377
|
+
...initialValues,
|
|
345
378
|
},
|
|
346
379
|
callback: callback,
|
|
347
380
|
};
|
|
@@ -351,7 +384,8 @@ export class ZoomOutLeft
|
|
|
351
384
|
|
|
352
385
|
export class ZoomOutRight
|
|
353
386
|
extends ComplexAnimationBuilder
|
|
354
|
-
implements IEntryExitAnimationBuilder
|
|
387
|
+
implements IEntryExitAnimationBuilder
|
|
388
|
+
{
|
|
355
389
|
static createInstance(): ZoomOutRight {
|
|
356
390
|
return new ZoomOutRight();
|
|
357
391
|
}
|
|
@@ -361,6 +395,7 @@ export class ZoomOutRight
|
|
|
361
395
|
const [animation, config] = this.getAnimationAndConfig();
|
|
362
396
|
const delay = this.getDelay();
|
|
363
397
|
const callback = this.callbackV;
|
|
398
|
+
const initialValues = this.initialValues;
|
|
364
399
|
|
|
365
400
|
return () => {
|
|
366
401
|
'worklet';
|
|
@@ -373,6 +408,7 @@ export class ZoomOutRight
|
|
|
373
408
|
},
|
|
374
409
|
initialValues: {
|
|
375
410
|
transform: [{ translateX: 0 }, { scale: 1 }],
|
|
411
|
+
...initialValues,
|
|
376
412
|
},
|
|
377
413
|
callback: callback,
|
|
378
414
|
};
|
|
@@ -382,7 +418,8 @@ export class ZoomOutRight
|
|
|
382
418
|
|
|
383
419
|
export class ZoomOutUp
|
|
384
420
|
extends ComplexAnimationBuilder
|
|
385
|
-
implements IEntryExitAnimationBuilder
|
|
421
|
+
implements IEntryExitAnimationBuilder
|
|
422
|
+
{
|
|
386
423
|
static createInstance(): ZoomOutUp {
|
|
387
424
|
return new ZoomOutUp();
|
|
388
425
|
}
|
|
@@ -392,6 +429,7 @@ export class ZoomOutUp
|
|
|
392
429
|
const [animation, config] = this.getAnimationAndConfig();
|
|
393
430
|
const delay = this.getDelay();
|
|
394
431
|
const callback = this.callbackV;
|
|
432
|
+
const initialValues = this.initialValues;
|
|
395
433
|
|
|
396
434
|
return () => {
|
|
397
435
|
'worklet';
|
|
@@ -404,6 +442,7 @@ export class ZoomOutUp
|
|
|
404
442
|
},
|
|
405
443
|
initialValues: {
|
|
406
444
|
transform: [{ translateY: 0 }, { scale: 1 }],
|
|
445
|
+
...initialValues,
|
|
407
446
|
},
|
|
408
447
|
callback: callback,
|
|
409
448
|
};
|
|
@@ -413,7 +452,8 @@ export class ZoomOutUp
|
|
|
413
452
|
|
|
414
453
|
export class ZoomOutDown
|
|
415
454
|
extends ComplexAnimationBuilder
|
|
416
|
-
implements IEntryExitAnimationBuilder
|
|
455
|
+
implements IEntryExitAnimationBuilder
|
|
456
|
+
{
|
|
417
457
|
static createInstance(): ZoomOutDown {
|
|
418
458
|
return new ZoomOutDown();
|
|
419
459
|
}
|
|
@@ -423,6 +463,7 @@ export class ZoomOutDown
|
|
|
423
463
|
const [animation, config] = this.getAnimationAndConfig();
|
|
424
464
|
const delay = this.getDelay();
|
|
425
465
|
const callback = this.callbackV;
|
|
466
|
+
const initialValues = this.initialValues;
|
|
426
467
|
|
|
427
468
|
return () => {
|
|
428
469
|
'worklet';
|
|
@@ -435,6 +476,7 @@ export class ZoomOutDown
|
|
|
435
476
|
},
|
|
436
477
|
initialValues: {
|
|
437
478
|
transform: [{ translateY: 0 }, { scale: 1 }],
|
|
479
|
+
...initialValues,
|
|
438
480
|
},
|
|
439
481
|
callback: callback,
|
|
440
482
|
};
|
|
@@ -444,7 +486,8 @@ export class ZoomOutDown
|
|
|
444
486
|
|
|
445
487
|
export class ZoomOutEasyUp
|
|
446
488
|
extends ComplexAnimationBuilder
|
|
447
|
-
implements IExitAnimationBuilder
|
|
489
|
+
implements IExitAnimationBuilder
|
|
490
|
+
{
|
|
448
491
|
static createInstance(): ZoomOutEasyUp {
|
|
449
492
|
return new ZoomOutEasyUp();
|
|
450
493
|
}
|
|
@@ -454,6 +497,7 @@ export class ZoomOutEasyUp
|
|
|
454
497
|
const [animation, config] = this.getAnimationAndConfig();
|
|
455
498
|
const delay = this.getDelay();
|
|
456
499
|
const callback = this.callbackV;
|
|
500
|
+
const initialValues = this.initialValues;
|
|
457
501
|
|
|
458
502
|
return (values) => {
|
|
459
503
|
'worklet';
|
|
@@ -471,6 +515,7 @@ export class ZoomOutEasyUp
|
|
|
471
515
|
},
|
|
472
516
|
initialValues: {
|
|
473
517
|
transform: [{ translateY: 0 }, { scale: 1 }],
|
|
518
|
+
...initialValues,
|
|
474
519
|
},
|
|
475
520
|
callback: callback,
|
|
476
521
|
};
|
|
@@ -480,7 +525,8 @@ export class ZoomOutEasyUp
|
|
|
480
525
|
|
|
481
526
|
export class ZoomOutEasyDown
|
|
482
527
|
extends ComplexAnimationBuilder
|
|
483
|
-
implements IExitAnimationBuilder
|
|
528
|
+
implements IExitAnimationBuilder
|
|
529
|
+
{
|
|
484
530
|
static createInstance(): ZoomOutEasyDown {
|
|
485
531
|
return new ZoomOutEasyDown();
|
|
486
532
|
}
|
|
@@ -490,6 +536,7 @@ export class ZoomOutEasyDown
|
|
|
490
536
|
const [animation, config] = this.getAnimationAndConfig();
|
|
491
537
|
const delay = this.getDelay();
|
|
492
538
|
const callback = this.callbackV;
|
|
539
|
+
const initialValues = this.initialValues;
|
|
493
540
|
|
|
494
541
|
return (values) => {
|
|
495
542
|
'worklet';
|
|
@@ -507,6 +554,7 @@ export class ZoomOutEasyDown
|
|
|
507
554
|
},
|
|
508
555
|
initialValues: {
|
|
509
556
|
transform: [{ translateY: 0 }, { scale: 1 }],
|
|
557
|
+
...initialValues,
|
|
510
558
|
},
|
|
511
559
|
callback: callback,
|
|
512
560
|
};
|
|
@@ -8,7 +8,8 @@ import { withTiming } from '../../animation';
|
|
|
8
8
|
|
|
9
9
|
export class CurvedTransition
|
|
10
10
|
extends BaseAnimationBuilder
|
|
11
|
-
implements ILayoutAnimationBuilder
|
|
11
|
+
implements ILayoutAnimationBuilder
|
|
12
|
+
{
|
|
12
13
|
easingXV: EasingFn = Easing.in(Easing.ease);
|
|
13
14
|
easingYV: EasingFn = Easing.out(Easing.ease);
|
|
14
15
|
easingWidthV: EasingFn = Easing.in(Easing.exp);
|
|
@@ -4,13 +4,18 @@ import {
|
|
|
4
4
|
LayoutAnimationFunction,
|
|
5
5
|
} from '../animationBuilder/commonTypes';
|
|
6
6
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
7
|
-
import {
|
|
7
|
+
import { withSequence, withTiming } from '../../animation';
|
|
8
8
|
import { FadeIn, FadeOut } from '../defaultAnimations/Fade';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
StyleProps,
|
|
11
|
+
TransformProperty,
|
|
12
|
+
AnimationObject,
|
|
13
|
+
} from '../../commonTypes';
|
|
10
14
|
|
|
11
15
|
export class EntryExitTransition
|
|
12
16
|
extends BaseAnimationBuilder
|
|
13
|
-
implements ILayoutAnimationBuilder
|
|
17
|
+
implements ILayoutAnimationBuilder
|
|
18
|
+
{
|
|
14
19
|
enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;
|
|
15
20
|
|
|
16
21
|
exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;
|
|
@@ -148,24 +153,30 @@ export class EntryExitTransition
|
|
|
148
153
|
exitingValues.initialValues.transform ?? []
|
|
149
154
|
).concat(
|
|
150
155
|
(enteringValues.animations.transform ?? []).map((value) => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
const objectKeys = Object.keys(value);
|
|
157
|
+
if (objectKeys?.length < 1) {
|
|
158
|
+
console.error(
|
|
159
|
+
`[Reanimated]: \${value} is not a valid Transform object`
|
|
160
|
+
);
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
const transformProp = objectKeys[0];
|
|
164
|
+
const current = (
|
|
165
|
+
value[transformProp as keyof TransformProperty] as AnimationObject
|
|
166
|
+
).current;
|
|
167
|
+
if (typeof current === 'string') {
|
|
168
|
+
if (current.includes('deg'))
|
|
169
|
+
return {
|
|
170
|
+
[transformProp]: '0deg',
|
|
171
|
+
} as unknown as TransformProperty;
|
|
172
|
+
else
|
|
173
|
+
return {
|
|
174
|
+
[transformProp]: '0',
|
|
175
|
+
} as unknown as TransformProperty;
|
|
176
|
+
} else if (transformProp.includes('translate')) {
|
|
177
|
+
return { [transformProp]: 0 } as unknown as TransformProperty;
|
|
178
|
+
} else {
|
|
179
|
+
return { [transformProp]: 1 } as unknown as TransformProperty;
|
|
169
180
|
}
|
|
170
181
|
return value;
|
|
171
182
|
})
|
|
@@ -7,7 +7,8 @@ import { BaseAnimationBuilder } from '../animationBuilder';
|
|
|
7
7
|
|
|
8
8
|
export class FadingTransition
|
|
9
9
|
extends BaseAnimationBuilder
|
|
10
|
-
implements ILayoutAnimationBuilder
|
|
10
|
+
implements ILayoutAnimationBuilder
|
|
11
|
+
{
|
|
11
12
|
static createInstance(): FadingTransition {
|
|
12
13
|
return new FadingTransition();
|
|
13
14
|
}
|
|
@@ -7,7 +7,8 @@ import { Easing } from '../../Easing';
|
|
|
7
7
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
8
8
|
export class JumpingTransition
|
|
9
9
|
extends BaseAnimationBuilder
|
|
10
|
-
implements ILayoutAnimationBuilder
|
|
10
|
+
implements ILayoutAnimationBuilder
|
|
11
|
+
{
|
|
11
12
|
static createInstance(): JumpingTransition {
|
|
12
13
|
return new JumpingTransition();
|
|
13
14
|
}
|
|
@@ -7,7 +7,8 @@ import { BaseAnimationBuilder } from '../animationBuilder';
|
|
|
7
7
|
|
|
8
8
|
export class SequencedTransition
|
|
9
9
|
extends BaseAnimationBuilder
|
|
10
|
-
implements ILayoutAnimationBuilder
|
|
10
|
+
implements ILayoutAnimationBuilder
|
|
11
|
+
{
|
|
11
12
|
reversed = false;
|
|
12
13
|
|
|
13
14
|
static createInstance(): SequencedTransition {
|
package/src/reanimated2/mock.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable node/no-callback-literal */
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
const NOOP = () => {
|
|
@@ -59,7 +59,8 @@ const ReanimatedV2 = {
|
|
|
59
59
|
elastic: ID,
|
|
60
60
|
back: ID,
|
|
61
61
|
bounce: ID,
|
|
62
|
-
bezier: ID,
|
|
62
|
+
bezier: () => ({ factory: ID }),
|
|
63
|
+
bezierFn: ID,
|
|
63
64
|
in: ID,
|
|
64
65
|
out: ID,
|
|
65
66
|
inOut: ID,
|
package/src/reanimated2/utils.ts
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package com.swmansion.reanimated;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactPackage;
|
|
4
|
-
import com.facebook.react.bridge.NativeModule;
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
7
|
-
|
|
8
|
-
import java.util.Arrays;
|
|
9
|
-
import java.util.List;
|
|
10
|
-
|
|
11
|
-
import com.swmansion.reanimated.ReanimatedPackage;
|
|
12
|
-
|
|
13
|
-
public class ReanimatedPackage implements ReactPackage {
|
|
14
|
-
// dummy package
|
|
15
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|