react-native-reanimated 2.13.0 → 2.14.1
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/Tools/ReanimatedVersion.cpp +17 -0
- package/Common/cpp/Tools/ReanimatedVersion.h +11 -0
- package/RNReanimated.podspec +2 -1
- package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/CMakeLists.txt +191 -188
- package/android/build.gradle +386 -316
- 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/react-native-reanimated-69-hermes.aar +0 -0
- package/android/react-native-reanimated-69-jsc.aar +0 -0
- package/android/react-native-reanimated-70-hermes.aar +0 -0
- package/android/react-native-reanimated-70-jsc.aar +0 -0
- package/android/react-native-reanimated-71-hermes.aar +0 -0
- package/android/react-native-reanimated-71-jsc.aar +0 -0
- package/android/src/main/cpp/NativeProxy.cpp +8 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +5 -4
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +1 -1
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +16 -0
- package/android/src/{main/java → reactNativeVersionPatch/ReanimatedUIManager/70}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +63 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +271 -0
- package/android/src/reactNativeVersionPatch/nativeHierarchyManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +3 -30
- package/ios/REAModule.mm +2 -0
- package/ios/native/REAInitializer.mm +4 -0
- package/lib/createAnimatedComponent.js +6 -1
- package/lib/reanimated2/Colors.js +27 -11
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +4 -0
- package/lib/reanimated2/animation/util.js +15 -15
- package/lib/reanimated2/globals.d.ts +2 -0
- package/lib/reanimated2/interpolateColor.js +79 -20
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +16 -18
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -10
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +15 -10
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +8 -10
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +24 -18
- package/lib/reanimated2/platform-specific/checkVersion.js +24 -0
- package/lib/reanimated2/platform-specific/checkVersion.web.js +6 -0
- package/lib/types/{Animated.d.ts → lib/Animated.d.ts} +0 -0
- package/lib/types/{ConfigHelper.d.ts → lib/ConfigHelper.d.ts} +0 -0
- package/lib/types/{ReanimatedEventEmitter.d.ts → lib/ReanimatedEventEmitter.d.ts} +0 -0
- package/lib/types/{ReanimatedModule.d.ts → lib/ReanimatedModule.d.ts} +0 -0
- package/lib/types/{ReanimatedModule.macos.d.ts → lib/ReanimatedModule.macos.d.ts} +0 -0
- package/lib/types/{ReanimatedModule.native.d.ts → lib/ReanimatedModule.native.d.ts} +0 -0
- package/lib/types/{ReanimatedModule.windows.d.ts → lib/ReanimatedModule.windows.d.ts} +0 -0
- package/lib/types/{ReanimatedModuleCompat.d.ts → lib/ReanimatedModuleCompat.d.ts} +0 -0
- package/lib/types/{createAnimatedComponent.d.ts → lib/createAnimatedComponent.d.ts} +0 -0
- package/lib/types/{index.d.ts → lib/index.d.ts} +0 -0
- package/lib/types/{index.web.d.ts → lib/index.web.d.ts} +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/Bezier.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/Colors.d.ts +5 -3
- package/lib/types/{reanimated2 → lib/reanimated2}/Easing.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/NativeMethods.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/NativeReanimated.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/PlatformChecker.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/PropAdapters.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/UpdateProps.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/ViewDescriptorsSet.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/WorkletEventHandler.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/MutableValue.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/commonTypes.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/decay.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/delay.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/repeat.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/sequence.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/spring.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/styleAnimation.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/timing.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/animation/util.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/commonTypes.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/component/FlatList.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/component/Image.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/component/ScrollView.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/component/Text.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/component/View.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/core.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryJS.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryUI.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/Hooks.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/commonTypes.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedKeyboard.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedRef.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedScrollHandler.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedSensor.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useDerivedValue.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useFrameCallback.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useScrollViewOffset.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/useSharedValue.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/hook/utils.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/interpolateColor.d.ts +8 -2
- package/lib/types/{reanimated2 → lib/reanimated2}/interpolation.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/jestUtils.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/JSReanimated.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/Mapper.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/global.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +4 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/index.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/mock.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/platform-specific/checkVersion.d.ts +4 -0
- package/lib/types/lib/reanimated2/platform-specific/checkVersion.web.d.ts +5 -0
- package/lib/types/{reanimated2 → lib/reanimated2}/utils.d.ts +0 -0
- package/lib/types/{setAndForwardRef.d.ts → lib/setAndForwardRef.d.ts} +0 -0
- package/package.json +6 -6
- package/plugin.js +7 -3
- package/react-native-reanimated.d.ts +11 -2
- package/scripts/reanimated_utils.rb +7 -3
- package/src/createAnimatedComponent.tsx +8 -1
- package/src/reanimated2/Colors.ts +38 -11
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
- package/src/reanimated2/animation/util.ts +26 -15
- package/src/reanimated2/globals.d.ts +2 -0
- package/src/reanimated2/interpolateColor.ts +105 -21
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +4 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +16 -19
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +14 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +21 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +36 -19
- package/src/reanimated2/platform-specific/checkVersion.ts +28 -0
- package/src/reanimated2/platform-specific/checkVersion.web.ts +6 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
2
1
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
3
|
-
const { width, height } = Dimensions.get('window');
|
|
4
2
|
export class ZoomIn extends ComplexAnimationBuilder {
|
|
5
3
|
constructor() {
|
|
6
4
|
super(...arguments);
|
|
@@ -64,7 +62,7 @@ export class ZoomInLeft extends ComplexAnimationBuilder {
|
|
|
64
62
|
const delay = this.getDelay();
|
|
65
63
|
const callback = this.callbackV;
|
|
66
64
|
const initialValues = this.initialValues;
|
|
67
|
-
return () => {
|
|
65
|
+
return (values) => {
|
|
68
66
|
'worklet';
|
|
69
67
|
return {
|
|
70
68
|
animations: {
|
|
@@ -73,7 +71,7 @@ export class ZoomInLeft extends ComplexAnimationBuilder {
|
|
|
73
71
|
{ scale: delayFunction(delay, animation(1, config)) },
|
|
74
72
|
],
|
|
75
73
|
},
|
|
76
|
-
initialValues: Object.assign({ transform: [{ translateX: -
|
|
74
|
+
initialValues: Object.assign({ transform: [{ translateX: -values.windowWidth }, { scale: 0 }] }, initialValues),
|
|
77
75
|
callback: callback,
|
|
78
76
|
};
|
|
79
77
|
};
|
|
@@ -92,7 +90,7 @@ export class ZoomInRight extends ComplexAnimationBuilder {
|
|
|
92
90
|
const delay = this.getDelay();
|
|
93
91
|
const callback = this.callbackV;
|
|
94
92
|
const initialValues = this.initialValues;
|
|
95
|
-
return () => {
|
|
93
|
+
return (values) => {
|
|
96
94
|
'worklet';
|
|
97
95
|
return {
|
|
98
96
|
animations: {
|
|
@@ -101,7 +99,7 @@ export class ZoomInRight extends ComplexAnimationBuilder {
|
|
|
101
99
|
{ scale: delayFunction(delay, animation(1, config)) },
|
|
102
100
|
],
|
|
103
101
|
},
|
|
104
|
-
initialValues: Object.assign({ transform: [{ translateX:
|
|
102
|
+
initialValues: Object.assign({ transform: [{ translateX: values.windowWidth }, { scale: 0 }] }, initialValues),
|
|
105
103
|
callback: callback,
|
|
106
104
|
};
|
|
107
105
|
};
|
|
@@ -120,7 +118,7 @@ export class ZoomInUp extends ComplexAnimationBuilder {
|
|
|
120
118
|
const delay = this.getDelay();
|
|
121
119
|
const callback = this.callbackV;
|
|
122
120
|
const initialValues = this.initialValues;
|
|
123
|
-
return () => {
|
|
121
|
+
return (values) => {
|
|
124
122
|
'worklet';
|
|
125
123
|
return {
|
|
126
124
|
animations: {
|
|
@@ -129,7 +127,7 @@ export class ZoomInUp extends ComplexAnimationBuilder {
|
|
|
129
127
|
{ scale: delayFunction(delay, animation(1, config)) },
|
|
130
128
|
],
|
|
131
129
|
},
|
|
132
|
-
initialValues: Object.assign({ transform: [{ translateY: -
|
|
130
|
+
initialValues: Object.assign({ transform: [{ translateY: -values.windowHeight }, { scale: 0 }] }, initialValues),
|
|
133
131
|
callback: callback,
|
|
134
132
|
};
|
|
135
133
|
};
|
|
@@ -148,7 +146,7 @@ export class ZoomInDown extends ComplexAnimationBuilder {
|
|
|
148
146
|
const delay = this.getDelay();
|
|
149
147
|
const callback = this.callbackV;
|
|
150
148
|
const initialValues = this.initialValues;
|
|
151
|
-
return () => {
|
|
149
|
+
return (values) => {
|
|
152
150
|
'worklet';
|
|
153
151
|
return {
|
|
154
152
|
animations: {
|
|
@@ -157,7 +155,7 @@ export class ZoomInDown extends ComplexAnimationBuilder {
|
|
|
157
155
|
{ scale: delayFunction(delay, animation(1, config)) },
|
|
158
156
|
],
|
|
159
157
|
},
|
|
160
|
-
initialValues: Object.assign({ transform: [{ translateY:
|
|
158
|
+
initialValues: Object.assign({ transform: [{ translateY: values.windowHeight }, { scale: 0 }] }, initialValues),
|
|
161
159
|
callback: callback,
|
|
162
160
|
};
|
|
163
161
|
};
|
|
@@ -286,12 +284,14 @@ export class ZoomOutLeft extends ComplexAnimationBuilder {
|
|
|
286
284
|
const delay = this.getDelay();
|
|
287
285
|
const callback = this.callbackV;
|
|
288
286
|
const initialValues = this.initialValues;
|
|
289
|
-
return () => {
|
|
287
|
+
return (values) => {
|
|
290
288
|
'worklet';
|
|
291
289
|
return {
|
|
292
290
|
animations: {
|
|
293
291
|
transform: [
|
|
294
|
-
{
|
|
292
|
+
{
|
|
293
|
+
translateX: delayFunction(delay, animation(-values.windowWidth, config)),
|
|
294
|
+
},
|
|
295
295
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
296
296
|
],
|
|
297
297
|
},
|
|
@@ -314,12 +314,14 @@ export class ZoomOutRight extends ComplexAnimationBuilder {
|
|
|
314
314
|
const delay = this.getDelay();
|
|
315
315
|
const callback = this.callbackV;
|
|
316
316
|
const initialValues = this.initialValues;
|
|
317
|
-
return () => {
|
|
317
|
+
return (values) => {
|
|
318
318
|
'worklet';
|
|
319
319
|
return {
|
|
320
320
|
animations: {
|
|
321
321
|
transform: [
|
|
322
|
-
{
|
|
322
|
+
{
|
|
323
|
+
translateX: delayFunction(delay, animation(values.windowWidth, config)),
|
|
324
|
+
},
|
|
323
325
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
324
326
|
],
|
|
325
327
|
},
|
|
@@ -342,12 +344,14 @@ export class ZoomOutUp extends ComplexAnimationBuilder {
|
|
|
342
344
|
const delay = this.getDelay();
|
|
343
345
|
const callback = this.callbackV;
|
|
344
346
|
const initialValues = this.initialValues;
|
|
345
|
-
return () => {
|
|
347
|
+
return (values) => {
|
|
346
348
|
'worklet';
|
|
347
349
|
return {
|
|
348
350
|
animations: {
|
|
349
351
|
transform: [
|
|
350
|
-
{
|
|
352
|
+
{
|
|
353
|
+
translateY: delayFunction(delay, animation(-values.windowHeight, config)),
|
|
354
|
+
},
|
|
351
355
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
352
356
|
],
|
|
353
357
|
},
|
|
@@ -370,12 +374,14 @@ export class ZoomOutDown extends ComplexAnimationBuilder {
|
|
|
370
374
|
const delay = this.getDelay();
|
|
371
375
|
const callback = this.callbackV;
|
|
372
376
|
const initialValues = this.initialValues;
|
|
373
|
-
return () => {
|
|
377
|
+
return (values) => {
|
|
374
378
|
'worklet';
|
|
375
379
|
return {
|
|
376
380
|
animations: {
|
|
377
381
|
transform: [
|
|
378
|
-
{
|
|
382
|
+
{
|
|
383
|
+
translateY: delayFunction(delay, animation(values.windowHeight, config)),
|
|
384
|
+
},
|
|
379
385
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
380
386
|
],
|
|
381
387
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { version as jsVersion } from '../../../package.json';
|
|
2
|
+
/**
|
|
3
|
+
* Checks that native and js versions of reanimated match.
|
|
4
|
+
*/
|
|
5
|
+
export function checkVersion() {
|
|
6
|
+
const cppVersion = global._REANIMATED_VERSION_CPP;
|
|
7
|
+
const ok = (() => {
|
|
8
|
+
if (jsVersion.match(/^\d+\.\d+\.\d+$/) &&
|
|
9
|
+
cppVersion.match(/^\d+\.\d+\.\d+$/)) {
|
|
10
|
+
// x.y.z, compare only major and minor, skip patch
|
|
11
|
+
const [jsMajor, jsMinor] = jsVersion.split('.');
|
|
12
|
+
const [cppMajor, cppMinor] = cppVersion.split('.');
|
|
13
|
+
return jsMajor === cppMajor && jsMinor === cppMinor;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
// alpha, beta or rc, compare everything
|
|
17
|
+
return jsVersion === cppVersion;
|
|
18
|
+
}
|
|
19
|
+
})();
|
|
20
|
+
if (!ok) {
|
|
21
|
+
console.error(`[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs. ${cppVersion}). Did you forget to re-build the app after upgrading react-native-reanimated? If you use Expo Go, you must downgrade to ${cppVersion} which is bundled into Expo SDK.`);
|
|
22
|
+
// TODO: detect Expo managed workflow
|
|
23
|
+
}
|
|
24
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,11 +21,13 @@ export declare const blue: (c: number) => number;
|
|
|
21
21
|
export declare const rgbaColor: (r: number, g: number, b: number, alpha?: number) => number | string;
|
|
22
22
|
export declare function RGBtoHSV(rgb: RGB): HSV;
|
|
23
23
|
export declare function RGBtoHSV(r: number, g: number, b: number): HSV;
|
|
24
|
-
export declare const hsvToColor: (h: number, s: number, v: number) => number | string;
|
|
24
|
+
export declare const hsvToColor: (h: number, s: number, v: number, a: number) => number | string;
|
|
25
25
|
export declare function processColorInitially(color: unknown): number | null | undefined;
|
|
26
26
|
export declare function isColor(value: unknown): boolean;
|
|
27
27
|
export declare function processColor(color: unknown): number | null | undefined;
|
|
28
28
|
export declare type ParsedColorArray = [number, number, number, number];
|
|
29
|
-
export declare function
|
|
30
|
-
export declare function
|
|
29
|
+
export declare function convertToRGBA(color: unknown): ParsedColorArray;
|
|
30
|
+
export declare function rgbaArrayToRGBAColor(RGBA: ParsedColorArray): string;
|
|
31
|
+
export declare function toLinearSpace(RGBA: ParsedColorArray, gamma?: number): ParsedColorArray;
|
|
32
|
+
export declare function toGammaSpace(RGBA: ParsedColorArray, gamma?: number): ParsedColorArray;
|
|
31
33
|
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryJS.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryUI.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SharedValue } from './commonTypes';
|
|
2
|
+
export declare type InterpolationOptions = {
|
|
3
|
+
gamma?: number;
|
|
4
|
+
useCorrectedHSVInterpolation?: boolean;
|
|
5
|
+
};
|
|
2
6
|
interface InterpolateRGB {
|
|
3
7
|
r: number[];
|
|
4
8
|
g: number[];
|
|
@@ -9,8 +13,9 @@ interface InterpolateHSV {
|
|
|
9
13
|
h: number[];
|
|
10
14
|
s: number[];
|
|
11
15
|
v: number[];
|
|
16
|
+
a: number[];
|
|
12
17
|
}
|
|
13
|
-
export declare const interpolateColor: (value: number, inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: 'RGB' | 'HSV') => string | number;
|
|
18
|
+
export declare const interpolateColor: (value: number, inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: 'RGB' | 'HSV', options?: InterpolationOptions) => string | number;
|
|
14
19
|
export declare enum ColorSpace {
|
|
15
20
|
RGB = 0,
|
|
16
21
|
HSV = 1
|
|
@@ -20,7 +25,8 @@ export interface InterpolateConfig {
|
|
|
20
25
|
outputRange: readonly (string | number)[];
|
|
21
26
|
colorSpace: ColorSpace;
|
|
22
27
|
cache: SharedValue<InterpolateRGB | InterpolateHSV | null>;
|
|
28
|
+
options: InterpolationOptions;
|
|
23
29
|
}
|
|
24
|
-
export declare function useInterpolateConfig(inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: ColorSpace): SharedValue<InterpolateConfig>;
|
|
30
|
+
export declare function useInterpolateConfig(inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: ColorSpace, options?: InterpolationOptions): SharedValue<InterpolateConfig>;
|
|
25
31
|
export declare const interpolateSharableColor: (value: number, interpolateConfig: SharedValue<InterpolateConfig>) => string | number;
|
|
26
32
|
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts
RENAMED
|
File without changes
|
|
@@ -17,6 +17,8 @@ export interface EntryAnimationsValues {
|
|
|
17
17
|
targetHeight: number;
|
|
18
18
|
targetGlobalOriginX: number;
|
|
19
19
|
targetGlobalOriginY: number;
|
|
20
|
+
windowWidth: number;
|
|
21
|
+
windowHeight: number;
|
|
20
22
|
}
|
|
21
23
|
export interface ExitAnimationsValues {
|
|
22
24
|
currentOriginX: number;
|
|
@@ -25,6 +27,8 @@ export interface ExitAnimationsValues {
|
|
|
25
27
|
currentHeight: number;
|
|
26
28
|
currentGlobalOriginX: number;
|
|
27
29
|
currentGlobalOriginY: number;
|
|
30
|
+
windowWidth: number;
|
|
31
|
+
windowHeight: number;
|
|
28
32
|
}
|
|
29
33
|
export declare type EntryExitAnimationFunction = (targetValues: EntryAnimationsValues | ExitAnimationsValues) => LayoutAnimation;
|
|
30
34
|
export declare type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/index.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts
RENAMED
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.1",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "yarn run format:js && yarn run lint:js && yarn run test:unit",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@babel/plugin-transform-object-assign": "^7.16.7",
|
|
79
79
|
"@babel/preset-typescript": "^7.16.7",
|
|
80
|
-
"
|
|
80
|
+
"convert-source-map": "^1.7.0",
|
|
81
81
|
"invariant": "^2.2.4",
|
|
82
82
|
"lodash.isequal": "^4.5.0",
|
|
83
83
|
"setimmediate": "^1.0.5",
|
|
@@ -101,8 +101,9 @@
|
|
|
101
101
|
"@types/babel__core": "^7.1.18",
|
|
102
102
|
"@types/babel__generator": "^7.6.4",
|
|
103
103
|
"@types/babel__traverse": "^7.14.2",
|
|
104
|
+
"@types/invariant": "^2.2.35",
|
|
104
105
|
"@types/jest": "^27.4.0",
|
|
105
|
-
"@types/react
|
|
106
|
+
"@types/react": "^18.0.26",
|
|
106
107
|
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
|
107
108
|
"@typescript-eslint/parser": "^5.11.0",
|
|
108
109
|
"babel-eslint": "^10.1.0",
|
|
@@ -123,10 +124,9 @@
|
|
|
123
124
|
"madge": "^5.0.1",
|
|
124
125
|
"prettier": "^2.5.1",
|
|
125
126
|
"react": "17.0.2",
|
|
126
|
-
"react-native": "0.
|
|
127
|
+
"react-native": "0.71.0-rc.5",
|
|
127
128
|
"react-native-builder-bob": "^0.18.3",
|
|
128
|
-
"react-native-
|
|
129
|
-
"react-native-gesture-handler": "^1.6.1",
|
|
129
|
+
"react-native-gesture-handler": "^2.4.2",
|
|
130
130
|
"react-test-renderer": "17.0.2",
|
|
131
131
|
"release-it": "^13.7.2",
|
|
132
132
|
"typescript": "^4.1.3"
|
package/plugin.js
CHANGED
|
@@ -705,10 +705,14 @@ function isGestureObject(t, node) {
|
|
|
705
705
|
}
|
|
706
706
|
|
|
707
707
|
function processWorklets(t, path, state) {
|
|
708
|
+
const callee =
|
|
709
|
+
path.node.callee.type === 'SequenceExpression'
|
|
710
|
+
? path.node.callee.expressions[path.node.callee.expressions.length - 1]
|
|
711
|
+
: path.node.callee;
|
|
712
|
+
|
|
708
713
|
const name =
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
: path.node.callee.name;
|
|
714
|
+
callee.type === 'MemberExpression' ? callee.property.name : callee.name;
|
|
715
|
+
|
|
712
716
|
if (
|
|
713
717
|
objectHooks.has(name) &&
|
|
714
718
|
path.get('arguments.0').type === 'ObjectExpression'
|
|
@@ -713,11 +713,19 @@ declare module 'react-native-reanimated' {
|
|
|
713
713
|
|
|
714
714
|
export function processColor(color: number | string): number;
|
|
715
715
|
|
|
716
|
+
export type InterpolationOptions = {
|
|
717
|
+
gamma?: number;
|
|
718
|
+
useCorrectedHSVInterpolation?: boolean;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
export function isColor(value: unknown): boolean;
|
|
722
|
+
|
|
716
723
|
export function interpolateColor<T extends string | number>(
|
|
717
724
|
value: number,
|
|
718
725
|
inputRange: readonly number[],
|
|
719
726
|
outputRange: readonly T[],
|
|
720
|
-
colorSpace?: 'RGB' | 'HSV'
|
|
727
|
+
colorSpace?: 'RGB' | 'HSV',
|
|
728
|
+
options?: InterpolationOptions
|
|
721
729
|
): T;
|
|
722
730
|
|
|
723
731
|
export enum ColorSpace {
|
|
@@ -748,7 +756,8 @@ declare module 'react-native-reanimated' {
|
|
|
748
756
|
export function useInterpolateConfig(
|
|
749
757
|
inputRange: readonly number[],
|
|
750
758
|
outputRange: readonly (string | number)[],
|
|
751
|
-
colorSpace?: ColorSpace
|
|
759
|
+
colorSpace?: ColorSpace,
|
|
760
|
+
options?: InterpolationOptions
|
|
752
761
|
): SharedValue<InterpolateConfig>;
|
|
753
762
|
|
|
754
763
|
export function interpolateSharableColor(
|