react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4
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/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
- package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
- package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
- package/Common/cpp/SharedItems/FrozenObject.cpp +17 -8
- package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
- package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
- package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
- package/Common/cpp/SharedItems/ShareableValue.cpp +211 -160
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
- package/Common/cpp/Tools/Mapper.cpp +30 -30
- package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
- package/Common/cpp/Tools/Scheduler.cpp +6 -5
- package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
- package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
- package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
- package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
- package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
- package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
- package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
- package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
- package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
- package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
- package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
- package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
- package/Common/cpp/headers/Tools/Mapper.h +19 -16
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
- package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
- package/Common/cpp/headers/Tools/Scheduler.h +30 -35
- package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
- package/Common/cpp/hidden_headers/Logger.h +14 -14
- package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
- package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
- package/README.md +1 -1
- package/RNReanimated.podspec +24 -6
- package/android/build.gradle +38 -29
- 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/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
- package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
- package/ios/LayoutReanimation/REASnapshot.h +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +8 -7
- package/ios/LayoutReanimation/REAUIManager.h +4 -4
- package/ios/LayoutReanimation/REAUIManager.mm +116 -70
- package/ios/Nodes/REAAlwaysNode.m +14 -15
- package/ios/Nodes/REABezierNode.m +8 -7
- package/ios/Nodes/REABlockNode.m +1 -1
- package/ios/Nodes/REACallFuncNode.h +0 -1
- package/ios/Nodes/REACallFuncNode.m +10 -8
- package/ios/Nodes/REAClockNodes.m +22 -20
- package/ios/Nodes/REAConcatNode.h +0 -1
- package/ios/Nodes/REAConcatNode.m +2 -2
- package/ios/Nodes/REACondNode.m +7 -5
- package/ios/Nodes/READebugNode.m +5 -4
- package/ios/Nodes/REAEventNode.m +1 -1
- package/ios/Nodes/REAFunctionNode.h +0 -1
- package/ios/Nodes/REAFunctionNode.m +2 -2
- package/ios/Nodes/REAJSCallNode.m +4 -5
- package/ios/Nodes/REANode.h +3 -4
- package/ios/Nodes/REANode.m +9 -11
- package/ios/Nodes/REAOperatorNode.m +68 -67
- package/ios/Nodes/REAParamNode.h +1 -3
- package/ios/Nodes/REAParamNode.m +15 -17
- package/ios/Nodes/REAPropsNode.h +1 -3
- package/ios/Nodes/REAPropsNode.m +19 -22
- package/ios/Nodes/REASetNode.h +0 -1
- package/ios/Nodes/REASetNode.m +7 -5
- package/ios/Nodes/REAStyleNode.h +0 -1
- package/ios/Nodes/REAStyleNode.m +2 -4
- package/ios/Nodes/REATransformNode.h +0 -1
- package/ios/Nodes/REATransformNode.m +3 -5
- package/ios/Nodes/REAValueNode.m +5 -7
- package/ios/REAEventDispatcher.m +4 -4
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +29 -38
- package/ios/REANodesManager.h +11 -19
- package/ios/REANodesManager.m +106 -130
- package/ios/REAUtils.h +5 -3
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
- package/ios/Transitioning/REAAllTransitions.h +2 -2
- package/ios/Transitioning/REAAllTransitions.m +14 -25
- package/ios/Transitioning/REATransition.h +8 -7
- package/ios/Transitioning/REATransition.m +19 -16
- package/ios/Transitioning/REATransitionAnimation.h +1 -1
- package/ios/Transitioning/REATransitionAnimation.m +2 -3
- package/ios/Transitioning/REATransitionManager.m +3 -3
- package/ios/native/NativeMethods.h +20 -5
- package/ios/native/NativeMethods.mm +14 -6
- package/ios/native/NativeProxy.h +4 -2
- package/ios/native/NativeProxy.mm +84 -63
- package/ios/native/REAIOSErrorHandler.h +13 -10
- package/ios/native/REAIOSErrorHandler.mm +19 -15
- package/ios/native/REAIOSLogger.h +8 -8
- package/ios/native/REAIOSLogger.mm +10 -6
- package/ios/native/REAIOSScheduler.h +5 -5
- package/ios/native/REAIOSScheduler.mm +17 -10
- package/ios/native/REAInitializer.h +5 -7
- package/ios/native/REAInitializer.mm +43 -31
- package/ios/native/UIResponder+Reanimated.mm +2 -2
- package/lib/Animated.js +9 -1
- package/lib/ConfigHelper.js +121 -138
- package/lib/ReanimatedEventEmitter.js +0 -1
- package/lib/ReanimatedModule.js +0 -1
- package/lib/ReanimatedModule.macos.js +0 -1
- package/lib/ReanimatedModule.native.js +5 -6
- package/lib/ReanimatedModule.windows.js +0 -1
- package/lib/ReanimatedModuleCompat.js +64 -35
- package/lib/createAnimatedComponent.js +468 -487
- package/lib/index.js +9 -1
- package/lib/reanimated2/NativeMethods.js +7 -12
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
- package/lib/reanimated2/NativeReanimated/index.js +15 -0
- package/lib/reanimated2/PropAdapters.js +0 -1
- package/lib/reanimated2/UpdateProps.js +6 -7
- package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
- package/lib/reanimated2/WorkletEventHandler.js +15 -13
- package/lib/reanimated2/animation/delay.js +8 -2
- package/lib/reanimated2/animation/spring.js +2 -0
- package/lib/reanimated2/animation/styleAnimation.js +7 -3
- package/lib/reanimated2/animation/util.js +25 -2
- package/lib/reanimated2/core.js +41 -17
- package/lib/reanimated2/globals.d.ts +21 -1
- package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
- package/lib/reanimated2/index.js +1 -0
- package/lib/reanimated2/interpolation.js +95 -87
- package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
- package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
- package/lib/reanimated2/js-reanimated/index.js +10 -8
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
- package/lib/reanimated2/layoutReanimation/index.js +1 -0
- package/lib/reanimated2/mock.js +3 -1
- package/lib/reanimated2/utils.js +9 -0
- package/lib/setAndForwardRef.js +14 -48
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
- package/mock.js +1 -1
- package/package.json +28 -17
- package/plugin.js +220 -39
- package/react-native-reanimated.d.ts +542 -547
- package/src/Animated.js +9 -1
- package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
- package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
- package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
- package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
- package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
- package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
- package/src/ReanimatedModuleCompat.ts +51 -0
- package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
- package/src/reanimated2/NativeMethods.ts +34 -13
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
- package/src/reanimated2/NativeReanimated/index.ts +18 -0
- package/src/reanimated2/PropAdapters.ts +0 -1
- package/src/reanimated2/UpdateProps.ts +31 -15
- package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
- package/src/reanimated2/WorkletEventHandler.ts +41 -23
- package/src/reanimated2/animation/commonTypes.ts +4 -4
- package/src/reanimated2/animation/decay.ts +2 -2
- package/src/reanimated2/animation/delay.ts +11 -5
- package/src/reanimated2/animation/index.ts +7 -7
- package/src/reanimated2/animation/repeat.ts +4 -4
- package/src/reanimated2/animation/sequence.ts +2 -2
- package/src/reanimated2/animation/spring.ts +6 -5
- package/src/reanimated2/animation/styleAnimation.ts +27 -15
- package/src/reanimated2/animation/timing.ts +5 -5
- package/src/reanimated2/animation/util.ts +47 -8
- package/src/reanimated2/commonTypes.ts +3 -0
- package/src/reanimated2/core.ts +80 -34
- package/src/reanimated2/globals.d.ts +21 -1
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
- package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
- package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
- package/src/reanimated2/hook/utils.ts +4 -3
- package/src/reanimated2/index.ts +1 -0
- package/src/reanimated2/interpolation.ts +170 -103
- package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
- package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
- package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
- package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
- package/src/reanimated2/js-reanimated/index.ts +31 -14
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
- package/src/reanimated2/layoutReanimation/index.ts +1 -0
- package/src/reanimated2/mock.ts +3 -1
- package/src/reanimated2/utils.ts +21 -0
- package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
- package/android/react-native-reanimated-62-hermes.aar +0 -0
- package/android/react-native-reanimated-62-jsc.aar +0 -0
- package/lib/reanimated2/NativeReanimated.js +0 -48
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
- package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
- package/src/ReanimatedModuleCompat.js +0 -37
- package/src/reanimated2/NativeReanimated.ts +0 -70
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
- package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class StretchInX extends
|
|
1
|
+
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
2
|
+
export class StretchInX extends ComplexAnimationBuilder {
|
|
3
3
|
constructor() {
|
|
4
4
|
super(...arguments);
|
|
5
5
|
this.build = () => {
|
|
6
6
|
const delayFunction = this.getDelayFunction();
|
|
7
7
|
const [animation, config] = this.getAnimationAndConfig();
|
|
8
|
-
const delay = this.
|
|
8
|
+
const delay = this.getDelay();
|
|
9
9
|
const callback = this.callbackV;
|
|
10
10
|
return () => {
|
|
11
11
|
'worklet';
|
|
@@ -25,13 +25,13 @@ export class StretchInX extends BaseAnimationBuilder {
|
|
|
25
25
|
return new StretchInX();
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
export class StretchInY extends
|
|
28
|
+
export class StretchInY extends ComplexAnimationBuilder {
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
31
31
|
this.build = () => {
|
|
32
32
|
const delayFunction = this.getDelayFunction();
|
|
33
33
|
const [animation, config] = this.getAnimationAndConfig();
|
|
34
|
-
const delay = this.
|
|
34
|
+
const delay = this.getDelay();
|
|
35
35
|
const callback = this.callbackV;
|
|
36
36
|
return () => {
|
|
37
37
|
'worklet';
|
|
@@ -51,13 +51,13 @@ export class StretchInY extends BaseAnimationBuilder {
|
|
|
51
51
|
return new StretchInY();
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
export class StretchOutX extends
|
|
54
|
+
export class StretchOutX extends ComplexAnimationBuilder {
|
|
55
55
|
constructor() {
|
|
56
56
|
super(...arguments);
|
|
57
57
|
this.build = () => {
|
|
58
58
|
const delayFunction = this.getDelayFunction();
|
|
59
59
|
const [animation, config] = this.getAnimationAndConfig();
|
|
60
|
-
const delay = this.
|
|
60
|
+
const delay = this.getDelay();
|
|
61
61
|
const callback = this.callbackV;
|
|
62
62
|
return () => {
|
|
63
63
|
'worklet';
|
|
@@ -77,13 +77,13 @@ export class StretchOutX extends BaseAnimationBuilder {
|
|
|
77
77
|
return new StretchOutX();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
export class StretchOutY extends
|
|
80
|
+
export class StretchOutY extends ComplexAnimationBuilder {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments);
|
|
83
83
|
this.build = () => {
|
|
84
84
|
const delayFunction = this.getDelayFunction();
|
|
85
85
|
const [animation, config] = this.getAnimationAndConfig();
|
|
86
|
-
const delay = this.
|
|
86
|
+
const delay = this.getDelay();
|
|
87
87
|
const callback = this.callbackV;
|
|
88
88
|
return () => {
|
|
89
89
|
'worklet';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BaseAnimationBuilder } from '../animationBuilder/BaseAnimationBuilder';
|
|
2
1
|
import { Dimensions } from 'react-native';
|
|
2
|
+
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
3
3
|
const { width, height } = Dimensions.get('window');
|
|
4
|
-
export class ZoomIn extends
|
|
4
|
+
export class ZoomIn extends ComplexAnimationBuilder {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.build = () => {
|
|
8
8
|
const delayFunction = this.getDelayFunction();
|
|
9
9
|
const [animation, config] = this.getAnimationAndConfig();
|
|
10
|
-
const delay = this.
|
|
10
|
+
const delay = this.getDelay();
|
|
11
11
|
const callback = this.callbackV;
|
|
12
12
|
return () => {
|
|
13
13
|
'worklet';
|
|
@@ -27,13 +27,13 @@ export class ZoomIn extends BaseAnimationBuilder {
|
|
|
27
27
|
return new ZoomIn();
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
export class ZoomInRotate extends
|
|
30
|
+
export class ZoomInRotate extends ComplexAnimationBuilder {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
33
33
|
this.build = () => {
|
|
34
34
|
const delayFunction = this.getDelayFunction();
|
|
35
35
|
const [animation, config] = this.getAnimationAndConfig();
|
|
36
|
-
const delay = this.
|
|
36
|
+
const delay = this.getDelay();
|
|
37
37
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
38
38
|
const callback = this.callbackV;
|
|
39
39
|
return () => {
|
|
@@ -57,13 +57,13 @@ export class ZoomInRotate extends BaseAnimationBuilder {
|
|
|
57
57
|
return new ZoomInRotate();
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
export class ZoomInLeft extends
|
|
60
|
+
export class ZoomInLeft extends ComplexAnimationBuilder {
|
|
61
61
|
constructor() {
|
|
62
62
|
super(...arguments);
|
|
63
63
|
this.build = () => {
|
|
64
64
|
const delayFunction = this.getDelayFunction();
|
|
65
65
|
const [animation, config] = this.getAnimationAndConfig();
|
|
66
|
-
const delay = this.
|
|
66
|
+
const delay = this.getDelay();
|
|
67
67
|
const callback = this.callbackV;
|
|
68
68
|
return () => {
|
|
69
69
|
'worklet';
|
|
@@ -86,13 +86,13 @@ export class ZoomInLeft extends BaseAnimationBuilder {
|
|
|
86
86
|
return new ZoomInLeft();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
export class ZoomInRight extends
|
|
89
|
+
export class ZoomInRight extends ComplexAnimationBuilder {
|
|
90
90
|
constructor() {
|
|
91
91
|
super(...arguments);
|
|
92
92
|
this.build = () => {
|
|
93
93
|
const delayFunction = this.getDelayFunction();
|
|
94
94
|
const [animation, config] = this.getAnimationAndConfig();
|
|
95
|
-
const delay = this.
|
|
95
|
+
const delay = this.getDelay();
|
|
96
96
|
const callback = this.callbackV;
|
|
97
97
|
return () => {
|
|
98
98
|
'worklet';
|
|
@@ -115,13 +115,13 @@ export class ZoomInRight extends BaseAnimationBuilder {
|
|
|
115
115
|
return new ZoomInRight();
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
export class ZoomInUp extends
|
|
118
|
+
export class ZoomInUp extends ComplexAnimationBuilder {
|
|
119
119
|
constructor() {
|
|
120
120
|
super(...arguments);
|
|
121
121
|
this.build = () => {
|
|
122
122
|
const delayFunction = this.getDelayFunction();
|
|
123
123
|
const [animation, config] = this.getAnimationAndConfig();
|
|
124
|
-
const delay = this.
|
|
124
|
+
const delay = this.getDelay();
|
|
125
125
|
const callback = this.callbackV;
|
|
126
126
|
return () => {
|
|
127
127
|
'worklet';
|
|
@@ -144,13 +144,13 @@ export class ZoomInUp extends BaseAnimationBuilder {
|
|
|
144
144
|
return new ZoomInUp();
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
export class ZoomInDown extends
|
|
147
|
+
export class ZoomInDown extends ComplexAnimationBuilder {
|
|
148
148
|
constructor() {
|
|
149
149
|
super(...arguments);
|
|
150
150
|
this.build = () => {
|
|
151
151
|
const delayFunction = this.getDelayFunction();
|
|
152
152
|
const [animation, config] = this.getAnimationAndConfig();
|
|
153
|
-
const delay = this.
|
|
153
|
+
const delay = this.getDelay();
|
|
154
154
|
const callback = this.callbackV;
|
|
155
155
|
return () => {
|
|
156
156
|
'worklet';
|
|
@@ -173,13 +173,13 @@ export class ZoomInDown extends BaseAnimationBuilder {
|
|
|
173
173
|
return new ZoomInDown();
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
export class ZoomInEasyUp extends
|
|
176
|
+
export class ZoomInEasyUp extends ComplexAnimationBuilder {
|
|
177
177
|
constructor() {
|
|
178
178
|
super(...arguments);
|
|
179
179
|
this.build = () => {
|
|
180
180
|
const delayFunction = this.getDelayFunction();
|
|
181
181
|
const [animation, config] = this.getAnimationAndConfig();
|
|
182
|
-
const delay = this.
|
|
182
|
+
const delay = this.getDelay();
|
|
183
183
|
const callback = this.callbackV;
|
|
184
184
|
return (values) => {
|
|
185
185
|
'worklet';
|
|
@@ -202,13 +202,13 @@ export class ZoomInEasyUp extends BaseAnimationBuilder {
|
|
|
202
202
|
return new ZoomInEasyUp();
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
export class ZoomInEasyDown extends
|
|
205
|
+
export class ZoomInEasyDown extends ComplexAnimationBuilder {
|
|
206
206
|
constructor() {
|
|
207
207
|
super(...arguments);
|
|
208
208
|
this.build = () => {
|
|
209
209
|
const delayFunction = this.getDelayFunction();
|
|
210
210
|
const [animation, config] = this.getAnimationAndConfig();
|
|
211
|
-
const delay = this.
|
|
211
|
+
const delay = this.getDelay();
|
|
212
212
|
const callback = this.callbackV;
|
|
213
213
|
return (values) => {
|
|
214
214
|
'worklet';
|
|
@@ -231,13 +231,13 @@ export class ZoomInEasyDown extends BaseAnimationBuilder {
|
|
|
231
231
|
return new ZoomInEasyDown();
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
export class ZoomOut extends
|
|
234
|
+
export class ZoomOut extends ComplexAnimationBuilder {
|
|
235
235
|
constructor() {
|
|
236
236
|
super(...arguments);
|
|
237
237
|
this.build = () => {
|
|
238
238
|
const delayFunction = this.getDelayFunction();
|
|
239
239
|
const [animation, config] = this.getAnimationAndConfig();
|
|
240
|
-
const delay = this.
|
|
240
|
+
const delay = this.getDelay();
|
|
241
241
|
const callback = this.callbackV;
|
|
242
242
|
return () => {
|
|
243
243
|
'worklet';
|
|
@@ -257,13 +257,13 @@ export class ZoomOut extends BaseAnimationBuilder {
|
|
|
257
257
|
return new ZoomOut();
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
export class ZoomOutRotate extends
|
|
260
|
+
export class ZoomOutRotate extends ComplexAnimationBuilder {
|
|
261
261
|
constructor() {
|
|
262
262
|
super(...arguments);
|
|
263
263
|
this.build = () => {
|
|
264
264
|
const delayFunction = this.getDelayFunction();
|
|
265
265
|
const [animation, config] = this.getAnimationAndConfig();
|
|
266
|
-
const delay = this.
|
|
266
|
+
const delay = this.getDelay();
|
|
267
267
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
268
268
|
const callback = this.callbackV;
|
|
269
269
|
return () => {
|
|
@@ -287,13 +287,13 @@ export class ZoomOutRotate extends BaseAnimationBuilder {
|
|
|
287
287
|
return new ZoomOutRotate();
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
export class ZoomOutLeft extends
|
|
290
|
+
export class ZoomOutLeft extends ComplexAnimationBuilder {
|
|
291
291
|
constructor() {
|
|
292
292
|
super(...arguments);
|
|
293
293
|
this.build = () => {
|
|
294
294
|
const delayFunction = this.getDelayFunction();
|
|
295
295
|
const [animation, config] = this.getAnimationAndConfig();
|
|
296
|
-
const delay = this.
|
|
296
|
+
const delay = this.getDelay();
|
|
297
297
|
const callback = this.callbackV;
|
|
298
298
|
return () => {
|
|
299
299
|
'worklet';
|
|
@@ -316,13 +316,13 @@ export class ZoomOutLeft extends BaseAnimationBuilder {
|
|
|
316
316
|
return new ZoomOutLeft();
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
export class ZoomOutRight extends
|
|
319
|
+
export class ZoomOutRight extends ComplexAnimationBuilder {
|
|
320
320
|
constructor() {
|
|
321
321
|
super(...arguments);
|
|
322
322
|
this.build = () => {
|
|
323
323
|
const delayFunction = this.getDelayFunction();
|
|
324
324
|
const [animation, config] = this.getAnimationAndConfig();
|
|
325
|
-
const delay = this.
|
|
325
|
+
const delay = this.getDelay();
|
|
326
326
|
const callback = this.callbackV;
|
|
327
327
|
return () => {
|
|
328
328
|
'worklet';
|
|
@@ -345,13 +345,13 @@ export class ZoomOutRight extends BaseAnimationBuilder {
|
|
|
345
345
|
return new ZoomOutRight();
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
export class ZoomOutUp extends
|
|
348
|
+
export class ZoomOutUp extends ComplexAnimationBuilder {
|
|
349
349
|
constructor() {
|
|
350
350
|
super(...arguments);
|
|
351
351
|
this.build = () => {
|
|
352
352
|
const delayFunction = this.getDelayFunction();
|
|
353
353
|
const [animation, config] = this.getAnimationAndConfig();
|
|
354
|
-
const delay = this.
|
|
354
|
+
const delay = this.getDelay();
|
|
355
355
|
const callback = this.callbackV;
|
|
356
356
|
return () => {
|
|
357
357
|
'worklet';
|
|
@@ -374,13 +374,13 @@ export class ZoomOutUp extends BaseAnimationBuilder {
|
|
|
374
374
|
return new ZoomOutUp();
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
export class ZoomOutDown extends
|
|
377
|
+
export class ZoomOutDown extends ComplexAnimationBuilder {
|
|
378
378
|
constructor() {
|
|
379
379
|
super(...arguments);
|
|
380
380
|
this.build = () => {
|
|
381
381
|
const delayFunction = this.getDelayFunction();
|
|
382
382
|
const [animation, config] = this.getAnimationAndConfig();
|
|
383
|
-
const delay = this.
|
|
383
|
+
const delay = this.getDelay();
|
|
384
384
|
const callback = this.callbackV;
|
|
385
385
|
return () => {
|
|
386
386
|
'worklet';
|
|
@@ -403,13 +403,13 @@ export class ZoomOutDown extends BaseAnimationBuilder {
|
|
|
403
403
|
return new ZoomOutDown();
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
export class ZoomOutEasyUp extends
|
|
406
|
+
export class ZoomOutEasyUp extends ComplexAnimationBuilder {
|
|
407
407
|
constructor() {
|
|
408
408
|
super(...arguments);
|
|
409
409
|
this.build = () => {
|
|
410
410
|
const delayFunction = this.getDelayFunction();
|
|
411
411
|
const [animation, config] = this.getAnimationAndConfig();
|
|
412
|
-
const delay = this.
|
|
412
|
+
const delay = this.getDelay();
|
|
413
413
|
const callback = this.callbackV;
|
|
414
414
|
return (values) => {
|
|
415
415
|
'worklet';
|
|
@@ -434,13 +434,13 @@ export class ZoomOutEasyUp extends BaseAnimationBuilder {
|
|
|
434
434
|
return new ZoomOutEasyUp();
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
export class ZoomOutEasyDown extends
|
|
437
|
+
export class ZoomOutEasyDown extends ComplexAnimationBuilder {
|
|
438
438
|
constructor() {
|
|
439
439
|
super(...arguments);
|
|
440
440
|
this.build = () => {
|
|
441
441
|
const delayFunction = this.getDelayFunction();
|
|
442
442
|
const [animation, config] = this.getAnimationAndConfig();
|
|
443
|
-
const delay = this.
|
|
443
|
+
const delay = this.getDelay();
|
|
444
444
|
const callback = this.callbackV;
|
|
445
445
|
return (values) => {
|
|
446
446
|
'worklet';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
2
|
+
import { Easing } from '../../Easing';
|
|
3
|
+
import { withTiming } from '../../animation';
|
|
4
|
+
export class CurvedTransition extends BaseAnimationBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.easingXV = Easing.in(Easing.ease);
|
|
8
|
+
this.easingYV = Easing.out(Easing.ease);
|
|
9
|
+
this.easingWidthV = Easing.in(Easing.exp);
|
|
10
|
+
this.easingHeightV = Easing.out(Easing.exp);
|
|
11
|
+
this.build = () => {
|
|
12
|
+
var _a;
|
|
13
|
+
const delayFunction = this.getDelayFunction();
|
|
14
|
+
const callback = this.callbackV;
|
|
15
|
+
const delay = this.getDelay();
|
|
16
|
+
const duration = (_a = this.durationV) !== null && _a !== void 0 ? _a : 300;
|
|
17
|
+
const easing = {
|
|
18
|
+
easingX: this.easingXV,
|
|
19
|
+
easingY: this.easingYV,
|
|
20
|
+
easingWidth: this.easingWidthV,
|
|
21
|
+
easingHeight: this.easingHeightV,
|
|
22
|
+
};
|
|
23
|
+
return (values) => {
|
|
24
|
+
'worklet';
|
|
25
|
+
return {
|
|
26
|
+
initialValues: {
|
|
27
|
+
originX: values.boriginX,
|
|
28
|
+
originY: values.boriginY,
|
|
29
|
+
width: values.bwidth,
|
|
30
|
+
height: values.bheight,
|
|
31
|
+
},
|
|
32
|
+
animations: {
|
|
33
|
+
originX: delayFunction(delay, withTiming(values.originX, { duration, easing: easing.easingX })),
|
|
34
|
+
originY: delayFunction(delay, withTiming(values.originY, { duration, easing: easing.easingY })),
|
|
35
|
+
width: delayFunction(delay, withTiming(values.width, { duration, easing: easing.easingWidth })),
|
|
36
|
+
height: delayFunction(delay, withTiming(values.height, { duration, easing: easing.easingHeight })),
|
|
37
|
+
},
|
|
38
|
+
callback: callback,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
static createInstance() {
|
|
44
|
+
return new CurvedTransition();
|
|
45
|
+
}
|
|
46
|
+
static easingX(easing) {
|
|
47
|
+
const instance = this.createInstance();
|
|
48
|
+
return instance.easingX(easing);
|
|
49
|
+
}
|
|
50
|
+
easingX(easing) {
|
|
51
|
+
this.easingXV = easing;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
static easingY(easing) {
|
|
55
|
+
const instance = this.createInstance();
|
|
56
|
+
return instance.easingY(easing);
|
|
57
|
+
}
|
|
58
|
+
easingY(easing) {
|
|
59
|
+
this.easingYV = easing;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
static easingWidth(easing) {
|
|
63
|
+
const instance = this.createInstance();
|
|
64
|
+
return instance.easingWidth(easing);
|
|
65
|
+
}
|
|
66
|
+
easingWidth(easing) {
|
|
67
|
+
this.easingWidthV = easing;
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
static easingHeight(easing) {
|
|
71
|
+
const instance = this.createInstance();
|
|
72
|
+
return instance.easingHeight(easing);
|
|
73
|
+
}
|
|
74
|
+
easingHeight(easing) {
|
|
75
|
+
this.easingHeightV = easing;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
2
|
+
import { withSequence, withTiming } from '../../animation';
|
|
3
|
+
import { FadeIn, FadeOut } from '../defaultAnimations/Fade';
|
|
4
|
+
export class EntryExitTransition extends BaseAnimationBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.enteringV = FadeIn;
|
|
8
|
+
this.exitingV = FadeOut;
|
|
9
|
+
this.build = () => {
|
|
10
|
+
const delayFunction = this.getDelayFunction();
|
|
11
|
+
const callback = this.callbackV;
|
|
12
|
+
const delay = this.getDelay();
|
|
13
|
+
const enteringAnimation = this.enteringV.build();
|
|
14
|
+
const exitingAnimation = this.exitingV.build();
|
|
15
|
+
const exitingDuration = this.exitingV.getDuration();
|
|
16
|
+
return (values) => {
|
|
17
|
+
'worklet';
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
const enteringValues = enteringAnimation(values);
|
|
20
|
+
const exitingValues = exitingAnimation(values);
|
|
21
|
+
const animations = {
|
|
22
|
+
transform: [],
|
|
23
|
+
};
|
|
24
|
+
for (const prop of Object.keys(exitingValues.animations)) {
|
|
25
|
+
if (prop === 'transform') {
|
|
26
|
+
(_a = exitingValues.animations[prop]) === null || _a === void 0 ? void 0 : _a.forEach((value, index) => {
|
|
27
|
+
var _a;
|
|
28
|
+
for (const transformProp of Object.keys(value)) {
|
|
29
|
+
(_a = animations.transform) === null || _a === void 0 ? void 0 : _a.push({
|
|
30
|
+
[transformProp]: delayFunction(delay, withSequence(value[transformProp], withTiming(exitingValues.initialValues.transform
|
|
31
|
+
? exitingValues.initialValues.transform[index][transformProp]
|
|
32
|
+
: 0, { duration: 0 }))),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const sequence = enteringValues.animations[prop] !== undefined
|
|
39
|
+
? [
|
|
40
|
+
exitingValues.animations[prop],
|
|
41
|
+
withTiming(enteringValues.initialValues[prop], {
|
|
42
|
+
duration: 0,
|
|
43
|
+
}),
|
|
44
|
+
enteringValues.animations[prop],
|
|
45
|
+
]
|
|
46
|
+
: [
|
|
47
|
+
exitingValues.animations[prop],
|
|
48
|
+
withTiming(Object.keys(values).includes(prop)
|
|
49
|
+
? values[prop]
|
|
50
|
+
: exitingValues.initialValues[prop], { duration: 0 }),
|
|
51
|
+
];
|
|
52
|
+
animations[prop] = delayFunction(delay, withSequence(...sequence));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (const prop of Object.keys(enteringValues.animations)) {
|
|
56
|
+
if (prop === 'transform') {
|
|
57
|
+
(_b = enteringValues.animations[prop]) === null || _b === void 0 ? void 0 : _b.forEach((value, index) => {
|
|
58
|
+
var _a;
|
|
59
|
+
for (const transformProp of Object.keys(value)) {
|
|
60
|
+
(_a = animations.transform) === null || _a === void 0 ? void 0 : _a.push({
|
|
61
|
+
[transformProp]: delayFunction(delay + exitingDuration, withSequence(withTiming(enteringValues.initialValues.transform
|
|
62
|
+
? enteringValues.initialValues.transform[index][transformProp]
|
|
63
|
+
: 0, { duration: exitingDuration }), value[transformProp])),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else if (animations[prop] !== undefined) {
|
|
69
|
+
// it was already added in the previous loop
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
animations[prop] = delayFunction(delay, withSequence(withTiming(enteringValues.initialValues[prop], { duration: 0 }), enteringValues.animations[prop]));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const mergedTransform = ((_c = exitingValues.initialValues.transform) !== null && _c !== void 0 ? _c : []).concat(((_d = enteringValues.animations.transform) !== null && _d !== void 0 ? _d : []).map((value) => {
|
|
77
|
+
for (const transformProp of Object.keys(value)) {
|
|
78
|
+
const current = value[transformProp].current;
|
|
79
|
+
if (typeof current === 'string') {
|
|
80
|
+
if (current.includes('deg'))
|
|
81
|
+
return {
|
|
82
|
+
[transformProp]: '0deg',
|
|
83
|
+
};
|
|
84
|
+
else
|
|
85
|
+
return {
|
|
86
|
+
[transformProp]: '0',
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
else if (transformProp.includes('translate')) {
|
|
90
|
+
return { [transformProp]: 0 };
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return { [transformProp]: 1 };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return value;
|
|
97
|
+
}));
|
|
98
|
+
return {
|
|
99
|
+
initialValues: Object.assign(Object.assign({}, exitingValues.initialValues), { originX: values.boriginX, originY: values.boriginY, width: values.bwidth, height: values.bheight, transform: mergedTransform }),
|
|
100
|
+
animations: Object.assign({ originX: delayFunction(delay + exitingDuration, withTiming(values.originX, { duration: exitingDuration })), originY: delayFunction(delay + exitingDuration, withTiming(values.originY, { duration: exitingDuration })), width: delayFunction(delay + exitingDuration, withTiming(values.width, { duration: exitingDuration })), height: delayFunction(delay + exitingDuration, withTiming(values.height, { duration: exitingDuration })) }, animations),
|
|
101
|
+
callback: callback,
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
static createInstance() {
|
|
107
|
+
return new EntryExitTransition();
|
|
108
|
+
}
|
|
109
|
+
static entering(animation) {
|
|
110
|
+
const instance = this.createInstance();
|
|
111
|
+
return instance.entering(animation);
|
|
112
|
+
}
|
|
113
|
+
entering(animation) {
|
|
114
|
+
this.enteringV = animation;
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
static exiting(animation) {
|
|
118
|
+
const instance = this.createInstance();
|
|
119
|
+
return instance.exiting(animation);
|
|
120
|
+
}
|
|
121
|
+
exiting(animation) {
|
|
122
|
+
this.exitingV = animation;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function combineTransition(exiting, entering) {
|
|
127
|
+
return EntryExitTransition.entering(entering).exiting(exiting);
|
|
128
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { withSequence, withTiming } from '../../animation';
|
|
2
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
3
|
+
export class FadingTransition extends BaseAnimationBuilder {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.build = () => {
|
|
7
|
+
var _a;
|
|
8
|
+
const delayFunction = this.getDelayFunction();
|
|
9
|
+
const callback = this.callbackV;
|
|
10
|
+
const delay = this.getDelay();
|
|
11
|
+
const duration = (_a = this.durationV) !== null && _a !== void 0 ? _a : 500;
|
|
12
|
+
return (values) => {
|
|
13
|
+
'worklet';
|
|
14
|
+
return {
|
|
15
|
+
initialValues: {
|
|
16
|
+
opacity: 1,
|
|
17
|
+
originX: values.boriginX,
|
|
18
|
+
originY: values.boriginY,
|
|
19
|
+
width: values.bwidth,
|
|
20
|
+
height: values.bheight,
|
|
21
|
+
},
|
|
22
|
+
animations: {
|
|
23
|
+
opacity: delayFunction(delay, withSequence(withTiming(0, { duration: duration }), withTiming(1, { duration: duration }))),
|
|
24
|
+
originX: delayFunction(delay + duration, withTiming(values.originX, { duration: 50 })),
|
|
25
|
+
originY: delayFunction(delay + duration, withTiming(values.originY, { duration: 50 })),
|
|
26
|
+
width: delayFunction(delay + duration, withTiming(values.width, { duration: 50 })),
|
|
27
|
+
height: delayFunction(delay + duration, withTiming(values.height, { duration: 50 })),
|
|
28
|
+
},
|
|
29
|
+
callback: callback,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static createInstance() {
|
|
35
|
+
return new FadingTransition();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { withSequence, withTiming } from '../../animation';
|
|
2
|
+
import { Easing } from '../../Easing';
|
|
3
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
4
|
+
export class JumpingTransition extends BaseAnimationBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.build = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
const delayFunction = this.getDelayFunction();
|
|
10
|
+
const callback = this.callbackV;
|
|
11
|
+
const delay = this.getDelay();
|
|
12
|
+
const duration = ((_a = this.durationV) !== null && _a !== void 0 ? _a : 300) / 2;
|
|
13
|
+
const config = { duration: duration * 2 };
|
|
14
|
+
return (values) => {
|
|
15
|
+
'worklet';
|
|
16
|
+
const d = Math.max(Math.abs(values.originX - values.boriginX), Math.abs(values.originY - values.boriginY));
|
|
17
|
+
return {
|
|
18
|
+
initialValues: {
|
|
19
|
+
originX: values.boriginX,
|
|
20
|
+
originY: values.boriginY,
|
|
21
|
+
width: values.bwidth,
|
|
22
|
+
height: values.bheight,
|
|
23
|
+
},
|
|
24
|
+
animations: {
|
|
25
|
+
originX: delayFunction(delay, withTiming(values.originX, config)),
|
|
26
|
+
originY: delayFunction(delay, withSequence(withTiming(Math.min(values.originY, values.boriginY) - d, {
|
|
27
|
+
duration,
|
|
28
|
+
easing: Easing.out(Easing.exp),
|
|
29
|
+
}), withTiming(values.originY, Object.assign(Object.assign({}, config), { duration, easing: Easing.bounce })))),
|
|
30
|
+
width: delayFunction(delay, withTiming(values.width, config)),
|
|
31
|
+
height: delayFunction(delay, withTiming(values.height, config)),
|
|
32
|
+
},
|
|
33
|
+
callback: callback,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static createInstance() {
|
|
39
|
+
return new JumpingTransition();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';
|
|
2
|
+
export class LinearTransition extends ComplexAnimationBuilder {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.build = () => {
|
|
6
|
+
const delayFunction = this.getDelayFunction();
|
|
7
|
+
const [animation, config] = this.getAnimationAndConfig();
|
|
8
|
+
const callback = this.callbackV;
|
|
9
|
+
const delay = this.getDelay();
|
|
10
|
+
return (values) => {
|
|
11
|
+
'worklet';
|
|
12
|
+
return {
|
|
13
|
+
initialValues: {
|
|
14
|
+
originX: values.boriginX,
|
|
15
|
+
originY: values.boriginY,
|
|
16
|
+
width: values.bwidth,
|
|
17
|
+
height: values.bheight,
|
|
18
|
+
},
|
|
19
|
+
animations: {
|
|
20
|
+
originX: delayFunction(delay, animation(values.originX, config)),
|
|
21
|
+
originY: delayFunction(delay, animation(values.originY, config)),
|
|
22
|
+
width: delayFunction(delay, animation(values.width, config)),
|
|
23
|
+
height: delayFunction(delay, animation(values.height, config)),
|
|
24
|
+
},
|
|
25
|
+
callback: callback,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static createInstance() {
|
|
31
|
+
return new LinearTransition();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const Layout = LinearTransition;
|