react-native-reanimated 3.0.0-rc.9 → 3.0.1
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 +105 -109
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +19 -12
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +15 -7
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -2
- package/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp +20 -1
- package/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.h +9 -0
- 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 +9 -63
- package/Common/cpp/SharedItems/Shareables.h +77 -72
- 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 +49 -230
- package/Common/cpp/Tools/RuntimeDecorator.h +0 -2
- package/Common/cpp/Tools/WorkletEventHandler.cpp +3 -2
- package/Common/cpp/Tools/WorkletEventHandler.h +14 -6
- package/README.md +1 -1
- 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 +28 -4
- package/ios/LayoutReanimation/REAAnimationsManager.m +216 -61
- 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 +64 -17
- 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 +244 -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 +16 -33
- 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/core.js +33 -14
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- 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 +91 -15
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +43 -40
- 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 +71 -32
- package/lib/commonjs/reanimated2/initializers.js.map +1 -1
- 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 +103 -13
- 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 +0 -2
- 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 +22 -9
- 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 +20 -1
- 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 +36 -15
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +114 -7
- 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 +241 -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 +16 -32
- 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/core.js +32 -7
- package/lib/module/reanimated2/core.js.map +1 -1
- 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 +90 -13
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +46 -43
- 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 +72 -33
- package/lib/module/reanimated2/initializers.js.map +1 -1
- 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 +103 -13
- 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 +0 -2
- 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 +20 -8
- 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 +20 -1
- 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 +36 -12
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +105 -7
- 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/mock.js +1 -211
- package/package.json +10 -10
- package/{plugin.js → plugin/index.js} +128 -249
- package/react-native-reanimated.d.ts +55 -417
- package/scripts/reanimated_utils.rb +15 -2
- package/src/createAnimatedComponent.tsx +247 -28
- package/src/reanimated2/Colors.ts +38 -11
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +52 -39
- 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/core.ts +42 -9
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +2 -2
- package/src/reanimated2/globals.d.ts +12 -15
- 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 +90 -11
- package/src/reanimated2/hook/useAnimatedStyle.ts +44 -36
- 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 +76 -35
- package/src/reanimated2/interpolateColor.ts +104 -20
- package/src/reanimated2/jestUtils.ts +1 -1
- package/src/reanimated2/js-reanimated/JSReanimated.ts +98 -15
- 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 +0 -1
- 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 +20 -9
- 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 +25 -2
- 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 +45 -16
- package/src/reanimated2/threads.ts +103 -4
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["hsvToColor","RGBtoHSV","rgbaColor","processColor","red","green","blue","opacity","makeMutable","interpolate","useSharedValue","Extrapolate","EXTEND","CLAMP","IDENTITY","interpolateColorsHSV","value","inputRange","colors","h","s","v","interpolateColorsRGB","r","g","b","a","getInterpolateRGB","i","length","color","processedColor","undefined","push","getInterpolateHSV","interpolateColor","outputRange","colorSpace","Error","ColorSpace","useInterpolateConfig","RGB","cache","interpolateSharableColor","interpolateConfig","HSV"],"sources":["interpolateColor.ts"],"sourcesContent":["import {\n hsvToColor,\n RGBtoHSV,\n rgbaColor,\n processColor,\n red,\n green,\n blue,\n opacity,\n} from './Colors';\nimport { makeMutable } from './core';\nimport { interpolate } from './interpolation';\nimport { SharedValue } from './commonTypes';\nimport { useSharedValue } from './hook/useSharedValue';\n\nexport const Extrapolate = {\n EXTEND: 'extend',\n CLAMP: 'clamp',\n IDENTITY: 'identity',\n};\n\nconst interpolateColorsHSV = (\n value: number,\n inputRange: readonly number[],\n colors: InterpolateHSV\n) => {\n 'worklet';\n const h = interpolate(value, inputRange, colors.h, Extrapolate.CLAMP);\n const s = interpolate(value, inputRange, colors.s, Extrapolate.CLAMP);\n const v = interpolate(value, inputRange, colors.v, Extrapolate.CLAMP);\n return hsvToColor(h, s, v);\n};\n\nconst interpolateColorsRGB = (\n value: number,\n inputRange: readonly number[],\n colors: InterpolateRGB\n) => {\n 'worklet';\n const r = interpolate(value, inputRange, colors.r, Extrapolate.CLAMP);\n const g = interpolate(value, inputRange, colors.g, Extrapolate.CLAMP);\n const b = interpolate(value, inputRange, colors.b, Extrapolate.CLAMP);\n const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);\n return rgbaColor(r, g, b, a);\n};\n\ninterface InterpolateRGB {\n r: number[];\n g: number[];\n b: number[];\n a: number[];\n}\n\nconst getInterpolateRGB = (\n colors: readonly (string | number)[]\n): InterpolateRGB => {\n 'worklet';\n\n const r = [];\n const g = [];\n const b = [];\n const a = [];\n for (let i = 0; i < colors.length; ++i) {\n const color = colors[i];\n const processedColor = processColor(color);\n // explicit check in case if processedColor is 0\n if (processedColor !== null && processedColor !== undefined) {\n r.push(red(processedColor));\n g.push(green(processedColor));\n b.push(blue(processedColor));\n a.push(opacity(processedColor));\n }\n }\n return { r, g, b, a };\n};\n\ninterface InterpolateHSV {\n h: number[];\n s: number[];\n v: number[];\n}\n\nconst getInterpolateHSV = (\n colors: readonly (string | number)[]\n): InterpolateHSV => {\n 'worklet';\n const h = [];\n const s = [];\n const v = [];\n for (let i = 0; i < colors.length; ++i) {\n const color = colors[i];\n const processedColor = RGBtoHSV(processColor(color) as any);\n if (processedColor) {\n h.push(processedColor.h);\n s.push(processedColor.s);\n v.push(processedColor.v);\n }\n }\n return { h, s, v };\n};\n\nexport const interpolateColor = (\n value: number,\n inputRange: readonly number[],\n outputRange: readonly (string | number)[],\n colorSpace: 'RGB' | 'HSV' = 'RGB'\n): string | number => {\n 'worklet';\n if (colorSpace === 'HSV') {\n return interpolateColorsHSV(\n value,\n inputRange,\n getInterpolateHSV(outputRange)\n );\n } else if (colorSpace === 'RGB') {\n return interpolateColorsRGB(\n value,\n inputRange,\n getInterpolateRGB(outputRange)\n );\n }\n throw new Error(\n `Invalid color space provided: ${colorSpace}. Supported values are: ['RGB', 'HSV']`\n );\n};\n\nexport enum ColorSpace {\n RGB = 0,\n HSV = 1,\n}\n\nexport interface InterpolateConfig {\n inputRange: readonly number[];\n outputRange: readonly (string | number)[];\n colorSpace: ColorSpace;\n cache: SharedValue<InterpolateRGB | InterpolateHSV | null>;\n}\n\nexport function useInterpolateConfig(\n inputRange: readonly number[],\n outputRange: readonly (string | number)[],\n colorSpace = ColorSpace.RGB\n): SharedValue<InterpolateConfig> {\n return useSharedValue<InterpolateConfig>({\n inputRange,\n outputRange,\n colorSpace,\n cache: makeMutable<InterpolateRGB | InterpolateHSV | null>(null),\n });\n}\n\nexport const interpolateSharableColor = (\n value: number,\n interpolateConfig: SharedValue<InterpolateConfig>\n): string | number => {\n 'worklet';\n let colors = interpolateConfig.value.cache.value;\n if (interpolateConfig.value.colorSpace === ColorSpace.RGB) {\n if (!colors) {\n colors = getInterpolateRGB(interpolateConfig.value.outputRange);\n interpolateConfig.value.cache.value = colors;\n }\n return interpolateColorsRGB(\n value,\n interpolateConfig.value.inputRange,\n colors as InterpolateRGB\n );\n } else if (interpolateConfig.value.colorSpace === ColorSpace.HSV) {\n if (!colors) {\n colors = getInterpolateHSV(interpolateConfig.value.outputRange);\n interpolateConfig.value.cache.value = colors;\n }\n return interpolateColorsHSV(\n value,\n interpolateConfig.value.inputRange,\n colors as InterpolateHSV\n );\n }\n throw new Error(\n `Invalid color space provided: ${interpolateConfig.value.colorSpace}. Supported values are: ['RGB', 'HSV']`\n );\n};\n"],"mappings":"AAAA,SACEA,UADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,YAJF,EAKEC,GALF,EAMEC,KANF,EAOEC,IAPF,EAQEC,OARF,QASO,UATP;AAUA,SAASC,WAAT,QAA4B,QAA5B;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA,SAASC,cAAT,QAA+B,uBAA/B;AAEA,OAAO,MAAMC,WAAW,GAAG;EACzBC,MAAM,EAAE,QADiB;EAEzBC,KAAK,EAAE,OAFkB;EAGzBC,QAAQ,EAAE;AAHe,CAApB;;AAMP,MAAMC,oBAAoB,GAAG,CAC3BC,KAD2B,EAE3BC,UAF2B,EAG3BC,MAH2B,KAIxB;EACH;;EACA,MAAMC,CAAC,GAAGV,WAAW,CAACO,KAAD,EAAQC,UAAR,EAAoBC,MAAM,CAACC,CAA3B,EAA8BR,WAAW,CAACE,KAA1C,CAArB;EACA,MAAMO,CAAC,GAAGX,WAAW,CAACO,KAAD,EAAQC,UAAR,EAAoBC,MAAM,CAACE,CAA3B,EAA8BT,WAAW,CAACE,KAA1C,CAArB;EACA,MAAMQ,CAAC,GAAGZ,WAAW,CAACO,KAAD,EAAQC,UAAR,EAAoBC,MAAM,CAACG,CAA3B,EAA8BV,WAAW,CAACE,KAA1C,CAArB;EACA,OA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AAGgB,iBAAiB,CAACU,iBAAiB,CAAC5B,KAAlB,CAAwBoB,WAAzB,CAA1B;MACAQ,iBAAiB,CAAC5B,KAAlB,CAAwB0B,KAAxB,CAA8B1B,KAA9B,GAAsCE,MAAtC;IACD;;IACD,OAAOH,oBAAoB,CACzBC,KADyB,EAEzB4B,iBAAiB,CAAC5B,KAAlB,CAAwBC,UAFC,EAGzBC,MAHyB,CAA3B;EAKD;;EACD,MAAM,IAAIoB,KAAJ,CACH,iCAAgCM,iBAAiB,CAAC5B,KAAlB,CAAwBqB,UAAW,wCADhE,CAAN;AAGD,CA9BM"}
|
|
1
|
+
{"version":3,"names":["hsvToColor","RGBtoHSV","rgbaColor","processColor","red","green","blue","opacity","makeMutable","interpolate","useSharedValue","Extrapolate","EXTEND","CLAMP","IDENTITY","interpolateColorsHSV","value","inputRange","colors","options","h","useCorrectedHSVInterpolation","correctedInputRange","originalH","correctedH","i","length","d","push","s","v","a","toLinearSpace","x","gamma","map","Math","pow","toGammaSpace","round","interpolateColorsRGB","r","outputR","g","outputG","b","outputB","getInterpolateRGB","color","processedColor","undefined","getInterpolateHSV","processedHSVColor","interpolateColor","outputRange","colorSpace","Error","ColorSpace","useInterpolateConfig","RGB","cache","interpolateSharableColor","interpolateConfig","HSV"],"sources":["interpolateColor.ts"],"sourcesContent":["import {\n hsvToColor,\n RGBtoHSV,\n rgbaColor,\n processColor,\n red,\n green,\n blue,\n opacity,\n} from './Colors';\nimport { makeMutable } from './core';\nimport { interpolate } from './interpolation';\nimport { SharedValue } from './commonTypes';\nimport { useSharedValue } from './hook/useSharedValue';\n\nexport const Extrapolate = {\n EXTEND: 'extend',\n CLAMP: 'clamp',\n IDENTITY: 'identity',\n};\n\nexport type InterpolationOptions = {\n gamma?: number;\n useCorrectedHSVInterpolation?: boolean;\n};\n\nconst interpolateColorsHSV = (\n value: number,\n inputRange: readonly number[],\n colors: InterpolateHSV,\n options: InterpolationOptions\n) => {\n 'worklet';\n let h = 0;\n const { useCorrectedHSVInterpolation = true } = options;\n if (useCorrectedHSVInterpolation) {\n // if the difference between hues in a range is > 180 deg\n // then move the hue at the right end of the range +/- 360 deg\n // and add the next point in the original place + 0.00001 with original hue\n // to not break the next range\n const correctedInputRange = [inputRange[0]];\n const originalH = colors.h;\n const correctedH = [originalH[0]];\n\n for (let i = 1; i < originalH.length; ++i) {\n const d = originalH[i] - originalH[i - 1];\n if (originalH[i] > originalH[i - 1] && d > 0.5) {\n correctedInputRange.push(inputRange[i]);\n correctedInputRange.push(inputRange[i] + 0.00001);\n correctedH.push(originalH[i] - 1);\n correctedH.push(originalH[i]);\n } else if (originalH[i] < originalH[i - 1] && d < -0.5) {\n correctedInputRange.push(inputRange[i]);\n correctedInputRange.push(inputRange[i] + 0.00001);\n correctedH.push(originalH[i] + 1);\n correctedH.push(originalH[i]);\n } else {\n correctedInputRange.push(inputRange[i]);\n correctedH.push(originalH[i]);\n }\n }\n h =\n (interpolate(value, correctedInputRange, correctedH, Extrapolate.CLAMP) +\n 1) %\n 1;\n } else {\n h = interpolate(value, inputRange, colors.h, Extrapolate.CLAMP);\n }\n const s = interpolate(value, inputRange, colors.s, Extrapolate.CLAMP);\n const v = interpolate(value, inputRange, colors.v, Extrapolate.CLAMP);\n const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);\n return hsvToColor(h, s, v, a);\n};\n\nconst toLinearSpace = (x: number[], gamma: number): number[] => {\n 'worklet';\n return x.map((v) => Math.pow(v / 255, gamma));\n};\n\nconst toGammaSpace = (x: number, gamma: number): number => {\n 'worklet';\n return Math.round(Math.pow(x, 1 / gamma) * 255);\n};\n\nconst interpolateColorsRGB = (\n value: number,\n inputRange: readonly number[],\n colors: InterpolateRGB,\n options: InterpolationOptions\n) => {\n 'worklet';\n const { gamma = 2.2 } = options;\n let { r: outputR, g: outputG, b: outputB } = colors;\n if (gamma !== 1) {\n outputR = toLinearSpace(outputR, gamma);\n outputG = toLinearSpace(outputG, gamma);\n outputB = toLinearSpace(outputB, gamma);\n }\n const r = interpolate(value, inputRange, outputR, Extrapolate.CLAMP);\n const g = interpolate(value, inputRange, outputG, Extrapolate.CLAMP);\n const b = interpolate(value, inputRange, outputB, Extrapolate.CLAMP);\n const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);\n if (gamma === 1) {\n return rgbaColor(r, g, b, a);\n }\n return rgbaColor(\n toGammaSpace(r, gamma),\n toGammaSpace(g, gamma),\n toGammaSpace(b, gamma),\n a\n );\n};\n\ninterface InterpolateRGB {\n r: number[];\n g: number[];\n b: number[];\n a: number[];\n}\n\nconst getInterpolateRGB = (\n colors: readonly (string | number)[]\n): InterpolateRGB => {\n 'worklet';\n\n const r = [];\n const g = [];\n const b = [];\n const a = [];\n for (let i = 0; i < colors.length; ++i) {\n const color = colors[i];\n const processedColor = processColor(color);\n // explicit check in case if processedColor is 0\n if (processedColor !== null && processedColor !== undefined) {\n r.push(red(processedColor));\n g.push(green(processedColor));\n b.push(blue(processedColor));\n a.push(opacity(processedColor));\n }\n }\n return { r, g, b, a };\n};\n\ninterface InterpolateHSV {\n h: number[];\n s: number[];\n v: number[];\n a: number[];\n}\n\nconst getInterpolateHSV = (\n colors: readonly (string | number)[]\n): InterpolateHSV => {\n 'worklet';\n const h = [];\n const s = [];\n const v = [];\n const a = [];\n for (let i = 0; i < colors.length; ++i) {\n const color = colors[i];\n const processedColor = processColor(color) as any;\n if (typeof processedColor === 'number') {\n const processedHSVColor = RGBtoHSV(\n red(processedColor),\n green(processedColor),\n blue(processedColor)\n );\n\n h.push(processedHSVColor.h);\n s.push(processedHSVColor.s);\n v.push(processedHSVColor.v);\n a.push(opacity(processedColor));\n }\n }\n return { h, s, v, a };\n};\n\nexport const interpolateColor = (\n value: number,\n inputRange: readonly number[],\n outputRange: readonly (string | number)[],\n colorSpace: 'RGB' | 'HSV' = 'RGB',\n options: InterpolationOptions = {}\n): string | number => {\n 'worklet';\n if (colorSpace === 'HSV') {\n return interpolateColorsHSV(\n value,\n inputRange,\n getInterpolateHSV(outputRange),\n options\n );\n } else if (colorSpace === 'RGB') {\n return interpolateColorsRGB(\n value,\n inputRange,\n getInterpolateRGB(outputRange),\n options\n );\n }\n throw new Error(\n `Invalid color space provided: ${colorSpace}. Supported values are: ['RGB', 'HSV']`\n );\n};\n\nexport enum ColorSpace {\n RGB = 0,\n HSV = 1,\n}\n\nexport interface InterpolateConfig {\n inputRange: readonly number[];\n outputRange: readonly (string | number)[];\n colorSpace: ColorSpace;\n cache: SharedValue<InterpolateRGB | InterpolateHSV | null>;\n options: InterpolationOptions;\n}\n\nexport function useInterpolateConfig(\n inputRange: readonly number[],\n outputRange: readonly (string | number)[],\n colorSpace = ColorSpace.RGB,\n options: InterpolationOptions = {}\n): SharedValue<InterpolateConfig> {\n return useSharedValue<InterpolateConfig>({\n inputRange,\n outputRange,\n colorSpace,\n cache: makeMutable<InterpolateRGB | InterpolateHSV | null>(null),\n options,\n });\n}\n\nexport const interpolateSharableColor = (\n value: number,\n interpolateConfig: SharedValue<InterpolateConfig>\n): string | number => {\n 'worklet';\n let colors = interpolateConfig.value.cache.value;\n if (interpolateConfig.value.colorSpace === ColorSpace.RGB) {\n if (!colors) {\n colors = getInterpolateRGB(interpolateConfig.value.outputRange);\n interpolateConfig.value.cache.value = colors;\n }\n return interpolateColorsRGB(\n value,\n interpolateConfig.value.inputRange,\n colors as InterpolateRGB,\n interpolateConfig.value.options\n );\n } else if (interpolateConfig.value.colorSpace === ColorSpace.HSV) {\n if (!colors) {\n colors = getInterpolateHSV(interpolateConfig.value.outputRange);\n interpolateConfig.value.cache.value = colors;\n }\n return interpolateColorsHSV(\n value,\n interpolateConfig.value.inputRange,\n colors as InterpolateHSV,\n interpolateConfig.value.options\n );\n }\n throw new Error(\n `Invalid color space provided: ${interpolateConfig.value.colorSpace}. Supported values are: ['RGB', 'HSV']`\n );\n};\n"],"mappings":"AAAA,SACEA,UADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,YAJF,EAKEC,GALF,EAMEC,KANF,EAOE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CAAC9C,KAAlB,CAAwBG,OAJC,CAA3B;EAMD,CAXD,MAWO,IAAI2C,iBAAiB,CAAC9C,KAAlB,CAAwBuC,UAAxB,KAAuCE,UAAU,CAACM,GAAtD,EAA2D;IAChE,IAAI,CAAC7C,MAAL,EAAa;MACXA,MAAM,GAAGiC,iBAAiB,CAACW,iBAAiB,CAAC9C,KAAlB,CAAwBsC,WAAzB,CAA1B;MACAQ,iBAAiB,CAAC9C,KAAlB,CAAwB4C,KAAxB,CAA8B5C,KAA9B,GAAsCE,MAAtC;IACD;;IACD,OAAOH,oBAAoB,CACzBC,KADyB,EAEzB8C,iBAAiB,CAAC9C,KAAlB,CAAwBC,UAFC,EAGzBC,MAHyB,EAIzB4C,iBAAiB,CAAC9C,KAAlB,CAAwBG,OAJC,CAA3B;EAMD;;EACD,MAAM,IAAIqC,KAAJ,CACH,iCAAgCM,iBAAiB,CAAC9C,KAAlB,CAAwBuC,UAAW,wCADhE,CAAN;AAGD,CAhCM"}
|
|
@@ -143,7 +143,7 @@ const afterTest = () => {
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
export const withReanimatedTimer = animationTest => {
|
|
146
|
-
console.warn('This method is deprecated, you
|
|
146
|
+
console.warn('This method is deprecated, you should define your own before and after test hooks to enable jest.useFakeTimers(). Check out the documentation for details on testing');
|
|
147
147
|
beforeTest();
|
|
148
148
|
animationTest();
|
|
149
149
|
afterTest();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["config","fps","isAnimatedStyle","style","animatedStyle","getAnimatedStyleFromObject","current","value","getCurrentStyle","received","styleObject","props","currentStyle","Array","isArray","forEach","checkEqual","expectStyle","length","i","property","findStyleDiff","expect","requireAllMatch","diffs","isEqual","push","Object","keys","undefined","compareStyle","expectedStyle","message","pass","exact","currentStyleStr","JSON","stringify","expectedStyleStr","differences","map","diff","join","frameTime","beforeTest","jest","useFakeTimers","afterTest","runOnlyPendingTimers","useRealTimers","withReanimatedTimer","animationTest","console","warn","advanceAnimationByTime","time","advanceTimersByTime","advanceAnimationByFrame","count","setUpTests","userConfig","global","expectModule","require","jestGlobals","extend","default","Math","round","toHaveAnimatedStyle","getAnimatedStyle"],"sources":["jestUtils.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R> {\n toHaveAnimatedStyle(\n style: Record<string, unknown>[] | Record<string, unknown>\n ): R;\n }\n }\n}\n\nlet config = {\n fps: 60,\n};\n\nconst isAnimatedStyle = (style) => {\n return !!style.animatedStyle;\n};\n\nconst getAnimatedStyleFromObject = (style) => {\n return style.animatedStyle.current.value;\n};\n\nconst getCurrentStyle = (received) => {\n const styleObject = received.props.style;\n let currentStyle = {};\n if (Array.isArray(styleObject)) {\n received.props.style.forEach((style) => {\n if (isAnimatedStyle(style)) {\n currentStyle = {\n ...currentStyle,\n ...getAnimatedStyleFromObject(style),\n };\n } else {\n currentStyle = {\n ...currentStyle,\n ...style,\n };\n }\n });\n } else {\n if (isAnimatedStyle(styleObject)) {\n currentStyle = getAnimatedStyleFromObject(styleObject);\n } else {\n currentStyle = {\n ...styleObject,\n ...received.props.animatedStyle.value,\n };\n }\n }\n return currentStyle;\n};\n\nconst checkEqual = (currentStyle, expectStyle) => {\n if (Array.isArray(expectStyle)) {\n if (expectStyle.length !== currentStyle.length) return false;\n for (let i = 0; i < currentStyle.length; i++) {\n if (!checkEqual(currentStyle[i], expectStyle[i])) {\n return false;\n }\n }\n } else if (typeof currentStyle === 'object' && currentStyle) {\n for (const property in expectStyle) {\n if (!checkEqual(currentStyle[property], expectStyle[property])) {\n return false;\n }\n }\n } else {\n return currentStyle === expectStyle;\n }\n return true;\n};\n\nconst findStyleDiff = (current, expect, requireAllMatch) => {\n const diffs = [];\n let isEqual = true;\n for (const property in expect) {\n if (!checkEqual(current[property], expect[property])) {\n isEqual = false;\n diffs.push({\n property: property,\n current: current[property],\n expect: expect[property],\n });\n }\n }\n\n if (\n requireAllMatch &&\n Object.keys(current).length !== Object.keys(expect).length\n ) {\n isEqual = false;\n for (const property in current) {\n if (expect[property] === undefined) {\n diffs.push({\n property: property,\n current: current[property],\n expect: expect[property],\n });\n }\n }\n }\n\n return { isEqual, diffs };\n};\n\nconst compareStyle = (received, expectedStyle, config) => {\n if (!received.props.style) {\n return { message: () => message, pass: false };\n }\n const { exact } = config;\n const currentStyle = getCurrentStyle(received);\n const { isEqual, diffs } = findStyleDiff(currentStyle, expectedStyle, exact);\n\n if (isEqual) {\n return { message: () => 'ok', pass: true };\n }\n\n const currentStyleStr = JSON.stringify(currentStyle);\n const expectedStyleStr = JSON.stringify(expectedStyle);\n const differences = diffs\n .map(\n (diff) =>\n `- '${diff.property}' should be ${JSON.stringify(\n diff.expect\n )}, but is ${JSON.stringify(diff.current)}`\n )\n .join('\\n');\n\n return {\n message: () =>\n `Expected: ${expectedStyleStr}\\nReceived: ${currentStyleStr}\\n\\nDifferences:\\n${differences}`,\n pass: false,\n };\n};\n\nlet frameTime = 1000 / config.fps;\n\nconst beforeTest = () => {\n jest.useFakeTimers();\n};\n\nconst afterTest = () => {\n jest.runOnlyPendingTimers();\n jest.useRealTimers();\n};\n\nexport const withReanimatedTimer = (animationTest) => {\n console.warn(\n 'This method is deprecated, you shoulddefine your own before and after test hooks to enable jest.useFakeTimers(). Check out the documentation for details on testing'\n );\n beforeTest();\n animationTest();\n afterTest();\n};\n\nexport const advanceAnimationByTime = (time = frameTime) => {\n console.warn(\n 'This method is deprecated, use jest.advanceTimersByTime directly'\n );\n jest.advanceTimersByTime(time);\n jest.runOnlyPendingTimers();\n};\n\nexport const advanceAnimationByFrame = (count) => {\n console.warn(\n 'This method is deprecated, use jest.advanceTimersByTime directly'\n );\n jest.advanceTimersByTime(count * frameTime);\n jest.runOnlyPendingTimers();\n};\n\nexport const setUpTests = (userConfig = {}) => {\n let expect = global.expect;\n if (expect === undefined) {\n const expectModule = require('expect');\n expect = expectModule;\n // Starting from Jest 28, \"expect\" package uses named exports instead of default export.\n // So, requiring \"expect\" package doesn't give direct access to \"expect\" function anymore.\n // It gives access to the module object instead.\n // We use this info to detect if the project uses Jest 28 or higher.\n if (typeof expect === 'object') {\n const jestGlobals = require('@jest/globals');\n expect = jestGlobals.expect;\n }\n if (expect === undefined || expect.extend === undefined) {\n expect = expectModule.default;\n }\n }\n\n require('setimmediate');\n frameTime = Math.round(1000 / config.fps);\n\n config = {\n ...config,\n ...userConfig,\n };\n\n expect.extend({\n toHaveAnimatedStyle(received, expectedStyle, config = {}) {\n return compareStyle(received, expectedStyle, config);\n },\n });\n};\n\nexport const getAnimatedStyle = (received) => {\n return getCurrentStyle(received);\n};\n"],"mappings":"AAAA;AACA;AAYA,IAAIA,MAAM,GAAG;EACXC,GAAG,EAAE;AADM,CAAb;;AAIA,MAAMC,eAAe,GAAIC,KAAD,IAAW;EACjC,OAAO,CAAC,CAACA,KAAK,CAACC,aAAf;AACD,CAFD;;AAIA,MAAMC,0BAA0B,GAAIF,KAAD,IAAW;EAC5C,OAAOA,KAAK,CAACC,aAAN,CAAoBE,OAApB,CAA4BC,KAAnC;AACD,CAFD;;AAIA,MAAMC,eAAe,GAAIC,QAAD,IAAc;EACpC,MAAMC,WAAW,GAAGD,QAAQ,CAACE,KAAT,CAAeR,KAAnC;EACA,IAAIS,YAAY,GAAG,EAAnB;;EACA,IAAIC,KAAK,CAACC,OAAN,CAAcJ,WAAd,CAAJ,EAAgC;IAC9BD,QAAQ,CAACE,KAAT,CAAeR,KAAf,CAAqBY,OAArB,CAA8BZ,KAAD,IAAW;MACtC,IAAID,eAAe,CAACC,KAAD,CAAnB,EAA4B;QAC1BS,YAAY,GAAG,EACb,GAAGA,YADU;UAEb,GAAGP,0BAA0B,CAACF,KAAD;QAFhB,CAAf;MAID,CALD,MAKO;QACLS,YAAY,GAAG,EACb,GAAGA,YADU;UAEb,GAAGT;QAFU,CAAf;MAID;IACF,CAZD;EAaD,CAdD,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AL,CAAyBE,KAAK,GAAGf,SAAjC;EACAE,IAAI,CAACG,oBAAL;AACD,CANM;AAQP,OAAO,MAAMW,UAAU,GAAG,YAAqB;EAAA,IAApBC,UAAoB,uEAAP,EAAO;EAC7C,IAAItC,MAAM,GAAGuC,MAAM,CAACvC,MAApB;;EACA,IAAIA,MAAM,KAAKO,SAAf,EAA0B;IACxB,MAAMiC,YAAY,GAAGC,OAAO,CAAC,QAAD,CAA5B;;IACAzC,MAAM,GAAGwC,YAAT,CAFwB,CAGxB;IACA;IACA;IACA;;IACA,IAAI,OAAOxC,MAAP,KAAkB,QAAtB,EAAgC;MAC9B,MAAM0C,WAAW,GAAGD,OAAO,CAAC,eAAD,CAA3B;;MACAzC,MAAM,GAAG0C,WAAW,CAAC1C,MAArB;IACD;;IACD,IAAIA,MAAM,KAAKO,SAAX,IAAwBP,MAAM,CAAC2C,MAAP,KAAkBpC,SAA9C,EAAyD;MACvDP,MAAM,GAAGwC,YAAY,CAACI,OAAtB;IACD;EACF;;EAEDH,OAAO,CAAC,cAAD,CAAP;;EACApB,SAAS,GAAGwB,IAAI,CAACC,KAAL,CAAW,OAAOpE,MAAM,CAACC,GAAzB,CAAZ;EAEAD,MAAM,GAAG,EACP,GAAGA,MADI;IAEP,GAAG4D;EAFI,CAAT;EAKAtC,MAAM,CAAC2C,MAAP,CAAc;IACZI,mBAAmB,CAAC5D,QAAD,EAAWsB,aAAX,EAAuC;MAAA,IAAb/B,MAAa,uEAAJ,EAAI;MACxD,OAAO8B,YAAY,CAACrB,QAAD,EAAWsB,aAAX,EAA0B/B,MAA1B,CAAnB;IACD;;EAHW,CAAd;AAKD,CA/BM;AAiCP,OAAO,MAAMsE,gBAAgB,GAAI7D,QAAD,IAAc;EAC5C,OAAOD,eAAe,CAACC,QAAD,CAAtB;AACD,CAFM"}
|
|
1
|
+
{"version":3,"names":["config","fps","isAnimatedStyle","style","animatedStyle","getAnimatedStyleFromObject","current","value","getCurrentStyle","received","styleObject","props","currentStyle","Array","isArray","forEach","checkEqual","expectStyle","length","i","property","findStyleDiff","expect","requireAllMatch","diffs","isEqual","push","Object","keys","undefined","compareStyle","expectedStyle","message","pass","exact","currentStyleStr","JSON","stringify","expectedStyleStr","differences","map","diff","join","frameTime","beforeTest","jest","useFakeTimers","afterTest","runOnlyPendingTimers","useRealTimers","withReanimatedTimer","animationTest","console","warn","advanceAnimationByTime","time","advanceTimersByTime","advanceAnimationByFrame","count","setUpTests","userConfig","global","expectModule","require","jestGlobals","extend","default","Math","round","toHaveAnimatedStyle","getAnimatedStyle"],"sources":["jestUtils.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R> {\n toHaveAnimatedStyle(\n style: Record<string, unknown>[] | Record<string, unknown>\n ): R;\n }\n }\n}\n\nlet config = {\n fps: 60,\n};\n\nconst isAnimatedStyle = (style) => {\n return !!style.animatedStyle;\n};\n\nconst getAnimatedStyleFromObject = (style) => {\n return style.animatedStyle.current.value;\n};\n\nconst getCurrentStyle = (received) => {\n const styleObject = received.props.style;\n let currentStyle = {};\n if (Array.isArray(styleObject)) {\n received.props.style.forEach((style) => {\n if (isAnimatedStyle(style)) {\n currentStyle = {\n ...currentStyle,\n ...getAnimatedStyleFromObject(style),\n };\n } else {\n currentStyle = {\n ...currentStyle,\n ...style,\n };\n }\n });\n } else {\n if (isAnimatedStyle(styleObject)) {\n currentStyle = getAnimatedStyleFromObject(styleObject);\n } else {\n currentStyle = {\n ...styleObject,\n ...received.props.animatedStyle.value,\n };\n }\n }\n return currentStyle;\n};\n\nconst checkEqual = (currentStyle, expectStyle) => {\n if (Array.isArray(expectStyle)) {\n if (expectStyle.length !== currentStyle.length) return false;\n for (let i = 0; i < currentStyle.length; i++) {\n if (!checkEqual(currentStyle[i], expectStyle[i])) {\n return false;\n }\n }\n } else if (typeof currentStyle === 'object' && currentStyle) {\n for (const property in expectStyle) {\n if (!checkEqual(currentStyle[property], expectStyle[property])) {\n return false;\n }\n }\n } else {\n return currentStyle === expectStyle;\n }\n return true;\n};\n\nconst findStyleDiff = (current, expect, requireAllMatch) => {\n const diffs = [];\n let isEqual = true;\n for (const property in expect) {\n if (!checkEqual(current[property], expect[property])) {\n isEqual = false;\n diffs.push({\n property: property,\n current: current[property],\n expect: expect[property],\n });\n }\n }\n\n if (\n requireAllMatch &&\n Object.keys(current).length !== Object.keys(expect).length\n ) {\n isEqual = false;\n for (const property in current) {\n if (expect[property] === undefined) {\n diffs.push({\n property: property,\n current: current[property],\n expect: expect[property],\n });\n }\n }\n }\n\n return { isEqual, diffs };\n};\n\nconst compareStyle = (received, expectedStyle, config) => {\n if (!received.props.style) {\n return { message: () => message, pass: false };\n }\n const { exact } = config;\n const currentStyle = getCurrentStyle(received);\n const { isEqual, diffs } = findStyleDiff(currentStyle, expectedStyle, exact);\n\n if (isEqual) {\n return { message: () => 'ok', pass: true };\n }\n\n const currentStyleStr = JSON.stringify(currentStyle);\n const expectedStyleStr = JSON.stringify(expectedStyle);\n const differences = diffs\n .map(\n (diff) =>\n `- '${diff.property}' should be ${JSON.stringify(\n diff.expect\n )}, but is ${JSON.stringify(diff.current)}`\n )\n .join('\\n');\n\n return {\n message: () =>\n `Expected: ${expectedStyleStr}\\nReceived: ${currentStyleStr}\\n\\nDifferences:\\n${differences}`,\n pass: false,\n };\n};\n\nlet frameTime = 1000 / config.fps;\n\nconst beforeTest = () => {\n jest.useFakeTimers();\n};\n\nconst afterTest = () => {\n jest.runOnlyPendingTimers();\n jest.useRealTimers();\n};\n\nexport const withReanimatedTimer = (animationTest) => {\n console.warn(\n 'This method is deprecated, you should define your own before and after test hooks to enable jest.useFakeTimers(). Check out the documentation for details on testing'\n );\n beforeTest();\n animationTest();\n afterTest();\n};\n\nexport const advanceAnimationByTime = (time = frameTime) => {\n console.warn(\n 'This method is deprecated, use jest.advanceTimersByTime directly'\n );\n jest.advanceTimersByTime(time);\n jest.runOnlyPendingTimers();\n};\n\nexport const advanceAnimationByFrame = (count) => {\n console.warn(\n 'This method is deprecated, use jest.advanceTimersByTime directly'\n );\n jest.advanceTimersByTime(count * frameTime);\n jest.runOnlyPendingTimers();\n};\n\nexport const setUpTests = (userConfig = {}) => {\n let expect = global.expect;\n if (expect === undefined) {\n const expectModule = require('expect');\n expect = expectModule;\n // Starting from Jest 28, \"expect\" package uses named exports instead of default export.\n // So, requiring \"expect\" package doesn't give direct access to \"expect\" function anymore.\n // It gives access to the module object instead.\n // We use this info to detect if the project uses Jest 28 or higher.\n if (typeof expect === 'object') {\n const jestGlobals = require('@jest/globals');\n expect = jestGlobals.expect;\n }\n if (expect === undefined || expect.extend === undefined) {\n expect = expectModule.default;\n }\n }\n\n require('setimmediate');\n frameTime = Math.round(1000 / config.fps);\n\n config = {\n ...config,\n ...userConfig,\n };\n\n expect.extend({\n toHaveAnimatedStyle(received, expectedStyle, config = {}) {\n return compareStyle(received, expectedStyle, config);\n },\n });\n};\n\nexport const getAnimatedStyle = (received) => {\n return getCurrentStyle(received);\n};\n"],"mappings":"AAAA;AACA;AAYA,IAAIA,MAAM,GAAG;EACXC,GAAG,EAAE;AADM,CAAb;;AAIA,MAAMC,eAAe,GAAIC,KAAD,IAAW;EACjC,OAAO,CAAC,CAACA,KAAK,CAACC,aAAf;AACD,CAFD;;AAIA,MAAMC,0BAA0B,GAAIF,KAAD,IAAW;EAC5C,OAAOA,KAAK,CAACC,aAAN,CAAoBE,OAApB,CAA4BC,KAAnC;AACD,CAFD;;AAIA,MAAMC,eAAe,GAAIC,QAAD,IAAc;EACpC,MAAMC,WAAW,GAAGD,QAAQ,CAACE,KAAT,CAAeR,KAAnC;EACA,IAAIS,YAAY,GAAG,EAAnB;;EACA,IAAIC,KAAK,CAACC,OAAN,CAAcJ,WAAd,CAAJ,EAAgC;IAC9BD,QAAQ,CAACE,KAAT,CAAeR,KAAf,CAAqBY,OAArB,CAA8BZ,KAAD,IAAW;MACtC,IA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d;AAKD,CA/BM;AAiCP,OAAO,MAAMsE,gBAAgB,GAAI7D,QAAD,IAAc;EAC5C,OAAOD,eAAe,CAACC,QAAD,CAAtB;AACD,CAFM"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import { NativeReanimated } from '../NativeReanimated/NativeReanimated';
|
|
2
|
-
import {
|
|
4
|
+
import { SensorType } from '../commonTypes';
|
|
3
5
|
export default class JSReanimated extends NativeReanimated {
|
|
4
6
|
constructor() {
|
|
5
7
|
super(false);
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// for tests, we use Date.now instead
|
|
11
|
-
this.getTimestamp = () => Date.now();
|
|
12
|
-
} else {
|
|
13
|
-
this.getTimestamp = () => window.performance.now();
|
|
14
|
-
}
|
|
9
|
+
_defineProperty(this, "nextSensorId", 0);
|
|
10
|
+
|
|
11
|
+
_defineProperty(this, "sensors", new Map());
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
makeShareableClone(value) {
|
|
@@ -40,12 +37,61 @@ export default class JSReanimated extends NativeReanimated {
|
|
|
40
37
|
console.warn('[Reanimated] enableLayoutAnimations is not available for WEB yet');
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
registerSensor() {
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
registerSensor(sensorType, interval, iosReferenceFrame, eventHandler) {
|
|
41
|
+
if (!(this.getSensorName(sensorType) in window)) {
|
|
42
|
+
return -1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const sensor = this.initializeSensor(sensorType, interval);
|
|
46
|
+
let callback;
|
|
47
|
+
|
|
48
|
+
if (sensorType === SensorType.ROTATION) {
|
|
49
|
+
callback = () => {
|
|
50
|
+
const [qw, qx, qy, qz] = sensor.quaternion; // reference: https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion
|
|
51
|
+
|
|
52
|
+
const yaw = Math.atan2(2.0 * (qy * qz + qw * qx), qw * qw - qx * qx - qy * qy + qz * qz);
|
|
53
|
+
const pitch = Math.sin(-2.0 * (qx * qz - qw * qy));
|
|
54
|
+
const roll = Math.atan2(2.0 * (qx * qy + qw * qz), qw * qw + qx * qx - qy * qy - qz * qz);
|
|
55
|
+
eventHandler({
|
|
56
|
+
qw,
|
|
57
|
+
qx,
|
|
58
|
+
qy,
|
|
59
|
+
qz,
|
|
60
|
+
yaw,
|
|
61
|
+
pitch,
|
|
62
|
+
roll,
|
|
63
|
+
interfaceOrientation: 0
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
} else {
|
|
67
|
+
callback = () => {
|
|
68
|
+
const {
|
|
69
|
+
x,
|
|
70
|
+
y,
|
|
71
|
+
z
|
|
72
|
+
} = sensor;
|
|
73
|
+
eventHandler({
|
|
74
|
+
x,
|
|
75
|
+
y,
|
|
76
|
+
z,
|
|
77
|
+
interfaceOrientation: 0
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
sensor.addEventListener('reading', callback);
|
|
83
|
+
sensor.start();
|
|
84
|
+
this.sensors.set(this.nextSensorId, sensor);
|
|
85
|
+
return this.nextSensorId++;
|
|
46
86
|
}
|
|
47
87
|
|
|
48
|
-
unregisterSensor() {
|
|
88
|
+
unregisterSensor(id) {
|
|
89
|
+
const sensor = this.sensors.get(id);
|
|
90
|
+
|
|
91
|
+
if (sensor !== undefined) {
|
|
92
|
+
sensor.stop();
|
|
93
|
+
this.sensors.delete(id);
|
|
94
|
+
}
|
|
49
95
|
}
|
|
50
96
|
|
|
51
97
|
subscribeForKeyboardEvents(_) {
|
|
@@ -56,5 +102,49 @@ export default class JSReanimated extends NativeReanimated {
|
|
|
56
102
|
unsubscribeFromKeyboardEvents(_) {// noop
|
|
57
103
|
}
|
|
58
104
|
|
|
105
|
+
initializeSensor(sensorType, interval) {
|
|
106
|
+
const config = interval <= 0 ? {
|
|
107
|
+
referenceFrame: 'device'
|
|
108
|
+
} : {
|
|
109
|
+
frequency: 1000 / interval
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
switch (sensorType) {
|
|
113
|
+
case SensorType.ACCELEROMETER:
|
|
114
|
+
return new window.Accelerometer(config);
|
|
115
|
+
|
|
116
|
+
case SensorType.GYROSCOPE:
|
|
117
|
+
return new window.Gyroscope(config);
|
|
118
|
+
|
|
119
|
+
case SensorType.GRAVITY:
|
|
120
|
+
return new window.GravitySensor(config);
|
|
121
|
+
|
|
122
|
+
case SensorType.MAGNETIC_FIELD:
|
|
123
|
+
return new window.Magnetometer(config);
|
|
124
|
+
|
|
125
|
+
case SensorType.ROTATION:
|
|
126
|
+
return new window.AbsoluteOrientationSensor(config);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
getSensorName(sensorType) {
|
|
131
|
+
switch (sensorType) {
|
|
132
|
+
case SensorType.ACCELEROMETER:
|
|
133
|
+
return 'Accelerometer';
|
|
134
|
+
|
|
135
|
+
case SensorType.GRAVITY:
|
|
136
|
+
return 'GravitySensor';
|
|
137
|
+
|
|
138
|
+
case SensorType.GYROSCOPE:
|
|
139
|
+
return 'Gyroscope';
|
|
140
|
+
|
|
141
|
+
case SensorType.MAGNETIC_FIELD:
|
|
142
|
+
return 'Magnetometer';
|
|
143
|
+
|
|
144
|
+
case SensorType.ROTATION:
|
|
145
|
+
return 'AbsoluteOrientationSensor';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
59
149
|
}
|
|
60
150
|
//# sourceMappingURL=JSReanimated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeReanimated","
|
|
1
|
+
{"version":3,"names":["NativeReanimated","SensorType","JSReanimated","constructor","Map","makeShareableClone","value","__hostObjectShareableJSRef","installCoreFunctions","_callGuard","_valueUnpacker","scheduleOnUI","worklet","requestAnimationFrame","registerEventHandler","_eventHash","_eventHandler","unregisterEventHandler","_","enableLayoutAnimations","console","warn","registerSensor","sensorType","interval","iosReferenceFrame","eventHandler","getSensorName","window","sensor","initializeSensor","callback","ROTATION","qw","qx","qy","qz","quaternion","yaw","Math","atan2","pitch","sin","roll","interfaceOrientation","x","y","z","addEventListener","start","sensors","set","nextSensorId","unregisterSensor","id","get","undefined","stop","delete","subscribeForKeyboardEvents","unsubscribeFromKeyboardEvents","config","referenceFrame","frequency","ACCELEROMETER","Accelerometer","GYROSCOPE","Gyroscope","GRAVITY","GravitySensor","MAGNETIC_FIELD","Magnetometer","AbsoluteOrientationSensor"],"sources":["JSReanimated.ts"],"sourcesContent":["import { NativeReanimated } from '../NativeReanimated/NativeReanimated';\nimport {\n SensorType,\n ShareableRef,\n Value3D,\n ValueRotation,\n} from '../commonTypes';\nimport { WebSensor } from './WebSensor';\n\nexport default class JSReanimated extends NativeReanimated {\n nextSensorId = 0;\n sensors = new Map<number, WebSensor>();\n\n constructor() {\n super(false);\n }\n\n makeShareableClone<T>(value: T): ShareableRef<T> {\n return { __hostObjectShareableJSRef: value };\n }\n\n installCoreFunctions(\n _callGuard: <T extends Array<any>, U>(\n fn: (...args: T) => U,\n ...args: T\n ) => void,\n _valueUnpacker: <T>(value: T) => T\n ): void {\n // noop\n }\n\n scheduleOnUI<T>(worklet: ShareableRef<T>) {\n // @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready\n requestAnimationFrame(worklet);\n }\n\n registerEventHandler<T>(\n _eventHash: string,\n _eventHandler: ShareableRef<T>\n ): string {\n // noop\n return '';\n }\n\n unregisterEventHandler(_: string): void {\n // noop\n }\n\n enableLayoutAnimations() {\n console.warn(\n '[Reanimated] enableLayoutAnimations is not available for WEB yet'\n );\n }\n\n registerSensor(\n sensorType: SensorType,\n interval: number,\n iosReferenceFrame: number,\n eventHandler: (data: Value3D | ValueRotation) => void\n ): number {\n if (!(this.getSensorName(sensorType) in window)) {\n return -1;\n }\n\n const sensor: WebSensor = this.initializeSensor(sensorType, interval);\n let callback;\n if (sensorType === SensorType.ROTATION) {\n callback = () => {\n const [qw, qx, qy, qz] = sensor.quaternion;\n\n // reference: https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion\n const yaw = Math.atan2(\n 2.0 * (qy * qz + qw * qx),\n qw * qw - qx * qx - qy * qy + qz * qz\n );\n const pitch = Math.sin(-2.0 * (qx * qz - qw * qy));\n const roll = Math.atan2(\n 2.0 * (qx * qy + qw * qz),\n qw * qw + qx * qx - qy * qy - qz * qz\n );\n eventHandler({\n qw,\n qx,\n qy,\n qz,\n yaw,\n pitch,\n roll,\n interfaceOrientation: 0,\n });\n };\n } else {\n callback = () => {\n const { x, y, z } = sensor;\n eventHandler({ x, y, z, interfaceOrientation: 0 });\n };\n }\n sensor.addEventListener('reading', callback);\n sensor.start();\n\n this.sensors.set(this.nextSensorId, sensor);\n return this.nextSensorId++;\n }\n\n unregisterSensor(id: number): void {\n const sensor: WebSensor | undefined = this.sensors.get(id);\n if (sensor !== undefined) {\n sensor.stop();\n this.sensors.delete(id);\n }\n }\n\n subscribeForKeyboardEvents(_: ShareableRef<number>): number {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on web yet.'\n );\n return -1;\n }\n\n unsubscribeFromKeyboardEvents(_: number): void {\n // noop\n }\n\n initializeSensor(sensorType: SensorType, interval: number): WebSensor {\n const config =\n interval <= 0\n ? { referenceFrame: 'device' }\n : { frequency: 1000 / interval };\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return new window.Accelerometer(config);\n case SensorType.GYROSCOPE:\n return new window.Gyroscope(config);\n case SensorType.GRAVITY:\n return new window.GravitySensor(config);\n case SensorType.MAGNETIC_FIELD:\n return new window.Magnetometer(config);\n case SensorType.ROTATION:\n return new window.AbsoluteOrientationSensor(config);\n }\n }\n\n getSensorName(sensorType: SensorType): string {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return 'Accelerometer';\n case SensorType.GRAVITY:\n return 'GravitySensor';\n case SensorType.GYROSCOPE:\n return 'Gyroscope';\n case SensorType.MAGNETIC_FIELD:\n return 'Magnetometer';\n case SensorType.ROTATION:\n return 'AbsoluteOrientationSensor';\n }\n }\n}\n"],"mappings":";;AAAA,SAASA,gBAAT,QAAiC,sCAAjC;AACA,SACEC,UADF,QAKO,gBALP;AAQA,eAAe,MAAMC,YAAN,SAA2BF,gBAA3B,CAA4C;EAIzDG,WAAW,GAAG;IACZ,MAAM,KAAN;;IADY,sCAHC,CAGD;;IAAA,iCAFJ,IAAIC,GAAJ,EAEI;EAEb;;EAEDC,kBAAkB,CAAIC,KAAJ,EAA+B;IAC/C,OAAO;MAAEC,0BAA0B,EAAED;IAA9B,CAAP;EACD;;EAEDE,oBAAoB,CAClBC,UADkB,EAKlBC,cALkB,EAMZ,CACN;EACD;;EAEDC,YAAY,CAAIC,OAAJ,EAA8B;IACxC;IACAC,qBAAqB,CAACD,OAAD,CAArB;EACD;;EAEDE,oBAAoB,CAClBC,UADkB,EAElBC,aAFkB,EAGV;IACR;IACA,OAAO,EAAP;EACD;;EAEDC,sBAAsB,CAACC,CAAD,EAAkB,CACtC;EACD;;EAEDC,sBAAsB,GAAG;IACvBC,OAAO,CAACC,IAAR,CACE,kEADF;EAGD;;EAEDC,cAAc,CACZC,UADY,EAEZC,QAFY,EAGZC,iBAHY,EAIZC,YAJY,EAKJ;IACR,IAAI,EAAE,KAAKC,aAAL,CAAmBJ,UAAnB,KAAkCK,MAApC,CAAJ,EAAiD;MAC/C,OAAO,CAAC,CAAR;IACD;;IAED,MAAMC,MAAiB,GAAG,KAAKC,gBAAL,CAAsBP,UAAtB,EAAkCC,QAAlC,CAA1B;IACA,IAAIO,QAAJ;;IACA,IAAIR,UAAU,KAAKtB,UAAU,CAAC+B,QAA9B,EAAwC;MACtCD,QAAQ,GAAG,MAAM;QACf,MAAM,CAACE,EAAD,EAAKC,EAAL,EAASC,EAAT,EAAaC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KAAKnE,UAAU,CAACiE,SAAhB;QACE,OAAO,WAAP;;MACF,KAAKjE,UAAU,CAACqE,cAAhB;QACE,OAAO,cAAP;;MACF,KAAKrE,UAAU,CAAC+B,QAAhB;QACE,OAAO,2BAAP;IAVJ;EAYD;;AAlJwD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
+
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
3
4
|
import MutableValue from './MutableValue';
|
|
4
5
|
export default class Mapper {
|
|
5
6
|
constructor(module, mapper) {
|
|
@@ -45,6 +46,8 @@ export default class Mapper {
|
|
|
45
46
|
res.push(value);
|
|
46
47
|
} else if (Array.isArray(value)) {
|
|
47
48
|
value.forEach(v => extractMutables(v));
|
|
49
|
+
} else if (isWebDomElement(value)) {// do nothing on dom elements
|
|
50
|
+
// without this check, we get a "Maximum call size exceeded error"
|
|
48
51
|
} else if (typeof value === 'object') {
|
|
49
52
|
Object.keys(value).forEach(key => {
|
|
50
53
|
extractMutables(value[key]);
|
|
@@ -59,4 +62,22 @@ export default class Mapper {
|
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
_defineProperty(Mapper, "MAPPER_ID", 1);
|
|
65
|
+
|
|
66
|
+
function isWebDomElement(value) {
|
|
67
|
+
if (!shouldBeUseWeb()) {
|
|
68
|
+
return false;
|
|
69
|
+
} // https://stackoverflow.com/a/384380/7869175
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
function isWebNode(o) {
|
|
73
|
+
return typeof Node === 'object' ? o instanceof Node : o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isWebElement(o) {
|
|
77
|
+
return typeof HTMLElement === 'object' ? o instanceof HTMLElement // DOM2
|
|
78
|
+
: o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return isWebNode(value) || isWebElement(value);
|
|
82
|
+
}
|
|
62
83
|
//# sourceMappingURL=Mapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MutableValue","Mapper","constructor","module","mapper","inputs","outputs","id","MAPPER_ID","extractMutablesFromArray","markDirty","dirty","maybeRequestRender","forEach","input","addListener","execute","array","res","extractMutables","value","push","Array","isArray","v","Object","keys","key"],"sources":["Mapper.ts"],"sourcesContent":["import { NestedObjectValues } from '../commonTypes';\nimport { JSReanimated } from './commonTypes';\nimport MutableValue from './MutableValue';\n\nexport default class Mapper<T> {\n static MAPPER_ID = 1;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n\n dirty = true;\n\n constructor(\n module: JSReanimated,\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<T>>[] = [],\n outputs: NestedObjectValues<MutableValue<T>>[] = []\n ) {\n this.id = Mapper.MAPPER_ID++;\n this.inputs = this.extractMutablesFromArray(inputs);\n this.outputs = this.extractMutablesFromArray(outputs);\n this.mapper = mapper;\n\n const markDirty = () => {\n this.dirty = true;\n module.maybeRequestRender();\n };\n\n this.inputs.forEach((input) => {\n input.addListener(markDirty);\n });\n }\n\n execute(): void {\n this.dirty = false;\n this.mapper();\n }\n\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[] {\n const res: MutableValue<T>[] = [];\n\n function extractMutables(value: NestedObjectValues<MutableValue<T>>) {\n if (value == null) {\n // return;\n } else if (value instanceof MutableValue) {\n res.push(value);\n } else if (Array.isArray(value)) {\n value.forEach((v) => extractMutables(v));\n } else if (typeof value === 'object') {\n Object.keys(value).forEach((key) => {\n extractMutables(value[key]);\n });\n }\n }\n\n extractMutables(array);\n return res;\n }\n}\n"],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"names":["shouldBeUseWeb","MutableValue","Mapper","constructor","module","mapper","inputs","outputs","id","MAPPER_ID","extractMutablesFromArray","markDirty","dirty","maybeRequestRender","forEach","input","addListener","execute","array","res","extractMutables","value","push","Array","isArray","v","isWebDomElement","Object","keys","key","isWebNode","o","Node","nodeType","nodeName","isWebElement","HTMLElement"],"sources":["Mapper.ts"],"sourcesContent":["import { NestedObjectValues } from '../commonTypes';\nimport { shouldBeUseWeb } from '../PlatformChecker';\nimport { JSReanimated } from './commonTypes';\nimport MutableValue from './MutableValue';\n\nexport default class Mapper<T> {\n static MAPPER_ID = 1;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n\n dirty = true;\n\n constructor(\n module: JSReanimated,\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<T>>[] = [],\n outputs: NestedObjectValues<MutableValue<T>>[] = []\n ) {\n this.id = Mapper.MAPPER_ID++;\n this.inputs = this.extractMutablesFromArray(inputs);\n this.outputs = this.extractMutablesFromArray(outputs);\n this.mapper = mapper;\n\n const markDirty = () => {\n this.dirty = true;\n module.maybeRequestRender();\n };\n\n this.inputs.forEach((input) => {\n input.addListener(markDirty);\n });\n }\n\n execute(): void {\n this.dirty = false;\n this.mapper();\n }\n\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[] {\n const res: MutableValue<T>[] = [];\n\n function extractMutables(value: NestedObjectValues<MutableValue<T>>) {\n if (value == null) {\n // return;\n } else if (value instanceof MutableValue) {\n res.push(value);\n } else if (Array.isArray(value)) {\n value.forEach((v) => extractMutables(v));\n } else if (isWebDomElement(value)) {\n // do nothing on dom elements\n // without this check, we get a \"Maximum call size exceeded error\"\n } else if (typeof value === 'object') {\n Object.keys(value).forEach((key) => {\n extractMutables(value[key]);\n });\n }\n }\n\n extractMutables(array);\n return res;\n }\n}\n\nfunction isWebDomElement(value: any) {\n if (!shouldBeUseWeb()) {\n return false;\n }\n\n // https://stackoverflow.com/a/384380/7869175\n function isWebNode(o: any) {\n return typeof Node === 'object'\n ? o instanceof Node\n : o &&\n typeof o === 'object' &&\n typeof o.nodeType === 'number' &&\n typeof o.nodeName === 'string';\n }\n\n function isWebElement(o: any) {\n return typeof HTMLElement === 'object'\n ? o instanceof HTMLElement // DOM2\n : o &&\n typeof o === 'object' &&\n o !== null &&\n o.nodeType === 1 &&\n typeof o.nodeName === 'string';\n }\n\n return isWebNode(value) || isWebElement(value);\n}\n"],"mappings":";;AACA,SAASA,cAAT,QAA+B,oBAA/B;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,MAAMC,MAAN,CAAgB;EAS7BC,WAAW,CACTC,MADS,EAETC,MAFS,EAKT;IAAA,IAFAC,MAEA,uEAFgD,EAEhD;IAAA,IADAC,OACA,uEADiD,EACjD;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA,+BAPM,IAON;;IACA,KAAKC,EAAL,GAAUN,MAAM,CAACO,SAAP,EAAV;IACA,KAAKH,MAAL,GAAc,KAAKI,wBAAL,CAA8BJ,MAA9B,CAAd;IACA,KAAKC,OAAL,GAAe,KAAKG,wBAAL,CAA8BH,OAA9B,CAAf;IACA,KAAKF,MAAL,GAAcA,MAAd;;IAEA,MAAMM,SAAS,GAAG,MAAM;MACtB,KAAKC,KAAL,GAAa,IAAb;MACAR,MAAM,CAACS,kBAAP;IACD,CAHD;;IAKA,KAAKP,MAAL,CAAYQ,OAAZ,CAAqBC,KAAD,IAAW;MAC7BA,KAAK,CAACC,WAAN,CAAkBL,SAAlB;IACD,CAFD;EAGD;;EAEDM,OAAO,GAAS;IACd,KAAKL,KAAL,GAAa,KAAb;IACA,KAAKP,MAAL;EACD;;EAEDK,wBAAwB,CACtBQ,KADsB,EAEH;IACnB,MAAMC,GAAsB,GAAG,EAA/B;;IAEA,SAASC,eAAT,CAAyBC,KAAzB,EAAqE;MACnE,IAAIA,KAAK,IAAI,IAAb,EAAmB,CACjB;MACD,CAFD,MAEO,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,SAAS,CAACT,KAAD,CAAT,IAAoBc,YAAY,CAACd,KAAD,CAAvC;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["WebSensor.ts"],"sourcesContent":["export declare class WebSensor {\n start: () => void;\n stop: () => void;\n addEventListener: (eventType: string, eventHandler: () => void) => void;\n quaternion: [number, number, number, number];\n x: number;\n y: number;\n z: number;\n}\n\ntype configOptions =\n | {\n referenceFrame: string;\n frequency?: undefined;\n }\n | {\n frequency: number;\n referenceFrame?: undefined;\n };\n\ninterface Constructable<T> {\n new (config: configOptions): T;\n}\n\ndeclare global {\n interface Window {\n Accelerometer: Constructable<WebSensor>;\n GravitySensor: Constructable<WebSensor>;\n Gyroscope: Constructable<WebSensor>;\n Magnetometer: Constructable<WebSensor>;\n AbsoluteOrientationSensor: Constructable<WebSensor>;\n Sensor: Constructable<WebSensor>;\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["import { Timestamp, NestedObjectValues } from '../commonTypes';\nimport MutableValue from './MutableValue';\n\nexport interface Mapper<T> {\n MAPPER_ID?: number;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n dirty: boolean;\n execute(): void;\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[];\n}\n\nexport interface MapperRegistry<T> {\n sortedMappers: Mapper<T>[];\n mappers: Map<number, Mapper<T>>;\n _module: JSReanimated;\n updatedSinceLastExecute: boolean;\n startMapper(mapper: Mapper<T>): number;\n stopMapper(id: number): void;\n execute(): void;\n updateOrder(): void;\n}\n\nexport interface JSReanimated {\n _valueSetter?: <T>(value: T) => void;\n _renderRequested: boolean;\n _mapperRegistry: MapperRegistry<any>;\n _frames: ((timestamp: Timestamp) => void)[];\n timeProvider: { now: () => number };\n pushFrame(frame: (timestamp: Timestamp) => void): void;\n
|
|
1
|
+
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["import { Timestamp, NestedObjectValues } from '../commonTypes';\nimport MutableValue from './MutableValue';\n\nexport interface Mapper<T> {\n MAPPER_ID?: number;\n id: number;\n inputs: MutableValue<T>[];\n outputs: MutableValue<T>[];\n mapper: () => void;\n dirty: boolean;\n execute(): void;\n extractMutablesFromArray<T>(\n array: NestedObjectValues<MutableValue<T>>\n ): MutableValue<T>[];\n}\n\nexport interface MapperRegistry<T> {\n sortedMappers: Mapper<T>[];\n mappers: Map<number, Mapper<T>>;\n _module: JSReanimated;\n updatedSinceLastExecute: boolean;\n startMapper(mapper: Mapper<T>): number;\n stopMapper(id: number): void;\n execute(): void;\n updateOrder(): void;\n}\n\nexport interface JSReanimated {\n _valueSetter?: <T>(value: T) => void;\n _renderRequested: boolean;\n _mapperRegistry: MapperRegistry<any>;\n _frames: ((timestamp: Timestamp) => void)[];\n timeProvider: { now: () => number };\n pushFrame(frame: (timestamp: Timestamp) => void): void;\n maybeRequestRender(): void;\n _onRender(timestampMs: number): void;\n installCoreFunctions(valueSetter: <T>(value: T) => void): void;\n makeShareable<T>(value: T): T;\n makeMutable<T>(value: T): MutableValue<T>;\n makeRemote<T>(object: Record<string, any>): T;\n startMapper(\n mapper: () => void,\n inputs: NestedObjectValues<MutableValue<unknown>>[],\n outputs: NestedObjectValues<MutableValue<unknown>>[]\n ): number;\n stopMapper(mapperId: number): void;\n registerEventHandler<T>(_: string, __: (event: T) => void): string;\n unregisterEventHandler(_: string): void;\n enableLayoutAnimations(): void;\n}\n"],"mappings":""}
|
|
@@ -3,8 +3,6 @@ import { shouldBeUseWeb } from '../PlatformChecker';
|
|
|
3
3
|
|
|
4
4
|
const initializeGlobalsForWeb = () => {
|
|
5
5
|
if (shouldBeUseWeb()) {
|
|
6
|
-
global._frameTimestamp = null;
|
|
7
|
-
|
|
8
6
|
global._measure = () => {
|
|
9
7
|
console.warn("[Reanimated] You can't use `measure` with Chrome Debugger or with web version");
|
|
10
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldBeUseWeb","initializeGlobalsForWeb","global","
|
|
1
|
+
{"version":3,"names":["shouldBeUseWeb","initializeGlobalsForWeb","global","_measure","console","warn","x","y","width","height","pageX","pageY","_scrollTo","_dispatchCommand","_setGestureState"],"sources":["global.ts"],"sourcesContent":["// In order to keep bundle size down, we treat this file as a polyfill for Web.\n\nimport { shouldBeUseWeb } from '../PlatformChecker';\nconst initializeGlobalsForWeb = () => {\n if (shouldBeUseWeb()) {\n global._measure = () => {\n console.warn(\n \"[Reanimated] You can't use `measure` with Chrome Debugger or with web version\"\n );\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n pageX: 0,\n pageY: 0,\n };\n };\n global._scrollTo = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version\"\n );\n };\n global._dispatchCommand = () => {\n console.warn(\n \"[Reanimated] You can't use `scrollTo` or `dispatchCommand` methods with Chrome Debugger or with web version\"\n );\n };\n global._setGestureState = () => {\n console.warn(\n \"[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version\"\n );\n };\n }\n return true;\n};\n\n/*\n If a file doesn't export anything, tree shaking doesn't pack\n it into the JS bundle. In effect, the code inside of this file\n will never execute. That is why we wrapped initialization code\n into a function, and we call this one during creating\n the module export object.\n*/\n\nexport default initializeGlobalsForWeb();\n"],"mappings":"AAAA;AAEA,SAASA,cAAT,QAA+B,oBAA/B;;AACA,MAAMC,uBAAuB,GAAG,MAAM;EACpC,IAAID,cAAc,EAAlB,EAAsB;IACpBE,MAAM,CAACC,QAAP,GAAkB,MAAM;MACtBC,OAAO,CAACC,IAAR,CACE,+EADF;MAGA,OAAO;QACLC,CAAC,EAAE,CADE;QAELC,CAAC,EAAE,CAFE;QAGLC,KAAK,EAAE,CAHF;QAILC,MAAM,EAAE,CAJH;QAKLC,KAAK,EAAE,CALF;QAMLC,KAAK,EAAE;MANF,CAAP;IAQD,CAZD;;IAaAT,MAAM,CAACU,SAAP,GAAmB,MAAM;MACvBR,OAAO,CAACC,IAAR,CACE,gFADF;IAGD,CAJD;;IAKAH,MAAM,CAACW,gBAAP,GAA0B,MAAM;MAC9BT,OAAO,CAACC,IAAR,CACE,6GADF;IAGD,CAJD;;IAKAH,MAAM,CAACY,gBAAP,GAA0B,MAAM;MAC9BV,OAAO,CAACC,IAAR,CACE,uFADF;IAGD,CAJD;EAKD;;EACD,OAAO,IAAP;AACD,CAhCD;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEA,eAAeJ,uBAAuB,EAAtC"}
|
|
@@ -4,7 +4,6 @@ const reanimatedJS = new JSReanimated();
|
|
|
4
4
|
global._makeShareableClone = c => c;
|
|
5
5
|
|
|
6
6
|
global._scheduleOnJS = setImmediate;
|
|
7
|
-
global._getTimestamp = reanimatedJS.getTimestamp.bind(reanimatedJS);
|
|
8
7
|
export const _updatePropsJS = (updates, viewRef) => {
|
|
9
8
|
if (viewRef._component) {
|
|
10
9
|
const component = viewRef._component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JSReanimated","reanimatedJS","global","_makeShareableClone","c","_scheduleOnJS","setImmediate","
|
|
1
|
+
{"version":3,"names":["JSReanimated","reanimatedJS","global","_makeShareableClone","c","_scheduleOnJS","setImmediate","_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","style","previousStyle","currentStyle"],"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 = setImmediate;\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,OAAOA,YAAP,MAAyB,gBAAzB;AAGA,MAAMC,YAAY,GAAG,IAAID,YAAJ,EAArB;;AAEAE,MAAM,CAACC,mBAAP,GAA8BC,CAAD,IAAOA,CAApC;;AACAF,MAAM,CAACG,aAAP,GAAuBC,YAAvB;AAWA,OAAO,MAAMC,cAAc,GAAG,CAC5BC,OAD4B,EAE5BC,OAF4B,KAGnB;EACT,IAAIA,OAAO,CAACC,UAAZ,EAAwB;IACtB,MAAMC,SAAS,GAAGF,OAAO,CAACC,UAA1B;IACA,MAAM,CAACE,SAAD,IAAcC,MAAM,CAACC,IAAP,CAAYN,OAAZ,EAAqBO,MAArB,CAClB,CAACC,GAAD,EAAmCC,GAAnC,KAA2C;MACzC,MAAMC,KAAK,GAAGV,OAAO,CAACS,GAAD,CAArB;MACA,MAAME,KAAK,GAAG,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10 @@
|
|
|
1
|
-
|
|
1
|
+
// this is just a temporary mock
|
|
2
|
+
export let LayoutAnimationType;
|
|
3
|
+
|
|
4
|
+
(function (LayoutAnimationType) {
|
|
5
|
+
LayoutAnimationType[LayoutAnimationType["ENTERING"] = 1] = "ENTERING";
|
|
6
|
+
LayoutAnimationType[LayoutAnimationType["EXITING"] = 2] = "EXITING";
|
|
7
|
+
LayoutAnimationType[LayoutAnimationType["LAYOUT"] = 3] = "LAYOUT";
|
|
8
|
+
LayoutAnimationType[LayoutAnimationType["SHARED_ELEMENT_TRANSITION"] = 4] = "SHARED_ELEMENT_TRANSITION";
|
|
9
|
+
})(LayoutAnimationType || (LayoutAnimationType = {}));
|
|
2
10
|
//# sourceMappingURL=commonTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["import { EasingFn } from '../../Easing';\nimport { StyleProps } from '../../commonTypes';\n\nexport interface KeyframeProps extends StyleProps {\n easing?: EasingFn;\n [key: string]: any;\n}\n\nexport type LayoutAnimation = {\n initialValues: StyleProps;\n animations: StyleProps;\n callback?: (finished: boolean) => void;\n};\n\nexport type AnimationFunction = (a?: any, b?: any, c?: any) => any; // this is just a temporary mock\n\nexport interface EntryAnimationsValues {\n targetOriginX: number;\n targetOriginY: number;\n targetWidth: number;\n targetHeight: number;\n targetGlobalOriginX: number;\n targetGlobalOriginY: number;\n}\n\nexport interface ExitAnimationsValues {\n currentOriginX: number;\n currentOriginY: number;\n currentWidth: number;\n currentHeight: number;\n currentGlobalOriginX: number;\n currentGlobalOriginY: number;\n}\n\nexport type EntryExitAnimationFunction = (\n targetValues: EntryAnimationsValues | ExitAnimationsValues\n) => LayoutAnimation;\n\nexport type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;\n\nexport interface LayoutAnimationsValues {\n currentOriginX: number;\n currentOriginY: number;\n currentWidth: number;\n currentHeight: number;\n currentGlobalOriginX: number;\n currentGlobalOriginY: number;\n targetOriginX: number;\n targetOriginY: number;\n targetWidth: number;\n targetHeight: number;\n targetGlobalOriginX: number;\n targetGlobalOriginY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport type LayoutAnimationFunction = (\n targetValues: LayoutAnimationsValues\n) => LayoutAnimation;\n\nexport type LayoutAnimationStartFunction = (\n tag: number,\n type:
|
|
1
|
+
{"version":3,"names":["LayoutAnimationType"],"sources":["commonTypes.ts"],"sourcesContent":["import { EasingFn } from '../../Easing';\nimport { StyleProps } from '../../commonTypes';\n\nexport interface KeyframeProps extends StyleProps {\n easing?: EasingFn;\n [key: string]: any;\n}\n\nexport type LayoutAnimation = {\n initialValues: StyleProps;\n animations: StyleProps;\n callback?: (finished: boolean) => void;\n};\n\nexport type AnimationFunction = (a?: any, b?: any, c?: any) => any; // this is just a temporary mock\n\nexport interface EntryAnimationsValues {\n targetOriginX: number;\n targetOriginY: number;\n targetWidth: number;\n targetHeight: number;\n targetGlobalOriginX: number;\n targetGlobalOriginY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport interface ExitAnimationsValues {\n currentOriginX: number;\n currentOriginY: number;\n currentWidth: number;\n currentHeight: number;\n currentGlobalOriginX: number;\n currentGlobalOriginY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport type EntryExitAnimationFunction = (\n targetValues: EntryAnimationsValues | ExitAnimationsValues\n) => LayoutAnimation;\n\nexport type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;\n\nexport interface LayoutAnimationsValues {\n [key: string]: number;\n currentOriginX: number;\n currentOriginY: number;\n currentWidth: number;\n currentHeight: number;\n currentGlobalOriginX: number;\n currentGlobalOriginY: number;\n targetOriginX: number;\n targetOriginY: number;\n targetWidth: number;\n targetHeight: number;\n targetGlobalOriginX: number;\n targetGlobalOriginY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport enum LayoutAnimationType {\n ENTERING = 1,\n EXITING = 2,\n LAYOUT = 3,\n SHARED_ELEMENT_TRANSITION = 4,\n}\n\nexport type LayoutAnimationFunction = (\n targetValues: LayoutAnimationsValues\n) => LayoutAnimation;\n\nexport type LayoutAnimationStartFunction = (\n tag: number,\n type: LayoutAnimationType,\n yogaValues: LayoutAnimationsValues,\n config: LayoutAnimationFunction\n) => void;\n\nexport interface ILayoutAnimationBuilder {\n build: () => LayoutAnimationFunction;\n}\n\nexport interface BaseLayoutAnimationConfig {\n duration?: number;\n easing?: EasingFn;\n type?: AnimationFunction;\n damping?: number;\n mass?: number;\n stiffness?: number;\n overshootClamping?: number;\n restDisplacementThreshold?: number;\n restSpeedThreshold?: number;\n}\n\nexport interface BaseBuilderAnimationConfig extends BaseLayoutAnimationConfig {\n rotate?: number | string;\n}\n\nexport type LayoutAnimationAndConfig = [\n AnimationFunction,\n BaseBuilderAnimationConfig\n];\n\nexport interface IEntryExitAnimationBuilder {\n build: () => EntryExitAnimationFunction;\n}\n\nexport interface IEntryAnimationBuilder {\n build: () => AnimationConfigFunction<EntryAnimationsValues>;\n}\n\nexport interface IExitAnimationBuilder {\n build: () => AnimationConfigFunction<ExitAnimationsValues>;\n}\n"],"mappings":"AAcoE;AAgDpE,WAAYA,mBAAZ;;WAAYA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;GAAAA,mB,KAAAA,mB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAnimationBuilder","ComplexAnimationBuilder","Keyframe"],"sources":["index.ts"],"sourcesContent":["export { BaseAnimationBuilder } from './BaseAnimationBuilder';\nexport { ComplexAnimationBuilder } from './ComplexAnimationBuilder';\nexport { Keyframe } from './Keyframe';\nexport type {\n LayoutAnimation,\n AnimationFunction,\n EntryAnimationsValues,\n ExitAnimationsValues,\n EntryExitAnimationFunction,\n AnimationConfigFunction,\n IEntryAnimationBuilder,\n IExitAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n LayoutAnimationStartFunction,\n ILayoutAnimationBuilder,\n BaseLayoutAnimationConfig,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n IEntryExitAnimationBuilder,\n} from './commonTypes';\n"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,wBAArC;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,QAAT,QAAyB,YAAzB"}
|
|
1
|
+
{"version":3,"names":["BaseAnimationBuilder","ComplexAnimationBuilder","Keyframe","LayoutAnimationType"],"sources":["index.ts"],"sourcesContent":["export { BaseAnimationBuilder } from './BaseAnimationBuilder';\nexport { ComplexAnimationBuilder } from './ComplexAnimationBuilder';\nexport { Keyframe } from './Keyframe';\nexport { LayoutAnimationType } from './commonTypes';\nexport type {\n LayoutAnimation,\n AnimationFunction,\n EntryAnimationsValues,\n ExitAnimationsValues,\n EntryExitAnimationFunction,\n AnimationConfigFunction,\n IEntryAnimationBuilder,\n IExitAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n LayoutAnimationStartFunction,\n ILayoutAnimationBuilder,\n BaseLayoutAnimationConfig,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n IEntryExitAnimationBuilder,\n} from './commonTypes';\n"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,wBAArC;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,QAAT,QAAyB,YAAzB;AACA,SAASC,mBAAT,QAAoC,eAApC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { runOnUI } from '../core';
|
|
2
1
|
import { withStyleAnimation } from '../animation/styleAnimation';
|
|
3
2
|
import { makeUIMutable } from '../mutables';
|
|
3
|
+
import { LayoutAnimationType } from './animationBuilder';
|
|
4
|
+
import { runOnUIImmediately } from '../threads';
|
|
4
5
|
const TAG_OFFSET = 1e9;
|
|
5
6
|
|
|
6
|
-
function startObservingProgress(tag, sharedValue) {
|
|
7
|
+
function startObservingProgress(tag, sharedValue, animationType) {
|
|
7
8
|
'worklet';
|
|
8
9
|
|
|
10
|
+
const isSharedTransition = animationType === LayoutAnimationType.SHARED_ELEMENT_TRANSITION;
|
|
9
11
|
sharedValue.addListener(tag + TAG_OFFSET, () => {
|
|
10
|
-
_notifyAboutProgress(tag, sharedValue.value);
|
|
12
|
+
_notifyAboutProgress(tag, sharedValue.value, isSharedTransition);
|
|
11
13
|
});
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -29,9 +31,9 @@ function createLayoutAnimationManager() {
|
|
|
29
31
|
const style = config(yogaValues);
|
|
30
32
|
let currentAnimation = style.animations;
|
|
31
33
|
|
|
32
|
-
if (type ===
|
|
34
|
+
if (type === LayoutAnimationType.ENTERING) {
|
|
33
35
|
enteringAnimationForTag.set(tag, currentAnimation);
|
|
34
|
-
} else if (type ===
|
|
36
|
+
} else if (type === LayoutAnimationType.LAYOUT) {
|
|
35
37
|
// When layout animation is requested, but entering is still running, we merge
|
|
36
38
|
// new layout animation targets into the ongoing animation
|
|
37
39
|
const enteringAnimation = enteringAnimationForTag.get(tag);
|
|
@@ -60,21 +62,31 @@ function createLayoutAnimationManager() {
|
|
|
60
62
|
if (finished) {
|
|
61
63
|
enteringAnimationForTag.delete(tag);
|
|
62
64
|
mutableValuesForTag.delete(tag);
|
|
63
|
-
const shouldRemoveView = type ===
|
|
65
|
+
const shouldRemoveView = type === LayoutAnimationType.EXITING;
|
|
64
66
|
stopObservingProgress(tag, value, finished, shouldRemoveView);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
style.callback && style.callback(finished === undefined ? false : finished);
|
|
68
70
|
};
|
|
69
71
|
|
|
70
|
-
startObservingProgress(tag, value);
|
|
72
|
+
startObservingProgress(tag, value, type);
|
|
71
73
|
value.value = animation;
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
stop(tag) {
|
|
77
|
+
const value = mutableValuesForTag.get(tag);
|
|
78
|
+
|
|
79
|
+
if (!value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
stopObservingProgress(tag, value, true, true);
|
|
72
84
|
}
|
|
73
85
|
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
88
|
|
|
77
|
-
|
|
89
|
+
runOnUIImmediately(() => {
|
|
78
90
|
'worklet';
|
|
79
91
|
|
|
80
92
|
global.LayoutAnimationsManager = createLayoutAnimationManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["withStyleAnimation","makeUIMutable","LayoutAnimationType","runOnUIImmediately","TAG_OFFSET","startObservingProgress","tag","sharedValue","animationType","isSharedTransition","SHARED_ELEMENT_TRANSITION","addListener","_notifyAboutProgress","value","stopObservingProgress","cancelled","removeView","removeListener","_notifyAboutEnd","createLayoutAnimationManager","enteringAnimationForTag","Map","mutableValuesForTag","start","type","yogaValues","config","style","currentAnimation","animations","ENTERING","set","LAYOUT","enteringAnimation","get","undefined","initialValues","_value","animation","callback","finished","delete","shouldRemoveView","EXITING","stop","global","LayoutAnimationsManager"],"sources":["animationsManager.ts"],"sourcesContent":["import { withStyleAnimation } from '../animation/styleAnimation';\nimport { SharedValue } from '../commonTypes';\nimport { makeUIMutable } from '../mutables';\nimport {\n LayoutAnimationFunction,\n LayoutAnimationType,\n LayoutAnimationsValues,\n} from './animationBuilder';\nimport { runOnUIImmediately } from '../threads';\n\nconst TAG_OFFSET = 1e9;\n\nfunction startObservingProgress(\n tag: number,\n sharedValue: SharedValue<number>,\n animationType: LayoutAnimationType\n): void {\n 'worklet';\n const isSharedTransition =\n animationType === LayoutAnimationType.SHARED_ELEMENT_TRANSITION;\n sharedValue.addListener(tag + TAG_OFFSET, () => {\n _notifyAboutProgress(tag, sharedValue.value, isSharedTransition);\n });\n}\n\nfunction stopObservingProgress(\n tag: number,\n sharedValue: SharedValue<number>,\n cancelled: boolean,\n removeView: boolean\n): void {\n 'worklet';\n sharedValue.removeListener(tag + TAG_OFFSET);\n _notifyAboutEnd(tag, cancelled, removeView);\n}\n\nfunction createLayoutAnimationManager() {\n 'worklet';\n const enteringAnimationForTag = new Map();\n const mutableValuesForTag = new Map();\n\n return {\n start(\n tag: number,\n type: LayoutAnimationType,\n yogaValues: LayoutAnimationsValues,\n config: LayoutAnimationFunction\n ) {\n const style = config(yogaValues);\n let currentAnimation = style.animations;\n\n if (type === LayoutAnimationType.ENTERING) {\n enteringAnimationForTag.set(tag, currentAnimation);\n } else if (type === LayoutAnimationType.LAYOUT) {\n // When layout animation is requested, but entering is still running, we merge\n // new layout animation targets into the ongoing animation\n const enteringAnimation = enteringAnimationForTag.get(tag);\n if (enteringAnimation) {\n currentAnimation = { ...enteringAnimation, ...style.animations };\n }\n }\n\n let value = mutableValuesForTag.get(tag);\n if (value === undefined) {\n value = makeUIMutable(style.initialValues);\n mutableValuesForTag.set(tag, value);\n } else {\n stopObservingProgress(tag, value, false, false);\n value._value = style.initialValues;\n }\n\n // @ts-ignore The line below started failing because I added types to the method – don't have time to fix it right now\n const animation = withStyleAnimation(currentAnimation);\n\n animation.callback = (finished?: boolean) => {\n if (finished) {\n enteringAnimationForTag.delete(tag);\n mutableValuesForTag.delete(tag);\n const shouldRemoveView = type === LayoutAnimationType.EXITING;\n stopObservingProgress(tag, value, finished, shouldRemoveView);\n }\n style.callback &&\n style.callback(finished === undefined ? false : finished);\n };\n\n startObservingProgress(tag, value, type);\n value.value = animation;\n },\n stop(tag: number) {\n const value = mutableValuesForTag.get(tag);\n if (!value) {\n return;\n }\n stopObservingProgress(tag, value, true, true);\n },\n };\n}\n\nrunOnUIImmediately(() => {\n 'worklet';\n global.LayoutAnimationsManager = createLayoutAnimationManager();\n})();\n"],"mappings":"AAAA,SAASA,kBAAT,QAAmC,6BAAnC;AAEA,SAASC,aAAT,QAA8B,aAA9B;AACA,SAEEC,mBAFF,QAIO,oBAJP;AAKA,SAASC,kBAAT,QAAmC,YAAnC;AAEA,MAAMC,UAAU,GAAG,GAAnB;;AAEA,SAASC,sBAAT,CACEC,GADF,EAEEC,WAFF,EA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