react-native-reanimated 3.0.0-rc.8 → 3.0.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/AnimatedSensor/AnimatedSensorModule.cpp +30 -12
- package/Common/cpp/AnimatedSensor/AnimatedSensorModule.h +2 -0
- package/Common/cpp/Fabric/FabricUtils.cpp +3 -107
- package/Common/cpp/Fabric/FabricUtils.h +3 -24
- package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +54 -37
- package/Common/cpp/LayoutAnimations/LayoutAnimationType.h +8 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +81 -26
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +20 -3
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +122 -121
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +21 -14
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +15 -7
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +8 -4
- package/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp +50 -1
- package/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.h +10 -1
- package/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp +5 -1
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +8 -34
- package/Common/cpp/Registries/EventHandlerRegistry.h +7 -13
- package/Common/cpp/SharedItems/Shareables.cpp +11 -63
- package/Common/cpp/SharedItems/Shareables.h +113 -93
- package/Common/cpp/Tools/CollectionUtils.h +14 -0
- package/Common/cpp/Tools/JsiUtils.cpp +26 -0
- package/Common/cpp/Tools/JsiUtils.h +176 -0
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +5 -5
- package/Common/cpp/Tools/ReanimatedVersion.cpp +17 -0
- package/Common/cpp/Tools/ReanimatedVersion.h +11 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +67 -247
- package/Common/cpp/Tools/RuntimeDecorator.h +2 -3
- package/Common/cpp/Tools/WorkletEventHandler.cpp +3 -2
- package/Common/cpp/Tools/WorkletEventHandler.h +14 -6
- package/RNReanimated.podspec +2 -1
- package/android/CMakeLists.txt +188 -181
- package/android/build.gradle +362 -311
- package/android/proguard-rules.pro +2 -0
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +63 -295
- package/android/src/main/cpp/LayoutAnimations.cpp +35 -5
- package/android/src/main/cpp/LayoutAnimations.h +23 -6
- package/android/src/main/cpp/NativeProxy.cpp +143 -98
- package/android/src/main/cpp/NativeProxy.h +22 -28
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +5 -4
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +7 -1
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +10 -3
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +218 -35
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +43 -17
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +6 -2
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedElement.java +19 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +610 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +93 -23
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/AnimationFrameCallback.java +19 -0
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.java +35 -0
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/KeyboardEventDataUpdater.java +16 -0
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +206 -0
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/SensorSetter.java +17 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +9 -3
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +3 -4
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +31 -7
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +90 -307
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +16 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +63 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +271 -0
- package/android/src/reactNativeVersionPatch/nativeHierarchyManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +76 -20
- package/ios/LayoutReanimation/REAAnimationsManager.h +31 -5
- package/ios/LayoutReanimation/REAAnimationsManager.m +265 -77
- package/ios/LayoutReanimation/REAFrame.h +10 -0
- package/ios/LayoutReanimation/REAFrame.m +15 -0
- package/ios/LayoutReanimation/REAScreensHelper.h +19 -0
- package/ios/LayoutReanimation/REAScreensHelper.m +106 -0
- package/ios/LayoutReanimation/REASharedElement.h +15 -0
- package/ios/LayoutReanimation/REASharedElement.m +16 -0
- package/ios/LayoutReanimation/REASharedTransitionManager.h +17 -0
- package/ios/LayoutReanimation/REASharedTransitionManager.m +632 -0
- package/ios/LayoutReanimation/REASnapshot.h +1 -0
- package/ios/LayoutReanimation/REASnapshot.m +96 -11
- package/ios/LayoutReanimation/REAUIManager.mm +67 -60
- package/ios/REAModule.mm +2 -7
- package/ios/REANodesManager.mm +1 -21
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +72 -36
- package/ios/native/NativeProxy.mm +75 -114
- package/ios/native/REAInitializer.mm +2 -7
- package/ios/native/REAJSIUtils.h +60 -2
- package/ios/sensor/ReanimatedSensor.h +6 -2
- package/ios/sensor/ReanimatedSensor.m +43 -7
- package/ios/sensor/ReanimatedSensorContainer.h +4 -1
- package/ios/sensor/ReanimatedSensorContainer.m +8 -2
- package/lib/commonjs/createAnimatedComponent.js +232 -28
- package/lib/commonjs/createAnimatedComponent.js.map +1 -1
- package/lib/commonjs/reanimated2/Colors.js +43 -22
- package/lib/commonjs/reanimated2/Colors.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +18 -35
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +5 -1
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/util.js +17 -15
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
- package/lib/commonjs/reanimated2/commonTypes.js +33 -1
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/component/FlatList.js +19 -3
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
- package/lib/commonjs/reanimated2/core.js +34 -83
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- package/lib/commonjs/reanimated2/errors.js +66 -0
- package/lib/commonjs/reanimated2/errors.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +2 -2
- 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/index.js +0 -6
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +5 -2
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +13 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +89 -16
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +43 -50
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +13 -1
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +2 -2
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/utils.js +18 -65
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/index.js +13 -0
- package/lib/commonjs/reanimated2/index.js.map +1 -1
- package/lib/commonjs/reanimated2/initializers.js +196 -0
- package/lib/commonjs/reanimated2/initializers.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolateColor.js +96 -19
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +101 -16
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +22 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/WebSensor.js +2 -0
- package/lib/commonjs/reanimated2/js-reanimated/WebSensor.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/global.js +4 -9
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js +0 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +11 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +8 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +16 -12
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +16 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -14
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +8 -14
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +8 -15
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +16 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +13 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +94 -0
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -0
- package/lib/commonjs/reanimated2/mappers.js +18 -6
- package/lib/commonjs/reanimated2/mappers.js.map +1 -1
- package/lib/commonjs/reanimated2/mock.js +45 -0
- package/lib/commonjs/reanimated2/mock.js.map +1 -1
- package/lib/commonjs/reanimated2/mutables.js +4 -2
- package/lib/commonjs/reanimated2/mutables.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +42 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +15 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -0
- package/lib/commonjs/reanimated2/pluginUtils.js +11 -0
- package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/shareables.js +38 -11
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +114 -4
- package/lib/commonjs/reanimated2/threads.js.map +1 -1
- package/lib/commonjs/reanimated2/utils.js +7 -0
- package/lib/commonjs/reanimated2/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/valueSetter.js +1 -3
- package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/createAnimatedComponent.js +229 -29
- package/lib/module/createAnimatedComponent.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +35 -19
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +18 -34
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +5 -1
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +17 -16
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +29 -0
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +18 -4
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/core.js +30 -76
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +58 -0
- package/lib/module/reanimated2/errors.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +2 -2
- 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/index.js +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +5 -2
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +12 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +2 -2
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +88 -13
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +45 -52
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +12 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +2 -2
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js +17 -60
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js +1 -0
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +182 -0
- package/lib/module/reanimated2/initializers.js.map +1 -0
- package/lib/module/reanimated2/interpolateColor.js +96 -19
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +1 -1
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +101 -16
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/Mapper.js +21 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/WebSensor.js +2 -0
- package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/global.js +4 -9
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +0 -1
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +9 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +15 -10
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +16 -21
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -12
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +8 -12
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +8 -13
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +16 -21
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js +82 -0
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -0
- package/lib/module/reanimated2/mappers.js +16 -6
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mock.js +45 -0
- package/lib/module/reanimated2/mock.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +4 -2
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.js +35 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js +8 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -0
- package/lib/module/reanimated2/pluginUtils.js +4 -0
- package/lib/module/reanimated2/pluginUtils.js.map +1 -0
- package/lib/module/reanimated2/shareables.js +38 -9
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +105 -4
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/utils.js +5 -0
- package/lib/module/reanimated2/utils.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +1 -2
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/package.json +9 -8
- package/{plugin.js → plugin/index.js} +173 -228
- package/react-native-reanimated.d.ts +57 -10
- package/scripts/reanimated_utils.rb +15 -2
- package/src/createAnimatedComponent.tsx +238 -28
- package/src/reanimated2/Colors.ts +38 -11
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +63 -41
- package/src/reanimated2/animation/styleAnimation.ts +8 -1
- package/src/reanimated2/animation/util.ts +29 -16
- package/src/reanimated2/commonTypes.ts +28 -1
- package/src/reanimated2/component/FlatList.tsx +30 -5
- package/src/reanimated2/core.ts +45 -75
- package/src/reanimated2/errors.ts +57 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +2 -2
- package/src/reanimated2/globals.d.ts +34 -18
- package/src/reanimated2/hook/index.ts +1 -1
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +10 -4
- package/src/reanimated2/hook/useAnimatedReaction.ts +12 -5
- package/src/reanimated2/hook/useAnimatedRef.ts +1 -4
- package/src/reanimated2/hook/useAnimatedSensor.ts +88 -11
- package/src/reanimated2/hook/useAnimatedStyle.ts +43 -45
- package/src/reanimated2/hook/useDerivedValue.ts +8 -1
- package/src/reanimated2/hook/useScrollViewOffset.ts +2 -2
- package/src/reanimated2/hook/utils.ts +15 -61
- package/src/reanimated2/index.ts +1 -0
- package/src/reanimated2/initializers.ts +184 -0
- package/src/reanimated2/interpolateColor.ts +104 -20
- package/src/reanimated2/jestUtils.ts +1 -1
- package/src/reanimated2/js-reanimated/JSReanimated.ts +105 -18
- package/src/reanimated2/js-reanimated/Mapper.ts +32 -0
- package/src/reanimated2/js-reanimated/WebSensor.ts +34 -0
- package/src/reanimated2/js-reanimated/commonTypes.ts +0 -1
- package/src/reanimated2/js-reanimated/global.ts +4 -8
- package/src/reanimated2/js-reanimated/index.ts +0 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +13 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -0
- package/src/reanimated2/layoutReanimation/animationsManager.ts +17 -12
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +16 -19
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +14 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +21 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -11
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +36 -19
- package/src/reanimated2/layoutReanimation/index.ts +1 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/index.ts +87 -0
- package/src/reanimated2/mappers.ts +17 -6
- package/src/reanimated2/mock.ts +128 -0
- package/src/reanimated2/mutables.ts +2 -0
- package/src/reanimated2/platform-specific/checkVersion.ts +39 -0
- package/src/reanimated2/platform-specific/checkVersion.web.ts +6 -0
- package/src/reanimated2/pluginUtils.ts +8 -0
- package/src/reanimated2/shareables.ts +47 -11
- package/src/reanimated2/threads.ts +103 -1
- package/src/reanimated2/utils.ts +6 -0
- package/src/reanimated2/valueSetter.ts +1 -2
- package/lib/commonjs/reanimated2/time.js +0 -55
- package/lib/commonjs/reanimated2/time.js.map +0 -1
- package/lib/module/reanimated2/time.js +0 -37
- package/lib/module/reanimated2/time.js.map +0 -1
- package/src/reanimated2/time.ts +0 -30
- /package/android/src/{main/java → reactNativeVersionPatch/ReanimatedUIManager/70}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NestedObjectValues } from '../commonTypes';
|
|
2
|
+
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
2
3
|
import { JSReanimated } from './commonTypes';
|
|
3
4
|
import MutableValue from './MutableValue';
|
|
4
5
|
|
|
@@ -49,6 +50,9 @@ export default class Mapper<T> {
|
|
|
49
50
|
res.push(value);
|
|
50
51
|
} else if (Array.isArray(value)) {
|
|
51
52
|
value.forEach((v) => extractMutables(v));
|
|
53
|
+
} else if (isWebDomElement(value)) {
|
|
54
|
+
// do nothing on dom elements
|
|
55
|
+
// without this check, we get a "Maximum call size exceeded error"
|
|
52
56
|
} else if (typeof value === 'object') {
|
|
53
57
|
Object.keys(value).forEach((key) => {
|
|
54
58
|
extractMutables(value[key]);
|
|
@@ -60,3 +64,31 @@ export default class Mapper<T> {
|
|
|
60
64
|
return res;
|
|
61
65
|
}
|
|
62
66
|
}
|
|
67
|
+
|
|
68
|
+
function isWebDomElement(value: any) {
|
|
69
|
+
if (!shouldBeUseWeb()) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// https://stackoverflow.com/a/384380/7869175
|
|
74
|
+
function isWebNode(o: any) {
|
|
75
|
+
return typeof Node === 'object'
|
|
76
|
+
? o instanceof Node
|
|
77
|
+
: o &&
|
|
78
|
+
typeof o === 'object' &&
|
|
79
|
+
typeof o.nodeType === 'number' &&
|
|
80
|
+
typeof o.nodeName === 'string';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function isWebElement(o: any) {
|
|
84
|
+
return typeof HTMLElement === 'object'
|
|
85
|
+
? o instanceof HTMLElement // DOM2
|
|
86
|
+
: o &&
|
|
87
|
+
typeof o === 'object' &&
|
|
88
|
+
o !== null &&
|
|
89
|
+
o.nodeType === 1 &&
|
|
90
|
+
typeof o.nodeName === 'string';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return isWebNode(value) || isWebElement(value);
|
|
94
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare class WebSensor {
|
|
2
|
+
start: () => void;
|
|
3
|
+
stop: () => void;
|
|
4
|
+
addEventListener: (eventType: string, eventHandler: () => void) => void;
|
|
5
|
+
quaternion: [number, number, number, number];
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
z: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type configOptions =
|
|
12
|
+
| {
|
|
13
|
+
referenceFrame: string;
|
|
14
|
+
frequency?: undefined;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
frequency: number;
|
|
18
|
+
referenceFrame?: undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
interface Constructable<T> {
|
|
22
|
+
new (config: configOptions): T;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
interface Window {
|
|
27
|
+
Accelerometer: Constructable<WebSensor>;
|
|
28
|
+
GravitySensor: Constructable<WebSensor>;
|
|
29
|
+
Gyroscope: Constructable<WebSensor>;
|
|
30
|
+
Magnetometer: Constructable<WebSensor>;
|
|
31
|
+
AbsoluteOrientationSensor: Constructable<WebSensor>;
|
|
32
|
+
Sensor: Constructable<WebSensor>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -32,7 +32,6 @@ export interface JSReanimated {
|
|
|
32
32
|
_frames: ((timestamp: Timestamp) => void)[];
|
|
33
33
|
timeProvider: { now: () => number };
|
|
34
34
|
pushFrame(frame: (timestamp: Timestamp) => void): void;
|
|
35
|
-
getTimestamp(): number;
|
|
36
35
|
maybeRequestRender(): void;
|
|
37
36
|
_onRender(timestampMs: number): void;
|
|
38
37
|
installCoreFunctions(valueSetter: <T>(value: T) => void): void;
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
4
4
|
const initializeGlobalsForWeb = () => {
|
|
5
5
|
if (shouldBeUseWeb()) {
|
|
6
|
-
global._frameTimestamp = null;
|
|
7
|
-
global._setGlobalConsole = (_val) => {
|
|
8
|
-
// noop
|
|
9
|
-
};
|
|
10
6
|
global._measure = () => {
|
|
11
7
|
console.warn(
|
|
12
8
|
"[Reanimated] You can't use `measure` with Chrome Debugger or with web version"
|
|
@@ -40,10 +36,10 @@ const initializeGlobalsForWeb = () => {
|
|
|
40
36
|
};
|
|
41
37
|
|
|
42
38
|
/*
|
|
43
|
-
If a file doesn't export anything, tree shaking doesn't pack
|
|
44
|
-
it into the JS bundle. In effect, the code inside of this file
|
|
45
|
-
will never execute. That is why we wrapped initialization code
|
|
46
|
-
into a function, and we call this one during creating
|
|
39
|
+
If a file doesn't export anything, tree shaking doesn't pack
|
|
40
|
+
it into the JS bundle. In effect, the code inside of this file
|
|
41
|
+
will never execute. That is why we wrapped initialization code
|
|
42
|
+
into a function, and we call this one during creating
|
|
47
43
|
the module export object.
|
|
48
44
|
*/
|
|
49
45
|
|
|
@@ -21,6 +21,8 @@ export interface EntryAnimationsValues {
|
|
|
21
21
|
targetHeight: number;
|
|
22
22
|
targetGlobalOriginX: number;
|
|
23
23
|
targetGlobalOriginY: number;
|
|
24
|
+
windowWidth: number;
|
|
25
|
+
windowHeight: number;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export interface ExitAnimationsValues {
|
|
@@ -30,6 +32,8 @@ export interface ExitAnimationsValues {
|
|
|
30
32
|
currentHeight: number;
|
|
31
33
|
currentGlobalOriginX: number;
|
|
32
34
|
currentGlobalOriginY: number;
|
|
35
|
+
windowWidth: number;
|
|
36
|
+
windowHeight: number;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export type EntryExitAnimationFunction = (
|
|
@@ -39,6 +43,7 @@ export type EntryExitAnimationFunction = (
|
|
|
39
43
|
export type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;
|
|
40
44
|
|
|
41
45
|
export interface LayoutAnimationsValues {
|
|
46
|
+
[key: string]: number;
|
|
42
47
|
currentOriginX: number;
|
|
43
48
|
currentOriginY: number;
|
|
44
49
|
currentWidth: number;
|
|
@@ -55,13 +60,20 @@ export interface LayoutAnimationsValues {
|
|
|
55
60
|
windowHeight: number;
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
export enum LayoutAnimationType {
|
|
64
|
+
ENTERING = 1,
|
|
65
|
+
EXITING = 2,
|
|
66
|
+
LAYOUT = 3,
|
|
67
|
+
SHARED_ELEMENT_TRANSITION = 4,
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
export type LayoutAnimationFunction = (
|
|
59
71
|
targetValues: LayoutAnimationsValues
|
|
60
72
|
) => LayoutAnimation;
|
|
61
73
|
|
|
62
74
|
export type LayoutAnimationStartFunction = (
|
|
63
75
|
tag: number,
|
|
64
|
-
type:
|
|
76
|
+
type: LayoutAnimationType,
|
|
65
77
|
yogaValues: LayoutAnimationsValues,
|
|
66
78
|
config: LayoutAnimationFunction
|
|
67
79
|
) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BaseAnimationBuilder } from './BaseAnimationBuilder';
|
|
2
2
|
export { ComplexAnimationBuilder } from './ComplexAnimationBuilder';
|
|
3
3
|
export { Keyframe } from './Keyframe';
|
|
4
|
+
export { LayoutAnimationType } from './commonTypes';
|
|
4
5
|
export type {
|
|
5
6
|
LayoutAnimation,
|
|
6
7
|
AnimationFunction,
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { runOnUI } from '../core';
|
|
2
1
|
import { withStyleAnimation } from '../animation/styleAnimation';
|
|
3
|
-
import { LogBox } from 'react-native';
|
|
4
2
|
import { SharedValue } from '../commonTypes';
|
|
5
3
|
import { makeUIMutable } from '../mutables';
|
|
6
4
|
import {
|
|
7
5
|
LayoutAnimationFunction,
|
|
6
|
+
LayoutAnimationType,
|
|
8
7
|
LayoutAnimationsValues,
|
|
9
8
|
} from './animationBuilder';
|
|
10
|
-
|
|
11
|
-
LogBox.ignoreLogs(['Overriding previous layout animation with']);
|
|
9
|
+
import { runOnUIImmediately } from '../threads';
|
|
12
10
|
|
|
13
11
|
const TAG_OFFSET = 1e9;
|
|
14
12
|
|
|
15
13
|
function startObservingProgress(
|
|
16
14
|
tag: number,
|
|
17
|
-
sharedValue: SharedValue<number
|
|
15
|
+
sharedValue: SharedValue<number>,
|
|
16
|
+
animationType: LayoutAnimationType
|
|
18
17
|
): void {
|
|
19
18
|
'worklet';
|
|
19
|
+
const isSharedTransition =
|
|
20
|
+
animationType === LayoutAnimationType.SHARED_ELEMENT_TRANSITION;
|
|
20
21
|
sharedValue.addListener(tag + TAG_OFFSET, () => {
|
|
21
|
-
_notifyAboutProgress(tag, sharedValue.value);
|
|
22
|
+
_notifyAboutProgress(tag, sharedValue.value, isSharedTransition);
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -41,16 +42,16 @@ function createLayoutAnimationManager() {
|
|
|
41
42
|
return {
|
|
42
43
|
start(
|
|
43
44
|
tag: number,
|
|
44
|
-
type:
|
|
45
|
+
type: LayoutAnimationType,
|
|
45
46
|
yogaValues: LayoutAnimationsValues,
|
|
46
47
|
config: LayoutAnimationFunction
|
|
47
48
|
) {
|
|
48
49
|
const style = config(yogaValues);
|
|
49
50
|
let currentAnimation = style.animations;
|
|
50
51
|
|
|
51
|
-
if (type ===
|
|
52
|
+
if (type === LayoutAnimationType.ENTERING) {
|
|
52
53
|
enteringAnimationForTag.set(tag, currentAnimation);
|
|
53
|
-
} else if (type ===
|
|
54
|
+
} else if (type === LayoutAnimationType.LAYOUT) {
|
|
54
55
|
// When layout animation is requested, but entering is still running, we merge
|
|
55
56
|
// new layout animation targets into the ongoing animation
|
|
56
57
|
const enteringAnimation = enteringAnimationForTag.get(tag);
|
|
@@ -75,20 +76,24 @@ function createLayoutAnimationManager() {
|
|
|
75
76
|
if (finished) {
|
|
76
77
|
enteringAnimationForTag.delete(tag);
|
|
77
78
|
mutableValuesForTag.delete(tag);
|
|
78
|
-
const shouldRemoveView = type ===
|
|
79
|
+
const shouldRemoveView = type === LayoutAnimationType.EXITING;
|
|
79
80
|
stopObservingProgress(tag, value, finished, shouldRemoveView);
|
|
80
81
|
}
|
|
81
82
|
style.callback &&
|
|
82
83
|
style.callback(finished === undefined ? false : finished);
|
|
83
84
|
};
|
|
84
85
|
|
|
85
|
-
startObservingProgress(tag, value);
|
|
86
|
+
startObservingProgress(tag, value, type);
|
|
86
87
|
value.value = animation;
|
|
87
88
|
},
|
|
89
|
+
stop(tag: number) {
|
|
90
|
+
const value = mutableValuesForTag.get(tag);
|
|
91
|
+
stopObservingProgress(tag, value, true, true);
|
|
92
|
+
},
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
runOnUIImmediately(() => {
|
|
92
97
|
'worklet';
|
|
93
98
|
global.LayoutAnimationsManager = createLayoutAnimationManager();
|
|
94
99
|
})();
|
|
@@ -3,11 +3,8 @@ import {
|
|
|
3
3
|
IEntryExitAnimationBuilder,
|
|
4
4
|
} from '../animationBuilder/commonTypes';
|
|
5
5
|
import { withSequence, withTiming } from '../../animation';
|
|
6
|
-
import { Dimensions } from 'react-native';
|
|
7
6
|
import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';
|
|
8
7
|
|
|
9
|
-
const { width, height } = Dimensions.get('window');
|
|
10
|
-
|
|
11
8
|
export class BounceIn
|
|
12
9
|
extends ComplexAnimationBuilder
|
|
13
10
|
implements IEntryExitAnimationBuilder
|
|
@@ -82,7 +79,7 @@ export class BounceInDown
|
|
|
82
79
|
const callback = this.callbackV;
|
|
83
80
|
const initialValues = this.initialValues;
|
|
84
81
|
|
|
85
|
-
return () => {
|
|
82
|
+
return (values) => {
|
|
86
83
|
'worklet';
|
|
87
84
|
return {
|
|
88
85
|
animations: {
|
|
@@ -103,7 +100,7 @@ export class BounceInDown
|
|
|
103
100
|
initialValues: {
|
|
104
101
|
transform: [
|
|
105
102
|
{
|
|
106
|
-
translateY:
|
|
103
|
+
translateY: values.windowHeight,
|
|
107
104
|
},
|
|
108
105
|
],
|
|
109
106
|
...initialValues,
|
|
@@ -137,7 +134,7 @@ export class BounceInUp
|
|
|
137
134
|
const callback = this.callbackV;
|
|
138
135
|
const initialValues = this.initialValues;
|
|
139
136
|
|
|
140
|
-
return () => {
|
|
137
|
+
return (values) => {
|
|
141
138
|
'worklet';
|
|
142
139
|
return {
|
|
143
140
|
animations: {
|
|
@@ -156,7 +153,7 @@ export class BounceInUp
|
|
|
156
153
|
],
|
|
157
154
|
},
|
|
158
155
|
initialValues: {
|
|
159
|
-
transform: [{ translateY: -
|
|
156
|
+
transform: [{ translateY: -values.windowHeight }],
|
|
160
157
|
...initialValues,
|
|
161
158
|
},
|
|
162
159
|
callback: callback,
|
|
@@ -188,7 +185,7 @@ export class BounceInLeft
|
|
|
188
185
|
const callback = this.callbackV;
|
|
189
186
|
const initialValues = this.initialValues;
|
|
190
187
|
|
|
191
|
-
return () => {
|
|
188
|
+
return (values) => {
|
|
192
189
|
'worklet';
|
|
193
190
|
return {
|
|
194
191
|
animations: {
|
|
@@ -207,7 +204,7 @@ export class BounceInLeft
|
|
|
207
204
|
],
|
|
208
205
|
},
|
|
209
206
|
initialValues: {
|
|
210
|
-
transform: [{ translateX: -
|
|
207
|
+
transform: [{ translateX: -values.windowWidth }],
|
|
211
208
|
...initialValues,
|
|
212
209
|
},
|
|
213
210
|
callback: callback,
|
|
@@ -239,7 +236,7 @@ export class BounceInRight
|
|
|
239
236
|
const callback = this.callbackV;
|
|
240
237
|
const initialValues = this.initialValues;
|
|
241
238
|
|
|
242
|
-
return () => {
|
|
239
|
+
return (values) => {
|
|
243
240
|
'worklet';
|
|
244
241
|
return {
|
|
245
242
|
animations: {
|
|
@@ -258,7 +255,7 @@ export class BounceInRight
|
|
|
258
255
|
],
|
|
259
256
|
},
|
|
260
257
|
initialValues: {
|
|
261
|
-
transform: [{ translateX:
|
|
258
|
+
transform: [{ translateX: values.windowWidth }],
|
|
262
259
|
...initialValues,
|
|
263
260
|
},
|
|
264
261
|
callback: callback,
|
|
@@ -341,7 +338,7 @@ export class BounceOutDown
|
|
|
341
338
|
const callback = this.callbackV;
|
|
342
339
|
const initialValues = this.initialValues;
|
|
343
340
|
|
|
344
|
-
return () => {
|
|
341
|
+
return (values) => {
|
|
345
342
|
'worklet';
|
|
346
343
|
return {
|
|
347
344
|
animations: {
|
|
@@ -353,7 +350,7 @@ export class BounceOutDown
|
|
|
353
350
|
withTiming(-10, { duration: duration * 0.15 }),
|
|
354
351
|
withTiming(10, { duration: duration * 0.15 }),
|
|
355
352
|
withTiming(-20, { duration: duration * 0.15 }),
|
|
356
|
-
withTiming(
|
|
353
|
+
withTiming(values.windowHeight, {
|
|
357
354
|
duration: duration * 0.55,
|
|
358
355
|
})
|
|
359
356
|
)
|
|
@@ -394,7 +391,7 @@ export class BounceOutUp
|
|
|
394
391
|
const callback = this.callbackV;
|
|
395
392
|
const initialValues = this.initialValues;
|
|
396
393
|
|
|
397
|
-
return () => {
|
|
394
|
+
return (values) => {
|
|
398
395
|
'worklet';
|
|
399
396
|
return {
|
|
400
397
|
animations: {
|
|
@@ -406,7 +403,7 @@ export class BounceOutUp
|
|
|
406
403
|
withTiming(10, { duration: duration * 0.15 }),
|
|
407
404
|
withTiming(-10, { duration: duration * 0.15 }),
|
|
408
405
|
withTiming(20, { duration: duration * 0.15 }),
|
|
409
|
-
withTiming(-
|
|
406
|
+
withTiming(-values.windowHeight, {
|
|
410
407
|
duration: duration * 0.55,
|
|
411
408
|
})
|
|
412
409
|
)
|
|
@@ -447,7 +444,7 @@ export class BounceOutLeft
|
|
|
447
444
|
const callback = this.callbackV;
|
|
448
445
|
const initialValues = this.initialValues;
|
|
449
446
|
|
|
450
|
-
return () => {
|
|
447
|
+
return (values) => {
|
|
451
448
|
'worklet';
|
|
452
449
|
return {
|
|
453
450
|
animations: {
|
|
@@ -459,7 +456,7 @@ export class BounceOutLeft
|
|
|
459
456
|
withTiming(10, { duration: duration * 0.15 }),
|
|
460
457
|
withTiming(-10, { duration: duration * 0.15 }),
|
|
461
458
|
withTiming(20, { duration: duration * 0.15 }),
|
|
462
|
-
withTiming(-
|
|
459
|
+
withTiming(-values.windowWidth, {
|
|
463
460
|
duration: duration * 0.55,
|
|
464
461
|
})
|
|
465
462
|
)
|
|
@@ -500,7 +497,7 @@ export class BounceOutRight
|
|
|
500
497
|
const callback = this.callbackV;
|
|
501
498
|
const initialValues = this.initialValues;
|
|
502
499
|
|
|
503
|
-
return () => {
|
|
500
|
+
return (values) => {
|
|
504
501
|
'worklet';
|
|
505
502
|
return {
|
|
506
503
|
animations: {
|
|
@@ -512,7 +509,7 @@ export class BounceOutRight
|
|
|
512
509
|
withTiming(-10, { duration: duration * 0.15 }),
|
|
513
510
|
withTiming(10, { duration: duration * 0.15 }),
|
|
514
511
|
withTiming(-20, { duration: duration * 0.15 }),
|
|
515
|
-
withTiming(
|
|
512
|
+
withTiming(values.windowWidth, {
|
|
516
513
|
duration: duration * 0.55,
|
|
517
514
|
})
|
|
518
515
|
)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
2
1
|
import { withSequence, withTiming } from '../../animation';
|
|
3
2
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
4
3
|
import {
|
|
@@ -6,8 +5,6 @@ import {
|
|
|
6
5
|
IEntryExitAnimationBuilder,
|
|
7
6
|
} from '../animationBuilder/commonTypes';
|
|
8
7
|
|
|
9
|
-
const { width } = Dimensions.get('window');
|
|
10
|
-
|
|
11
8
|
export class LightSpeedInRight
|
|
12
9
|
extends ComplexAnimationBuilder
|
|
13
10
|
implements IEntryExitAnimationBuilder
|
|
@@ -24,7 +21,7 @@ export class LightSpeedInRight
|
|
|
24
21
|
const callback = this.callbackV;
|
|
25
22
|
const initialValues = this.initialValues;
|
|
26
23
|
|
|
27
|
-
return () => {
|
|
24
|
+
return (values) => {
|
|
28
25
|
'worklet';
|
|
29
26
|
return {
|
|
30
27
|
animations: {
|
|
@@ -50,7 +47,7 @@ export class LightSpeedInRight
|
|
|
50
47
|
},
|
|
51
48
|
initialValues: {
|
|
52
49
|
opacity: 0,
|
|
53
|
-
transform: [{ translateX:
|
|
50
|
+
transform: [{ translateX: values.windowWidth }, { skewX: '-45deg' }],
|
|
54
51
|
...initialValues,
|
|
55
52
|
},
|
|
56
53
|
callback: callback,
|
|
@@ -75,7 +72,7 @@ export class LightSpeedInLeft
|
|
|
75
72
|
const callback = this.callbackV;
|
|
76
73
|
const initialValues = this.initialValues;
|
|
77
74
|
|
|
78
|
-
return () => {
|
|
75
|
+
return (values) => {
|
|
79
76
|
'worklet';
|
|
80
77
|
return {
|
|
81
78
|
animations: {
|
|
@@ -101,7 +98,7 @@ export class LightSpeedInLeft
|
|
|
101
98
|
},
|
|
102
99
|
initialValues: {
|
|
103
100
|
opacity: 0,
|
|
104
|
-
transform: [{ translateX: -
|
|
101
|
+
transform: [{ translateX: -values.windowWidth }, { skewX: '45deg' }],
|
|
105
102
|
...initialValues,
|
|
106
103
|
},
|
|
107
104
|
callback: callback,
|
|
@@ -125,14 +122,17 @@ export class LightSpeedOutRight
|
|
|
125
122
|
const callback = this.callbackV;
|
|
126
123
|
const initialValues = this.initialValues;
|
|
127
124
|
|
|
128
|
-
return () => {
|
|
125
|
+
return (values) => {
|
|
129
126
|
'worklet';
|
|
130
127
|
return {
|
|
131
128
|
animations: {
|
|
132
129
|
opacity: delayFunction(delay, animation(0, config)),
|
|
133
130
|
transform: [
|
|
134
131
|
{
|
|
135
|
-
translateX: delayFunction(
|
|
132
|
+
translateX: delayFunction(
|
|
133
|
+
delay,
|
|
134
|
+
animation(values.windowWidth, config)
|
|
135
|
+
),
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
skewX: delayFunction(delay, animation('-45deg', config)),
|
|
@@ -165,14 +165,17 @@ export class LightSpeedOutLeft
|
|
|
165
165
|
const callback = this.callbackV;
|
|
166
166
|
const initialValues = this.initialValues;
|
|
167
167
|
|
|
168
|
-
return () => {
|
|
168
|
+
return (values) => {
|
|
169
169
|
'worklet';
|
|
170
170
|
return {
|
|
171
171
|
animations: {
|
|
172
172
|
opacity: delayFunction(delay, animation(0, config)),
|
|
173
173
|
transform: [
|
|
174
174
|
{
|
|
175
|
-
translateX: delayFunction(
|
|
175
|
+
translateX: delayFunction(
|
|
176
|
+
delay,
|
|
177
|
+
animation(-values.windowWidth, config)
|
|
178
|
+
),
|
|
176
179
|
},
|
|
177
180
|
{
|
|
178
181
|
skewX: delayFunction(delay, animation('45deg', config)),
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
2
1
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
3
2
|
import {
|
|
4
3
|
EntryExitAnimationFunction,
|
|
5
4
|
IEntryExitAnimationBuilder,
|
|
6
5
|
} from '../animationBuilder/commonTypes';
|
|
7
6
|
|
|
8
|
-
const { width } = Dimensions.get('window');
|
|
9
|
-
|
|
10
7
|
export class RollInLeft
|
|
11
8
|
extends ComplexAnimationBuilder
|
|
12
9
|
implements IEntryExitAnimationBuilder
|
|
@@ -22,7 +19,7 @@ export class RollInLeft
|
|
|
22
19
|
const callback = this.callbackV;
|
|
23
20
|
const initialValues = this.initialValues;
|
|
24
21
|
|
|
25
|
-
return () => {
|
|
22
|
+
return (values) => {
|
|
26
23
|
'worklet';
|
|
27
24
|
return {
|
|
28
25
|
animations: {
|
|
@@ -32,7 +29,10 @@ export class RollInLeft
|
|
|
32
29
|
],
|
|
33
30
|
},
|
|
34
31
|
initialValues: {
|
|
35
|
-
transform: [
|
|
32
|
+
transform: [
|
|
33
|
+
{ translateX: -values.windowWidth },
|
|
34
|
+
{ rotate: '-180deg' },
|
|
35
|
+
],
|
|
36
36
|
...initialValues,
|
|
37
37
|
},
|
|
38
38
|
callback: callback,
|
|
@@ -56,7 +56,7 @@ export class RollInRight
|
|
|
56
56
|
const callback = this.callbackV;
|
|
57
57
|
const initialValues = this.initialValues;
|
|
58
58
|
|
|
59
|
-
return () => {
|
|
59
|
+
return (values) => {
|
|
60
60
|
'worklet';
|
|
61
61
|
return {
|
|
62
62
|
animations: {
|
|
@@ -66,7 +66,7 @@ export class RollInRight
|
|
|
66
66
|
],
|
|
67
67
|
},
|
|
68
68
|
initialValues: {
|
|
69
|
-
transform: [{ translateX:
|
|
69
|
+
transform: [{ translateX: values.windowWidth }, { rotate: '180deg' }],
|
|
70
70
|
...initialValues,
|
|
71
71
|
},
|
|
72
72
|
callback: callback,
|
|
@@ -90,12 +90,17 @@ export class RollOutLeft
|
|
|
90
90
|
const callback = this.callbackV;
|
|
91
91
|
const initialValues = this.initialValues;
|
|
92
92
|
|
|
93
|
-
return () => {
|
|
93
|
+
return (values) => {
|
|
94
94
|
'worklet';
|
|
95
95
|
return {
|
|
96
96
|
animations: {
|
|
97
97
|
transform: [
|
|
98
|
-
{
|
|
98
|
+
{
|
|
99
|
+
translateX: delayFunction(
|
|
100
|
+
delay,
|
|
101
|
+
animation(-values.windowWidth, config)
|
|
102
|
+
),
|
|
103
|
+
},
|
|
99
104
|
{ rotate: delayFunction(delay, animation('-180deg', config)) },
|
|
100
105
|
],
|
|
101
106
|
},
|
|
@@ -124,12 +129,17 @@ export class RollOutRight
|
|
|
124
129
|
const callback = this.callbackV;
|
|
125
130
|
const initialValues = this.initialValues;
|
|
126
131
|
|
|
127
|
-
return () => {
|
|
132
|
+
return (values) => {
|
|
128
133
|
'worklet';
|
|
129
134
|
return {
|
|
130
135
|
animations: {
|
|
131
136
|
transform: [
|
|
132
|
-
{
|
|
137
|
+
{
|
|
138
|
+
translateX: delayFunction(
|
|
139
|
+
delay,
|
|
140
|
+
animation(values.windowWidth, config)
|
|
141
|
+
),
|
|
142
|
+
},
|
|
133
143
|
{ rotate: delayFunction(delay, animation('180deg', config)) },
|
|
134
144
|
],
|
|
135
145
|
},
|