react-native-reanimated 2.3.0-beta.3 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +9 -0
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +13 -0
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +38 -2
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +3 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +5 -0
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -7
- package/README.md +1 -1
- package/RNReanimated.podspec +20 -3
- package/android/build.gradle +31 -5
- package/android/expo/linking.gradle +46 -0
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +12 -0
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +26 -0
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -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/expo-module.config.json +3 -0
- package/ios/LayoutReanimation/REAAnimationsManager.m +64 -19
- package/ios/LayoutReanimation/REAUIManager.mm +63 -18
- package/ios/Nodes/REAPropsNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +0 -3
- package/ios/REANodesManager.m +1 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/native/NativeMethods.h +5 -0
- package/ios/native/NativeMethods.mm +8 -1
- package/ios/native/NativeProxy.h +1 -0
- package/ios/native/NativeProxy.mm +10 -2
- package/ios/native/REAInitializer.mm +7 -3
- package/lib/src/Animated.js +31 -0
- package/lib/{ConfigHelper.js → src/ConfigHelper.js} +0 -0
- package/lib/{ReanimatedEventEmitter.js → src/ReanimatedEventEmitter.js} +0 -0
- package/lib/{ReanimatedModule.js → src/ReanimatedModule.js} +0 -0
- package/lib/{ReanimatedModule.macos.js → src/ReanimatedModule.macos.js} +0 -0
- package/lib/{ReanimatedModule.native.js → src/ReanimatedModule.native.js} +0 -0
- package/lib/{ReanimatedModule.windows.js → src/ReanimatedModule.windows.js} +0 -0
- package/lib/{ReanimatedModuleCompat.js → src/ReanimatedModuleCompat.js} +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedEventEmitter.js +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedModule.native.js +0 -0
- package/lib/{createAnimatedComponent.js → src/createAnimatedComponent.js} +55 -37
- package/lib/src/index.js +31 -0
- package/lib/{reanimated1 → src/reanimated1}/Easing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/SpringConfig.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/Transitioning.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/Animation.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/SpringUtils.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/backwardCompatibleAnimWrapper.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/decay.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/spring.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/timing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/base.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedAlways.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBezier.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBlock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCall.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCallFunc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClockTest.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedConcat.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCond.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedDebug.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedEvent.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedFunction.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedNode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedOperator.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedParam.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedSet.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStartClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStopClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStyle.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedTransform.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/Core.test.js +1 -1
- package/lib/{reanimated1 → src/reanimated1}/core/InternalAnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/__mocks__/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/createEventObjectProxyPolyfill.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/__mocks__/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/acc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/color.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diff.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diffClamp.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolate.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolateColors.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/onChange.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/useCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/operators.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/useValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/val.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Bezier.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Colors.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Easing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeMethods.js +7 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/NativeReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PlatformChecker.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PropAdapters.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/UpdateProps.js +1 -1
- package/lib/{reanimated2 → src/reanimated2}/ViewDescriptorsSet.js +4 -2
- package/lib/{reanimated2 → src/reanimated2}/WorkletEventHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.native.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/decay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/delay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/repeat.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/sequence.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/spring.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/styleAnimation.js +5 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/timing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/util.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/commonTypes.js +0 -0
- package/lib/src/reanimated2/component/FlatList.js +30 -0
- package/lib/src/reanimated2/component/WrappedComponents.js +9 -0
- package/lib/src/reanimated2/component/index.js +4 -0
- package/lib/{reanimated2 → src/reanimated2}/core.js +27 -3
- package/lib/{reanimated2 → src/reanimated2}/globals.d.ts +5 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/Hooks.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedGestureHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedReaction.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedRef.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedScrollHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedStyle.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useDerivedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useSharedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/utils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/interpolation.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/jestUtils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/JSReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/Mapper.js +4 -1
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MapperRegistry.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/index.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/LayoutAnimationRepository.js +14 -5
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/Keyframe.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Bounce.js +0 -0
- package/lib/src/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Fade.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Flip.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Roll.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Rotate.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Slide.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Stretch.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Zoom.js +4 -4
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.js +20 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.js +3 -3
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.js +10 -10
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/mock.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.web.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/utils.js +0 -0
- package/lib/{setAndForwardRef.js → src/setAndForwardRef.js} +0 -0
- package/mock.js +1 -1
- package/package.json +4 -3
- package/plugin.js +10 -3
- package/react-native-reanimated.d.ts +40 -23
- package/src/Animated.js +11 -5
- package/src/createAnimatedComponent.tsx +86 -43
- package/src/reanimated1/core/Core.test.js +1 -1
- package/src/reanimated2/NativeMethods.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
- package/src/reanimated2/UpdateProps.ts +1 -1
- package/src/reanimated2/ViewDescriptorsSet.ts +6 -2
- package/src/reanimated2/animation/styleAnimation.ts +9 -0
- package/src/reanimated2/component/FlatList.tsx +44 -0
- package/src/reanimated2/component/WrappedComponents.ts +11 -0
- package/src/reanimated2/component/index.ts +9 -0
- package/src/reanimated2/core.ts +38 -3
- package/src/reanimated2/globals.d.ts +5 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -0
- package/src/reanimated2/js-reanimated/Mapper.ts +3 -1
- package/src/reanimated2/js-reanimated/index.ts +5 -0
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +18 -5
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +39 -20
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +5 -1
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +21 -15
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +29 -24
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +61 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +49 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +17 -12
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +20 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +9 -9
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +20 -14
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +14 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +24 -12
- package/lib/Animated.js +0 -25
- package/lib/index.js +0 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
|
@@ -22,8 +22,8 @@ export class RotateInDownLeft extends ComplexAnimationBuilder {
|
|
|
22
22
|
opacity: 0,
|
|
23
23
|
transform: [
|
|
24
24
|
{ rotate: '-90deg' },
|
|
25
|
-
{ translateX: values.
|
|
26
|
-
{ translateY: -(values.
|
|
25
|
+
{ translateX: values.targetWidth / 2 - values.targetHeight / 2 },
|
|
26
|
+
{ translateY: -(values.targetWidth / 2 - values.targetHeight / 2) },
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
29
|
callback: callback,
|
|
@@ -58,8 +58,8 @@ export class RotateInDownRight extends ComplexAnimationBuilder {
|
|
|
58
58
|
opacity: 0,
|
|
59
59
|
transform: [
|
|
60
60
|
{ rotate: '90deg' },
|
|
61
|
-
{ translateX: -(values.
|
|
62
|
-
{ translateY: -(values.
|
|
61
|
+
{ translateX: -(values.targetWidth / 2 - values.targetHeight / 2) },
|
|
62
|
+
{ translateY: -(values.targetWidth / 2 - values.targetHeight / 2) },
|
|
63
63
|
],
|
|
64
64
|
},
|
|
65
65
|
callback: callback,
|
|
@@ -94,8 +94,8 @@ export class RotateInUpLeft extends ComplexAnimationBuilder {
|
|
|
94
94
|
opacity: 0,
|
|
95
95
|
transform: [
|
|
96
96
|
{ rotate: '90deg' },
|
|
97
|
-
{ translateX: values.
|
|
98
|
-
{ translateY: values.
|
|
97
|
+
{ translateX: values.targetWidth / 2 - values.targetHeight / 2 },
|
|
98
|
+
{ translateY: values.targetWidth / 2 - values.targetHeight / 2 },
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
101
|
callback: callback,
|
|
@@ -130,8 +130,8 @@ export class RotateInUpRight extends ComplexAnimationBuilder {
|
|
|
130
130
|
opacity: 0,
|
|
131
131
|
transform: [
|
|
132
132
|
{ rotate: '-90deg' },
|
|
133
|
-
{ translateX: -(values.
|
|
134
|
-
{ translateY: values.
|
|
133
|
+
{ translateX: -(values.targetWidth / 2 - values.targetHeight / 2) },
|
|
134
|
+
{ translateY: values.targetWidth / 2 - values.targetHeight / 2 },
|
|
135
135
|
],
|
|
136
136
|
},
|
|
137
137
|
callback: callback,
|
|
@@ -159,10 +159,10 @@ export class RotateOutDownLeft extends ComplexAnimationBuilder {
|
|
|
159
159
|
transform: [
|
|
160
160
|
{ rotate: delayFunction(delay, animation('90deg', config)) },
|
|
161
161
|
{
|
|
162
|
-
translateX: delayFunction(delay, animation(values.
|
|
162
|
+
translateX: delayFunction(delay, animation(values.currentWidth / 2 - values.currentHeight / 2, config)),
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
translateY: delayFunction(delay, animation(values.
|
|
165
|
+
translateY: delayFunction(delay, animation(values.currentWidth / 2 - values.currentHeight / 2, config)),
|
|
166
166
|
},
|
|
167
167
|
],
|
|
168
168
|
},
|
|
@@ -195,10 +195,10 @@ export class RotateOutDownRight extends ComplexAnimationBuilder {
|
|
|
195
195
|
transform: [
|
|
196
196
|
{ rotate: delayFunction(delay, animation('-90deg', config)) },
|
|
197
197
|
{
|
|
198
|
-
translateX: delayFunction(delay, animation(-(values.
|
|
198
|
+
translateX: delayFunction(delay, animation(-(values.currentWidth / 2 - values.currentHeight / 2), config)),
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
translateY: delayFunction(delay, animation(values.
|
|
201
|
+
translateY: delayFunction(delay, animation(values.currentWidth / 2 - values.currentHeight / 2, config)),
|
|
202
202
|
},
|
|
203
203
|
],
|
|
204
204
|
},
|
|
@@ -231,10 +231,10 @@ export class RotateOutUpLeft extends ComplexAnimationBuilder {
|
|
|
231
231
|
transform: [
|
|
232
232
|
{ rotate: delayFunction(delay, animation('-90deg', config)) },
|
|
233
233
|
{
|
|
234
|
-
translateX: delayFunction(delay, animation(values.
|
|
234
|
+
translateX: delayFunction(delay, animation(values.currentWidth / 2 - values.currentHeight / 2, config)),
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
translateY: delayFunction(delay, animation(-(values.
|
|
237
|
+
translateY: delayFunction(delay, animation(-(values.currentWidth / 2 - values.currentHeight / 2), config)),
|
|
238
238
|
},
|
|
239
239
|
],
|
|
240
240
|
},
|
|
@@ -267,10 +267,10 @@ export class RotateOutUpRight extends ComplexAnimationBuilder {
|
|
|
267
267
|
transform: [
|
|
268
268
|
{ rotate: delayFunction(delay, animation('90deg', config)) },
|
|
269
269
|
{
|
|
270
|
-
translateX: delayFunction(delay, animation(-(values.
|
|
270
|
+
translateX: delayFunction(delay, animation(-(values.currentWidth / 2 - values.currentHeight / 2), config)),
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
|
-
translateY: delayFunction(delay, animation(-(values.
|
|
273
|
+
translateY: delayFunction(delay, animation(-(values.currentWidth / 2 - values.currentHeight / 2), config)),
|
|
274
274
|
},
|
|
275
275
|
],
|
|
276
276
|
},
|
|
@@ -13,10 +13,10 @@ export class SlideInRight extends ComplexAnimationBuilder {
|
|
|
13
13
|
'worklet';
|
|
14
14
|
return {
|
|
15
15
|
animations: {
|
|
16
|
-
originX: delayFunction(delay, animation(values.
|
|
16
|
+
originX: delayFunction(delay, animation(values.targetOriginX, config)),
|
|
17
17
|
},
|
|
18
18
|
initialValues: {
|
|
19
|
-
originX: values.
|
|
19
|
+
originX: values.targetOriginX + width,
|
|
20
20
|
},
|
|
21
21
|
callback: callback,
|
|
22
22
|
};
|
|
@@ -39,10 +39,10 @@ export class SlideInLeft extends ComplexAnimationBuilder {
|
|
|
39
39
|
'worklet';
|
|
40
40
|
return {
|
|
41
41
|
animations: {
|
|
42
|
-
originX: delayFunction(delay, animation(values.
|
|
42
|
+
originX: delayFunction(delay, animation(values.targetOriginX, config)),
|
|
43
43
|
},
|
|
44
44
|
initialValues: {
|
|
45
|
-
originX: values.
|
|
45
|
+
originX: values.targetOriginX - width,
|
|
46
46
|
},
|
|
47
47
|
callback: callback,
|
|
48
48
|
};
|
|
@@ -65,10 +65,10 @@ export class SlideOutRight extends ComplexAnimationBuilder {
|
|
|
65
65
|
'worklet';
|
|
66
66
|
return {
|
|
67
67
|
animations: {
|
|
68
|
-
originX: delayFunction(delay, animation(Math.max(values.
|
|
68
|
+
originX: delayFunction(delay, animation(Math.max(values.currentOriginX + width, width), config)),
|
|
69
69
|
},
|
|
70
70
|
initialValues: {
|
|
71
|
-
originX: values.
|
|
71
|
+
originX: values.currentOriginX,
|
|
72
72
|
},
|
|
73
73
|
callback: callback,
|
|
74
74
|
};
|
|
@@ -91,10 +91,10 @@ export class SlideOutLeft extends ComplexAnimationBuilder {
|
|
|
91
91
|
'worklet';
|
|
92
92
|
return {
|
|
93
93
|
animations: {
|
|
94
|
-
originX: delayFunction(delay, animation(Math.min(values.
|
|
94
|
+
originX: delayFunction(delay, animation(Math.min(values.currentOriginX - width, -width), config)),
|
|
95
95
|
},
|
|
96
96
|
initialValues: {
|
|
97
|
-
originX: values.
|
|
97
|
+
originX: values.currentOriginX,
|
|
98
98
|
},
|
|
99
99
|
callback: callback,
|
|
100
100
|
};
|
|
@@ -117,10 +117,10 @@ export class SlideInUp extends ComplexAnimationBuilder {
|
|
|
117
117
|
'worklet';
|
|
118
118
|
return {
|
|
119
119
|
animations: {
|
|
120
|
-
originY: delayFunction(delay, animation(values.
|
|
120
|
+
originY: delayFunction(delay, animation(values.targetOriginY, config)),
|
|
121
121
|
},
|
|
122
122
|
initialValues: {
|
|
123
|
-
originY: height,
|
|
123
|
+
originY: -height,
|
|
124
124
|
},
|
|
125
125
|
callback: callback,
|
|
126
126
|
};
|
|
@@ -143,10 +143,10 @@ export class SlideInDown extends ComplexAnimationBuilder {
|
|
|
143
143
|
'worklet';
|
|
144
144
|
return {
|
|
145
145
|
animations: {
|
|
146
|
-
originY: delayFunction(delay, animation(values.
|
|
146
|
+
originY: delayFunction(delay, animation(values.targetOriginY, config)),
|
|
147
147
|
},
|
|
148
148
|
initialValues: {
|
|
149
|
-
originY: values.
|
|
149
|
+
originY: values.targetOriginY + height,
|
|
150
150
|
},
|
|
151
151
|
callback: callback,
|
|
152
152
|
};
|
|
@@ -169,9 +169,9 @@ export class SlideOutUp extends ComplexAnimationBuilder {
|
|
|
169
169
|
'worklet';
|
|
170
170
|
return {
|
|
171
171
|
animations: {
|
|
172
|
-
originY: delayFunction(delay, animation(Math.min(values.
|
|
172
|
+
originY: delayFunction(delay, animation(Math.min(values.currentOriginY - height, -height), config)),
|
|
173
173
|
},
|
|
174
|
-
initialValues: { originY: values.
|
|
174
|
+
initialValues: { originY: values.currentOriginY },
|
|
175
175
|
callback: callback,
|
|
176
176
|
};
|
|
177
177
|
};
|
|
@@ -193,9 +193,9 @@ export class SlideOutDown extends ComplexAnimationBuilder {
|
|
|
193
193
|
'worklet';
|
|
194
194
|
return {
|
|
195
195
|
animations: {
|
|
196
|
-
originY: delayFunction(delay, animation(Math.max(values.
|
|
196
|
+
originY: delayFunction(delay, animation(Math.max(values.currentOriginY + height, height), config)),
|
|
197
197
|
},
|
|
198
|
-
initialValues: { originY: values.
|
|
198
|
+
initialValues: { originY: values.currentOriginY },
|
|
199
199
|
callback: callback,
|
|
200
200
|
};
|
|
201
201
|
};
|
|
File without changes
|
|
@@ -191,7 +191,7 @@ export class ZoomInEasyUp extends ComplexAnimationBuilder {
|
|
|
191
191
|
],
|
|
192
192
|
},
|
|
193
193
|
initialValues: {
|
|
194
|
-
transform: [{ translateY: -values.
|
|
194
|
+
transform: [{ translateY: -values.targetHeight }, { scale: 0 }],
|
|
195
195
|
},
|
|
196
196
|
callback: callback,
|
|
197
197
|
};
|
|
@@ -220,7 +220,7 @@ export class ZoomInEasyDown extends ComplexAnimationBuilder {
|
|
|
220
220
|
],
|
|
221
221
|
},
|
|
222
222
|
initialValues: {
|
|
223
|
-
transform: [{ translateY: values.
|
|
223
|
+
transform: [{ translateY: values.targetHeight }, { scale: 0 }],
|
|
224
224
|
},
|
|
225
225
|
callback: callback,
|
|
226
226
|
};
|
|
@@ -417,7 +417,7 @@ export class ZoomOutEasyUp extends ComplexAnimationBuilder {
|
|
|
417
417
|
animations: {
|
|
418
418
|
transform: [
|
|
419
419
|
{
|
|
420
|
-
translateY: delayFunction(delay, animation(-values.
|
|
420
|
+
translateY: delayFunction(delay, animation(-values.currentHeight, config)),
|
|
421
421
|
},
|
|
422
422
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
423
423
|
],
|
|
@@ -448,7 +448,7 @@ export class ZoomOutEasyDown extends ComplexAnimationBuilder {
|
|
|
448
448
|
animations: {
|
|
449
449
|
transform: [
|
|
450
450
|
{
|
|
451
|
-
translateY: delayFunction(delay, animation(values.
|
|
451
|
+
translateY: delayFunction(delay, animation(values.currentHeight, config)),
|
|
452
452
|
},
|
|
453
453
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
454
454
|
],
|
|
File without changes
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.js
RENAMED
|
@@ -24,16 +24,28 @@ export class CurvedTransition extends BaseAnimationBuilder {
|
|
|
24
24
|
'worklet';
|
|
25
25
|
return {
|
|
26
26
|
initialValues: {
|
|
27
|
-
originX: values.
|
|
28
|
-
originY: values.
|
|
29
|
-
width: values.
|
|
30
|
-
height: values.
|
|
27
|
+
originX: values.currentOriginX,
|
|
28
|
+
originY: values.currentOriginY,
|
|
29
|
+
width: values.currentWidth,
|
|
30
|
+
height: values.currentHeight,
|
|
31
31
|
},
|
|
32
32
|
animations: {
|
|
33
|
-
originX: delayFunction(delay, withTiming(values.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
originX: delayFunction(delay, withTiming(values.targetOriginX, {
|
|
34
|
+
duration,
|
|
35
|
+
easing: easing.easingX,
|
|
36
|
+
})),
|
|
37
|
+
originY: delayFunction(delay, withTiming(values.targetOriginY, {
|
|
38
|
+
duration,
|
|
39
|
+
easing: easing.easingY,
|
|
40
|
+
})),
|
|
41
|
+
width: delayFunction(delay, withTiming(values.targetWidth, {
|
|
42
|
+
duration,
|
|
43
|
+
easing: easing.easingWidth,
|
|
44
|
+
})),
|
|
45
|
+
height: delayFunction(delay, withTiming(values.targetHeight, {
|
|
46
|
+
duration,
|
|
47
|
+
easing: easing.easingHeight,
|
|
48
|
+
})),
|
|
37
49
|
},
|
|
38
50
|
callback: callback,
|
|
39
51
|
};
|
|
@@ -60,7 +60,7 @@ export class EntryExitTransition extends BaseAnimationBuilder {
|
|
|
60
60
|
(_a = animations.transform) === null || _a === void 0 ? void 0 : _a.push({
|
|
61
61
|
[transformProp]: delayFunction(delay + exitingDuration, withSequence(withTiming(enteringValues.initialValues.transform
|
|
62
62
|
? enteringValues.initialValues.transform[index][transformProp]
|
|
63
|
-
: 0, { duration:
|
|
63
|
+
: 0, { duration: exitingDuration }), value[transformProp])),
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
});
|
|
@@ -96,8 +96,8 @@ export class EntryExitTransition extends BaseAnimationBuilder {
|
|
|
96
96
|
return value;
|
|
97
97
|
}));
|
|
98
98
|
return {
|
|
99
|
-
initialValues: Object.assign(Object.assign({}, exitingValues.initialValues), { originX: values.
|
|
100
|
-
animations: Object.assign({ originX: delayFunction(delay + exitingDuration, withTiming(values.
|
|
99
|
+
initialValues: Object.assign(Object.assign({}, exitingValues.initialValues), { originX: values.currentOriginX, originY: values.currentOriginY, width: values.currentWidth, height: values.currentHeight, transform: mergedTransform }),
|
|
100
|
+
animations: Object.assign({ originX: delayFunction(delay + exitingDuration, withTiming(values.targetOriginX, { duration: exitingDuration })), originY: delayFunction(delay + exitingDuration, withTiming(values.targetOriginY, { duration: exitingDuration })), width: delayFunction(delay + exitingDuration, withTiming(values.targetWidth, { duration: exitingDuration })), height: delayFunction(delay + exitingDuration, withTiming(values.targetHeight, { duration: exitingDuration })) }, animations),
|
|
101
101
|
callback: callback,
|
|
102
102
|
};
|
|
103
103
|
};
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.js
RENAMED
|
@@ -14,17 +14,17 @@ export class FadingTransition extends BaseAnimationBuilder {
|
|
|
14
14
|
return {
|
|
15
15
|
initialValues: {
|
|
16
16
|
opacity: 1,
|
|
17
|
-
originX: values.
|
|
18
|
-
originY: values.
|
|
19
|
-
width: values.
|
|
20
|
-
height: values.
|
|
17
|
+
originX: values.currentOriginX,
|
|
18
|
+
originY: values.currentOriginY,
|
|
19
|
+
width: values.currentWidth,
|
|
20
|
+
height: values.currentHeight,
|
|
21
21
|
},
|
|
22
22
|
animations: {
|
|
23
23
|
opacity: delayFunction(delay, withSequence(withTiming(0, { duration: duration }), withTiming(1, { duration: duration }))),
|
|
24
|
-
originX: delayFunction(delay + duration, withTiming(values.
|
|
25
|
-
originY: delayFunction(delay + duration, withTiming(values.
|
|
26
|
-
width: delayFunction(delay + duration, withTiming(values.
|
|
27
|
-
height: delayFunction(delay + duration, withTiming(values.
|
|
24
|
+
originX: delayFunction(delay + duration, withTiming(values.targetOriginX, { duration: 50 })),
|
|
25
|
+
originY: delayFunction(delay + duration, withTiming(values.targetOriginY, { duration: 50 })),
|
|
26
|
+
width: delayFunction(delay + duration, withTiming(values.targetWidth, { duration: 50 })),
|
|
27
|
+
height: delayFunction(delay + duration, withTiming(values.targetHeight, { duration: 50 })),
|
|
28
28
|
},
|
|
29
29
|
callback: callback,
|
|
30
30
|
};
|
|
@@ -13,22 +13,22 @@ export class JumpingTransition extends BaseAnimationBuilder {
|
|
|
13
13
|
const config = { duration: duration * 2 };
|
|
14
14
|
return (values) => {
|
|
15
15
|
'worklet';
|
|
16
|
-
const d = Math.max(Math.abs(values.
|
|
16
|
+
const d = Math.max(Math.abs(values.targetOriginX - values.currentOriginX), Math.abs(values.targetOriginY - values.currentOriginY));
|
|
17
17
|
return {
|
|
18
18
|
initialValues: {
|
|
19
|
-
originX: values.
|
|
20
|
-
originY: values.
|
|
21
|
-
width: values.
|
|
22
|
-
height: values.
|
|
19
|
+
originX: values.currentOriginX,
|
|
20
|
+
originY: values.currentOriginY,
|
|
21
|
+
width: values.currentWidth,
|
|
22
|
+
height: values.currentHeight,
|
|
23
23
|
},
|
|
24
24
|
animations: {
|
|
25
|
-
originX: delayFunction(delay, withTiming(values.
|
|
26
|
-
originY: delayFunction(delay, withSequence(withTiming(Math.min(values.
|
|
25
|
+
originX: delayFunction(delay, withTiming(values.targetOriginX, config)),
|
|
26
|
+
originY: delayFunction(delay, withSequence(withTiming(Math.min(values.targetOriginY, values.currentOriginY) - d, {
|
|
27
27
|
duration,
|
|
28
28
|
easing: Easing.out(Easing.exp),
|
|
29
|
-
}), withTiming(values.
|
|
30
|
-
width: delayFunction(delay, withTiming(values.
|
|
31
|
-
height: delayFunction(delay, withTiming(values.
|
|
29
|
+
}), withTiming(values.targetOriginY, Object.assign(Object.assign({}, config), { duration, easing: Easing.bounce })))),
|
|
30
|
+
width: delayFunction(delay, withTiming(values.targetWidth, config)),
|
|
31
|
+
height: delayFunction(delay, withTiming(values.targetHeight, config)),
|
|
32
32
|
},
|
|
33
33
|
callback: callback,
|
|
34
34
|
};
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.js
RENAMED
|
@@ -11,16 +11,16 @@ export class LinearTransition extends ComplexAnimationBuilder {
|
|
|
11
11
|
'worklet';
|
|
12
12
|
return {
|
|
13
13
|
initialValues: {
|
|
14
|
-
originX: values.
|
|
15
|
-
originY: values.
|
|
16
|
-
width: values.
|
|
17
|
-
height: values.
|
|
14
|
+
originX: values.currentOriginX,
|
|
15
|
+
originY: values.currentOriginY,
|
|
16
|
+
width: values.currentWidth,
|
|
17
|
+
height: values.currentHeight,
|
|
18
18
|
},
|
|
19
19
|
animations: {
|
|
20
|
-
originX: delayFunction(delay, animation(values.
|
|
21
|
-
originY: delayFunction(delay, animation(values.
|
|
22
|
-
width: delayFunction(delay, animation(values.
|
|
23
|
-
height: delayFunction(delay, animation(values.
|
|
20
|
+
originX: delayFunction(delay, animation(values.targetOriginX, config)),
|
|
21
|
+
originY: delayFunction(delay, animation(values.targetOriginY, config)),
|
|
22
|
+
width: delayFunction(delay, animation(values.targetWidth, config)),
|
|
23
|
+
height: delayFunction(delay, animation(values.targetHeight, config)),
|
|
24
24
|
},
|
|
25
25
|
callback: callback,
|
|
26
26
|
};
|
|
@@ -16,16 +16,16 @@ export class SequencedTransition extends BaseAnimationBuilder {
|
|
|
16
16
|
'worklet';
|
|
17
17
|
return {
|
|
18
18
|
initialValues: {
|
|
19
|
-
originX: values.
|
|
20
|
-
originY: values.
|
|
21
|
-
width: values.
|
|
22
|
-
height: values.
|
|
19
|
+
originX: values.currentOriginX,
|
|
20
|
+
originY: values.currentOriginY,
|
|
21
|
+
width: values.currentWidth,
|
|
22
|
+
height: values.currentHeight,
|
|
23
23
|
},
|
|
24
24
|
animations: {
|
|
25
|
-
originX: delayFunction(delay, withSequence(withTiming(reverse ? values.
|
|
26
|
-
originY: delayFunction(delay, withSequence(withTiming(reverse ? values.
|
|
27
|
-
width: delayFunction(delay, withSequence(withTiming(reverse ? values.
|
|
28
|
-
height: delayFunction(delay, withSequence(withTiming(reverse ? values.
|
|
25
|
+
originX: delayFunction(delay, withSequence(withTiming(reverse ? values.currentOriginX : values.targetOriginX, config), withTiming(values.targetOriginX, config))),
|
|
26
|
+
originY: delayFunction(delay, withSequence(withTiming(reverse ? values.targetOriginY : values.currentOriginY, config), withTiming(values.targetOriginY, config))),
|
|
27
|
+
width: delayFunction(delay, withSequence(withTiming(reverse ? values.currentWidth : values.targetWidth, config), withTiming(values.targetWidth, config))),
|
|
28
|
+
height: delayFunction(delay, withSequence(withTiming(reverse ? values.targetHeight : values.currentHeight, config), withTiming(values.targetHeight, config))),
|
|
29
29
|
},
|
|
30
30
|
callback: callback,
|
|
31
31
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/mock.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"react-native-reanimated.d.ts",
|
|
49
49
|
"mock.js",
|
|
50
50
|
"plugin.js",
|
|
51
|
+
"expo-module.config.json",
|
|
51
52
|
"!__snapshots__",
|
|
52
53
|
"!*.test.js",
|
|
53
54
|
"!*.test.js.map"
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
"lint-staged": "^11.2.0",
|
|
116
117
|
"prettier": "^2.2.1",
|
|
117
118
|
"react": "17.0.2",
|
|
118
|
-
"react-native": "0.
|
|
119
|
+
"react-native": "0.67.0-rc.4",
|
|
119
120
|
"react-native-codegen": "^0.0.7",
|
|
120
121
|
"react-native-gesture-handler": "^1.6.1",
|
|
121
122
|
"react-test-renderer": "17.0.2",
|
|
@@ -124,7 +125,7 @@
|
|
|
124
125
|
},
|
|
125
126
|
"lint-staged": {
|
|
126
127
|
"*.(js|ts|tsx)": [
|
|
127
|
-
"eslint --ext '.js,.ts,.tsx' src/ --ignore-pattern src/reanimated1 --ignore-pattern react-native-reanimated.d.ts",
|
|
128
|
+
"eslint --ext '.js,.ts,.tsx' src/ --ignore-pattern src/reanimated1 --ignore-pattern react-native-reanimated.d.ts --ignore-pattern docs",
|
|
128
129
|
"prettier --write"
|
|
129
130
|
],
|
|
130
131
|
"**/*.{h,cpp}": "yarn lint:cpp",
|
package/plugin.js
CHANGED
|
@@ -69,6 +69,7 @@ const globals = new Set([
|
|
|
69
69
|
'global',
|
|
70
70
|
'_measure',
|
|
71
71
|
'_scrollTo',
|
|
72
|
+
'_setGestureState',
|
|
72
73
|
'_getCurrentTime',
|
|
73
74
|
'_eventTimestamp',
|
|
74
75
|
'_frameTimestamp',
|
|
@@ -145,16 +146,22 @@ const gestureHandlerGestureObjects = new Set([
|
|
|
145
146
|
'LongPress',
|
|
146
147
|
'ForceTouch',
|
|
147
148
|
'Native',
|
|
149
|
+
'Manual',
|
|
148
150
|
'Race',
|
|
149
151
|
'Simultaneous',
|
|
150
152
|
'Exclusive',
|
|
151
153
|
]);
|
|
152
154
|
|
|
153
|
-
const
|
|
154
|
-
'
|
|
155
|
+
const gestureHandlerBuilderMethods = new Set([
|
|
156
|
+
'onBegin',
|
|
155
157
|
'onStart',
|
|
156
158
|
'onEnd',
|
|
159
|
+
'onFinalize',
|
|
157
160
|
'onUpdate',
|
|
161
|
+
'onTouchesDown',
|
|
162
|
+
'onTouchesMove',
|
|
163
|
+
'onTouchesUp',
|
|
164
|
+
'onTouchesCancelled',
|
|
158
165
|
]);
|
|
159
166
|
|
|
160
167
|
class ClosureGenerator {
|
|
@@ -652,7 +659,7 @@ function isGestureObjectEventCallbackMethod(t, node) {
|
|
|
652
659
|
return (
|
|
653
660
|
t.isMemberExpression(node) &&
|
|
654
661
|
t.isIdentifier(node.property) &&
|
|
655
|
-
|
|
662
|
+
gestureHandlerBuilderMethods.has(node.property.name) &&
|
|
656
663
|
containsGestureObject(t, node.object)
|
|
657
664
|
);
|
|
658
665
|
}
|
|
@@ -26,6 +26,7 @@ declare module 'react-native-reanimated' {
|
|
|
26
26
|
Text as ReactNativeText,
|
|
27
27
|
Image as ReactNativeImage,
|
|
28
28
|
ScrollView as ReactNativeScrollView,
|
|
29
|
+
FlatList as ReactNativeFlatList,
|
|
29
30
|
NativeScrollEvent,
|
|
30
31
|
NativeSyntheticEvent,
|
|
31
32
|
ColorValue,
|
|
@@ -256,6 +257,10 @@ declare module 'react-native-reanimated' {
|
|
|
256
257
|
getNode(): ReactNativeScrollView;
|
|
257
258
|
}
|
|
258
259
|
export class Code extends Component<CodeProps> {}
|
|
260
|
+
export class FlatList extends Component<AnimateProps<FlatList>> {
|
|
261
|
+
itemLayoutAnimation: ILayoutAnimationBuilder;
|
|
262
|
+
getNode(): ReactNativeFlatList;
|
|
263
|
+
}
|
|
259
264
|
|
|
260
265
|
type Options<P> = {
|
|
261
266
|
setNativeProps: (ref: any, props: P) => void;
|
|
@@ -451,34 +456,45 @@ declare module 'react-native-reanimated' {
|
|
|
451
456
|
animations: AnimateStyle;
|
|
452
457
|
};
|
|
453
458
|
|
|
454
|
-
export
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
459
|
+
export interface EntryAnimationsValues {
|
|
460
|
+
targetOriginX: number;
|
|
461
|
+
targetOriginY: number;
|
|
462
|
+
targetWidth: number;
|
|
463
|
+
targetHeight: number;
|
|
464
|
+
targetGlobalOriginX: number;
|
|
465
|
+
targetGlobalOriginY: number;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface ExitAnimationsValues {
|
|
469
|
+
currentOriginX: number;
|
|
470
|
+
currentOriginY: number;
|
|
471
|
+
currentWidth: number;
|
|
472
|
+
currentHeight: number;
|
|
473
|
+
currentGlobalOriginX: number;
|
|
474
|
+
currentGlobalOriginY: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export type EntryExitAnimationFunction =
|
|
478
|
+
| ((targetValues: EntryAnimationsValues) => LayoutAnimation)
|
|
479
|
+
| ((targetValues: ExitAnimationsValues) => LayoutAnimation);
|
|
465
480
|
|
|
466
481
|
export type LayoutAnimationsValues = {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
482
|
+
currentOriginX: number;
|
|
483
|
+
currentOriginY: number;
|
|
484
|
+
currentWidth: number;
|
|
485
|
+
currentHeight: number;
|
|
486
|
+
currentGlobalOriginX: number;
|
|
487
|
+
currentGlobalOriginY: number;
|
|
488
|
+
targetOriginX: number;
|
|
489
|
+
targetOriginY: number;
|
|
490
|
+
targetWidth: number;
|
|
491
|
+
targetHeight: number;
|
|
492
|
+
targetGlobalOriginX: number;
|
|
493
|
+
targetGlobalOriginY: number;
|
|
479
494
|
windowWidth: number;
|
|
480
495
|
windowHeight: number;
|
|
481
496
|
};
|
|
497
|
+
|
|
482
498
|
export type LayoutAnimationFunction = (
|
|
483
499
|
targetValues: LayoutAnimationsValues
|
|
484
500
|
) => LayoutAnimation;
|
|
@@ -1071,4 +1087,5 @@ declare module 'react-native-reanimated' {
|
|
|
1071
1087
|
export const SpringUtils: typeof Animated.SpringUtils;
|
|
1072
1088
|
export const useValue: typeof Animated.useValue;
|
|
1073
1089
|
export const ReverseAnimation: typeof Animated.ReverseAnimation;
|
|
1090
|
+
export function enableLayoutAnimations(flag: boolean): void;
|
|
1074
1091
|
}
|
package/src/Animated.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LogBox } from 'react-native';
|
|
2
2
|
import createAnimatedComponent from './createAnimatedComponent';
|
|
3
3
|
import {
|
|
4
4
|
addWhitelistedNativeProps,
|
|
5
5
|
addWhitelistedUIProps,
|
|
6
6
|
} from './ConfigHelper';
|
|
7
7
|
import * as reanimated1 from './reanimated1';
|
|
8
|
+
import ReanimatedComponents from './reanimated2/component';
|
|
8
9
|
|
|
9
10
|
const Animated = {
|
|
10
11
|
// components
|
|
11
|
-
|
|
12
|
-
Text: createAnimatedComponent(Text),
|
|
13
|
-
Image: createAnimatedComponent(Image),
|
|
14
|
-
ScrollView: createAnimatedComponent(ScrollView),
|
|
12
|
+
...ReanimatedComponents,
|
|
15
13
|
createAnimatedComponent,
|
|
16
14
|
// configuration
|
|
17
15
|
addWhitelistedNativeProps,
|
|
@@ -23,3 +21,11 @@ const Animated = {
|
|
|
23
21
|
export * from './reanimated2';
|
|
24
22
|
export * from './reanimated1';
|
|
25
23
|
export default Animated;
|
|
24
|
+
|
|
25
|
+
// I think we can ignore this message as long as Gesture Handler doesn't
|
|
26
|
+
// try to load the Reanimated module. I figured it should be here instead of
|
|
27
|
+
// RNGH because this prevents the message from being displayed for all
|
|
28
|
+
// versions of RNGH.
|
|
29
|
+
LogBox.ignoreLogs([
|
|
30
|
+
'RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks',
|
|
31
|
+
]);
|