react-native-reanimated 2.3.0-beta.3 → 2.4.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/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.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +68 -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 +19 -3
- 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 +1 -97
- package/lib/{reanimated2 → src/reanimated2}/Easing.js +5 -0
- package/lib/src/reanimated2/NativeMethods.js +42 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/NativeReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/index.js +2 -2
- 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 +1 -2
- 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 +31 -14
- 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 +14 -11
- package/lib/{reanimated2 → src/reanimated2}/index.js +2 -0
- package/lib/src/reanimated2/interpolateColor.js +98 -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 +4 -1
- 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/layoutReanimation/animationBuilder → src/reanimated2/js-reanimated}/commonTypes.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/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +1 -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 +2 -1
- package/package.json +7 -4
- package/plugin.js +11 -3
- package/react-native-reanimated.d.ts +94 -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/Colors.ts +6 -150
- package/src/reanimated2/Easing.ts +11 -0
- package/src/reanimated2/NativeMethods.ts +31 -6
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +5 -0
- package/src/reanimated2/NativeReanimated/index.ts +2 -2
- package/src/reanimated2/UpdateProps.ts +1 -1
- package/src/reanimated2/ViewDescriptorsSet.ts +6 -2
- 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 +7 -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 +10 -18
- package/src/reanimated2/animation/timing.ts +1 -1
- package/src/reanimated2/animation/util.ts +12 -9
- package/src/reanimated2/commonTypes.ts +48 -1
- 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 +39 -6
- package/src/reanimated2/globals.d.ts +5 -0
- package/src/reanimated2/hook/commonTypes.ts +5 -0
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -2
- package/src/reanimated2/hook/useAnimatedRef.ts +1 -5
- package/src/reanimated2/hook/useAnimatedStyle.ts +35 -16
- package/src/reanimated2/hook/utils.ts +18 -17
- package/src/reanimated2/index.ts +2 -0
- package/src/reanimated2/interpolateColor.ts +178 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +9 -4
- package/src/reanimated2/js-reanimated/Mapper.ts +4 -2
- package/src/reanimated2/js-reanimated/MapperRegistry.ts +1 -1
- package/src/reanimated2/js-reanimated/commonTypes.ts +51 -0
- 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 +15 -11
- 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/src/reanimated2/utils.ts +1 -1
- package/lib/Animated.js +0 -25
- package/lib/index.js +0 -25
- package/lib/reanimated2/NativeMethods.js +0 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { processColor } from '../Colors';
|
|
3
3
|
import { makeRemote } from '../core';
|
|
4
|
-
import { isWeb } from '../PlatformChecker';
|
|
4
|
+
import { isWeb, isJest } from '../PlatformChecker';
|
|
5
5
|
import { colorProps } from '../UpdateProps';
|
|
6
6
|
import WorkletEventHandler from '../WorkletEventHandler';
|
|
7
7
|
export function useEvent(handler, eventNames = [], rebuild = false) {
|
|
@@ -36,7 +36,7 @@ export function useHandler(handlers, dependencies) {
|
|
|
36
36
|
dependencies = buildDependencies(dependencies, handlers);
|
|
37
37
|
const doDependenciesDiffer = !areDependenciesEqual(dependencies, savedDependencies);
|
|
38
38
|
initRef.current.savedDependencies = dependencies;
|
|
39
|
-
const useWeb = isWeb();
|
|
39
|
+
const useWeb = isWeb() || isJest();
|
|
40
40
|
return { context, doDependenciesDiffer, useWeb };
|
|
41
41
|
}
|
|
42
42
|
// builds one big hash from multiple worklets' hashes
|
|
@@ -95,7 +95,12 @@ export function parseColors(updates) {
|
|
|
95
95
|
'worklet';
|
|
96
96
|
for (const key in updates) {
|
|
97
97
|
if (colorProps.indexOf(key) !== -1) {
|
|
98
|
-
|
|
98
|
+
// value could be an animation in which case processColor will recognize it and will return undefined
|
|
99
|
+
// -> in such a case we don't want to override style of that key
|
|
100
|
+
const processedColor = processColor(updates[key]);
|
|
101
|
+
if (processedColor !== undefined) {
|
|
102
|
+
updates[key] = processedColor;
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
}
|
|
@@ -132,24 +137,22 @@ export function isAnimated(prop) {
|
|
|
132
137
|
export function styleDiff(oldStyle, newStyle) {
|
|
133
138
|
'worklet';
|
|
134
139
|
const diff = {};
|
|
135
|
-
|
|
140
|
+
for (const key in oldStyle) {
|
|
136
141
|
if (newStyle[key] === undefined) {
|
|
137
142
|
diff[key] = null;
|
|
138
143
|
}
|
|
139
|
-
}
|
|
140
|
-
|
|
144
|
+
}
|
|
145
|
+
for (const key in newStyle) {
|
|
141
146
|
const value = newStyle[key];
|
|
142
147
|
const oldValue = oldStyle[key];
|
|
143
148
|
if (isAnimated(value)) {
|
|
144
149
|
// do nothing
|
|
145
|
-
|
|
150
|
+
continue;
|
|
146
151
|
}
|
|
147
|
-
if (oldValue !== value
|
|
148
|
-
JSON.stringify(oldValue) !== JSON.stringify(value)) {
|
|
149
|
-
// I'd use deep equal here but that'd take additional work and this was easier
|
|
152
|
+
if (oldValue !== value) {
|
|
150
153
|
diff[key] = value;
|
|
151
154
|
}
|
|
152
|
-
}
|
|
155
|
+
}
|
|
153
156
|
return diff;
|
|
154
157
|
}
|
|
155
158
|
export function getStyleWithoutAnimations(newStyle) {
|
|
@@ -2,9 +2,11 @@ export * from './core';
|
|
|
2
2
|
export * from './hook';
|
|
3
3
|
export * from './animation';
|
|
4
4
|
export * from './interpolation';
|
|
5
|
+
export * from './interpolateColor';
|
|
5
6
|
export * from './Easing';
|
|
6
7
|
export * from './NativeMethods';
|
|
7
8
|
export * from './Colors';
|
|
8
9
|
export * from './PropAdapters';
|
|
9
10
|
export * from './layoutReanimation';
|
|
10
11
|
export * from './utils';
|
|
12
|
+
export * from './commonTypes';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { hsvToColor, RGBtoHSV, rgbaColor, processColor, red, green, blue, opacity, } from './Colors';
|
|
2
|
+
import { makeMutable } from './core';
|
|
3
|
+
import { interpolate } from './interpolation';
|
|
4
|
+
// @ts-ignore JS file
|
|
5
|
+
import { Extrapolate } from '../reanimated1/derived';
|
|
6
|
+
import { useSharedValue } from './hook/useSharedValue';
|
|
7
|
+
const interpolateColorsHSV = (value, inputRange, colors) => {
|
|
8
|
+
'worklet';
|
|
9
|
+
const h = interpolate(value, inputRange, colors.h, Extrapolate.CLAMP);
|
|
10
|
+
const s = interpolate(value, inputRange, colors.s, Extrapolate.CLAMP);
|
|
11
|
+
const v = interpolate(value, inputRange, colors.v, Extrapolate.CLAMP);
|
|
12
|
+
return hsvToColor(h, s, v);
|
|
13
|
+
};
|
|
14
|
+
const interpolateColorsRGB = (value, inputRange, colors) => {
|
|
15
|
+
'worklet';
|
|
16
|
+
const r = interpolate(value, inputRange, colors.r, Extrapolate.CLAMP);
|
|
17
|
+
const g = interpolate(value, inputRange, colors.g, Extrapolate.CLAMP);
|
|
18
|
+
const b = interpolate(value, inputRange, colors.b, Extrapolate.CLAMP);
|
|
19
|
+
const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);
|
|
20
|
+
return rgbaColor(r, g, b, a);
|
|
21
|
+
};
|
|
22
|
+
const getInterpolateRGB = (colors) => {
|
|
23
|
+
'worklet';
|
|
24
|
+
const r = [];
|
|
25
|
+
const g = [];
|
|
26
|
+
const b = [];
|
|
27
|
+
const a = [];
|
|
28
|
+
for (let i = 0; i < colors.length; ++i) {
|
|
29
|
+
const color = colors[i];
|
|
30
|
+
const proocessedColor = processColor(color);
|
|
31
|
+
// explicit check in case if processedColor is 0
|
|
32
|
+
if (proocessedColor !== null && proocessedColor !== undefined) {
|
|
33
|
+
r.push(red(proocessedColor));
|
|
34
|
+
g.push(green(proocessedColor));
|
|
35
|
+
b.push(blue(proocessedColor));
|
|
36
|
+
a.push(opacity(proocessedColor));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { r, g, b, a };
|
|
40
|
+
};
|
|
41
|
+
const getInterpolateHSV = (colors) => {
|
|
42
|
+
'worklet';
|
|
43
|
+
const h = [];
|
|
44
|
+
const s = [];
|
|
45
|
+
const v = [];
|
|
46
|
+
for (let i = 0; i < colors.length; ++i) {
|
|
47
|
+
const color = colors[i];
|
|
48
|
+
const proocessedColor = RGBtoHSV(processColor(color));
|
|
49
|
+
if (proocessedColor) {
|
|
50
|
+
h.push(proocessedColor.h);
|
|
51
|
+
s.push(proocessedColor.s);
|
|
52
|
+
v.push(proocessedColor.v);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { h, s, v };
|
|
56
|
+
};
|
|
57
|
+
export const interpolateColor = (value, inputRange, outputRange, colorSpace = 'RGB') => {
|
|
58
|
+
'worklet';
|
|
59
|
+
if (colorSpace === 'HSV') {
|
|
60
|
+
return interpolateColorsHSV(value, inputRange, getInterpolateHSV(outputRange));
|
|
61
|
+
}
|
|
62
|
+
else if (colorSpace === 'RGB') {
|
|
63
|
+
return interpolateColorsRGB(value, inputRange, getInterpolateRGB(outputRange));
|
|
64
|
+
}
|
|
65
|
+
throw new Error(`Invalid color space provided: ${colorSpace}. Supported values are: ['RGB', 'HSV']`);
|
|
66
|
+
};
|
|
67
|
+
export var ColorSpace;
|
|
68
|
+
(function (ColorSpace) {
|
|
69
|
+
ColorSpace[ColorSpace["RGB"] = 0] = "RGB";
|
|
70
|
+
ColorSpace[ColorSpace["HSV"] = 1] = "HSV";
|
|
71
|
+
})(ColorSpace || (ColorSpace = {}));
|
|
72
|
+
export function useInterpolateConfig(inputRange, outputRange, colorSpace = ColorSpace.RGB) {
|
|
73
|
+
return useSharedValue({
|
|
74
|
+
inputRange,
|
|
75
|
+
outputRange,
|
|
76
|
+
colorSpace,
|
|
77
|
+
cache: makeMutable(null),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export const interpolateSharableColor = (value, interpolateConfig) => {
|
|
81
|
+
'worklet';
|
|
82
|
+
let colors = interpolateConfig.value.cache.value;
|
|
83
|
+
if (interpolateConfig.value.colorSpace === ColorSpace.RGB) {
|
|
84
|
+
if (!colors) {
|
|
85
|
+
colors = getInterpolateRGB(interpolateConfig.value.outputRange);
|
|
86
|
+
interpolateConfig.value.cache.value = colors;
|
|
87
|
+
}
|
|
88
|
+
return interpolateColorsRGB(value, interpolateConfig.value.inputRange, colors);
|
|
89
|
+
}
|
|
90
|
+
else if (interpolateConfig.value.colorSpace === ColorSpace.HSV) {
|
|
91
|
+
if (!colors) {
|
|
92
|
+
colors = getInterpolateHSV(interpolateConfig.value.outputRange);
|
|
93
|
+
interpolateConfig.value.cache.value = colors;
|
|
94
|
+
}
|
|
95
|
+
return interpolateColorsHSV(value, interpolateConfig.value.inputRange, colors);
|
|
96
|
+
}
|
|
97
|
+
throw new Error(`Invalid color space provided: ${interpolateConfig.value.colorSpace}. Supported values are: ['RGB', 'HSV']`);
|
|
98
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MapperRegistry from './MapperRegistry';
|
|
2
|
-
import MutableValue from './MutableValue';
|
|
3
2
|
import Mapper from './Mapper';
|
|
3
|
+
import MutableValue from './MutableValue';
|
|
4
4
|
import { NativeReanimated } from '../NativeReanimated/NativeReanimated';
|
|
5
5
|
export default class JSReanimated extends NativeReanimated {
|
|
6
6
|
constructor() {
|
|
@@ -72,4 +72,7 @@ export default class JSReanimated extends NativeReanimated {
|
|
|
72
72
|
unregisterEventHandler(_) {
|
|
73
73
|
// noop
|
|
74
74
|
}
|
|
75
|
+
enableLayoutAnimations() {
|
|
76
|
+
console.warn('[Reanimated] enableLayoutAnimations is not available for WEB yet');
|
|
77
|
+
}
|
|
75
78
|
}
|
|
@@ -21,7 +21,10 @@ export default class Mapper {
|
|
|
21
21
|
extractMutablesFromArray(array) {
|
|
22
22
|
const res = [];
|
|
23
23
|
function extractMutables(value) {
|
|
24
|
-
if (value
|
|
24
|
+
if (value == null) {
|
|
25
|
+
// return;
|
|
26
|
+
}
|
|
27
|
+
else if (value instanceof MutableValue) {
|
|
25
28
|
res.push(value);
|
|
26
29
|
}
|
|
27
30
|
else if (Array.isArray(value)) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -20,6 +20,9 @@ if (shouldBeUseWeb()) {
|
|
|
20
20
|
global._scrollTo = () => {
|
|
21
21
|
console.warn("[Reanimated] You can't use 'scrollTo' method with Chrome Debugger or with web version");
|
|
22
22
|
};
|
|
23
|
+
global._setGestureState = () => {
|
|
24
|
+
console.warn("[Reanimated] You can't use 'setGestureState' method with Chrome Debugger or with web version");
|
|
25
|
+
};
|
|
23
26
|
}
|
|
24
27
|
export const _updatePropsJS = (updates, viewRef) => {
|
|
25
28
|
if (viewRef._component) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* global _stopObservingProgress, _startObservingProgress */
|
|
2
2
|
import { runOnUI } from '../core';
|
|
3
3
|
import { withStyleAnimation } from '../animation/styleAnimation';
|
|
4
|
+
import { ColorProperties } from '../UpdateProps';
|
|
5
|
+
import { processColor } from '../Colors';
|
|
4
6
|
runOnUI(() => {
|
|
5
7
|
'worklet';
|
|
6
8
|
const configs = {};
|
|
@@ -34,12 +36,19 @@ runOnUI(() => {
|
|
|
34
36
|
for (const key in layoutAnimation) {
|
|
35
37
|
currentAnimation[key] = layoutAnimation[key];
|
|
36
38
|
}
|
|
37
|
-
enteringAnimationForTag[tag] = null;
|
|
38
39
|
}
|
|
39
40
|
const sv = configs[tag].sv;
|
|
40
41
|
_stopObservingProgress(tag, false);
|
|
41
42
|
_startObservingProgress(tag, sv);
|
|
42
|
-
|
|
43
|
+
const backupColor = {};
|
|
44
|
+
for (const key in style.initialValues) {
|
|
45
|
+
if (ColorProperties.includes(key)) {
|
|
46
|
+
const value = style.initialValues[key];
|
|
47
|
+
backupColor[key] = value;
|
|
48
|
+
style.initialValues[key] = processColor(value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
sv.value = Object.assign({}, sv._value, style.initialValues);
|
|
43
52
|
_stopObservingProgress(tag, false);
|
|
44
53
|
const animation = withStyleAnimation(currentAnimation);
|
|
45
54
|
animation.callback = (finished) => {
|
|
@@ -47,10 +56,10 @@ runOnUI(() => {
|
|
|
47
56
|
_stopObservingProgress(tag, finished);
|
|
48
57
|
}
|
|
49
58
|
style.callback && style.callback(finished);
|
|
50
|
-
if (type === 'entering') {
|
|
51
|
-
enteringAnimationForTag[tag] = null;
|
|
52
|
-
}
|
|
53
59
|
};
|
|
60
|
+
if (backupColor) {
|
|
61
|
+
configs[tag].sv._value = Object.assign(Object.assign({}, configs[tag].sv.value), backupColor);
|
|
62
|
+
}
|
|
54
63
|
configs[tag].sv.value = animation;
|
|
55
64
|
_startObservingProgress(tag, sv);
|
|
56
65
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const DefaultLayout = (values) => {
|
|
2
|
+
'worklet';
|
|
3
|
+
return {
|
|
4
|
+
initialValues: {
|
|
5
|
+
originX: values.targetOriginX,
|
|
6
|
+
originY: values.targetOriginY,
|
|
7
|
+
width: values.targetWidth,
|
|
8
|
+
height: values.targetHeight,
|
|
9
|
+
},
|
|
10
|
+
animations: {},
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const DefaultEntering = (values) => {
|
|
14
|
+
'worklet';
|
|
15
|
+
return {
|
|
16
|
+
initialValues: {
|
|
17
|
+
originX: values.targetOriginX,
|
|
18
|
+
originY: values.targetOriginY,
|
|
19
|
+
width: values.targetWidth,
|
|
20
|
+
height: values.targetHeight,
|
|
21
|
+
},
|
|
22
|
+
animations: {},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export const DefaultExiting = (values) => {
|
|
26
|
+
'worklet';
|
|
27
|
+
return {
|
|
28
|
+
initialValues: {
|
|
29
|
+
originX: values.currentOriginX,
|
|
30
|
+
originY: values.currentOriginY,
|
|
31
|
+
width: values.currentWidth,
|
|
32
|
+
height: values.currentHeight,
|
|
33
|
+
},
|
|
34
|
+
animations: {},
|
|
35
|
+
};
|
|
36
|
+
};
|
|
File without changes
|
|
@@ -14,7 +14,7 @@ export class FlipInXUp extends ComplexAnimationBuilder {
|
|
|
14
14
|
transform: [
|
|
15
15
|
{ perspective: 500 },
|
|
16
16
|
{ rotateX: '90deg' },
|
|
17
|
-
{ translateY: -targetValues.
|
|
17
|
+
{ translateY: -targetValues.targetHeight },
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
animations: {
|
|
@@ -48,7 +48,7 @@ export class FlipInYLeft extends ComplexAnimationBuilder {
|
|
|
48
48
|
transform: [
|
|
49
49
|
{ perspective: 500 },
|
|
50
50
|
{ rotateY: '-90deg' },
|
|
51
|
-
{ translateX: -targetValues.
|
|
51
|
+
{ translateX: -targetValues.targetWidth },
|
|
52
52
|
],
|
|
53
53
|
},
|
|
54
54
|
animations: {
|
|
@@ -82,7 +82,7 @@ export class FlipInXDown extends ComplexAnimationBuilder {
|
|
|
82
82
|
transform: [
|
|
83
83
|
{ perspective: 500 },
|
|
84
84
|
{ rotateX: '-90deg' },
|
|
85
|
-
{ translateY: targetValues.
|
|
85
|
+
{ translateY: targetValues.targetHeight },
|
|
86
86
|
],
|
|
87
87
|
},
|
|
88
88
|
animations: {
|
|
@@ -116,7 +116,7 @@ export class FlipInYRight extends ComplexAnimationBuilder {
|
|
|
116
116
|
transform: [
|
|
117
117
|
{ perspective: 500 },
|
|
118
118
|
{ rotateY: '90deg' },
|
|
119
|
-
{ translateX: targetValues.
|
|
119
|
+
{ translateX: targetValues.targetWidth },
|
|
120
120
|
],
|
|
121
121
|
},
|
|
122
122
|
animations: {
|
|
@@ -216,7 +216,7 @@ export class FlipOutXUp extends ComplexAnimationBuilder {
|
|
|
216
216
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
217
217
|
{ rotateX: delayFunction(delay, animation('90deg', config)) },
|
|
218
218
|
{
|
|
219
|
-
translateY: delayFunction(delay, animation(-targetValues.
|
|
219
|
+
translateY: delayFunction(delay, animation(-targetValues.currentHeight, config)),
|
|
220
220
|
},
|
|
221
221
|
],
|
|
222
222
|
},
|
|
@@ -252,7 +252,7 @@ export class FlipOutYLeft extends ComplexAnimationBuilder {
|
|
|
252
252
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
253
253
|
{ rotateY: delayFunction(delay, animation('-90deg', config)) },
|
|
254
254
|
{
|
|
255
|
-
translateX: delayFunction(delay, animation(-targetValues.
|
|
255
|
+
translateX: delayFunction(delay, animation(-targetValues.currentWidth, config)),
|
|
256
256
|
},
|
|
257
257
|
],
|
|
258
258
|
},
|
|
@@ -288,7 +288,7 @@ export class FlipOutXDown extends ComplexAnimationBuilder {
|
|
|
288
288
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
289
289
|
{ rotateX: delayFunction(delay, animation('-90deg', config)) },
|
|
290
290
|
{
|
|
291
|
-
translateY: delayFunction(delay, animation(targetValues.
|
|
291
|
+
translateY: delayFunction(delay, animation(targetValues.currentHeight, config)),
|
|
292
292
|
},
|
|
293
293
|
],
|
|
294
294
|
},
|
|
@@ -324,7 +324,7 @@ export class FlipOutYRight extends ComplexAnimationBuilder {
|
|
|
324
324
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
325
325
|
{ rotateY: delayFunction(delay, animation('90deg', config)) },
|
|
326
326
|
{
|
|
327
|
-
translateX: delayFunction(delay, animation(targetValues.
|
|
327
|
+
translateX: delayFunction(delay, animation(targetValues.currentWidth, config)),
|
|
328
328
|
},
|
|
329
329
|
],
|
|
330
330
|
},
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|