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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["reanimatedJS","JSReanimated","global","_makeShareableClone","c","_scheduleOnJS","
|
|
1
|
+
{"version":3,"names":["_JSReanimated","_interopRequireDefault","require","obj","__esModule","default","reanimatedJS","JSReanimated","global","_makeShareableClone","c","_scheduleOnJS","queueMicrotask","_updatePropsJS","updates","viewRef","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","console","warn","exports","style","previousStyle","currentStyle","_default"],"sources":["index.ts"],"sourcesContent":["import JSReanimated from './JSReanimated';\nimport { AnimatedStyle, StyleProps } from '../commonTypes';\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = (c) => c;\nglobal._scheduleOnJS = queueMicrotask;\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport const _updatePropsJS = (\n updates: StyleProps | AnimatedStyle,\n viewRef: { _component?: JSReanimatedComponent }\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n setNativeProps(component, rawStyles);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n console.warn('It is not possible to manipulate component');\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent,\n style: StyleProps\n): void => {\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...style };\n component.previousStyle = currentStyle;\n component.setNativeProps({ style: currentStyle });\n};\n\nexport default reanimatedJS;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAG1C,MAAMG,YAAY,GAAG,IAAIC,qBAAY,EAAE;AAEvCC,MAAM,CAACC,mBAAmB,GAAIC,CAAC,IAAKA,CAAC;AACrCF,MAAM,CAACG,aAAa,GAAGC,cAAc;AAW9B,MAAMC,cAAc,GAAGA,CAC5BC,OAAmC,EACnCC,OAA+C,KACtC;EACT,IAAIA,OAAO,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C,aAAa,GAAGvB,SAAS,CAACuB,aAAa,GAAGvB,SAAS,CAACuB,aAAa,GAAG,CAAC,CAAC;EAC5E,MAAMC,YAAY,GAAG;IAAE,GAAGD,aAAa;IAAE,GAAGD;EAAM,CAAC;EACnDtB,SAAS,CAACuB,aAAa,GAAGC,YAAY;EACtCxB,SAAS,CAACS,cAAc,CAAC;IAAEa,KAAK,EAAEE;EAAa,CAAC,CAAC;AACnD,CAAC;AAAC,IAAAC,QAAA,GAEapC,YAAY;AAAAgC,OAAA,CAAAjC,OAAA,GAAAqC,QAAA"}
|
|
@@ -4,80 +4,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BaseAnimationBuilder = void 0;
|
|
7
|
-
|
|
8
7
|
var _animation = require("../../animation");
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
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); }
|
|
12
11
|
class BaseAnimationBuilder {
|
|
13
12
|
constructor() {
|
|
14
13
|
_defineProperty(this, "durationV", void 0);
|
|
15
|
-
|
|
16
14
|
_defineProperty(this, "delayV", void 0);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "randomizeDelay", false);
|
|
19
|
-
|
|
20
16
|
_defineProperty(this, "callbackV", void 0);
|
|
21
|
-
|
|
22
17
|
_defineProperty(this, "build", () => {
|
|
23
18
|
throw Error('Unimplemented method in child class.');
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
static duration(durationMs) {
|
|
28
22
|
const instance = this.createInstance();
|
|
29
23
|
return instance.duration(durationMs);
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
duration(durationMs) {
|
|
33
26
|
this.durationV = durationMs;
|
|
34
27
|
return this;
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
static delay(delayMs) {
|
|
38
30
|
const instance = this.createInstance();
|
|
39
31
|
return instance.delay(delayMs);
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
delay(delayMs) {
|
|
43
34
|
this.delayV = delayMs;
|
|
44
35
|
return this;
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
static withCallback(callback) {
|
|
48
38
|
const instance = this.createInstance();
|
|
49
39
|
return instance.withCallback(callback);
|
|
50
40
|
}
|
|
51
|
-
|
|
52
41
|
withCallback(callback) {
|
|
53
42
|
this.callbackV = callback;
|
|
54
43
|
return this;
|
|
55
|
-
}
|
|
56
|
-
|
|
44
|
+
}
|
|
57
45
|
|
|
46
|
+
// 300ms is the default animation duration. If any animation has different default has to override this method.
|
|
58
47
|
static getDuration() {
|
|
59
48
|
return 300;
|
|
60
49
|
}
|
|
61
|
-
|
|
62
50
|
getDuration() {
|
|
63
51
|
return this.durationV ?? 300;
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
static randomDelay() {
|
|
67
54
|
const instance = this.createInstance();
|
|
68
55
|
return instance.randomDelay();
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
randomDelay() {
|
|
72
58
|
this.randomizeDelay = true;
|
|
73
59
|
return this;
|
|
74
|
-
}
|
|
75
|
-
|
|
60
|
+
}
|
|
76
61
|
|
|
62
|
+
// when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)
|
|
77
63
|
getDelay() {
|
|
78
64
|
return this.randomizeDelay ? Math.random() * (this.delayV ?? 1000) : this.delayV ?? 0;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
66
|
getDelayFunction() {
|
|
82
67
|
const isDelayProvided = this.randomizeDelay || this.delayV;
|
|
83
68
|
return isDelayProvided ? _animation.withDelay : (_, animation) => {
|
|
@@ -86,15 +71,11 @@ class BaseAnimationBuilder {
|
|
|
86
71
|
return animation;
|
|
87
72
|
};
|
|
88
73
|
}
|
|
89
|
-
|
|
90
74
|
static build() {
|
|
91
75
|
const instance = this.createInstance();
|
|
92
76
|
return instance.build();
|
|
93
77
|
}
|
|
94
|
-
|
|
95
78
|
}
|
|
96
|
-
|
|
97
79
|
exports.BaseAnimationBuilder = BaseAnimationBuilder;
|
|
98
|
-
|
|
99
80
|
_defineProperty(BaseAnimationBuilder, "createInstance", void 0);
|
|
100
81
|
//# sourceMappingURL=BaseAnimationBuilder.js.map
|
package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAnimationBuilder","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","withDelay","_","animation","build"],"sources":["BaseAnimationBuilder.ts"],"sourcesContent":["import { withDelay } from '../../animation';\nimport {\n EntryExitAnimationFunction,\n AnimationFunction,\n LayoutAnimationFunction,\n} from './commonTypes';\n\nexport class BaseAnimationBuilder {\n durationV?: number;\n delayV?: number;\n randomizeDelay = false;\n callbackV?: (finished: boolean) => void;\n\n static createInstance: () => BaseAnimationBuilder;\n build = (): EntryExitAnimationFunction | LayoutAnimationFunction => {\n throw Error('Unimplemented method in child class.');\n };\n\n static duration(durationMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.duration(durationMs);\n }\n\n duration(durationMs: number): BaseAnimationBuilder {\n this.durationV = durationMs;\n return this;\n }\n\n static delay(delayMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.delay(delayMs);\n }\n\n delay(delayMs: number): BaseAnimationBuilder {\n this.delayV = delayMs;\n return this;\n }\n\n static withCallback(\n callback: (finished: boolean) => void\n ): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withCallback(callback);\n }\n\n withCallback(callback: (finsihed: boolean) => void): BaseAnimationBuilder {\n this.callbackV = callback;\n return this;\n }\n\n // 300ms is the default animation duration. If any animation has different default has to override this method.\n static getDuration(): number {\n return 300;\n }\n\n getDuration(): number {\n return this.durationV ?? 300;\n }\n\n static randomDelay(): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.randomDelay();\n }\n\n randomDelay(): BaseAnimationBuilder {\n this.randomizeDelay = true;\n return this;\n }\n\n // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)\n getDelay(): number {\n return this.randomizeDelay\n ? Math.random() * (this.delayV ?? 1000)\n : this.delayV ?? 0;\n }\n\n getDelayFunction(): AnimationFunction {\n const isDelayProvided = this.randomizeDelay || this.delayV;\n return isDelayProvided\n ? withDelay\n : (_, animation) => {\n 'worklet';\n return animation;\n };\n }\n\n static build(): EntryExitAnimationFunction | LayoutAnimationFunction {\n const instance = this.createInstance();\n return instance.build();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_animation","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","BaseAnimationBuilder","constructor","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getDelayFunction","isDelayProvided","withDelay","_","animation","build","exports"],"sources":["BaseAnimationBuilder.ts"],"sourcesContent":["import { withDelay } from '../../animation';\nimport {\n EntryExitAnimationFunction,\n AnimationFunction,\n LayoutAnimationFunction,\n} from './commonTypes';\n\nexport class BaseAnimationBuilder {\n durationV?: number;\n delayV?: number;\n randomizeDelay = false;\n callbackV?: (finished: boolean) => void;\n\n static createInstance: () => BaseAnimationBuilder;\n build = (): EntryExitAnimationFunction | LayoutAnimationFunction => {\n throw Error('Unimplemented method in child class.');\n };\n\n static duration(durationMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.duration(durationMs);\n }\n\n duration(durationMs: number): BaseAnimationBuilder {\n this.durationV = durationMs;\n return this;\n }\n\n static delay(delayMs: number): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.delay(delayMs);\n }\n\n delay(delayMs: number): BaseAnimationBuilder {\n this.delayV = delayMs;\n return this;\n }\n\n static withCallback(\n callback: (finished: boolean) => void\n ): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withCallback(callback);\n }\n\n withCallback(callback: (finsihed: boolean) => void): BaseAnimationBuilder {\n this.callbackV = callback;\n return this;\n }\n\n // 300ms is the default animation duration. If any animation has different default has to override this method.\n static getDuration(): number {\n return 300;\n }\n\n getDuration(): number {\n return this.durationV ?? 300;\n }\n\n static randomDelay(): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.randomDelay();\n }\n\n randomDelay(): BaseAnimationBuilder {\n this.randomizeDelay = true;\n return this;\n }\n\n // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)\n getDelay(): number {\n return this.randomizeDelay\n ? Math.random() * (this.delayV ?? 1000)\n : this.delayV ?? 0;\n }\n\n getDelayFunction(): AnimationFunction {\n const isDelayProvided = this.randomizeDelay || this.delayV;\n return isDelayProvided\n ? withDelay\n : (_, animation) => {\n 'worklet';\n return animation;\n };\n }\n\n static build(): EntryExitAnimationFunction | LayoutAnimationFunction {\n const instance = this.createInstance();\n return instance.build();\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAA4C,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAA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AA,oBAAA;AAAAvB,eAAA,CAnFYuB,oBAAoB"}
|
package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js
CHANGED
|
@@ -4,138 +4,105 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ComplexAnimationBuilder = void 0;
|
|
7
|
-
|
|
8
7
|
var _animation = require("../../animation");
|
|
9
|
-
|
|
10
8
|
var _BaseAnimationBuilder = require("./BaseAnimationBuilder");
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
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); }
|
|
14
12
|
class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder {
|
|
15
13
|
constructor() {
|
|
16
14
|
super(...arguments);
|
|
17
|
-
|
|
18
15
|
_defineProperty(this, "easingV", void 0);
|
|
19
|
-
|
|
20
16
|
_defineProperty(this, "rotateV", void 0);
|
|
21
|
-
|
|
22
17
|
_defineProperty(this, "type", void 0);
|
|
23
|
-
|
|
24
18
|
_defineProperty(this, "dampingV", void 0);
|
|
25
|
-
|
|
26
19
|
_defineProperty(this, "massV", void 0);
|
|
27
|
-
|
|
28
20
|
_defineProperty(this, "stiffnessV", void 0);
|
|
29
|
-
|
|
30
21
|
_defineProperty(this, "overshootClampingV", void 0);
|
|
31
|
-
|
|
32
22
|
_defineProperty(this, "restDisplacementThresholdV", void 0);
|
|
33
|
-
|
|
34
23
|
_defineProperty(this, "restSpeedThresholdV", void 0);
|
|
35
|
-
|
|
36
24
|
_defineProperty(this, "initialValues", void 0);
|
|
37
25
|
}
|
|
38
|
-
|
|
39
26
|
static easing(easingFunction) {
|
|
40
27
|
const instance = this.createInstance();
|
|
41
28
|
return instance.easing(easingFunction);
|
|
42
29
|
}
|
|
43
|
-
|
|
44
30
|
easing(easingFunction) {
|
|
45
31
|
this.easingV = easingFunction;
|
|
46
32
|
return this;
|
|
47
33
|
}
|
|
48
|
-
|
|
49
34
|
static rotate(degree) {
|
|
50
35
|
const instance = this.createInstance();
|
|
51
36
|
return instance.rotate(degree);
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
rotate(degree) {
|
|
55
39
|
this.rotateV = degree;
|
|
56
40
|
return this;
|
|
57
41
|
}
|
|
58
|
-
|
|
59
42
|
static springify() {
|
|
60
43
|
const instance = this.createInstance();
|
|
61
44
|
return instance.springify();
|
|
62
45
|
}
|
|
63
|
-
|
|
64
46
|
springify() {
|
|
65
47
|
this.type = _animation.withSpring;
|
|
66
48
|
return this;
|
|
67
49
|
}
|
|
68
|
-
|
|
69
50
|
static damping(damping) {
|
|
70
51
|
const instance = this.createInstance();
|
|
71
52
|
return instance.damping(damping);
|
|
72
53
|
}
|
|
73
|
-
|
|
74
54
|
damping(damping) {
|
|
75
55
|
this.dampingV = damping;
|
|
76
56
|
return this;
|
|
77
57
|
}
|
|
78
|
-
|
|
79
58
|
static mass(mass) {
|
|
80
59
|
const instance = this.createInstance();
|
|
81
60
|
return instance.mass(mass);
|
|
82
61
|
}
|
|
83
|
-
|
|
84
62
|
mass(mass) {
|
|
85
63
|
this.massV = mass;
|
|
86
64
|
return this;
|
|
87
65
|
}
|
|
88
|
-
|
|
89
66
|
static stiffness(stiffness) {
|
|
90
67
|
const instance = this.createInstance();
|
|
91
68
|
return instance.stiffness(stiffness);
|
|
92
69
|
}
|
|
93
|
-
|
|
94
70
|
stiffness(stiffness) {
|
|
95
71
|
this.stiffnessV = stiffness;
|
|
96
72
|
return this;
|
|
97
73
|
}
|
|
98
|
-
|
|
99
74
|
static overshootClamping(overshootClamping) {
|
|
100
75
|
const instance = this.createInstance();
|
|
101
76
|
return instance.overshootClamping(overshootClamping);
|
|
102
77
|
}
|
|
103
|
-
|
|
104
78
|
overshootClamping(overshootClamping) {
|
|
105
79
|
this.overshootClampingV = overshootClamping;
|
|
106
80
|
return this;
|
|
107
81
|
}
|
|
108
|
-
|
|
109
82
|
static restDisplacementThreshold(restDisplacementThreshold) {
|
|
110
83
|
const instance = this.createInstance();
|
|
111
84
|
return instance.restDisplacementThreshold(restDisplacementThreshold);
|
|
112
85
|
}
|
|
113
|
-
|
|
114
86
|
restDisplacementThreshold(restDisplacementThreshold) {
|
|
115
87
|
this.restDisplacementThresholdV = restDisplacementThreshold;
|
|
116
88
|
return this;
|
|
117
89
|
}
|
|
118
|
-
|
|
119
90
|
static restSpeedThreshold(restSpeedThreshold) {
|
|
120
91
|
const instance = this.createInstance();
|
|
121
92
|
return instance.restSpeedThreshold(restSpeedThreshold);
|
|
122
93
|
}
|
|
123
|
-
|
|
124
94
|
restSpeedThreshold(restSpeedThreshold) {
|
|
125
95
|
this.restSpeedThresholdV = restSpeedThreshold;
|
|
126
96
|
return this;
|
|
127
97
|
}
|
|
128
|
-
|
|
129
98
|
static withInitialValues(values) {
|
|
130
99
|
const instance = this.createInstance();
|
|
131
100
|
return instance.withInitialValues(values);
|
|
132
101
|
}
|
|
133
|
-
|
|
134
102
|
withInitialValues(values) {
|
|
135
103
|
this.initialValues = values;
|
|
136
104
|
return this;
|
|
137
105
|
}
|
|
138
|
-
|
|
139
106
|
getAnimationAndConfig() {
|
|
140
107
|
const duration = this.durationV;
|
|
141
108
|
const easing = this.easingV;
|
|
@@ -149,16 +116,13 @@ class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder
|
|
|
149
116
|
const restSpeedThreshold = this.restSpeedThresholdV;
|
|
150
117
|
const animation = type;
|
|
151
118
|
const config = {};
|
|
152
|
-
|
|
153
119
|
if (type === _animation.withTiming) {
|
|
154
120
|
if (easing) {
|
|
155
121
|
config.easing = easing;
|
|
156
122
|
}
|
|
157
|
-
|
|
158
123
|
if (duration) {
|
|
159
124
|
config.duration = duration;
|
|
160
125
|
}
|
|
161
|
-
|
|
162
126
|
if (rotate) {
|
|
163
127
|
config.rotate = rotate;
|
|
164
128
|
}
|
|
@@ -166,38 +130,28 @@ class ComplexAnimationBuilder extends _BaseAnimationBuilder.BaseAnimationBuilder
|
|
|
166
130
|
if (damping) {
|
|
167
131
|
config.damping = damping;
|
|
168
132
|
}
|
|
169
|
-
|
|
170
133
|
if (mass) {
|
|
171
134
|
config.mass = mass;
|
|
172
135
|
}
|
|
173
|
-
|
|
174
136
|
if (stiffness) {
|
|
175
137
|
config.stiffness = stiffness;
|
|
176
138
|
}
|
|
177
|
-
|
|
178
139
|
if (overshootClamping) {
|
|
179
140
|
config.overshootClamping = overshootClamping;
|
|
180
141
|
}
|
|
181
|
-
|
|
182
142
|
if (restDisplacementThreshold) {
|
|
183
143
|
config.restDisplacementThreshold = restDisplacementThreshold;
|
|
184
144
|
}
|
|
185
|
-
|
|
186
145
|
if (restSpeedThreshold) {
|
|
187
146
|
config.restSpeedThreshold = restSpeedThreshold;
|
|
188
147
|
}
|
|
189
|
-
|
|
190
148
|
if (rotate) {
|
|
191
149
|
config.rotate = rotate;
|
|
192
150
|
}
|
|
193
151
|
}
|
|
194
|
-
|
|
195
152
|
return [animation, config];
|
|
196
153
|
}
|
|
197
|
-
|
|
198
154
|
}
|
|
199
|
-
|
|
200
155
|
exports.ComplexAnimationBuilder = ComplexAnimationBuilder;
|
|
201
|
-
|
|
202
156
|
_defineProperty(ComplexAnimationBuilder, "createInstance", void 0);
|
|
203
157
|
//# sourceMappingURL=ComplexAnimationBuilder.js.map
|
package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComplexAnimationBuilder","BaseAnimationBuilder","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","withSpring","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","withTiming","animation","config"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["import { withTiming, withSpring } from '../../animation';\nimport {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport { EasingFn } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport { StyleProps } from '../../commonTypes';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFn;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: () => ComplexAnimationBuilder;\n\n static easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n this.easingV = easingFunction;\n return this;\n }\n\n static rotate(degree: string): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): ComplexAnimationBuilder {\n this.rotateV = degree;\n return this;\n }\n\n static springify(): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify();\n }\n\n springify(): ComplexAnimationBuilder {\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n static damping(damping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): ComplexAnimationBuilder {\n this.dampingV = damping;\n return this;\n }\n\n static mass(mass: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): ComplexAnimationBuilder {\n this.massV = mass;\n return this;\n }\n\n static stiffness(stiffness: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): ComplexAnimationBuilder {\n this.stiffnessV = stiffness;\n return this;\n }\n\n static overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n static restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n static restSpeedThreshold(\n restSpeedThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n static withInitialValues(values: StyleProps): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): BaseAnimationBuilder {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n if (type === withTiming) {\n if (easing) {\n config.easing = easing;\n }\n if (duration) {\n config.duration = duration;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n } else {\n if (damping) {\n config.damping = damping;\n }\n if (mass) {\n config.mass = mass;\n }\n if (stiffness) {\n config.stiffness = stiffness;\n }\n if (overshootClamping) {\n config.overshootClamping = overshootClamping;\n }\n if (restDisplacementThreshold) {\n config.restDisplacementThreshold = restDisplacementThreshold;\n }\n if (restSpeedThreshold) {\n config.restSpeedThreshold = restSpeedThreshold;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n }\n return [animation, config];\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAOA;;;;AAGO,MAAMA,uBAAN,SAAsCC,0CAAtC,CAA2D;EAAA;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;EAAA;;EAcnD,OAANC,MAAM,CAACC,cAAD,EAAoD;IAC/D,MAAMC,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACF,MAAT,CAAgBC,cAAhB,CAAP;EACD;;EAEDD,MAAM,CAACC,cAAD,EAAoD;IACxD,KAAKG,OAAL,GAAeH,cAAf;IACA,OAAO,IAAP;EACD;;EAEY,OAANI,MAAM,CAACC,MAAD,EAA0C;IACrD,MAAMJ,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACG,MAAT,CAAgBC,MAAhB,CAAP;EACD;;EAEDD,MAAM,CAACC,MAAD,EAA0C;IAC9C,KAAKC,OAAL,GAAeD,MAAf;IACA,OAAO,IAAP;EACD;;EAEe,OAATE,SAAS,GAA4B;IAC1C,MAAMN,QAAQ,GAAG,KAAKC,cAAL,EAAjB;IACA,OAAOD,QAAQ,CAACM,SAAT,EAAP;EACD;;EAEDA,SAAS,GAA4B;IACnC,KAAKC,IAAL,GAAYC,qBAAZ;IACA,OAAO,IAAP;EACD;;EAEa,OAAPC,OAAO,CAAC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hB;MACD;IACF,CAVD,MAUO;MACL,IAAIM,OAAJ,EAAa;QACXoB,MAAM,CAACpB,OAAP,GAAiBA,OAAjB;MACD;;MACD,IAAIE,IAAJ,EAAU;QACRkB,MAAM,CAAClB,IAAP,GAAcA,IAAd;MACD;;MACD,IAAIE,SAAJ,EAAe;QACbgB,MAAM,CAAChB,SAAP,GAAmBA,SAAnB;MACD;;MACD,IAAIE,iBAAJ,EAAuB;QACrBc,MAAM,CAACd,iBAAP,GAA2BA,iBAA3B;MACD;;MACD,IAAIE,yBAAJ,EAA+B;QAC7BY,MAAM,CAACZ,yBAAP,GAAmCA,yBAAnC;MACD;;MACD,IAAIE,kBAAJ,EAAwB;QACtBU,MAAM,CAACV,kBAAP,GAA4BA,kBAA5B;MACD;;MACD,IAAIhB,MAAJ,EAAY;QACV0B,MAAM,CAAC1B,MAAP,GAAgBA,MAAhB;MACD;IACF;;IACD,OAAO,CAACyB,SAAD,EAAYC,MAAZ,CAAP;EACD;;AA1K+D;;;;gBAArDjC,uB"}
|
|
1
|
+
{"version":3,"names":["_animation","require","_BaseAnimationBuilder","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","ComplexAnimationBuilder","BaseAnimationBuilder","constructor","arguments","easing","easingFunction","instance","createInstance","easingV","rotate","degree","rotateV","springify","type","withSpring","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","duration","durationV","withTiming","animation","config","exports"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["import { withTiming, withSpring } from '../../animation';\nimport {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport { EasingFn } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport { StyleProps } from '../../commonTypes';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFn;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: () => ComplexAnimationBuilder;\n\n static easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFn): ComplexAnimationBuilder {\n this.easingV = easingFunction;\n return this;\n }\n\n static rotate(degree: string): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): ComplexAnimationBuilder {\n this.rotateV = degree;\n return this;\n }\n\n static springify(): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify();\n }\n\n springify(): ComplexAnimationBuilder {\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n static damping(damping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): ComplexAnimationBuilder {\n this.dampingV = damping;\n return this;\n }\n\n static mass(mass: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): ComplexAnimationBuilder {\n this.massV = mass;\n return this;\n }\n\n static stiffness(stiffness: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): ComplexAnimationBuilder {\n this.stiffnessV = stiffness;\n return this;\n }\n\n static overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): ComplexAnimationBuilder {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n static restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(\n restDisplacementThreshold: number\n ): ComplexAnimationBuilder {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n static restSpeedThreshold(\n restSpeedThreshold: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n static withInitialValues(values: StyleProps): BaseAnimationBuilder {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): BaseAnimationBuilder {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n if (type === withTiming) {\n if (easing) {\n config.easing = easing;\n }\n if (duration) {\n config.duration = duration;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n } else {\n if (damping) {\n config.damping = damping;\n }\n if (mass) {\n config.mass = mass;\n }\n if (stiffness) {\n config.stiffness = stiffness;\n }\n if (overshootClamping) {\n config.overshootClamping = overshootClamping;\n }\n if (restDisplacementThreshold) {\n config.restDisplacementThreshold = restDisplacementThreshold;\n }\n if (restSpeedThreshold) {\n config.restSpeedThreshold = restSpeedThreshold;\n }\n if (rotate) {\n config.rotate = rotate;\n }\n }\n return [animation, config];\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA,IAAAC,qBAAA,GAAAD,OAAA;AAA8D,SAAA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AAvB,eAAA,CA3KYuB,uBAAuB"}
|
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Keyframe = void 0;
|
|
7
|
-
|
|
8
7
|
var _Easing = require("../../Easing");
|
|
9
|
-
|
|
10
8
|
var _animation = require("../../animation");
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
|
+
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); }
|
|
14
12
|
class Keyframe {
|
|
15
13
|
/*
|
|
16
14
|
Keyframe definition should be passed in the constructor as the map
|
|
@@ -18,13 +16,9 @@ class Keyframe {
|
|
|
18
16
|
*/
|
|
19
17
|
constructor(definitions) {
|
|
20
18
|
_defineProperty(this, "durationV", void 0);
|
|
21
|
-
|
|
22
19
|
_defineProperty(this, "delayV", void 0);
|
|
23
|
-
|
|
24
20
|
_defineProperty(this, "callbackV", void 0);
|
|
25
|
-
|
|
26
21
|
_defineProperty(this, "definitions", void 0);
|
|
27
|
-
|
|
28
22
|
_defineProperty(this, "build", () => {
|
|
29
23
|
const delay = this.delayV;
|
|
30
24
|
const delayFunction = this.getDelayFunction();
|
|
@@ -37,14 +31,14 @@ class Keyframe {
|
|
|
37
31
|
'worklet';
|
|
38
32
|
|
|
39
33
|
const animations = {};
|
|
34
|
+
|
|
40
35
|
/*
|
|
41
36
|
For each style property, an animations sequence is created that corresponds with its key points.
|
|
42
37
|
Transform style properties require special handling because of their nested structure.
|
|
43
38
|
*/
|
|
44
|
-
|
|
45
39
|
const addAnimation = key => {
|
|
46
|
-
const keyframePoints = keyframes[key];
|
|
47
|
-
|
|
40
|
+
const keyframePoints = keyframes[key];
|
|
41
|
+
// in case if property was only passed as initial value
|
|
48
42
|
if (keyframePoints.length === 0) return;
|
|
49
43
|
const animation = delayFunction(delay, keyframePoints.length === 1 ? (0, _animation.withTiming)(keyframePoints[0].value, {
|
|
50
44
|
duration: keyframePoints[0].duration,
|
|
@@ -53,14 +47,11 @@ class Keyframe {
|
|
|
53
47
|
duration: keyframePoint.duration,
|
|
54
48
|
easing: keyframePoint.easing ? keyframePoint.easing : _Easing.Easing.linear
|
|
55
49
|
}))));
|
|
56
|
-
|
|
57
50
|
if (key.includes('transform')) {
|
|
58
51
|
var _animations$transform;
|
|
59
|
-
|
|
60
52
|
if (!('transform' in animations)) {
|
|
61
53
|
animations.transform = [];
|
|
62
54
|
}
|
|
63
|
-
|
|
64
55
|
(_animations$transform = animations.transform) === null || _animations$transform === void 0 ? void 0 : _animations$transform.push({
|
|
65
56
|
[key.split(':')[1]]: animation
|
|
66
57
|
});
|
|
@@ -68,7 +59,6 @@ class Keyframe {
|
|
|
68
59
|
animations[key] = animation;
|
|
69
60
|
}
|
|
70
61
|
};
|
|
71
|
-
|
|
72
62
|
Object.keys(initialValues).forEach(key => {
|
|
73
63
|
if (key.includes('transform')) {
|
|
74
64
|
initialValues[key].forEach((transformProp, index) => {
|
|
@@ -87,10 +77,8 @@ class Keyframe {
|
|
|
87
77
|
};
|
|
88
78
|
};
|
|
89
79
|
});
|
|
90
|
-
|
|
91
80
|
this.definitions = definitions;
|
|
92
81
|
}
|
|
93
|
-
|
|
94
82
|
parseDefinitions() {
|
|
95
83
|
/*
|
|
96
84
|
Each style property contain an array with all their key points:
|
|
@@ -100,21 +88,17 @@ class Keyframe {
|
|
|
100
88
|
/*
|
|
101
89
|
Parsing keyframes 'from' and 'to'.
|
|
102
90
|
*/
|
|
103
|
-
|
|
104
91
|
if (this.definitions.from) {
|
|
105
92
|
if (this.definitions['0']) {
|
|
106
93
|
throw Error("You cannot provide both keyframe 0 and 'from' as they both specified initial values");
|
|
107
94
|
}
|
|
108
|
-
|
|
109
95
|
this.definitions['0'] = this.definitions.from;
|
|
110
96
|
delete this.definitions.from;
|
|
111
97
|
}
|
|
112
|
-
|
|
113
98
|
if (this.definitions.to) {
|
|
114
99
|
if (this.definitions['100']) {
|
|
115
100
|
throw Error("You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.");
|
|
116
101
|
}
|
|
117
|
-
|
|
118
102
|
this.definitions['100'] = this.definitions.to;
|
|
119
103
|
delete this.definitions.to;
|
|
120
104
|
}
|
|
@@ -122,21 +106,16 @@ class Keyframe {
|
|
|
122
106
|
One of the assumptions is that keyframe 0 is required to properly set initial values.
|
|
123
107
|
Every other keyframe should contain properties from the set provided as initial values.
|
|
124
108
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
109
|
if (!this.definitions['0']) {
|
|
128
110
|
throw Error("Please provide 0, or 'from' keyframe with initial state of your object.");
|
|
129
111
|
}
|
|
130
|
-
|
|
131
112
|
const initialValues = this.definitions['0'];
|
|
132
113
|
/*
|
|
133
114
|
Initialize parsedKeyframes for properties provided in initial keyframe
|
|
134
115
|
*/
|
|
135
|
-
|
|
136
116
|
Object.keys(initialValues).forEach(styleProp => {
|
|
137
117
|
if (styleProp === 'transform') {
|
|
138
118
|
var _initialValues$styleP;
|
|
139
|
-
|
|
140
119
|
(_initialValues$styleP = initialValues[styleProp]) === null || _initialValues$styleP === void 0 ? void 0 : _initialValues$styleP.forEach((transformStyle, index) => {
|
|
141
120
|
Object.keys(transformStyle).forEach(transformProp => {
|
|
142
121
|
parsedKeyframes[index.toString() + '_transform:' + transformProp] = [];
|
|
@@ -148,17 +127,15 @@ class Keyframe {
|
|
|
148
127
|
});
|
|
149
128
|
const duration = this.durationV ? this.durationV : 500;
|
|
150
129
|
const animationKeyPoints = Array.from(Object.keys(this.definitions));
|
|
151
|
-
|
|
152
130
|
const getAnimationDuration = (key, currentKeyPoint) => {
|
|
153
131
|
const maxDuration = currentKeyPoint / 100 * duration;
|
|
154
132
|
const currentDuration = parsedKeyframes[key].reduce((acc, value) => acc + value.duration, 0);
|
|
155
133
|
return maxDuration - currentDuration;
|
|
156
134
|
};
|
|
135
|
+
|
|
157
136
|
/*
|
|
158
137
|
Other keyframes can't contain properties that were not specified in initial keyframe.
|
|
159
138
|
*/
|
|
160
|
-
|
|
161
|
-
|
|
162
139
|
const addKeyPoint = _ref => {
|
|
163
140
|
let {
|
|
164
141
|
key,
|
|
@@ -166,38 +143,31 @@ class Keyframe {
|
|
|
166
143
|
currentKeyPoint,
|
|
167
144
|
easing
|
|
168
145
|
} = _ref;
|
|
169
|
-
|
|
170
146
|
if (!(key in parsedKeyframes)) {
|
|
171
147
|
throw Error("Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')");
|
|
172
148
|
}
|
|
173
|
-
|
|
174
149
|
parsedKeyframes[key].push({
|
|
175
150
|
duration: getAnimationDuration(key, currentKeyPoint),
|
|
176
151
|
value: value,
|
|
177
152
|
easing: easing
|
|
178
153
|
});
|
|
179
154
|
};
|
|
180
|
-
|
|
181
155
|
animationKeyPoints.filter(value => parseInt(value) !== 0).sort((a, b) => parseInt(a) - parseInt(b)).forEach(keyPoint => {
|
|
182
156
|
if (parseInt(keyPoint) < 0 || parseInt(keyPoint) > 100) {
|
|
183
157
|
throw Error('Keyframe should be in between range 0 - 100.');
|
|
184
158
|
}
|
|
185
|
-
|
|
186
159
|
const keyframe = this.definitions[keyPoint];
|
|
187
160
|
const easing = keyframe.easing;
|
|
188
161
|
delete keyframe.easing;
|
|
189
|
-
|
|
190
162
|
const addKeyPointWith = (key, value) => addKeyPoint({
|
|
191
163
|
key,
|
|
192
164
|
value,
|
|
193
165
|
currentKeyPoint: parseInt(keyPoint),
|
|
194
166
|
easing
|
|
195
167
|
});
|
|
196
|
-
|
|
197
168
|
Object.keys(keyframe).forEach(key => {
|
|
198
169
|
if (key === 'transform') {
|
|
199
170
|
var _keyframe$key;
|
|
200
|
-
|
|
201
171
|
(_keyframe$key = keyframe[key]) === null || _keyframe$key === void 0 ? void 0 : _keyframe$key.forEach((transformStyle, index) => {
|
|
202
172
|
Object.keys(transformStyle).forEach(transformProp => {
|
|
203
173
|
addKeyPointWith(index.toString() + '_transform:' + transformProp, transformStyle[transformProp]);
|
|
@@ -213,22 +183,18 @@ class Keyframe {
|
|
|
213
183
|
keyframes: parsedKeyframes
|
|
214
184
|
};
|
|
215
185
|
}
|
|
216
|
-
|
|
217
186
|
duration(durationMs) {
|
|
218
187
|
this.durationV = durationMs;
|
|
219
188
|
return this;
|
|
220
189
|
}
|
|
221
|
-
|
|
222
190
|
delay(delayMs) {
|
|
223
191
|
this.delayV = delayMs;
|
|
224
192
|
return this;
|
|
225
193
|
}
|
|
226
|
-
|
|
227
194
|
withCallback(callback) {
|
|
228
195
|
this.callbackV = callback;
|
|
229
196
|
return this;
|
|
230
197
|
}
|
|
231
|
-
|
|
232
198
|
getDelayFunction() {
|
|
233
199
|
const delay = this.delayV;
|
|
234
200
|
return delay ? _animation.withDelay : (_, animation) => {
|
|
@@ -237,8 +203,6 @@ class Keyframe {
|
|
|
237
203
|
return animation;
|
|
238
204
|
};
|
|
239
205
|
}
|
|
240
|
-
|
|
241
206
|
}
|
|
242
|
-
|
|
243
207
|
exports.Keyframe = Keyframe;
|
|
244
208
|
//# sourceMappingURL=Keyframe.js.map
|