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
|
@@ -5,11 +5,8 @@ import {
|
|
|
5
5
|
IEntryAnimationBuilder,
|
|
6
6
|
IExitAnimationBuilder,
|
|
7
7
|
} from '../animationBuilder/commonTypes';
|
|
8
|
-
import { Dimensions } from 'react-native';
|
|
9
8
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
10
9
|
|
|
11
|
-
const { width, height } = Dimensions.get('window');
|
|
12
|
-
|
|
13
10
|
export class SlideInRight
|
|
14
11
|
extends ComplexAnimationBuilder
|
|
15
12
|
implements IEntryAnimationBuilder
|
|
@@ -35,7 +32,7 @@ export class SlideInRight
|
|
|
35
32
|
),
|
|
36
33
|
},
|
|
37
34
|
initialValues: {
|
|
38
|
-
originX: values.targetOriginX +
|
|
35
|
+
originX: values.targetOriginX + values.windowWidth,
|
|
39
36
|
...initialValues,
|
|
40
37
|
},
|
|
41
38
|
callback: callback,
|
|
@@ -69,7 +66,7 @@ export class SlideInLeft
|
|
|
69
66
|
),
|
|
70
67
|
},
|
|
71
68
|
initialValues: {
|
|
72
|
-
originX: values.targetOriginX -
|
|
69
|
+
originX: values.targetOriginX - values.windowWidth,
|
|
73
70
|
...initialValues,
|
|
74
71
|
},
|
|
75
72
|
callback: callback,
|
|
@@ -99,7 +96,13 @@ export class SlideOutRight
|
|
|
99
96
|
animations: {
|
|
100
97
|
originX: delayFunction(
|
|
101
98
|
delay,
|
|
102
|
-
animation(
|
|
99
|
+
animation(
|
|
100
|
+
Math.max(
|
|
101
|
+
values.currentOriginX + values.windowWidth,
|
|
102
|
+
values.windowWidth
|
|
103
|
+
),
|
|
104
|
+
config
|
|
105
|
+
)
|
|
103
106
|
),
|
|
104
107
|
},
|
|
105
108
|
initialValues: {
|
|
@@ -133,7 +136,13 @@ export class SlideOutLeft
|
|
|
133
136
|
animations: {
|
|
134
137
|
originX: delayFunction(
|
|
135
138
|
delay,
|
|
136
|
-
animation(
|
|
139
|
+
animation(
|
|
140
|
+
Math.min(
|
|
141
|
+
values.currentOriginX - values.windowWidth,
|
|
142
|
+
-values.windowWidth
|
|
143
|
+
),
|
|
144
|
+
config
|
|
145
|
+
)
|
|
137
146
|
),
|
|
138
147
|
},
|
|
139
148
|
initialValues: {
|
|
@@ -171,7 +180,7 @@ export class SlideInUp
|
|
|
171
180
|
),
|
|
172
181
|
},
|
|
173
182
|
initialValues: {
|
|
174
|
-
originY: -
|
|
183
|
+
originY: -values.windowHeight,
|
|
175
184
|
...initialValues,
|
|
176
185
|
},
|
|
177
186
|
callback: callback,
|
|
@@ -205,7 +214,7 @@ export class SlideInDown
|
|
|
205
214
|
),
|
|
206
215
|
},
|
|
207
216
|
initialValues: {
|
|
208
|
-
originY: values.targetOriginY +
|
|
217
|
+
originY: values.targetOriginY + values.windowHeight,
|
|
209
218
|
...initialValues,
|
|
210
219
|
},
|
|
211
220
|
callback: callback,
|
|
@@ -235,7 +244,13 @@ export class SlideOutUp
|
|
|
235
244
|
animations: {
|
|
236
245
|
originY: delayFunction(
|
|
237
246
|
delay,
|
|
238
|
-
animation(
|
|
247
|
+
animation(
|
|
248
|
+
Math.min(
|
|
249
|
+
values.currentOriginY - values.windowHeight,
|
|
250
|
+
-values.windowHeight
|
|
251
|
+
),
|
|
252
|
+
config
|
|
253
|
+
)
|
|
239
254
|
),
|
|
240
255
|
},
|
|
241
256
|
initialValues: { originY: values.currentOriginY, ...initialValues },
|
|
@@ -266,7 +281,13 @@ export class SlideOutDown
|
|
|
266
281
|
animations: {
|
|
267
282
|
originY: delayFunction(
|
|
268
283
|
delay,
|
|
269
|
-
animation(
|
|
284
|
+
animation(
|
|
285
|
+
Math.max(
|
|
286
|
+
values.currentOriginY + values.windowHeight,
|
|
287
|
+
values.windowHeight
|
|
288
|
+
),
|
|
289
|
+
config
|
|
290
|
+
)
|
|
270
291
|
),
|
|
271
292
|
},
|
|
272
293
|
initialValues: { originY: values.currentOriginY, ...initialValues },
|
|
@@ -7,11 +7,8 @@ import {
|
|
|
7
7
|
IEntryAnimationBuilder,
|
|
8
8
|
IExitAnimationBuilder,
|
|
9
9
|
} from '../animationBuilder/commonTypes';
|
|
10
|
-
import { Dimensions } from 'react-native';
|
|
11
10
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
12
11
|
|
|
13
|
-
const { width, height } = Dimensions.get('window');
|
|
14
|
-
|
|
15
12
|
export class ZoomIn
|
|
16
13
|
extends ComplexAnimationBuilder
|
|
17
14
|
implements IEntryExitAnimationBuilder
|
|
@@ -93,7 +90,7 @@ export class ZoomInLeft
|
|
|
93
90
|
const callback = this.callbackV;
|
|
94
91
|
const initialValues = this.initialValues;
|
|
95
92
|
|
|
96
|
-
return () => {
|
|
93
|
+
return (values) => {
|
|
97
94
|
'worklet';
|
|
98
95
|
return {
|
|
99
96
|
animations: {
|
|
@@ -103,7 +100,7 @@ export class ZoomInLeft
|
|
|
103
100
|
],
|
|
104
101
|
},
|
|
105
102
|
initialValues: {
|
|
106
|
-
transform: [{ translateX: -
|
|
103
|
+
transform: [{ translateX: -values.windowWidth }, { scale: 0 }],
|
|
107
104
|
...initialValues,
|
|
108
105
|
},
|
|
109
106
|
callback: callback,
|
|
@@ -127,7 +124,7 @@ export class ZoomInRight
|
|
|
127
124
|
const callback = this.callbackV;
|
|
128
125
|
const initialValues = this.initialValues;
|
|
129
126
|
|
|
130
|
-
return () => {
|
|
127
|
+
return (values) => {
|
|
131
128
|
'worklet';
|
|
132
129
|
return {
|
|
133
130
|
animations: {
|
|
@@ -137,7 +134,7 @@ export class ZoomInRight
|
|
|
137
134
|
],
|
|
138
135
|
},
|
|
139
136
|
initialValues: {
|
|
140
|
-
transform: [{ translateX:
|
|
137
|
+
transform: [{ translateX: values.windowWidth }, { scale: 0 }],
|
|
141
138
|
...initialValues,
|
|
142
139
|
},
|
|
143
140
|
callback: callback,
|
|
@@ -161,7 +158,7 @@ export class ZoomInUp
|
|
|
161
158
|
const callback = this.callbackV;
|
|
162
159
|
const initialValues = this.initialValues;
|
|
163
160
|
|
|
164
|
-
return () => {
|
|
161
|
+
return (values) => {
|
|
165
162
|
'worklet';
|
|
166
163
|
return {
|
|
167
164
|
animations: {
|
|
@@ -171,7 +168,7 @@ export class ZoomInUp
|
|
|
171
168
|
],
|
|
172
169
|
},
|
|
173
170
|
initialValues: {
|
|
174
|
-
transform: [{ translateY: -
|
|
171
|
+
transform: [{ translateY: -values.windowHeight }, { scale: 0 }],
|
|
175
172
|
...initialValues,
|
|
176
173
|
},
|
|
177
174
|
callback: callback,
|
|
@@ -195,7 +192,7 @@ export class ZoomInDown
|
|
|
195
192
|
const callback = this.callbackV;
|
|
196
193
|
const initialValues = this.initialValues;
|
|
197
194
|
|
|
198
|
-
return () => {
|
|
195
|
+
return (values) => {
|
|
199
196
|
'worklet';
|
|
200
197
|
return {
|
|
201
198
|
animations: {
|
|
@@ -205,7 +202,7 @@ export class ZoomInDown
|
|
|
205
202
|
],
|
|
206
203
|
},
|
|
207
204
|
initialValues: {
|
|
208
|
-
transform: [{ translateY:
|
|
205
|
+
transform: [{ translateY: values.windowHeight }, { scale: 0 }],
|
|
209
206
|
...initialValues,
|
|
210
207
|
},
|
|
211
208
|
callback: callback,
|
|
@@ -363,12 +360,17 @@ export class ZoomOutLeft
|
|
|
363
360
|
const callback = this.callbackV;
|
|
364
361
|
const initialValues = this.initialValues;
|
|
365
362
|
|
|
366
|
-
return () => {
|
|
363
|
+
return (values) => {
|
|
367
364
|
'worklet';
|
|
368
365
|
return {
|
|
369
366
|
animations: {
|
|
370
367
|
transform: [
|
|
371
|
-
{
|
|
368
|
+
{
|
|
369
|
+
translateX: delayFunction(
|
|
370
|
+
delay,
|
|
371
|
+
animation(-values.windowWidth, config)
|
|
372
|
+
),
|
|
373
|
+
},
|
|
372
374
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
373
375
|
],
|
|
374
376
|
},
|
|
@@ -397,12 +399,17 @@ export class ZoomOutRight
|
|
|
397
399
|
const callback = this.callbackV;
|
|
398
400
|
const initialValues = this.initialValues;
|
|
399
401
|
|
|
400
|
-
return () => {
|
|
402
|
+
return (values) => {
|
|
401
403
|
'worklet';
|
|
402
404
|
return {
|
|
403
405
|
animations: {
|
|
404
406
|
transform: [
|
|
405
|
-
{
|
|
407
|
+
{
|
|
408
|
+
translateX: delayFunction(
|
|
409
|
+
delay,
|
|
410
|
+
animation(values.windowWidth, config)
|
|
411
|
+
),
|
|
412
|
+
},
|
|
406
413
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
407
414
|
],
|
|
408
415
|
},
|
|
@@ -431,12 +438,17 @@ export class ZoomOutUp
|
|
|
431
438
|
const callback = this.callbackV;
|
|
432
439
|
const initialValues = this.initialValues;
|
|
433
440
|
|
|
434
|
-
return () => {
|
|
441
|
+
return (values) => {
|
|
435
442
|
'worklet';
|
|
436
443
|
return {
|
|
437
444
|
animations: {
|
|
438
445
|
transform: [
|
|
439
|
-
{
|
|
446
|
+
{
|
|
447
|
+
translateY: delayFunction(
|
|
448
|
+
delay,
|
|
449
|
+
animation(-values.windowHeight, config)
|
|
450
|
+
),
|
|
451
|
+
},
|
|
440
452
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
441
453
|
],
|
|
442
454
|
},
|
|
@@ -465,12 +477,17 @@ export class ZoomOutDown
|
|
|
465
477
|
const callback = this.callbackV;
|
|
466
478
|
const initialValues = this.initialValues;
|
|
467
479
|
|
|
468
|
-
return () => {
|
|
480
|
+
return (values) => {
|
|
469
481
|
'worklet';
|
|
470
482
|
return {
|
|
471
483
|
animations: {
|
|
472
484
|
transform: [
|
|
473
|
-
{
|
|
485
|
+
{
|
|
486
|
+
translateY: delayFunction(
|
|
487
|
+
delay,
|
|
488
|
+
animation(values.windowHeight, config)
|
|
489
|
+
),
|
|
490
|
+
},
|
|
474
491
|
{ scale: delayFunction(delay, animation(0, config)) },
|
|
475
492
|
],
|
|
476
493
|
},
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { withTiming } from '../../animation';
|
|
2
|
+
import {
|
|
3
|
+
ILayoutAnimationBuilder,
|
|
4
|
+
LayoutAnimationFunction,
|
|
5
|
+
LayoutAnimationsValues,
|
|
6
|
+
} from '../animationBuilder/commonTypes';
|
|
7
|
+
import { StyleProps } from '../../commonTypes';
|
|
8
|
+
|
|
9
|
+
const supportedProps = ['width', 'height', 'originX', 'originY', 'transform'];
|
|
10
|
+
|
|
11
|
+
type AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;
|
|
12
|
+
|
|
13
|
+
export class SharedTransition implements ILayoutAnimationBuilder {
|
|
14
|
+
animationFactory: AnimationFactoryType | null = null;
|
|
15
|
+
defaultDuration = 500;
|
|
16
|
+
|
|
17
|
+
static createInstance(): SharedTransition {
|
|
18
|
+
return new SharedTransition();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static custom(animationFactory: AnimationFactoryType): SharedTransition {
|
|
22
|
+
return this.createInstance().custom(animationFactory);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
custom(animationFactory: AnimationFactoryType): SharedTransition {
|
|
26
|
+
this.animationFactory = animationFactory;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static build(): LayoutAnimationFunction {
|
|
31
|
+
return this.createInstance().build();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
build(): LayoutAnimationFunction {
|
|
35
|
+
const animationFactory = this.animationFactory;
|
|
36
|
+
const animationDuration = this.defaultDuration;
|
|
37
|
+
return (values: LayoutAnimationsValues) => {
|
|
38
|
+
'worklet';
|
|
39
|
+
let animations: {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
} = {};
|
|
42
|
+
const initialValues: {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
} = {};
|
|
45
|
+
|
|
46
|
+
if (animationFactory) {
|
|
47
|
+
animations = animationFactory(values);
|
|
48
|
+
for (const key in animations) {
|
|
49
|
+
if (!supportedProps.includes(key)) {
|
|
50
|
+
throw Error(`The prop '${key}' is not supported yet.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
for (const propName of supportedProps) {
|
|
55
|
+
if (propName === 'transform') {
|
|
56
|
+
const matrix = values.targetTransformMatrix;
|
|
57
|
+
animations.transformMatrix = withTiming(matrix, {
|
|
58
|
+
// native screen transition takes around 500ms
|
|
59
|
+
duration: animationDuration,
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
const keyToTargetValue =
|
|
63
|
+
'target' + propName.charAt(0).toUpperCase() + propName.slice(1);
|
|
64
|
+
animations[propName] = withTiming(values[keyToTargetValue], {
|
|
65
|
+
// native screen transition takes around 500ms
|
|
66
|
+
duration: animationDuration,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
for (const propName in animations) {
|
|
73
|
+
if (propName === 'transform') {
|
|
74
|
+
initialValues.transformMatrix = values.currentTransformMatrix;
|
|
75
|
+
} else {
|
|
76
|
+
const keyToCurrentValue =
|
|
77
|
+
'current' + propName.charAt(0).toUpperCase() + propName.slice(1);
|
|
78
|
+
initialValues[propName] = values[keyToCurrentValue];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return { initialValues, animations };
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const DefaultSharedTransition = SharedTransition;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SharedValue } from './commonTypes';
|
|
2
|
+
import { isJest } from './PlatformChecker';
|
|
2
3
|
import { runOnUI } from './threads';
|
|
3
4
|
|
|
5
|
+
const IS_JEST = isJest();
|
|
6
|
+
|
|
4
7
|
export type Mapper = {
|
|
5
8
|
id: number;
|
|
6
9
|
dirty: boolean;
|
|
@@ -14,7 +17,7 @@ export function createMapperRegistry() {
|
|
|
14
17
|
const mappers = new Map();
|
|
15
18
|
let sortedMappers: Mapper[] = [];
|
|
16
19
|
|
|
17
|
-
let
|
|
20
|
+
let runRequested = false;
|
|
18
21
|
|
|
19
22
|
function updateMappersOrder() {
|
|
20
23
|
// sort mappers topologically
|
|
@@ -74,8 +77,8 @@ export function createMapperRegistry() {
|
|
|
74
77
|
sortedMappers = newOrder;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
function
|
|
78
|
-
|
|
80
|
+
function mapperRun() {
|
|
81
|
+
runRequested = false;
|
|
79
82
|
if (mappers.size !== sortedMappers.length) {
|
|
80
83
|
updateMappersOrder();
|
|
81
84
|
}
|
|
@@ -88,9 +91,17 @@ export function createMapperRegistry() {
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
function maybeRequestUpdates() {
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
if (IS_JEST) {
|
|
95
|
+
// On Jest environment we avoid using setImmediate as that'd require test
|
|
96
|
+
// to advance the clock manually. This on other hand would require tests
|
|
97
|
+
// to know how many times mappers need to run. As we don't want tests to
|
|
98
|
+
// make any assumptions on that number it is easier to execute mappers
|
|
99
|
+
// immediately for testing purposes and only expect test to advance timers
|
|
100
|
+
// if they want to make any assertions on the effects of animations being run.
|
|
101
|
+
mapperRun();
|
|
102
|
+
} else if (!runRequested) {
|
|
103
|
+
setImmediate(mapperRun);
|
|
104
|
+
runRequested = true;
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
|
package/src/reanimated2/mock.ts
CHANGED
|
@@ -7,6 +7,44 @@ const NOOP = () => {
|
|
|
7
7
|
const ID = (t) => t;
|
|
8
8
|
const IMMEDIATE_CB_INVOCATION = (cb: () => unknown) => cb();
|
|
9
9
|
|
|
10
|
+
class BaseAnimationMock {
|
|
11
|
+
duration(_: number) {
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
delay(_: number) {
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
springify(_: number) {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
damping(_: number) {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
stiffness(_: number) {
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
withCallback(_: (finsihed: boolean) => void) {
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
randomDelay() {
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
withInitialValues() {
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
build() {
|
|
44
|
+
return () => ({ initialValues: {}, animations: {} });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
10
48
|
const ReanimatedV2 = {
|
|
11
49
|
useSharedValue: (v) => ({ value: v }),
|
|
12
50
|
useDerivedValue: (a) => ({ value: a() }),
|
|
@@ -75,6 +113,96 @@ const ReanimatedV2 = {
|
|
|
75
113
|
runOnUI: (fn) => fn,
|
|
76
114
|
};
|
|
77
115
|
|
|
116
|
+
[
|
|
117
|
+
'FadeIn',
|
|
118
|
+
'FadeInRight',
|
|
119
|
+
'FadeInLeft',
|
|
120
|
+
'FadeInUp',
|
|
121
|
+
'FadeInDown',
|
|
122
|
+
'FadeOut',
|
|
123
|
+
'FadeOutRight',
|
|
124
|
+
'FadeOutLeft',
|
|
125
|
+
'FadeOutUp',
|
|
126
|
+
'FadeOutDown',
|
|
127
|
+
|
|
128
|
+
'FlipInYLeft',
|
|
129
|
+
'FlipInXDown',
|
|
130
|
+
'FlipInYRight',
|
|
131
|
+
'FlipInEasyX',
|
|
132
|
+
'FlipInEasyY',
|
|
133
|
+
'FlipOutXUp',
|
|
134
|
+
'FlipOutYLeft',
|
|
135
|
+
'FlipOutXDown',
|
|
136
|
+
'FlipOutYRight',
|
|
137
|
+
'FlipOutEasyX',
|
|
138
|
+
'FlipOutEasyY',
|
|
139
|
+
|
|
140
|
+
'StretchInY',
|
|
141
|
+
'StretchOutX',
|
|
142
|
+
'StretchOutY',
|
|
143
|
+
'SlideInLeft',
|
|
144
|
+
'SlideOutRight',
|
|
145
|
+
'SlideOutLeft',
|
|
146
|
+
'SlideInUp',
|
|
147
|
+
'SlideInDown',
|
|
148
|
+
'SlideOutUp',
|
|
149
|
+
|
|
150
|
+
'ZoomInRotate',
|
|
151
|
+
'ZoomInLeft',
|
|
152
|
+
'ZoomInRight',
|
|
153
|
+
'ZoomInUp',
|
|
154
|
+
'ZoomInDown',
|
|
155
|
+
'ZoomInEasyUp',
|
|
156
|
+
'ZoomInEasyDown',
|
|
157
|
+
'ZoomOut',
|
|
158
|
+
'ZoomOutRotate',
|
|
159
|
+
'ZoomOutLeft',
|
|
160
|
+
'ZoomOutRight',
|
|
161
|
+
'ZoomOutUp',
|
|
162
|
+
'ZoomOutDown',
|
|
163
|
+
'ZoomOutEasyUp',
|
|
164
|
+
'ZoomOutEasyDown',
|
|
165
|
+
|
|
166
|
+
'BounceInDown',
|
|
167
|
+
'BounceInUp',
|
|
168
|
+
'BounceInLeft',
|
|
169
|
+
'BounceInRight',
|
|
170
|
+
'BounceOut',
|
|
171
|
+
'BounceOutDown',
|
|
172
|
+
'BounceOutUp',
|
|
173
|
+
'BounceOutLeft',
|
|
174
|
+
'BounceOutRight',
|
|
175
|
+
|
|
176
|
+
'LightSpeedInLeft',
|
|
177
|
+
'LightSpeedOutRight',
|
|
178
|
+
'LightSpeedOutLeft',
|
|
179
|
+
|
|
180
|
+
'PinwheelOut',
|
|
181
|
+
|
|
182
|
+
'RotateInDownRight',
|
|
183
|
+
'RotateInUpLeft',
|
|
184
|
+
'RotateInUpRight',
|
|
185
|
+
'RotateOutDownLeft',
|
|
186
|
+
'RotateOutDownRight',
|
|
187
|
+
'RotateOutUpLeft',
|
|
188
|
+
'RotateOutUpRight',
|
|
189
|
+
|
|
190
|
+
'RollInRight',
|
|
191
|
+
'RollOutLeft',
|
|
192
|
+
'RollOutRight',
|
|
193
|
+
|
|
194
|
+
'Layout',
|
|
195
|
+
'CurvedTransition',
|
|
196
|
+
'JumpingTransition',
|
|
197
|
+
'SequencedTransition',
|
|
198
|
+
'FadingTransition',
|
|
199
|
+
'EntryExitTransition',
|
|
200
|
+
].forEach((k) =>
|
|
201
|
+
Object.assign(ReanimatedV2, {
|
|
202
|
+
[k]: new BaseAnimationMock(),
|
|
203
|
+
})
|
|
204
|
+
);
|
|
205
|
+
|
|
78
206
|
module.exports = {
|
|
79
207
|
...ReanimatedV2,
|
|
80
208
|
};
|
|
@@ -53,6 +53,7 @@ export function makeUIMutable<T>(
|
|
|
53
53
|
listeners.delete(id);
|
|
54
54
|
},
|
|
55
55
|
_animation: null,
|
|
56
|
+
_isReanimatedSharedValue: true,
|
|
56
57
|
};
|
|
57
58
|
return self;
|
|
58
59
|
}
|
|
@@ -134,6 +135,7 @@ export function makeMutable<T>(
|
|
|
134
135
|
}
|
|
135
136
|
listeners!.delete(id);
|
|
136
137
|
},
|
|
138
|
+
_isReanimatedSharedValue: true,
|
|
137
139
|
};
|
|
138
140
|
registerShareableMapping(mutable, handle);
|
|
139
141
|
return mutable;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We hardcode the version of Reanimated here in order to compare it
|
|
3
|
+
* with the version used to build the native part of the library in runtime.
|
|
4
|
+
* Remember to keep this in sync with the version declared in `package.json`
|
|
5
|
+
*/
|
|
6
|
+
const jsVersion = '3.0.0';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Checks that native and js versions of reanimated match.
|
|
10
|
+
*/
|
|
11
|
+
export function checkVersion(): void {
|
|
12
|
+
const cppVersion = global._REANIMATED_VERSION_CPP;
|
|
13
|
+
if (cppVersion === undefined) {
|
|
14
|
+
console.error(
|
|
15
|
+
`[Reanimated] Couldn't determine the version of the native part of Reanimated. Did you forget to re-build the app after upgrading react-native-reanimated? If you use Expo Go, you must use the exact version which is bundled into Expo SDK.`
|
|
16
|
+
);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const ok = (() => {
|
|
20
|
+
if (
|
|
21
|
+
jsVersion.match(/^\d+\.\d+\.\d+$/) &&
|
|
22
|
+
cppVersion.match(/^\d+\.\d+\.\d+$/)
|
|
23
|
+
) {
|
|
24
|
+
// x.y.z, compare only major and minor, skip patch
|
|
25
|
+
const [jsMajor, jsMinor] = jsVersion.split('.');
|
|
26
|
+
const [cppMajor, cppMinor] = cppVersion.split('.');
|
|
27
|
+
return jsMajor === cppMajor && jsMinor === cppMinor;
|
|
28
|
+
} else {
|
|
29
|
+
// alpha, beta or rc, compare everything
|
|
30
|
+
return jsVersion === cppVersion;
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
if (!ok) {
|
|
34
|
+
console.error(
|
|
35
|
+
`[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs. ${cppVersion}). Did you forget to re-build the app after upgrading react-native-reanimated? If you use Expo Go, you must downgrade to ${cppVersion} which is bundled into Expo SDK.`
|
|
36
|
+
);
|
|
37
|
+
// TODO: detect Expo managed workflow
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getUseOfValueInStyleWarning() {
|
|
2
|
+
return (
|
|
3
|
+
"It looks like you might be using shared value's .value inside reanimated inline style. " +
|
|
4
|
+
'If you want a component to update when shared value changes you should use the shared value' +
|
|
5
|
+
' directly instead of its current state represented by `.value`. See documentation here: ' +
|
|
6
|
+
'https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/animations#animations-in-inline-styles'
|
|
7
|
+
);
|
|
8
|
+
}
|