react-native-reanimated 3.0.2 → 3.1.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/Fabric/FabricUtils.h +1 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -27
- package/Common/cpp/SharedItems/Shareables.h +22 -0
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +4 -1
- package/Common/cpp/Tools/RuntimeDecorator.h +2 -1
- package/Common/cpp/Tools/SingleInstanceChecker.h +14 -2
- package/RNReanimated.podspec +5 -2
- package/android/CMakeLists.txt +4 -0
- package/android/build.gradle +18 -10
- package/android/src/main/cpp/NativeProxy.cpp +316 -337
- package/android/src/main/cpp/NativeProxy.h +53 -11
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +7 -12
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +11 -8
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +21 -14
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +0 -3
- package/ios/Fabric/REAInitializerRCTFabricSurface.mm +1 -0
- package/ios/REANodesManager.h +1 -0
- package/ios/REANodesManager.mm +30 -4
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +51 -130
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.mm +4 -1
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.mm +1 -1
- package/ios/native/REAInitializer.mm +1 -1
- package/ios/native/REAMessageThread.mm +2 -2
- package/lib/commonjs/Animated.js +0 -8
- package/lib/commonjs/Animated.js.map +1 -1
- package/lib/commonjs/ConfigHelper.js +8 -19
- package/lib/commonjs/ConfigHelper.js.map +1 -1
- package/lib/commonjs/createAnimatedComponent.js +20 -158
- package/lib/commonjs/createAnimatedComponent.js.map +1 -1
- package/lib/commonjs/index.js +0 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +0 -7
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/reanimated2/Bezier.js +14 -34
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -1
- package/lib/commonjs/reanimated2/Colors.js +60 -132
- package/lib/commonjs/reanimated2/Colors.js.map +1 -1
- package/lib/commonjs/reanimated2/Easing.js +81 -34
- package/lib/commonjs/reanimated2/Easing.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeMethods.js +8 -20
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +5 -31
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +0 -7
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/PlatformChecker.js +0 -6
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/commonjs/reanimated2/PropAdapters.js +10 -12
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -1
- package/lib/commonjs/reanimated2/UpdateProps.js +3 -12
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -1
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +0 -10
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +5 -22
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/decay.js +7 -18
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/delay.js +0 -11
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/index.js +0 -8
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/repeat.js +6 -22
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/sequence.js +3 -20
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/spring.js +11 -23
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +3 -35
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/timing.js +0 -11
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/util.js +11 -41
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
- package/lib/commonjs/reanimated2/commonTypes.js +16 -23
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/component/FlatList.js +0 -16
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Image.js +0 -4
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -1
- package/lib/commonjs/reanimated2/component/ScrollView.js +0 -4
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Text.js +0 -4
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -1
- package/lib/commonjs/reanimated2/component/View.js +0 -4
- package/lib/commonjs/reanimated2/component/View.js.map +1 -1
- package/lib/commonjs/reanimated2/core.js +6 -48
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- package/lib/commonjs/reanimated2/errors.js +3 -14
- package/lib/commonjs/reanimated2/errors.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.js +3 -5
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.web.js +1 -3
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -12
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -17
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/Hooks.js +0 -5
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/index.js +0 -12
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +4 -17
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +1 -11
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +0 -12
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +8 -23
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +13 -71
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +4 -13
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +0 -5
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +0 -7
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +2 -7
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/utils.js +8 -39
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/index.js +0 -26
- package/lib/commonjs/reanimated2/index.js.map +1 -1
- package/lib/commonjs/reanimated2/initializers.js +21 -43
- package/lib/commonjs/reanimated2/initializers.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolateColor.js +6 -43
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolation.js +14 -29
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js +11 -44
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +15 -39
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +9 -28
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +7 -37
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +5 -18
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/global.js +2 -9
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js +3 -14
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -49
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -43
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -5
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +0 -4
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +4 -23
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -74
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -53
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -63
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -13
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -83
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -20
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -22
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -29
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -9
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -11
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -8
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +0 -9
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -17
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/mappers.js +26 -32
- package/lib/commonjs/reanimated2/mappers.js.map +1 -1
- package/lib/commonjs/reanimated2/mock.js +5 -15
- package/lib/commonjs/reanimated2/mock.js.map +1 -1
- package/lib/commonjs/reanimated2/mutables.js +2 -28
- package/lib/commonjs/reanimated2/mutables.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +31 -0
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +14 -0
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/pluginUtils.js +0 -1
- package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/shareables.js +92 -49
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +42 -46
- package/lib/commonjs/reanimated2/threads.js.map +1 -1
- package/lib/commonjs/reanimated2/utils.js +0 -5
- package/lib/commonjs/reanimated2/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/valueSetter.js +6 -21
- package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
- package/lib/commonjs/setAndForwardRef.js +3 -3
- package/lib/commonjs/setAndForwardRef.js.map +1 -1
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +9 -15
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/createAnimatedComponent.js +20 -139
- package/lib/module/createAnimatedComponent.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js +14 -33
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +59 -109
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +37 -33
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeMethods.js +8 -15
- package/lib/module/reanimated2/NativeMethods.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +5 -27
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js +0 -2
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +12 -10
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js +3 -5
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js +0 -6
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +5 -18
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/decay.js +7 -15
- package/lib/module/reanimated2/animation/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js +0 -9
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +6 -20
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +3 -18
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js +11 -21
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +7 -31
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +0 -8
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +10 -33
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +12 -19
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +0 -4
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -22
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +3 -13
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +3 -3
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -8
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -15
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/hook/Hooks.js +3 -2
- package/lib/module/reanimated2/hook/Hooks.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +3 -14
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +2 -5
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -7
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +0 -6
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +2 -7
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +9 -20
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +13 -59
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +4 -8
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +0 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js +2 -3
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js +8 -21
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +23 -37
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +5 -34
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +13 -28
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +11 -35
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +15 -35
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/Mapper.js +9 -23
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +7 -35
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +5 -16
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/global.js +2 -6
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +3 -9
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -23
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -45
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -39
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +3 -3
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +4 -19
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -52
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -32
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -38
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -16
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -8
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -50
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -17
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -23
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -6
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -8
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -13
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +26 -25
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mock.js +5 -15
- package/lib/module/reanimated2/mock.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -19
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js +24 -0
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +7 -0
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +96 -44
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +39 -33
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/utils.js +0 -3
- package/lib/module/reanimated2/utils.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +6 -19
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/setAndForwardRef.js +3 -2
- package/lib/module/setAndForwardRef.js.map +1 -1
- package/package.json +46 -40
- package/plugin/.eslintrc.js +7 -0
- package/plugin/README.md +241 -0
- package/plugin/build/plugin.js +714 -0
- package/plugin/build/plugin.js.map +7 -0
- package/plugin/index.js +1 -807
- package/plugin/package.json +23 -0
- package/plugin/src/buildWorkletString.ts +213 -0
- package/plugin/src/commonObjects.ts +60 -0
- package/plugin/src/injectVersion.ts +37 -0
- package/plugin/src/makeWorklet.ts +375 -0
- package/plugin/src/plugin.ts +49 -0
- package/plugin/src/processForCalleesWorklets.ts +106 -0
- package/plugin/src/processIfGestureHandlerEventCallbackFunctionNode.ts +156 -0
- package/plugin/src/processIfWorkletFunction.ts +55 -0
- package/plugin/src/processIfWorkletNode.ts +44 -0
- package/plugin/src/processInlineStylesWarning.ts +129 -0
- package/plugin/src/processWorkletObjectMethod.ts +31 -0
- package/plugin/src/types.ts +15 -0
- package/plugin/src/utils.ts +6 -0
- package/plugin/tsconfig.json +15 -0
- package/plugin/yarn.lock +2193 -0
- package/react-native-reanimated.d.ts +1 -0
- package/scripts/reanimated_utils.rb +2 -2
- package/src/createAnimatedComponent.tsx +2 -3
- package/src/reanimated2/Easing.ts +19 -0
- package/src/reanimated2/NativeMethods.ts +9 -4
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +2 -2
- package/src/reanimated2/UpdateProps.ts +2 -2
- package/src/reanimated2/animation/decay.ts +7 -1
- package/src/reanimated2/animation/styleAnimation.ts +5 -1
- package/src/reanimated2/core.ts +4 -4
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +12 -4
- package/src/reanimated2/globals.d.ts +71 -112
- package/src/reanimated2/hook/commonTypes.ts +1 -1
- package/src/reanimated2/hook/useAnimatedReaction.ts +2 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +2 -2
- package/src/reanimated2/initializers.ts +11 -8
- package/src/reanimated2/jestUtils.ts +0 -1
- package/src/reanimated2/js-reanimated/JSReanimated.ts +5 -1
- package/src/reanimated2/js-reanimated/index.ts +1 -1
- package/src/reanimated2/mappers.ts +26 -4
- package/src/reanimated2/mock.ts +1 -0
- package/src/reanimated2/platform-specific/checkCppVersion.ts +29 -0
- package/src/reanimated2/platform-specific/jsVersion.ts +6 -0
- package/src/reanimated2/shareables.ts +107 -8
- package/src/reanimated2/threads.ts +36 -17
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +0 -42
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.js +0 -35
- package/lib/module/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/src/reanimated2/platform-specific/checkVersion.ts +0 -39
package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAnimationBuilder","withSequence","withTiming","FadeIn","FadeOut","EntryExitTransition","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","enteringAnimation","enteringV","build","exitingAnimation","exitingV","exitingDuration","getDuration","values","enteringValues","exitingValues","animations","transform","prop","Object","keys","forEach","value","index","transformProp","push","initialValues","duration","sequence","undefined","includes","mergedTransform","concat","map","objectKeys","length","console","error","current","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","entering","animation","instance","exiting","combineTransition"],"sources":["EntryExitTransition.ts"],"sourcesContent":["import {\n ILayoutAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport { withSequence, withTiming } from '../../animation';\nimport { FadeIn, FadeOut } from '../defaultAnimations/Fade';\nimport {\n StyleProps,\n TransformProperty,\n AnimationObject,\n} from '../../commonTypes';\n\nexport class EntryExitTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;\n\n exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;\n\n static createInstance(): EntryExitTransition {\n return new EntryExitTransition();\n }\n\n static entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.entering(animation);\n }\n\n entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.enteringV = animation;\n return this;\n }\n\n static exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.exiting(animation);\n }\n\n exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.exitingV = animation;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const enteringAnimation = this.enteringV.build();\n const exitingAnimation = this.exitingV.build();\n const exitingDuration = this.exitingV.getDuration();\n\n return (values) => {\n 'worklet';\n const enteringValues = enteringAnimation(values);\n const exitingValues = exitingAnimation(values);\n const animations: StyleProps = {\n transform: [],\n };\n\n for (const prop of Object.keys(exitingValues.animations)) {\n if (prop === 'transform') {\n exitingValues.animations[prop]?.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform?.push({\n [transformProp]: delayFunction(\n delay,\n withSequence(\n value[transformProp as keyof TransformProperty],\n withTiming(\n exitingValues.initialValues.transform\n ? exitingValues.initialValues.transform[index][\n transformProp as keyof TransformProperty\n ]\n : 0,\n { duration: 0 }\n )\n )\n ),\n } as TransformProperty);\n }\n });\n } else {\n const sequence =\n enteringValues.animations[prop] !== undefined\n ? [\n exitingValues.animations[prop],\n withTiming(enteringValues.initialValues[prop], {\n duration: 0,\n }),\n enteringValues.animations[prop],\n ]\n : [\n exitingValues.animations[prop],\n withTiming(\n Object.keys(values).includes(prop)\n ? values[prop as keyof LayoutAnimationsValues]\n : exitingValues.initialValues[prop],\n { duration: 0 }\n ),\n ];\n\n animations[prop] = delayFunction(delay, withSequence(...sequence));\n }\n }\n for (const prop of Object.keys(enteringValues.animations)) {\n if (prop === 'transform') {\n enteringValues.animations[prop]?.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform?.push({\n [transformProp]: delayFunction(\n delay + exitingDuration,\n withSequence(\n withTiming(\n enteringValues.initialValues.transform\n ? enteringValues.initialValues.transform[index][\n transformProp as keyof TransformProperty\n ]\n : 0,\n { duration: exitingDuration }\n ),\n value[transformProp as keyof TransformProperty]\n )\n ),\n } as TransformProperty);\n }\n });\n } else if (animations[prop] !== undefined) {\n // it was already added in the previous loop\n continue;\n } else {\n animations[prop] = delayFunction(\n delay,\n withSequence(\n withTiming(enteringValues.initialValues[prop], { duration: 0 }),\n enteringValues.animations[prop]\n )\n );\n }\n }\n\n const mergedTransform = (\n exitingValues.initialValues.transform ?? []\n ).concat(\n (enteringValues.animations.transform ?? []).map((value) => {\n const objectKeys = Object.keys(value);\n if (objectKeys?.length < 1) {\n console.error(\n `[Reanimated]: \\${value} is not a valid Transform object`\n );\n return value;\n }\n const transformProp = objectKeys[0];\n const current = (\n value[transformProp as keyof TransformProperty] as AnimationObject\n ).current;\n if (typeof current === 'string') {\n if (current.includes('deg'))\n return {\n [transformProp]: '0deg',\n } as unknown as TransformProperty;\n else\n return {\n [transformProp]: '0',\n } as unknown as TransformProperty;\n } else if (transformProp.includes('translate')) {\n return { [transformProp]: 0 } as unknown as TransformProperty;\n } else {\n return { [transformProp]: 1 } as unknown as TransformProperty;\n }\n return value;\n })\n );\n\n return {\n initialValues: {\n ...exitingValues.initialValues,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n transform: mergedTransform,\n },\n animations: {\n originX: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginX, { duration: exitingDuration })\n ),\n originY: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginY, { duration: exitingDuration })\n ),\n width: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetWidth, { duration: exitingDuration })\n ),\n height: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetHeight, { duration: exitingDuration })\n ),\n ...animations,\n },\n callback: callback,\n };\n };\n };\n}\n\nexport function combineTransition(\n exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,\n entering: BaseAnimationBuilder | typeof BaseAnimationBuilder\n): EntryExitTransition {\n return EntryExitTransition.entering(entering).exiting(exiting);\n}\n"],"mappings":";;AAKA,SAASA,oBAAT,QAAqC,qBAArC;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,MAAT,EAAiBC,OAAjB,QAAgC,2BAAhC;AAOA,OAAO,MAAMC,mBAAN,SACGL,oBADH,CAGP;EAAA;IAAA;;IAAA,mCACkEG,MADlE;;IAAA,kCAGiEC,OAHjE;;IAAA,+BAqCU,MAA+B;MACrC,MAAME,aAAa,GAAG,KAAKC,gBAAL,EAAtB;MACA,MAAMC,QAAQ,GAAG,KAAKC,SAAtB;MACA,MAAMC,KAAK,GAAG,KAAKC,QAAL,EAAd;MACA,MAAMC,iBAAiB,GAAG,KAAKC,SAAL,CAAeC,KAAf,EAA1B;MACA,MAAMC,gBAAgB,GAAG,KAAKC,QAAL,CAAcF,KAAd,EAAzB;MACA,MAAMG,eAAe,GAAG,KAAKD,QAAL,CAAcE,WAAd,EAAxB;MAEA,OAAQC,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,OAAPE,OAAO,CACZF,SADY,EAES;IACrB,MAAMC,QAAQ,GAAG,KAAKH,cAAL,EAAjB;IACA,OAAOG,QAAQ,CAACC,OAAT,CAAiBF,SAAjB,CAAP;EACD;;EAEDE,OAAO,CACLF,SADK,EAEgB;IACrB,KAAK3C,QAAL,GAAgB2C,SAAhB;IACA,OAAO,IAAP;EACD;;AAnCH;AAyMA,OAAO,SAASG,iBAAT,CACLD,OADK,EAELH,QAFK,EAGgB;EACrB,OAAOrD,mBAAmB,CAACqD,QAApB,CAA6BA,QAA7B,EAAuCG,OAAvC,CAA+CA,OAA/C,CAAP;AACD"}
|
|
1
|
+
{"version":3,"names":["BaseAnimationBuilder","withSequence","withTiming","FadeIn","FadeOut","EntryExitTransition","constructor","arguments","_defineProperty","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","enteringAnimation","enteringV","build","exitingAnimation","exitingV","exitingDuration","getDuration","values","enteringValues","exitingValues","animations","transform","prop","Object","keys","_exitingValues$animat","forEach","value","index","transformProp","_animations$transform","push","initialValues","duration","sequence","undefined","includes","_enteringValues$anima","_animations$transform2","mergedTransform","concat","map","objectKeys","length","console","error","current","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","entering","animation","instance","exiting","combineTransition"],"sources":["EntryExitTransition.ts"],"sourcesContent":["import {\n ILayoutAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport { withSequence, withTiming } from '../../animation';\nimport { FadeIn, FadeOut } from '../defaultAnimations/Fade';\nimport {\n StyleProps,\n TransformProperty,\n AnimationObject,\n} from '../../commonTypes';\n\nexport class EntryExitTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;\n\n exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;\n\n static createInstance(): EntryExitTransition {\n return new EntryExitTransition();\n }\n\n static entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.entering(animation);\n }\n\n entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.enteringV = animation;\n return this;\n }\n\n static exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.exiting(animation);\n }\n\n exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.exitingV = animation;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const enteringAnimation = this.enteringV.build();\n const exitingAnimation = this.exitingV.build();\n const exitingDuration = this.exitingV.getDuration();\n\n return (values) => {\n 'worklet';\n const enteringValues = enteringAnimation(values);\n const exitingValues = exitingAnimation(values);\n const animations: StyleProps = {\n transform: [],\n };\n\n for (const prop of Object.keys(exitingValues.animations)) {\n if (prop === 'transform') {\n exitingValues.animations[prop]?.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform?.push({\n [transformProp]: delayFunction(\n delay,\n withSequence(\n value[transformProp as keyof TransformProperty],\n withTiming(\n exitingValues.initialValues.transform\n ? exitingValues.initialValues.transform[index][\n transformProp as keyof TransformProperty\n ]\n : 0,\n { duration: 0 }\n )\n )\n ),\n } as TransformProperty);\n }\n });\n } else {\n const sequence =\n enteringValues.animations[prop] !== undefined\n ? [\n exitingValues.animations[prop],\n withTiming(enteringValues.initialValues[prop], {\n duration: 0,\n }),\n enteringValues.animations[prop],\n ]\n : [\n exitingValues.animations[prop],\n withTiming(\n Object.keys(values).includes(prop)\n ? values[prop as keyof LayoutAnimationsValues]\n : exitingValues.initialValues[prop],\n { duration: 0 }\n ),\n ];\n\n animations[prop] = delayFunction(delay, withSequence(...sequence));\n }\n }\n for (const prop of Object.keys(enteringValues.animations)) {\n if (prop === 'transform') {\n enteringValues.animations[prop]?.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform?.push({\n [transformProp]: delayFunction(\n delay + exitingDuration,\n withSequence(\n withTiming(\n enteringValues.initialValues.transform\n ? enteringValues.initialValues.transform[index][\n transformProp as keyof TransformProperty\n ]\n : 0,\n { duration: exitingDuration }\n ),\n value[transformProp as keyof TransformProperty]\n )\n ),\n } as TransformProperty);\n }\n });\n } else if (animations[prop] !== undefined) {\n // it was already added in the previous loop\n continue;\n } else {\n animations[prop] = delayFunction(\n delay,\n withSequence(\n withTiming(enteringValues.initialValues[prop], { duration: 0 }),\n enteringValues.animations[prop]\n )\n );\n }\n }\n\n const mergedTransform = (\n exitingValues.initialValues.transform ?? []\n ).concat(\n (enteringValues.animations.transform ?? []).map((value) => {\n const objectKeys = Object.keys(value);\n if (objectKeys?.length < 1) {\n console.error(\n `[Reanimated]: \\${value} is not a valid Transform object`\n );\n return value;\n }\n const transformProp = objectKeys[0];\n const current = (\n value[transformProp as keyof TransformProperty] as AnimationObject\n ).current;\n if (typeof current === 'string') {\n if (current.includes('deg'))\n return {\n [transformProp]: '0deg',\n } as unknown as TransformProperty;\n else\n return {\n [transformProp]: '0',\n } as unknown as TransformProperty;\n } else if (transformProp.includes('translate')) {\n return { [transformProp]: 0 } as unknown as TransformProperty;\n } else {\n return { [transformProp]: 1 } as unknown as TransformProperty;\n }\n return value;\n })\n );\n\n return {\n initialValues: {\n ...exitingValues.initialValues,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n transform: mergedTransform,\n },\n animations: {\n originX: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginX, { duration: exitingDuration })\n ),\n originY: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginY, { duration: exitingDuration })\n ),\n width: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetWidth, { duration: exitingDuration })\n ),\n height: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetHeight, { duration: exitingDuration })\n ),\n ...animations,\n },\n callback: callback,\n };\n };\n };\n}\n\nexport function combineTransition(\n exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,\n entering: BaseAnimationBuilder | typeof BaseAnimationBuilder\n): EntryExitTransition {\n return EntryExitTransition.entering(entering).exiting(exiting);\n}\n"],"mappings":";;;AAKA,SAASA,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,EAAEC,OAAO,QAAQ,2BAA2B;AAO3D,OAAO,MAAMC,mBAAmB,SACtBL,oBAAoB,CAE9B;EAAAM,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACkEL,MAAM;IAAAK,eAAA,mBAEPJ,OAAO;IAAAI,eAAA,gBAkC9D,MAA+B;MACrC,MAAMC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;MAC7C,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS;MAC/B,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;MAC7B,MAAMC,iBAAiB,GAAG,IAAI,CAACC,SAAS,CAACC,KAAK,EAAE;MAChD,MAAMC,gBAAgB,GAAG,IAAI,CAACC,QAAQ,CAACF,KAAK,EAAE;MAC9C,MAAMG,eAAe,GAAG,IAAI,CAACD,QAAQ,CAACE,WAAW,EAAE;MAEnD,OAAQC,MAAM,IAAK;QACjB,SAAS;;QACT,MAAMC,cAAc,GAAGR,iBAAiB,CAACO,MAAM,CAAC;QAChD,MAAME,aAAa,GAAGN,gBAAgB,CAACI,MAAM,CAAC;QAC9C,MAAMG,UAAsB,GAAG;UAC7BC,SAAS,EAAE;QACb,CAAC;QAED,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,IAAI,CAACL,aAAa,CAACC,UAAU,CAAC,EAAE;UACxD,IAAIE,IAAI,KAA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AAOA,CACLF,SAA6D,EACxC;IACrB,IAAI,CAAC/C,QAAQ,GAAG+C,SAAS;IACzB,OAAO,IAAI;EACb;AAoKF;AAEA,OAAO,SAASG,iBAAiBA,CAC/BD,OAA2D,EAC3DH,QAA4D,EACvC;EACrB,OAAO5D,mBAAmB,CAAC4D,QAAQ,CAACA,QAAQ,CAAC,CAACG,OAAO,CAACA,OAAO,CAAC;AAChE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { withSequence, withTiming } from '../../animation';
|
|
4
5
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
5
6
|
export class FadingTransition extends BaseAnimationBuilder {
|
|
6
7
|
constructor() {
|
|
7
8
|
super(...arguments);
|
|
8
|
-
|
|
9
9
|
_defineProperty(this, "build", () => {
|
|
10
10
|
const delayFunction = this.getDelayFunction();
|
|
11
11
|
const callback = this.callbackV;
|
|
@@ -46,10 +46,8 @@ export class FadingTransition extends BaseAnimationBuilder {
|
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
|
|
50
49
|
static createInstance() {
|
|
51
50
|
return new FadingTransition();
|
|
52
51
|
}
|
|
53
|
-
|
|
54
52
|
}
|
|
55
53
|
//# sourceMappingURL=FadingTransition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withSequence","withTiming","BaseAnimationBuilder","FadingTransition","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","values","initialValues","opacity","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance"],"sources":["FadingTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class FadingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): FadingTransition {\n return new FadingTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 500;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n opacity: 1,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n opacity: delayFunction(\n delay,\n withSequence(\n withTiming(0, { duration: duration }),\n withTiming(1, { duration: duration })\n )\n ),\n originX: delayFunction(\n delay + duration,\n withTiming(values.targetOriginX, { duration: 50 })\n ),\n originY: delayFunction(\n delay + duration,\n withTiming(values.targetOriginY, { duration: 50 })\n ),\n width: delayFunction(\n delay + duration,\n withTiming(values.targetWidth, { duration: 50 })\n ),\n height: delayFunction(\n delay + duration,\n withTiming(values.targetHeight, { duration: 50 })\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["withSequence","withTiming","BaseAnimationBuilder","FadingTransition","constructor","arguments","_defineProperty","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","values","initialValues","opacity","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance"],"sources":["FadingTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class FadingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): FadingTransition {\n return new FadingTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 500;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n opacity: 1,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n opacity: delayFunction(\n delay,\n withSequence(\n withTiming(0, { duration: duration }),\n withTiming(1, { duration: duration })\n )\n ),\n originX: delayFunction(\n delay + duration,\n withTiming(values.targetOriginX, { duration: 50 })\n ),\n originY: delayFunction(\n delay + duration,\n withTiming(values.targetOriginY, { duration: 50 })\n ),\n width: delayFunction(\n delay + duration,\n withTiming(values.targetWidth, { duration: 50 })\n ),\n height: delayFunction(\n delay + duration,\n withTiming(values.targetHeight, { duration: 50 })\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAK1D,SAASC,oBAAoB,QAAQ,qBAAqB;AAE1D,OAAO,MAAMC,gBAAgB,SACnBD,oBAAoB,CAE9B;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,gBAKU,MAA+B;MACrC,MAAMC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;MAC7C,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS;MAC/B,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;MAC7B,MAAMC,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C/B;AA+CF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { withSequence, withTiming } from '../../animation';
|
|
4
5
|
import { Easing } from '../../Easing';
|
|
5
6
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
6
7
|
export class JumpingTransition extends BaseAnimationBuilder {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
9
|
-
|
|
10
10
|
_defineProperty(this, "build", () => {
|
|
11
11
|
const delayFunction = this.getDelayFunction();
|
|
12
12
|
const callback = this.callbackV;
|
|
@@ -31,7 +31,8 @@ export class JumpingTransition extends BaseAnimationBuilder {
|
|
|
31
31
|
originY: delayFunction(delay, withSequence(withTiming(Math.min(values.targetOriginY, values.currentOriginY) - d, {
|
|
32
32
|
duration,
|
|
33
33
|
easing: Easing.out(Easing.exp)
|
|
34
|
-
}), withTiming(values.targetOriginY, {
|
|
34
|
+
}), withTiming(values.targetOriginY, {
|
|
35
|
+
...config,
|
|
35
36
|
duration,
|
|
36
37
|
easing: Easing.bounce
|
|
37
38
|
}))),
|
|
@@ -43,10 +44,8 @@ export class JumpingTransition extends BaseAnimationBuilder {
|
|
|
43
44
|
};
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
|
|
47
47
|
static createInstance() {
|
|
48
48
|
return new JumpingTransition();
|
|
49
49
|
}
|
|
50
|
-
|
|
51
50
|
}
|
|
52
51
|
//# sourceMappingURL=JumpingTransition.js.map
|
package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withSequence","withTiming","Easing","BaseAnimationBuilder","JumpingTransition","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","config","values","d","Math","max","abs","targetOriginX","currentOriginX","targetOriginY","currentOriginY","initialValues","originX","originY","width","currentWidth","height","currentHeight","animations","min","easing","out","exp","bounce","targetWidth","targetHeight","createInstance"],"sources":["JumpingTransition.ts"],"sourcesContent":["import {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { withSequence, withTiming } from '../../animation';\nimport { Easing } from '../../Easing';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nexport class JumpingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): JumpingTransition {\n return new JumpingTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 300) / 2;\n const config = { duration: duration * 2 };\n\n return (values) => {\n 'worklet';\n const d = Math.max(\n Math.abs(values.targetOriginX - values.currentOriginX),\n Math.abs(values.targetOriginY - values.currentOriginY)\n );\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n Math.min(values.targetOriginY, values.currentOriginY) - d,\n {\n duration,\n easing: Easing.out(Easing.exp),\n }\n ),\n withTiming(values.targetOriginY, {\n ...config,\n duration,\n easing: Easing.bounce,\n })\n )\n ),\n width: delayFunction(delay, withTiming(values.targetWidth, config)),\n height: delayFunction(delay, withTiming(values.targetHeight, config)),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["withSequence","withTiming","Easing","BaseAnimationBuilder","JumpingTransition","constructor","arguments","_defineProperty","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","config","values","d","Math","max","abs","targetOriginX","currentOriginX","targetOriginY","currentOriginY","initialValues","originX","originY","width","currentWidth","height","currentHeight","animations","min","easing","out","exp","bounce","targetWidth","targetHeight","createInstance"],"sources":["JumpingTransition.ts"],"sourcesContent":["import {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { withSequence, withTiming } from '../../animation';\nimport { Easing } from '../../Easing';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nexport class JumpingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): JumpingTransition {\n return new JumpingTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 300) / 2;\n const config = { duration: duration * 2 };\n\n return (values) => {\n 'worklet';\n const d = Math.max(\n Math.abs(values.targetOriginX - values.currentOriginX),\n Math.abs(values.targetOriginY - values.currentOriginY)\n );\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n Math.min(values.targetOriginY, values.currentOriginY) - d,\n {\n duration,\n easing: Easing.out(Easing.exp),\n }\n ),\n withTiming(values.targetOriginY, {\n ...config,\n duration,\n easing: Easing.bounce,\n })\n )\n ),\n width: delayFunction(delay, withTiming(values.targetWidth, config)),\n height: delayFunction(delay, withTiming(values.targetHeight, config)),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":";;;AAIA,SAASA,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,oBAAoB,QAAQ,qBAAqB;AAC1D,OAAO,MAAMC,iBAAiB,SACpBD,oBAAoB,CAE9B;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,gBAKU,MAA+B;MACrC,MAAMC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;MAC7C,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS;MAC/B,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;MAC7B,MAAMC,QAAQ,GAAG,CAAC,IAAI,CAACC,SAAS,IAAI,GAAG,IAAI,CAAC;MAC5C,MAAMC,MAAM,GAAG;QAAEF,QAAQ,EAAEA,QAAQ,GAAG;MAAE,CAAC;MAEzC,OAAQG,MAAM,IAAK;QACjB,SAAS;;QACT,MAAMC,CAAC,GAAGC,IAAI,CAACC,GAAG,CAChBD,IAAI,CAACE,GAAG,CAACJ,MAAM,CAACK,aAAa,GAAGL,MAAM,CAACM,cAAc,CAAC,EACtDJ,IAAI,CAACE,GAAG,CAACJ,MAAM,CAACO,aAAa,GAAGP,MAAM,CAACQ,cAAc,CAAC,CACvD;QACD,OAAO;UACLC,aAAa,EAAE;YACbC,OAAO,EAAEV,MAAM,CAACM,cAAc;YAC9BK,OAAO,EAAEX,MAAM,CAACQ,cAAc;YAC9BI,KAAK,EAAEZ,MAAM,CAACa,YAAY;YAC1BC,MAAM,EAAEd,MAAM,CAACe;UACjB,CAAC;UACDC,UAAU,EAAE;YACVN,OAAO,EAAEnB,aAAa,CACpBI,KAAK,EACLX,UAAU,CAACgB,MAAM,CAACK,aAAa,EAAEN,MAAM,CAAC,CACzC;YACDY,OAAO,EAAEpB,aAAa,CACpBI,KAAK,EACLZ,YAAY,CACVC,UAAU,CACRkB,IAAI,CAACe,GAAG,CAACjB,MAAM,CAACO,aAAa,EAAEP,MAAM,CAACQ,cAAc,CAAC,GAAGP,CAAC,EACzD;cACEJ,QAAQ;cACRqB,MAAM,EAAEjC,MAAM,CAACkC,GAAG,CAAClC,MAAM,CAACmC,GAAG;YAC/B,CAAC,CACF,EACDpC,UAAU,CAACgB,MAAM,CAACO,aAAa,EAAE;cAC/B,GAAGR,MAAM;cACTF,QAAQ;cACRqB,MAAM,EAAEjC,MAAM,CAACoC;YACjB,CAAC,CAAC,CACH,CACF;YACDT,KAAK,EAAErB,aAAa,CAACI,KAAK,EAAEX,UAAU,CAACgB,MAAM,CAACsB,WAAW,EAAEvB,MAAM,CAAC,CAAC;YACnEe,MAAM,EAAEvB,aAAa,CAACI,KAAK,EAAEX,UAAU,CAACgB,MAAM,CAACuB,YAAY,EAAExB,MAAM,CAAC;UACtE,CAAC;UACDN,QAAQ,EAAEA;QACZ,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EApDD,OAAO+B,cAAcA,CAAA,EAAsB;IACzC,OAAO,IAAIrC,iBAAiB,EAAE;EAChC;AAmDF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';
|
|
4
5
|
export class LinearTransition extends ComplexAnimationBuilder {
|
|
5
6
|
constructor() {
|
|
6
7
|
super(...arguments);
|
|
7
|
-
|
|
8
8
|
_defineProperty(this, "build", () => {
|
|
9
9
|
const delayFunction = this.getDelayFunction();
|
|
10
10
|
const [animation, config] = this.getAnimationAndConfig();
|
|
@@ -31,11 +31,9 @@ export class LinearTransition extends ComplexAnimationBuilder {
|
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
static createInstance() {
|
|
36
35
|
return new LinearTransition();
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
}
|
|
40
38
|
export const Layout = LinearTransition;
|
|
41
39
|
//# sourceMappingURL=LinearTransition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComplexAnimationBuilder","LinearTransition","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","callback","callbackV","delay","getDelay","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","Layout"],"sources":["LinearTransition.ts"],"sourcesContent":["import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\n\nexport class LinearTransition\n extends ComplexAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): LinearTransition {\n return new LinearTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const callback = this.callbackV;\n const delay = this.getDelay();\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n animation(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n animation(values.targetOriginY, config)\n ),\n width: delayFunction(delay, animation(values.targetWidth, config)),\n height: delayFunction(delay, animation(values.targetHeight, config)),\n },\n callback: callback,\n };\n };\n };\n}\n\nexport const Layout = LinearTransition;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ComplexAnimationBuilder","LinearTransition","constructor","arguments","_defineProperty","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","callback","callbackV","delay","getDelay","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","Layout"],"sources":["LinearTransition.ts"],"sourcesContent":["import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\n\nexport class LinearTransition\n extends ComplexAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance(): LinearTransition {\n return new LinearTransition();\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const callback = this.callbackV;\n const delay = this.getDelay();\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n animation(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n animation(values.targetOriginY, config)\n ),\n width: delayFunction(delay, animation(values.targetWidth, config)),\n height: delayFunction(delay, animation(values.targetHeight, config)),\n },\n callback: callback,\n };\n };\n };\n}\n\nexport const Layout = LinearTransition;\n"],"mappings":";;;AAAA,SAASA,uBAAuB,QAAQ,6CAA6C;AAMrF,OAAO,MAAMC,gBAAgB,SACnBD,uBAAuB,CAEjC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,gBAKU,MAA+B;MACrC,MAAMC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;MAC7C,MAAM,CAACC,SAAS,EAAEC,MAAM,CAAC,GAAG,IAAI,CAACC,qBAAqB,EAAE;MACxD,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS;MAC/B,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;MAE7B,OAAQC,MAAM,IAAK;QACjB,SAAS;;QACT,OAAO;UACLC,aAAa,EAAE;YACbC,OAAO,EAAEF,MAAM,CAACG,cAAc;YAC9BC,OAAO,EAAEJ,MAAM,CAACK,cAAc;YAC9BC,KAAK,EAAEN,MAAM,CAACO,YAAY;YAC1BC,MAAM,EAAER,MAAM,CAACS;UACjB,CAAC;UACDC,UAAU,EAAE;YACVR,OAAO,EAAEX,aAAa,CACpBO,KAAK,EACLL,SAAS,CAACO,MAAM,CAACW,aAAa,EAAEjB,MAAM,CAAC,CACxC;YACDU,OAAO,EAAEb,aAAa,CACpBO,KAAK,EACLL,SAAS,CAACO,MAAM,CAACY,aAAa,EAAElB,MAAM,CAAC,CACxC;YACDY,KAAK,EAAEf,aAAa,CAACO,KAAK,EAAEL,SAAS,CAACO,MAAM,CAACa,WAAW,EAAEnB,MAAM,CAAC,CAAC;YAClEc,MAAM,EAAEjB,aAAa,CAACO,KAAK,EAAEL,SAAS,CAACO,MAAM,CAACc,YAAY,EAAEpB,MAAM,CAAC;UACrE,CAAC;UACDE,QAAQ,EAAEA;QACZ,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAlCD,OAAOmB,cAAcA,CAAA,EAAqB;IACxC,OAAO,IAAI5B,gBAAgB,EAAE;EAC/B;AAiCF;AAEA,OAAO,MAAM6B,MAAM,GAAG7B,gBAAgB"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { withSequence, withTiming } from '../../animation';
|
|
4
5
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
5
6
|
export class SequencedTransition extends BaseAnimationBuilder {
|
|
6
7
|
constructor() {
|
|
7
8
|
super(...arguments);
|
|
8
|
-
|
|
9
9
|
_defineProperty(this, "reversed", false);
|
|
10
|
-
|
|
11
10
|
_defineProperty(this, "build", () => {
|
|
12
11
|
const delayFunction = this.getDelayFunction();
|
|
13
12
|
const callback = this.callbackV;
|
|
@@ -38,20 +37,16 @@ export class SequencedTransition extends BaseAnimationBuilder {
|
|
|
38
37
|
};
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
static createInstance() {
|
|
43
41
|
return new SequencedTransition();
|
|
44
42
|
}
|
|
45
|
-
|
|
46
43
|
static reverse() {
|
|
47
44
|
const instance = SequencedTransition.createInstance();
|
|
48
45
|
return instance.reverse();
|
|
49
46
|
}
|
|
50
|
-
|
|
51
47
|
reverse() {
|
|
52
48
|
this.reversed = !this.reversed;
|
|
53
49
|
return this;
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
}
|
|
57
52
|
//# sourceMappingURL=SequencedTransition.js.map
|
package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withSequence","withTiming","BaseAnimationBuilder","SequencedTransition","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance(): SequencedTransition {\n return new SequencedTransition();\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["withSequence","withTiming","BaseAnimationBuilder","SequencedTransition","constructor","arguments","_defineProperty","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["import { withSequence, withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance(): SequencedTransition {\n return new SequencedTransition();\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback: callback,\n };\n };\n };\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAK1D,SAASC,oBAAoB,QAAQ,qBAAqB;AAE1D,OAAO,MAAMC,mBAAmB,SACtBD,oBAAoB,CAE9B;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBACa,KAAK;IAAAA,eAAA,gBAgBR,MAA+B;MACrC,MAAMC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;MAC7C,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS;MAC/B,MAAMC,KAAK,GAAG,IAAI,CAACC,QAAQ,EAAE;MAC7B,MAAMC,gBAAgB,GAAG,CAAC,IAAI,CAACC,SAAS,IAAI,GAAG,IAAI,CAAC;MACpD,MAAMC,MAAM,GAAG;QAAEC,QAAQ,EAAEH;MAAiB,CAAC;MAC7C,MAAMI,OAAO,GAAG,IAAI,CAACC,QAAQ;MAE7B,OAAQC,MAAM,IAAK;QACjB,SAAS;;QACT,OAAO;UACLC,aAAa,EAAE;YACbC,OAAO,EAAEF,MAAM,CAACG,cAAc;YAC9BC,OAAO,EAAEJ,MAAM,CAACK,cAAc;YAC9BC,KAAK,EAAEN,MAAM,CAACO,YAAY;YAC1BC,MAAM,EAAER,MAAM,CAACS;UACjB,CAAC;UACDC,UAAU,EAAE;YACVR,OAAO,EAAEd,aAAa,CACpBI,KAAK,EACLX,YAAY,CACVC,UAAU,CACRgB,OAAO,GAAGE,MAAM,CAACG,cAAc,GAAGH,MAAM,CAACW,aAAa,EACtDf,MAAM,CACP,EACDd,UAAU,CAACkB,MAAM,CAACW,aAAa,EAAEf,MAAM,CAAC,CACzC,CACF;YACDQ,OAAO,EAAEhB,aAAa,CACpBI,KAAK,EACLX,YAAY,CACVC,UAAU,CACRgB,OAAO,GAAGE,MAAM,CAACY,aAAa,GAAGZ,MAAM,CAACK,cAAc,EACtDT,MAAM,CACP,EACDd,UAAU,CAACkB,MAAM,CAACY,aAAa,EAAEhB,MAAM,CAAC,CACzC,CACF;YACDU,KAAK,EAAElB,aAAa,CAClBI,KAAK,EACLX,YAAY,CACVC,UAAU,CACRgB,OAAO,GAAGE,MAAM,CAACO,YAAY,GAAGP,MAAM,CAACa,WAAW,EAClDjB,MAAM,CACP,EACDd,UAAU,CAACkB,MAAM,CAACa,WAAW,EAAEjB,MAAM,CAAC,CACvC,CACF;YACDY,MAAM,EAAEpB,aAAa,CACnBI,KAAK,EACLX,YAAY,CACVC,UAAU,CACRgB,OAAO,GAAGE,MAAM,CAACc,YAAY,GAAGd,MAAM,CAACS,aAAa,EACpDb,MAAM,CACP,EACDd,UAAU,CAACkB,MAAM,CAACc,YAAY,EAAElB,MAAM,CAAC,CACxC;UAEL,CAAC;UACDN,QAAQ,EAAEA;QACZ,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA5ED,OAAOyB,cAAcA,CAAA,EAAwB;IAC3C,OAAO,IAAI/B,mBAAmB,EAAE;EAClC;EAEA,OAAOc,OAAOA,CAAA,EAAwB;IACpC,MAAMkB,QAAQ,GAAGhC,mBAAmB,CAAC+B,cAAc,EAAE;IACrD,OAAOC,QAAQ,CAAClB,OAAO,EAAE;EAC3B;EAEAA,OAAOA,CAAA,EAAwB;IAC7B,IAAI,CAACC,QAAQ,GAAG,CAAC,IAAI,CAACA,QAAQ;IAC9B,OAAO,IAAI;EACb;AAiEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\n"],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\n"],"mappings":"AAAA,OAAO,qBAAqB;AAC5B,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,qBAAqB"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import { withTiming } from '../../animation';
|
|
4
5
|
const supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];
|
|
5
6
|
export class SharedTransition {
|
|
6
7
|
constructor() {
|
|
7
8
|
_defineProperty(this, "animationFactory", null);
|
|
8
|
-
|
|
9
9
|
_defineProperty(this, "defaultDuration", 500);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
static createInstance() {
|
|
13
12
|
return new SharedTransition();
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
static custom(animationFactory) {
|
|
17
15
|
return this.createInstance().custom(animationFactory);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
custom(animationFactory) {
|
|
21
18
|
this.animationFactory = animationFactory;
|
|
22
19
|
return this;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
21
|
static build() {
|
|
26
22
|
return this.createInstance().build();
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
build() {
|
|
30
25
|
const animationFactory = this.animationFactory;
|
|
31
26
|
const animationDuration = this.defaultDuration;
|
|
@@ -34,10 +29,8 @@ export class SharedTransition {
|
|
|
34
29
|
|
|
35
30
|
let animations = {};
|
|
36
31
|
const initialValues = {};
|
|
37
|
-
|
|
38
32
|
if (animationFactory) {
|
|
39
33
|
animations = animationFactory(values);
|
|
40
|
-
|
|
41
34
|
for (const key in animations) {
|
|
42
35
|
if (!supportedProps.includes(key)) {
|
|
43
36
|
throw Error(`The prop '${key}' is not supported yet.`);
|
|
@@ -60,7 +53,6 @@ export class SharedTransition {
|
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
55
|
}
|
|
63
|
-
|
|
64
56
|
for (const propName in animations) {
|
|
65
57
|
if (propName === 'transform') {
|
|
66
58
|
initialValues.transformMatrix = values.currentTransformMatrix;
|
|
@@ -69,14 +61,12 @@ export class SharedTransition {
|
|
|
69
61
|
initialValues[propName] = values[keyToCurrentValue];
|
|
70
62
|
}
|
|
71
63
|
}
|
|
72
|
-
|
|
73
64
|
return {
|
|
74
65
|
initialValues,
|
|
75
66
|
animations
|
|
76
67
|
};
|
|
77
68
|
};
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
}
|
|
81
71
|
export const DefaultSharedTransition = SharedTransition;
|
|
82
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["withTiming","supportedProps","SharedTransition","createInstance","custom","animationFactory","build","animationDuration","defaultDuration","values","animations","initialValues","key","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","duration","keyToTargetValue","charAt","toUpperCase","slice","currentTransformMatrix","keyToCurrentValue","DefaultSharedTransition"],"sources":["index.ts"],"sourcesContent":["import { withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { StyleProps } from '../../commonTypes';\n\nconst supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];\n\ntype AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;\n\nexport class SharedTransition implements ILayoutAnimationBuilder {\n animationFactory: AnimationFactoryType | null = null;\n defaultDuration = 500;\n\n static createInstance(): SharedTransition {\n return new SharedTransition();\n }\n\n static custom(animationFactory: AnimationFactoryType): SharedTransition {\n return this.createInstance().custom(animationFactory);\n }\n\n custom(animationFactory: AnimationFactoryType): SharedTransition {\n this.animationFactory = animationFactory;\n return this;\n }\n\n static build(): LayoutAnimationFunction {\n return this.createInstance().build();\n }\n\n build(): LayoutAnimationFunction {\n const animationFactory = this.animationFactory;\n const animationDuration = this.defaultDuration;\n return (values: LayoutAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: any;\n } = {};\n const initialValues: {\n [key: string]: any;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!supportedProps.includes(key)) {\n throw Error(`The prop '${key}' is not supported yet.`);\n }\n }\n } else {\n for (const propName of supportedProps) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n } else {\n const keyToTargetValue =\n 'target' + propName.charAt(0).toUpperCase() + propName.slice(1);\n animations[propName] = withTiming(values[keyToTargetValue], {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const keyToCurrentValue =\n 'current' + propName.charAt(0).toUpperCase() + propName.slice(1);\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n}\n\nexport const DefaultSharedTransition = SharedTransition;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["withTiming","supportedProps","SharedTransition","constructor","_defineProperty","createInstance","custom","animationFactory","build","animationDuration","defaultDuration","values","animations","initialValues","key","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","duration","keyToTargetValue","charAt","toUpperCase","slice","currentTransformMatrix","keyToCurrentValue","DefaultSharedTransition"],"sources":["index.ts"],"sourcesContent":["import { withTiming } from '../../animation';\nimport {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { StyleProps } from '../../commonTypes';\n\nconst supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];\n\ntype AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;\n\nexport class SharedTransition implements ILayoutAnimationBuilder {\n animationFactory: AnimationFactoryType | null = null;\n defaultDuration = 500;\n\n static createInstance(): SharedTransition {\n return new SharedTransition();\n }\n\n static custom(animationFactory: AnimationFactoryType): SharedTransition {\n return this.createInstance().custom(animationFactory);\n }\n\n custom(animationFactory: AnimationFactoryType): SharedTransition {\n this.animationFactory = animationFactory;\n return this;\n }\n\n static build(): LayoutAnimationFunction {\n return this.createInstance().build();\n }\n\n build(): LayoutAnimationFunction {\n const animationFactory = this.animationFactory;\n const animationDuration = this.defaultDuration;\n return (values: LayoutAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: any;\n } = {};\n const initialValues: {\n [key: string]: any;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!supportedProps.includes(key)) {\n throw Error(`The prop '${key}' is not supported yet.`);\n }\n }\n } else {\n for (const propName of supportedProps) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n } else {\n const keyToTargetValue =\n 'target' + propName.charAt(0).toUpperCase() + propName.slice(1);\n animations[propName] = withTiming(values[keyToTargetValue], {\n // native screen transition takes around 500ms\n duration: animationDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const keyToCurrentValue =\n 'current' + propName.charAt(0).toUpperCase() + propName.slice(1);\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n}\n\nexport const DefaultSharedTransition = SharedTransition;\n"],"mappings":";;;AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAQ5C,MAAMC,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC;AAI7E,OAAO,MAAMC,gBAAgB,CAAoC;EAAAC,YAAA;IAAAC,eAAA,2BACf,IAAI;IAAAA,eAAA,0BAClC,GAAG;EAAA;EAErB,OAAOC,cAAcA,CAAA,EAAqB;IACxC,OAAO,IAAIH,gBAAgB,EAAE;EAC/B;EAEA,OAAOI,MAAMA,CAACC,gBAAsC,EAAoB;IACtE,OAAO,IAAI,CAACF,cAAc,EAAE,CAACC,MAAM,CAACC,gBAAgB,CAAC;EACvD;EAEAD,MAAMA,CAACC,gBAAsC,EAAoB;IAC/D,IAAI,CAACA,gBAAgB,GAAGA,gBAAgB;IACxC,OAAO,IAAI;EACb;EAEA,OAAOC,KAAKA,CAAA,EAA4B;IACtC,OAAO,IAAI,CAACH,cAAc,EAAE,CAACG,KAAK,EAAE;EACtC;EAE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AAS,GAAGV,QAAQ,CAACM,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGP,QAAQ,CAACQ,KAAK,CAAC,CAAC,CAAC;UAClEZ,aAAa,CAACI,QAAQ,CAAC,GAAGN,MAAM,CAACgB,iBAAiB,CAAC;QACrD;MACF;MAEA,OAAO;QAAEd,aAAa;QAAED;MAAW,CAAC;IACtC,CAAC;EACH;AACF;AAEA,OAAO,MAAMgB,uBAAuB,GAAG1B,gBAAgB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isJest } from './PlatformChecker';
|
|
2
2
|
import { runOnUI } from './threads';
|
|
3
|
+
import { isSharedValue } from './utils';
|
|
3
4
|
const IS_JEST = isJest();
|
|
4
5
|
export function createMapperRegistry() {
|
|
5
6
|
'worklet';
|
|
@@ -7,7 +8,7 @@ export function createMapperRegistry() {
|
|
|
7
8
|
const mappers = new Map();
|
|
8
9
|
let sortedMappers = [];
|
|
9
10
|
let runRequested = false;
|
|
10
|
-
|
|
11
|
+
let processingMappers = false;
|
|
11
12
|
function updateMappersOrder() {
|
|
12
13
|
// sort mappers topologically
|
|
13
14
|
// the algorithm here takes adventage of a fact that the topological order
|
|
@@ -30,12 +31,10 @@ export function createMapperRegistry() {
|
|
|
30
31
|
// instead of reversing that order we can use a normal array and push processed
|
|
31
32
|
// mappers to the end. There is no need to reverse that array after we are done.
|
|
32
33
|
const pre = new Map(); // map from sv -> mapper that outputs that sv
|
|
33
|
-
|
|
34
34
|
mappers.forEach(mapper => {
|
|
35
35
|
if (mapper.outputs) {
|
|
36
36
|
for (const output of mapper.outputs) {
|
|
37
37
|
const preMappers = pre.get(output);
|
|
38
|
-
|
|
39
38
|
if (preMappers === undefined) {
|
|
40
39
|
pre.set(output, [mapper]);
|
|
41
40
|
} else {
|
|
@@ -46,13 +45,10 @@ export function createMapperRegistry() {
|
|
|
46
45
|
});
|
|
47
46
|
const visited = new Set();
|
|
48
47
|
const newOrder = [];
|
|
49
|
-
|
|
50
48
|
function dfs(mapper) {
|
|
51
49
|
visited.add(mapper);
|
|
52
|
-
|
|
53
50
|
for (const input of mapper.inputs) {
|
|
54
51
|
const preMappers = pre.get(input);
|
|
55
|
-
|
|
56
52
|
if (preMappers) {
|
|
57
53
|
for (const preMapper of preMappers) {
|
|
58
54
|
if (!visited.has(preMapper)) {
|
|
@@ -61,10 +57,8 @@ export function createMapperRegistry() {
|
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
|
-
|
|
65
60
|
newOrder.push(mapper);
|
|
66
61
|
}
|
|
67
|
-
|
|
68
62
|
mappers.forEach(mapper => {
|
|
69
63
|
if (!visited.has(mapper)) {
|
|
70
64
|
dfs(mapper);
|
|
@@ -72,25 +66,23 @@ export function createMapperRegistry() {
|
|
|
72
66
|
});
|
|
73
67
|
sortedMappers = newOrder;
|
|
74
68
|
}
|
|
75
|
-
|
|
76
69
|
function mapperRun() {
|
|
70
|
+
processingMappers = true;
|
|
77
71
|
runRequested = false;
|
|
78
|
-
|
|
79
72
|
if (mappers.size !== sortedMappers.length) {
|
|
80
73
|
updateMappersOrder();
|
|
81
74
|
}
|
|
82
|
-
|
|
83
75
|
for (const mapper of sortedMappers) {
|
|
84
76
|
if (mapper.dirty) {
|
|
85
77
|
mapper.dirty = false;
|
|
86
78
|
mapper.worklet();
|
|
87
79
|
}
|
|
88
80
|
}
|
|
81
|
+
processingMappers = false;
|
|
89
82
|
}
|
|
90
|
-
|
|
91
83
|
function maybeRequestUpdates() {
|
|
92
84
|
if (IS_JEST) {
|
|
93
|
-
// On Jest environment we avoid using
|
|
85
|
+
// On Jest environment we avoid using queueMicrotask as that'd require test
|
|
94
86
|
// to advance the clock manually. This on other hand would require tests
|
|
95
87
|
// to know how many times mappers need to run. As we don't want tests to
|
|
96
88
|
// make any assumptions on that number it is easier to execute mappers
|
|
@@ -98,27 +90,42 @@ export function createMapperRegistry() {
|
|
|
98
90
|
// if they want to make any assertions on the effects of animations being run.
|
|
99
91
|
mapperRun();
|
|
100
92
|
} else if (!runRequested) {
|
|
101
|
-
|
|
93
|
+
if (processingMappers) {
|
|
94
|
+
// In general, we should avoid having mappers trigger updates as this may
|
|
95
|
+
// result in unpredictable behavior. Specifically, the updated value can
|
|
96
|
+
// be read by mappers that run later in the same frame but previous mappers
|
|
97
|
+
// would access the old value. Updating mappers during the mapper-run phase
|
|
98
|
+
// breaks the order in which we should execute the mappers. However, doing
|
|
99
|
+
// that is still a possibility and there are some instances where people use
|
|
100
|
+
// the API in that way, hence we need to prevent mapper-run phase falling into
|
|
101
|
+
// an infinite loop. We do that by detecting when mapper-run is requested while
|
|
102
|
+
// we are already in mapper-run phase, and in that case we use `requestAnimationFrame`
|
|
103
|
+
// instead of `queueMicrotask` which will schedule mapper run for the next
|
|
104
|
+
// frame instead of queuing another set of updates in the same frame.
|
|
105
|
+
requestAnimationFrame(mapperRun);
|
|
106
|
+
} else {
|
|
107
|
+
queueMicrotask(mapperRun);
|
|
108
|
+
}
|
|
102
109
|
runRequested = true;
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
|
-
|
|
106
112
|
function extractInputs(inputs, resultArray) {
|
|
107
113
|
if (Array.isArray(inputs)) {
|
|
108
114
|
for (const input of inputs) {
|
|
109
115
|
input && extractInputs(input, resultArray);
|
|
110
116
|
}
|
|
111
|
-
} else if (inputs
|
|
117
|
+
} else if (isSharedValue(inputs)) {
|
|
112
118
|
resultArray.push(inputs);
|
|
113
|
-
} else if (
|
|
119
|
+
} else if (Object.getPrototypeOf(inputs) === Object.prototype) {
|
|
120
|
+
// we only extract inputs recursively from "plain" objects here, if object
|
|
121
|
+
// is of a derivative class (e.g. HostObject on web, or Map) we don't scan
|
|
122
|
+
// it recursively
|
|
114
123
|
for (const element of Object.values(inputs)) {
|
|
115
124
|
element && extractInputs(element, resultArray);
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
|
-
|
|
119
127
|
return resultArray;
|
|
120
128
|
}
|
|
121
|
-
|
|
122
129
|
return {
|
|
123
130
|
start: (mapperID, worklet, inputs, outputs) => {
|
|
124
131
|
const mapper = {
|
|
@@ -130,23 +137,19 @@ export function createMapperRegistry() {
|
|
|
130
137
|
};
|
|
131
138
|
mappers.set(mapper.id, mapper);
|
|
132
139
|
sortedMappers = [];
|
|
133
|
-
|
|
134
140
|
for (const sv of mapper.inputs) {
|
|
135
141
|
sv.addListener(mapper.id, () => {
|
|
136
142
|
mapper.dirty = true;
|
|
137
143
|
maybeRequestUpdates();
|
|
138
144
|
});
|
|
139
145
|
}
|
|
140
|
-
|
|
141
146
|
maybeRequestUpdates();
|
|
142
147
|
},
|
|
143
148
|
stop: mapperID => {
|
|
144
149
|
const mapper = mappers.get(mapperID);
|
|
145
|
-
|
|
146
150
|
if (mapper) {
|
|
147
151
|
mappers.delete(mapper.id);
|
|
148
152
|
sortedMappers = [];
|
|
149
|
-
|
|
150
153
|
for (const sv of mapper.inputs) {
|
|
151
154
|
sv.removeListener(mapper.id);
|
|
152
155
|
}
|
|
@@ -163,11 +166,9 @@ export function startMapper(worklet) {
|
|
|
163
166
|
'worklet';
|
|
164
167
|
|
|
165
168
|
let mapperRegistry = global.__mapperRegistry;
|
|
166
|
-
|
|
167
169
|
if (mapperRegistry === undefined) {
|
|
168
170
|
mapperRegistry = global.__mapperRegistry = createMapperRegistry();
|
|
169
171
|
}
|
|
170
|
-
|
|
171
172
|
mapperRegistry.start(mapperID, worklet, inputs, outputs);
|
|
172
173
|
})();
|
|
173
174
|
return mapperID;
|