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,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IEntryExitAnimationBuilder,
|
|
3
|
-
|
|
3
|
+
EntryExitAnimationFunction,
|
|
4
4
|
} from '../animationBuilder/commonTypes';
|
|
5
|
-
import { BaseAnimationBuilder } from '../animationBuilder/BaseAnimationBuilder';
|
|
6
5
|
import { Dimensions } from 'react-native';
|
|
6
|
+
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
7
7
|
|
|
8
8
|
const { width, height } = Dimensions.get('window');
|
|
9
9
|
|
|
10
10
|
export class ZoomIn
|
|
11
|
-
extends
|
|
11
|
+
extends ComplexAnimationBuilder
|
|
12
12
|
implements IEntryExitAnimationBuilder {
|
|
13
13
|
static createInstance(): ZoomIn {
|
|
14
14
|
return new ZoomIn();
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
build
|
|
17
|
+
build = (): EntryExitAnimationFunction => {
|
|
18
18
|
const delayFunction = this.getDelayFunction();
|
|
19
19
|
const [animation, config] = this.getAnimationAndConfig();
|
|
20
|
-
const delay = this.
|
|
20
|
+
const delay = this.getDelay();
|
|
21
21
|
const callback = this.callbackV;
|
|
22
22
|
|
|
23
23
|
return () => {
|
|
@@ -36,16 +36,16 @@ export class ZoomIn
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export class ZoomInRotate
|
|
39
|
-
extends
|
|
39
|
+
extends ComplexAnimationBuilder
|
|
40
40
|
implements IEntryExitAnimationBuilder {
|
|
41
41
|
static createInstance(): ZoomInRotate {
|
|
42
42
|
return new ZoomInRotate();
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
build
|
|
45
|
+
build = (): EntryExitAnimationFunction => {
|
|
46
46
|
const delayFunction = this.getDelayFunction();
|
|
47
47
|
const [animation, config] = this.getAnimationAndConfig();
|
|
48
|
-
const delay = this.
|
|
48
|
+
const delay = this.getDelay();
|
|
49
49
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
50
50
|
const callback = this.callbackV;
|
|
51
51
|
|
|
@@ -68,16 +68,16 @@ export class ZoomInRotate
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export class ZoomInLeft
|
|
71
|
-
extends
|
|
71
|
+
extends ComplexAnimationBuilder
|
|
72
72
|
implements IEntryExitAnimationBuilder {
|
|
73
73
|
static createInstance(): ZoomInLeft {
|
|
74
74
|
return new ZoomInLeft();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
build
|
|
77
|
+
build = (): EntryExitAnimationFunction => {
|
|
78
78
|
const delayFunction = this.getDelayFunction();
|
|
79
79
|
const [animation, config] = this.getAnimationAndConfig();
|
|
80
|
-
const delay = this.
|
|
80
|
+
const delay = this.getDelay();
|
|
81
81
|
const callback = this.callbackV;
|
|
82
82
|
|
|
83
83
|
return () => {
|
|
@@ -99,16 +99,16 @@ export class ZoomInLeft
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export class ZoomInRight
|
|
102
|
-
extends
|
|
102
|
+
extends ComplexAnimationBuilder
|
|
103
103
|
implements IEntryExitAnimationBuilder {
|
|
104
104
|
static createInstance(): ZoomInRight {
|
|
105
105
|
return new ZoomInRight();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
build
|
|
108
|
+
build = (): EntryExitAnimationFunction => {
|
|
109
109
|
const delayFunction = this.getDelayFunction();
|
|
110
110
|
const [animation, config] = this.getAnimationAndConfig();
|
|
111
|
-
const delay = this.
|
|
111
|
+
const delay = this.getDelay();
|
|
112
112
|
const callback = this.callbackV;
|
|
113
113
|
|
|
114
114
|
return () => {
|
|
@@ -130,16 +130,16 @@ export class ZoomInRight
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export class ZoomInUp
|
|
133
|
-
extends
|
|
133
|
+
extends ComplexAnimationBuilder
|
|
134
134
|
implements IEntryExitAnimationBuilder {
|
|
135
135
|
static createInstance(): ZoomInUp {
|
|
136
136
|
return new ZoomInUp();
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
build
|
|
139
|
+
build = (): EntryExitAnimationFunction => {
|
|
140
140
|
const delayFunction = this.getDelayFunction();
|
|
141
141
|
const [animation, config] = this.getAnimationAndConfig();
|
|
142
|
-
const delay = this.
|
|
142
|
+
const delay = this.getDelay();
|
|
143
143
|
const callback = this.callbackV;
|
|
144
144
|
|
|
145
145
|
return () => {
|
|
@@ -161,16 +161,16 @@ export class ZoomInUp
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export class ZoomInDown
|
|
164
|
-
extends
|
|
164
|
+
extends ComplexAnimationBuilder
|
|
165
165
|
implements IEntryExitAnimationBuilder {
|
|
166
166
|
static createInstance(): ZoomInDown {
|
|
167
167
|
return new ZoomInDown();
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
build
|
|
170
|
+
build = (): EntryExitAnimationFunction => {
|
|
171
171
|
const delayFunction = this.getDelayFunction();
|
|
172
172
|
const [animation, config] = this.getAnimationAndConfig();
|
|
173
|
-
const delay = this.
|
|
173
|
+
const delay = this.getDelay();
|
|
174
174
|
const callback = this.callbackV;
|
|
175
175
|
|
|
176
176
|
return () => {
|
|
@@ -192,16 +192,16 @@ export class ZoomInDown
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
export class ZoomInEasyUp
|
|
195
|
-
extends
|
|
195
|
+
extends ComplexAnimationBuilder
|
|
196
196
|
implements IEntryExitAnimationBuilder {
|
|
197
197
|
static createInstance(): ZoomInEasyUp {
|
|
198
198
|
return new ZoomInEasyUp();
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
build
|
|
201
|
+
build = (): EntryExitAnimationFunction => {
|
|
202
202
|
const delayFunction = this.getDelayFunction();
|
|
203
203
|
const [animation, config] = this.getAnimationAndConfig();
|
|
204
|
-
const delay = this.
|
|
204
|
+
const delay = this.getDelay();
|
|
205
205
|
const callback = this.callbackV;
|
|
206
206
|
|
|
207
207
|
return (values) => {
|
|
@@ -223,16 +223,16 @@ export class ZoomInEasyUp
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
export class ZoomInEasyDown
|
|
226
|
-
extends
|
|
226
|
+
extends ComplexAnimationBuilder
|
|
227
227
|
implements IEntryExitAnimationBuilder {
|
|
228
228
|
static createInstance(): ZoomInEasyDown {
|
|
229
229
|
return new ZoomInEasyDown();
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
build
|
|
232
|
+
build = (): EntryExitAnimationFunction => {
|
|
233
233
|
const delayFunction = this.getDelayFunction();
|
|
234
234
|
const [animation, config] = this.getAnimationAndConfig();
|
|
235
|
-
const delay = this.
|
|
235
|
+
const delay = this.getDelay();
|
|
236
236
|
const callback = this.callbackV;
|
|
237
237
|
|
|
238
238
|
return (values) => {
|
|
@@ -254,16 +254,16 @@ export class ZoomInEasyDown
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
export class ZoomOut
|
|
257
|
-
extends
|
|
257
|
+
extends ComplexAnimationBuilder
|
|
258
258
|
implements IEntryExitAnimationBuilder {
|
|
259
259
|
static createInstance(): ZoomOut {
|
|
260
260
|
return new ZoomOut();
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
build
|
|
263
|
+
build = (): EntryExitAnimationFunction => {
|
|
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 callback = this.callbackV;
|
|
268
268
|
|
|
269
269
|
return () => {
|
|
@@ -282,16 +282,16 @@ export class ZoomOut
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
export class ZoomOutRotate
|
|
285
|
-
extends
|
|
285
|
+
extends ComplexAnimationBuilder
|
|
286
286
|
implements IEntryExitAnimationBuilder {
|
|
287
287
|
static createInstance(): ZoomOutRotate {
|
|
288
288
|
return new ZoomOutRotate();
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
build
|
|
291
|
+
build = (): EntryExitAnimationFunction => {
|
|
292
292
|
const delayFunction = this.getDelayFunction();
|
|
293
293
|
const [animation, config] = this.getAnimationAndConfig();
|
|
294
|
-
const delay = this.
|
|
294
|
+
const delay = this.getDelay();
|
|
295
295
|
const rotate = this.rotateV ? this.rotateV : '0.3';
|
|
296
296
|
const callback = this.callbackV;
|
|
297
297
|
|
|
@@ -314,16 +314,16 @@ export class ZoomOutRotate
|
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
export class ZoomOutLeft
|
|
317
|
-
extends
|
|
317
|
+
extends ComplexAnimationBuilder
|
|
318
318
|
implements IEntryExitAnimationBuilder {
|
|
319
319
|
static createInstance(): ZoomOutLeft {
|
|
320
320
|
return new ZoomOutLeft();
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
build
|
|
323
|
+
build = (): EntryExitAnimationFunction => {
|
|
324
324
|
const delayFunction = this.getDelayFunction();
|
|
325
325
|
const [animation, config] = this.getAnimationAndConfig();
|
|
326
|
-
const delay = this.
|
|
326
|
+
const delay = this.getDelay();
|
|
327
327
|
const callback = this.callbackV;
|
|
328
328
|
|
|
329
329
|
return () => {
|
|
@@ -345,16 +345,16 @@ export class ZoomOutLeft
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
export class ZoomOutRight
|
|
348
|
-
extends
|
|
348
|
+
extends ComplexAnimationBuilder
|
|
349
349
|
implements IEntryExitAnimationBuilder {
|
|
350
350
|
static createInstance(): ZoomOutRight {
|
|
351
351
|
return new ZoomOutRight();
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
build
|
|
354
|
+
build = (): EntryExitAnimationFunction => {
|
|
355
355
|
const delayFunction = this.getDelayFunction();
|
|
356
356
|
const [animation, config] = this.getAnimationAndConfig();
|
|
357
|
-
const delay = this.
|
|
357
|
+
const delay = this.getDelay();
|
|
358
358
|
const callback = this.callbackV;
|
|
359
359
|
|
|
360
360
|
return () => {
|
|
@@ -376,16 +376,16 @@ export class ZoomOutRight
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
export class ZoomOutUp
|
|
379
|
-
extends
|
|
379
|
+
extends ComplexAnimationBuilder
|
|
380
380
|
implements IEntryExitAnimationBuilder {
|
|
381
381
|
static createInstance(): ZoomOutUp {
|
|
382
382
|
return new ZoomOutUp();
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
build
|
|
385
|
+
build = (): EntryExitAnimationFunction => {
|
|
386
386
|
const delayFunction = this.getDelayFunction();
|
|
387
387
|
const [animation, config] = this.getAnimationAndConfig();
|
|
388
|
-
const delay = this.
|
|
388
|
+
const delay = this.getDelay();
|
|
389
389
|
const callback = this.callbackV;
|
|
390
390
|
|
|
391
391
|
return () => {
|
|
@@ -407,16 +407,16 @@ export class ZoomOutUp
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
export class ZoomOutDown
|
|
410
|
-
extends
|
|
410
|
+
extends ComplexAnimationBuilder
|
|
411
411
|
implements IEntryExitAnimationBuilder {
|
|
412
412
|
static createInstance(): ZoomOutDown {
|
|
413
413
|
return new ZoomOutDown();
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
build
|
|
416
|
+
build = (): EntryExitAnimationFunction => {
|
|
417
417
|
const delayFunction = this.getDelayFunction();
|
|
418
418
|
const [animation, config] = this.getAnimationAndConfig();
|
|
419
|
-
const delay = this.
|
|
419
|
+
const delay = this.getDelay();
|
|
420
420
|
const callback = this.callbackV;
|
|
421
421
|
|
|
422
422
|
return () => {
|
|
@@ -438,16 +438,16 @@ export class ZoomOutDown
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
export class ZoomOutEasyUp
|
|
441
|
-
extends
|
|
441
|
+
extends ComplexAnimationBuilder
|
|
442
442
|
implements IEntryExitAnimationBuilder {
|
|
443
443
|
static createInstance(): ZoomOutEasyUp {
|
|
444
444
|
return new ZoomOutEasyUp();
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
build
|
|
447
|
+
build = (): EntryExitAnimationFunction => {
|
|
448
448
|
const delayFunction = this.getDelayFunction();
|
|
449
449
|
const [animation, config] = this.getAnimationAndConfig();
|
|
450
|
-
const delay = this.
|
|
450
|
+
const delay = this.getDelay();
|
|
451
451
|
const callback = this.callbackV;
|
|
452
452
|
|
|
453
453
|
return (values) => {
|
|
@@ -474,16 +474,16 @@ export class ZoomOutEasyUp
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
export class ZoomOutEasyDown
|
|
477
|
-
extends
|
|
477
|
+
extends ComplexAnimationBuilder
|
|
478
478
|
implements IEntryExitAnimationBuilder {
|
|
479
479
|
static createInstance(): ZoomOutEasyDown {
|
|
480
480
|
return new ZoomOutEasyDown();
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
build
|
|
483
|
+
build = (): EntryExitAnimationFunction => {
|
|
484
484
|
const delayFunction = this.getDelayFunction();
|
|
485
485
|
const [animation, config] = this.getAnimationAndConfig();
|
|
486
|
-
const delay = this.
|
|
486
|
+
const delay = this.getDelay();
|
|
487
487
|
const callback = this.callbackV;
|
|
488
488
|
|
|
489
489
|
return (values) => {
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ILayoutAnimationBuilder,
|
|
3
|
+
LayoutAnimationFunction,
|
|
4
|
+
} from '../animationBuilder/commonTypes';
|
|
5
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
6
|
+
import { EasingFn, Easing } from '../../Easing';
|
|
7
|
+
import { withTiming } from '../../animation';
|
|
8
|
+
|
|
9
|
+
export class CurvedTransition
|
|
10
|
+
extends BaseAnimationBuilder
|
|
11
|
+
implements ILayoutAnimationBuilder {
|
|
12
|
+
easingXV: EasingFn = Easing.in(Easing.ease);
|
|
13
|
+
easingYV: EasingFn = Easing.out(Easing.ease);
|
|
14
|
+
easingWidthV: EasingFn = Easing.in(Easing.exp);
|
|
15
|
+
easingHeightV: EasingFn = Easing.out(Easing.exp);
|
|
16
|
+
static createInstance(): CurvedTransition {
|
|
17
|
+
return new CurvedTransition();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static easingX(easing: EasingFn): CurvedTransition {
|
|
21
|
+
const instance = this.createInstance();
|
|
22
|
+
return instance.easingX(easing);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
easingX(easing: EasingFn): CurvedTransition {
|
|
26
|
+
this.easingXV = easing;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static easingY(easing: EasingFn): CurvedTransition {
|
|
31
|
+
const instance = this.createInstance();
|
|
32
|
+
return instance.easingY(easing);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
easingY(easing: EasingFn): CurvedTransition {
|
|
36
|
+
this.easingYV = easing;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static easingWidth(easing: EasingFn): CurvedTransition {
|
|
41
|
+
const instance = this.createInstance();
|
|
42
|
+
return instance.easingWidth(easing);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
easingWidth(easing: EasingFn): CurvedTransition {
|
|
46
|
+
this.easingWidthV = easing;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static easingHeight(easing: EasingFn): CurvedTransition {
|
|
51
|
+
const instance = this.createInstance();
|
|
52
|
+
return instance.easingHeight(easing);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
easingHeight(easing: EasingFn): CurvedTransition {
|
|
56
|
+
this.easingHeightV = easing;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
build = (): LayoutAnimationFunction => {
|
|
61
|
+
const delayFunction = this.getDelayFunction();
|
|
62
|
+
const callback = this.callbackV;
|
|
63
|
+
const delay = this.getDelay();
|
|
64
|
+
const duration = this.durationV ?? 300;
|
|
65
|
+
const easing = {
|
|
66
|
+
easingX: this.easingXV,
|
|
67
|
+
easingY: this.easingYV,
|
|
68
|
+
easingWidth: this.easingWidthV,
|
|
69
|
+
easingHeight: this.easingHeightV,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (values) => {
|
|
73
|
+
'worklet';
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
initialValues: {
|
|
77
|
+
originX: values.boriginX,
|
|
78
|
+
originY: values.boriginY,
|
|
79
|
+
width: values.bwidth,
|
|
80
|
+
height: values.bheight,
|
|
81
|
+
},
|
|
82
|
+
animations: {
|
|
83
|
+
originX: delayFunction(
|
|
84
|
+
delay,
|
|
85
|
+
withTiming(values.originX, { duration, easing: easing.easingX })
|
|
86
|
+
),
|
|
87
|
+
originY: delayFunction(
|
|
88
|
+
delay,
|
|
89
|
+
withTiming(values.originY, { duration, easing: easing.easingY })
|
|
90
|
+
),
|
|
91
|
+
width: delayFunction(
|
|
92
|
+
delay,
|
|
93
|
+
withTiming(values.width, { duration, easing: easing.easingWidth })
|
|
94
|
+
),
|
|
95
|
+
height: delayFunction(
|
|
96
|
+
delay,
|
|
97
|
+
withTiming(values.height, { duration, easing: easing.easingHeight })
|
|
98
|
+
),
|
|
99
|
+
},
|
|
100
|
+
callback: callback,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ILayoutAnimationBuilder,
|
|
3
|
+
LayoutAnimationsValues,
|
|
4
|
+
LayoutAnimationFunction,
|
|
5
|
+
} from '../animationBuilder/commonTypes';
|
|
6
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
7
|
+
import { AnimationObject, withSequence, withTiming } from '../../animation';
|
|
8
|
+
import { FadeIn, FadeOut } from '../defaultAnimations/Fade';
|
|
9
|
+
import { StyleProps, TransformProperty } from '../../commonTypes';
|
|
10
|
+
|
|
11
|
+
export class EntryExitTransition
|
|
12
|
+
extends BaseAnimationBuilder
|
|
13
|
+
implements ILayoutAnimationBuilder {
|
|
14
|
+
enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;
|
|
15
|
+
|
|
16
|
+
exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;
|
|
17
|
+
|
|
18
|
+
static createInstance(): EntryExitTransition {
|
|
19
|
+
return new EntryExitTransition();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static entering(
|
|
23
|
+
animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
|
|
24
|
+
): EntryExitTransition {
|
|
25
|
+
const instance = this.createInstance();
|
|
26
|
+
return instance.entering(animation);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
entering(
|
|
30
|
+
animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
|
|
31
|
+
): EntryExitTransition {
|
|
32
|
+
this.enteringV = animation;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static exiting(
|
|
37
|
+
animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
|
|
38
|
+
): EntryExitTransition {
|
|
39
|
+
const instance = this.createInstance();
|
|
40
|
+
return instance.exiting(animation);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exiting(
|
|
44
|
+
animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
|
|
45
|
+
): EntryExitTransition {
|
|
46
|
+
this.exitingV = animation;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
build = (): LayoutAnimationFunction => {
|
|
51
|
+
const delayFunction = this.getDelayFunction();
|
|
52
|
+
const callback = this.callbackV;
|
|
53
|
+
const delay = this.getDelay();
|
|
54
|
+
const enteringAnimation = this.enteringV.build();
|
|
55
|
+
const exitingAnimation = this.exitingV.build();
|
|
56
|
+
const exitingDuration = this.exitingV.getDuration();
|
|
57
|
+
|
|
58
|
+
return (values) => {
|
|
59
|
+
'worklet';
|
|
60
|
+
const enteringValues = enteringAnimation(values);
|
|
61
|
+
const exitingValues = exitingAnimation(values);
|
|
62
|
+
const animations: StyleProps = {
|
|
63
|
+
transform: [],
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
for (const prop of Object.keys(exitingValues.animations)) {
|
|
67
|
+
if (prop === 'transform') {
|
|
68
|
+
exitingValues.animations[prop]?.forEach((value, index) => {
|
|
69
|
+
for (const transformProp of Object.keys(value)) {
|
|
70
|
+
animations.transform?.push({
|
|
71
|
+
[transformProp]: delayFunction(
|
|
72
|
+
delay,
|
|
73
|
+
withSequence(
|
|
74
|
+
value[transformProp as keyof TransformProperty],
|
|
75
|
+
withTiming(
|
|
76
|
+
exitingValues.initialValues.transform
|
|
77
|
+
? exitingValues.initialValues.transform[index][
|
|
78
|
+
transformProp as keyof TransformProperty
|
|
79
|
+
]
|
|
80
|
+
: 0,
|
|
81
|
+
{ duration: 0 }
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
} as TransformProperty);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
const sequence =
|
|
90
|
+
enteringValues.animations[prop] !== undefined
|
|
91
|
+
? [
|
|
92
|
+
exitingValues.animations[prop],
|
|
93
|
+
withTiming(enteringValues.initialValues[prop], {
|
|
94
|
+
duration: 0,
|
|
95
|
+
}),
|
|
96
|
+
enteringValues.animations[prop],
|
|
97
|
+
]
|
|
98
|
+
: [
|
|
99
|
+
exitingValues.animations[prop],
|
|
100
|
+
withTiming(
|
|
101
|
+
Object.keys(values).includes(prop)
|
|
102
|
+
? values[prop as keyof LayoutAnimationsValues]
|
|
103
|
+
: exitingValues.initialValues[prop],
|
|
104
|
+
{ duration: 0 }
|
|
105
|
+
),
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
animations[prop] = delayFunction(delay, withSequence(...sequence));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
for (const prop of Object.keys(enteringValues.animations)) {
|
|
112
|
+
if (prop === 'transform') {
|
|
113
|
+
enteringValues.animations[prop]?.forEach((value, index) => {
|
|
114
|
+
for (const transformProp of Object.keys(value)) {
|
|
115
|
+
animations.transform?.push({
|
|
116
|
+
[transformProp]: delayFunction(
|
|
117
|
+
delay + exitingDuration,
|
|
118
|
+
withSequence(
|
|
119
|
+
withTiming(
|
|
120
|
+
enteringValues.initialValues.transform
|
|
121
|
+
? enteringValues.initialValues.transform[index][
|
|
122
|
+
transformProp as keyof TransformProperty
|
|
123
|
+
]
|
|
124
|
+
: 0,
|
|
125
|
+
{ duration: exitingDuration }
|
|
126
|
+
),
|
|
127
|
+
value[transformProp as keyof TransformProperty]
|
|
128
|
+
)
|
|
129
|
+
),
|
|
130
|
+
} as TransformProperty);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
} else if (animations[prop] !== undefined) {
|
|
134
|
+
// it was already added in the previous loop
|
|
135
|
+
continue;
|
|
136
|
+
} else {
|
|
137
|
+
animations[prop] = delayFunction(
|
|
138
|
+
delay,
|
|
139
|
+
withSequence(
|
|
140
|
+
withTiming(enteringValues.initialValues[prop], { duration: 0 }),
|
|
141
|
+
enteringValues.animations[prop]
|
|
142
|
+
)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const mergedTransform = (
|
|
148
|
+
exitingValues.initialValues.transform ?? []
|
|
149
|
+
).concat(
|
|
150
|
+
(enteringValues.animations.transform ?? []).map((value) => {
|
|
151
|
+
for (const transformProp of Object.keys(value)) {
|
|
152
|
+
const current = (value[
|
|
153
|
+
transformProp as keyof TransformProperty
|
|
154
|
+
] as AnimationObject).current;
|
|
155
|
+
if (typeof current === 'string') {
|
|
156
|
+
if (current.includes('deg'))
|
|
157
|
+
return ({
|
|
158
|
+
[transformProp]: '0deg',
|
|
159
|
+
} as unknown) as TransformProperty;
|
|
160
|
+
else
|
|
161
|
+
return ({
|
|
162
|
+
[transformProp]: '0',
|
|
163
|
+
} as unknown) as TransformProperty;
|
|
164
|
+
} else if (transformProp.includes('translate')) {
|
|
165
|
+
return ({ [transformProp]: 0 } as unknown) as TransformProperty;
|
|
166
|
+
} else {
|
|
167
|
+
return ({ [transformProp]: 1 } as unknown) as TransformProperty;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
initialValues: {
|
|
176
|
+
...exitingValues.initialValues,
|
|
177
|
+
originX: values.boriginX,
|
|
178
|
+
originY: values.boriginY,
|
|
179
|
+
width: values.bwidth,
|
|
180
|
+
height: values.bheight,
|
|
181
|
+
transform: mergedTransform,
|
|
182
|
+
},
|
|
183
|
+
animations: {
|
|
184
|
+
originX: delayFunction(
|
|
185
|
+
delay + exitingDuration,
|
|
186
|
+
withTiming(values.originX, { duration: exitingDuration })
|
|
187
|
+
),
|
|
188
|
+
originY: delayFunction(
|
|
189
|
+
delay + exitingDuration,
|
|
190
|
+
withTiming(values.originY, { duration: exitingDuration })
|
|
191
|
+
),
|
|
192
|
+
width: delayFunction(
|
|
193
|
+
delay + exitingDuration,
|
|
194
|
+
withTiming(values.width, { duration: exitingDuration })
|
|
195
|
+
),
|
|
196
|
+
height: delayFunction(
|
|
197
|
+
delay + exitingDuration,
|
|
198
|
+
withTiming(values.height, { duration: exitingDuration })
|
|
199
|
+
),
|
|
200
|
+
...animations,
|
|
201
|
+
},
|
|
202
|
+
callback: callback,
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function combineTransition(
|
|
209
|
+
exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,
|
|
210
|
+
entering: BaseAnimationBuilder | typeof BaseAnimationBuilder
|
|
211
|
+
): EntryExitTransition {
|
|
212
|
+
return EntryExitTransition.entering(entering).exiting(exiting);
|
|
213
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { withSequence, withTiming } from '../../animation';
|
|
2
|
+
import {
|
|
3
|
+
ILayoutAnimationBuilder,
|
|
4
|
+
LayoutAnimationFunction,
|
|
5
|
+
} from '../animationBuilder/commonTypes';
|
|
6
|
+
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
7
|
+
|
|
8
|
+
export class FadingTransition
|
|
9
|
+
extends BaseAnimationBuilder
|
|
10
|
+
implements ILayoutAnimationBuilder {
|
|
11
|
+
static createInstance(): FadingTransition {
|
|
12
|
+
return new FadingTransition();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
build = (): LayoutAnimationFunction => {
|
|
16
|
+
const delayFunction = this.getDelayFunction();
|
|
17
|
+
const callback = this.callbackV;
|
|
18
|
+
const delay = this.getDelay();
|
|
19
|
+
const duration = this.durationV ?? 500;
|
|
20
|
+
|
|
21
|
+
return (values) => {
|
|
22
|
+
'worklet';
|
|
23
|
+
return {
|
|
24
|
+
initialValues: {
|
|
25
|
+
opacity: 1,
|
|
26
|
+
originX: values.boriginX,
|
|
27
|
+
originY: values.boriginY,
|
|
28
|
+
width: values.bwidth,
|
|
29
|
+
height: values.bheight,
|
|
30
|
+
},
|
|
31
|
+
animations: {
|
|
32
|
+
opacity: delayFunction(
|
|
33
|
+
delay,
|
|
34
|
+
withSequence(
|
|
35
|
+
withTiming(0, { duration: duration }),
|
|
36
|
+
withTiming(1, { duration: duration })
|
|
37
|
+
)
|
|
38
|
+
),
|
|
39
|
+
originX: delayFunction(
|
|
40
|
+
delay + duration,
|
|
41
|
+
withTiming(values.originX, { duration: 50 })
|
|
42
|
+
),
|
|
43
|
+
originY: delayFunction(
|
|
44
|
+
delay + duration,
|
|
45
|
+
withTiming(values.originY, { duration: 50 })
|
|
46
|
+
),
|
|
47
|
+
width: delayFunction(
|
|
48
|
+
delay + duration,
|
|
49
|
+
withTiming(values.width, { duration: 50 })
|
|
50
|
+
),
|
|
51
|
+
height: delayFunction(
|
|
52
|
+
delay + duration,
|
|
53
|
+
withTiming(values.height, { duration: 50 })
|
|
54
|
+
),
|
|
55
|
+
},
|
|
56
|
+
callback: callback,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}
|