react-native-reanimated 3.0.0-rc.0 → 3.0.0-rc.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 +4 -4
- package/Common/cpp/Fabric/FabricUtils.cpp +7 -2
- package/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp +32 -9
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +92 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +60 -35
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +17 -11
- package/Common/cpp/headers/Fabric/FabricUtils.h +3 -2
- package/Common/cpp/headers/Fabric/ReanimatedUIManagerBinding.h +1 -0
- package/Common/cpp/headers/Fabric/ShadowTreeCloner.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +9 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +5 -0
- package/RNReanimated.podspec +28 -6
- package/android/CMakeLists.txt +73 -53
- package/android/build.gradle +178 -34
- package/android/src/fabric/java/com/swmansion/reanimated/NativeProxy.java +25 -0
- package/android/src/main/cpp/NativeProxy.cpp +48 -13
- package/android/src/main/cpp/OnLoad.cpp +1 -0
- package/android/src/main/cpp/headers/NativeProxy.h +29 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +3 -1
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +24 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +7 -5
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +25 -0
- package/ios/REAModule.mm +1 -1
- package/ios/REANodesManager.mm +31 -8
- package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
- package/ios/native/NativeProxy.mm +19 -68
- package/ios/native/REAJSIUtils.h +66 -0
- package/ios/sensor/ReanimatedSensor.m +27 -18
- package/lib/commonjs/Animated.js +70 -0
- package/lib/commonjs/Animated.js.map +1 -0
- package/lib/commonjs/ConfigHelper.js +173 -0
- package/lib/commonjs/ConfigHelper.js.map +1 -0
- package/lib/commonjs/createAnimatedComponent.js +474 -0
- package/lib/commonjs/createAnimatedComponent.js.map +1 -0
- package/lib/commonjs/index.js +44 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.web.js +32 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/reanimated2/Bezier.js +166 -0
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -0
- package/lib/commonjs/reanimated2/Colors.js +673 -0
- package/lib/commonjs/reanimated2/Colors.js.map +1 -0
- package/lib/{reanimated2 → commonjs/reanimated2}/Easing.js +151 -83
- package/lib/commonjs/reanimated2/Easing.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeMethods.js +100 -0
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +99 -0
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +26 -0
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js +33 -0
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/commonjs/reanimated2/PropAdapters.js +68 -0
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -0
- package/lib/commonjs/reanimated2/UpdateProps.js +82 -0
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +96 -0
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +75 -0
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/decay.js +132 -0
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/delay.js +89 -0
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/index.js +82 -0
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/repeat.js +107 -0
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/sequence.js +103 -0
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/spring.js +121 -0
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +206 -0
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/timing.js +82 -0
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -0
- package/lib/commonjs/reanimated2/animation/util.js +233 -0
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -0
- package/lib/commonjs/reanimated2/commonTypes.js +17 -0
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/component/FlatList.js +53 -0
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Image.js +17 -0
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js +17 -0
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/commonjs/reanimated2/component/Text.js +17 -0
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -0
- package/lib/commonjs/reanimated2/component/View.js +17 -0
- package/lib/commonjs/reanimated2/component/View.js.map +1 -0
- package/lib/commonjs/reanimated2/core.js +360 -0
- package/lib/commonjs/reanimated2/core.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.js +27 -0
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js +21 -0
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +55 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +64 -0
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/commonjs/reanimated2/globals.d.js +6 -0
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js +35 -0
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/index.js +118 -0
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +66 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +48 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +44 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +43 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +62 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +94 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +471 -0
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +49 -0
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +36 -0
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +30 -0
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/commonjs/reanimated2/hook/utils.js +247 -0
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -0
- package/lib/commonjs/reanimated2/index.js +162 -0
- package/lib/commonjs/reanimated2/index.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolateColor.js +154 -0
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -0
- package/lib/commonjs/reanimated2/interpolation.js +143 -0
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -0
- package/lib/commonjs/reanimated2/jestUtils.js +239 -0
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +160 -0
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +74 -0
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +146 -0
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js +57 -0
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js +97 -0
- package/lib/commonjs/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +100 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +203 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +244 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +6 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +30 -0
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +570 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js +55 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +409 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +559 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +221 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +101 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +189 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +403 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +298 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +167 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +700 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +136 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +120 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +180 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +66 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +64 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +52 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +68 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +84 -0
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +47 -0
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/commonjs/reanimated2/mock.js +88 -0
- package/lib/commonjs/reanimated2/mock.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +16 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/{reanimated2 → commonjs/reanimated2}/platform-specific/RNRenderer.web.js +2 -0
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/reanimated2/utils.js +19 -0
- package/lib/commonjs/reanimated2/utils.js.map +1 -0
- package/lib/commonjs/setAndForwardRef.js +63 -0
- package/lib/commonjs/setAndForwardRef.js.map +1 -0
- package/lib/module/Animated.js +8 -0
- package/lib/module/Animated.js.map +1 -0
- package/lib/module/ConfigHelper.js +161 -0
- package/lib/module/ConfigHelper.js.map +1 -0
- package/lib/module/createAnimatedComponent.js +452 -0
- package/lib/module/createAnimatedComponent.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +6 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/reanimated2/Bezier.js +159 -0
- package/lib/module/reanimated2/Bezier.js.map +1 -0
- package/lib/module/reanimated2/Colors.js +632 -0
- package/lib/module/reanimated2/Colors.js.map +1 -0
- package/lib/{types/reanimated2/Easing.d.ts → module/reanimated2/Easing.js} +179 -40
- package/lib/module/reanimated2/Easing.js.map +1 -0
- package/lib/module/reanimated2/NativeMethods.js +82 -0
- package/lib/module/reanimated2/NativeMethods.js.map +1 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +89 -0
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/NativeReanimated/index.js +6 -4
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -0
- package/lib/module/reanimated2/PlatformChecker.js +17 -0
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -0
- package/lib/module/reanimated2/PropAdapters.js +56 -0
- package/lib/module/reanimated2/PropAdapters.js.map +1 -0
- package/lib/module/reanimated2/UpdateProps.js +64 -0
- package/lib/module/reanimated2/UpdateProps.js.map +1 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js +83 -0
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -0
- package/lib/module/reanimated2/WorkletEventHandler.js +64 -0
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -0
- package/lib/module/reanimated2/animation/commonTypes.js +2 -0
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/animation/decay.js +123 -0
- package/lib/module/reanimated2/animation/decay.js.map +1 -0
- package/lib/module/reanimated2/animation/delay.js +79 -0
- package/lib/module/reanimated2/animation/delay.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/animation/index.js +1 -0
- package/lib/module/reanimated2/animation/index.js.map +1 -0
- package/lib/module/reanimated2/animation/repeat.js +95 -0
- package/lib/module/reanimated2/animation/repeat.js.map +1 -0
- package/lib/module/reanimated2/animation/sequence.js +93 -0
- package/lib/module/reanimated2/animation/sequence.js.map +1 -0
- package/lib/module/reanimated2/animation/spring.js +113 -0
- package/lib/module/reanimated2/animation/spring.js.map +1 -0
- package/lib/module/reanimated2/animation/styleAnimation.js +191 -0
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -0
- package/lib/module/reanimated2/animation/timing.js +73 -0
- package/lib/module/reanimated2/animation/timing.js.map +1 -0
- package/lib/module/reanimated2/animation/util.js +216 -0
- package/lib/module/reanimated2/animation/util.js.map +1 -0
- package/lib/module/reanimated2/commonTypes.js +10 -0
- package/lib/module/reanimated2/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/component/FlatList.js +33 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -0
- package/lib/module/reanimated2/component/Image.js +5 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +5 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -0
- package/lib/module/reanimated2/component/Text.js +5 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -0
- package/lib/module/reanimated2/component/View.js +5 -0
- package/lib/module/reanimated2/component/View.js.map +1 -0
- package/lib/module/reanimated2/core.js +314 -0
- package/lib/module/reanimated2/core.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.js +18 -0
- package/lib/module/reanimated2/fabricUtils.js.map +1 -0
- package/lib/module/reanimated2/fabricUtils.web.js +12 -0
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +44 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +55 -0
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -0
- package/lib/module/reanimated2/globals.d.js +2 -0
- package/lib/module/reanimated2/globals.d.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/hook/Hooks.js +4 -3
- package/lib/module/reanimated2/hook/Hooks.js.map +1 -0
- package/lib/module/reanimated2/hook/commonTypes.js +2 -0
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/hook/index.js +12 -0
- package/lib/module/reanimated2/hook/index.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +56 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +34 -0
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +35 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js +32 -0
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +54 -0
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +79 -0
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +450 -0
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js +39 -0
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js +24 -0
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -0
- package/lib/module/reanimated2/hook/useSharedValue.js +20 -0
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -0
- package/lib/module/reanimated2/hook/utils.js +208 -0
- package/lib/module/reanimated2/hook/utils.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/index.js +1 -0
- package/lib/module/reanimated2/index.js.map +1 -0
- package/lib/module/reanimated2/interpolateColor.js +135 -0
- package/lib/module/reanimated2/interpolateColor.js.map +1 -0
- package/lib/module/reanimated2/interpolation.js +135 -0
- package/lib/module/reanimated2/interpolation.js.map +1 -0
- package/lib/module/reanimated2/jestUtils.js +217 -0
- package/lib/module/reanimated2/jestUtils.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +144 -0
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js +62 -0
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +137 -0
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +48 -0
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js +2 -0
- package/lib/module/reanimated2/js-reanimated/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/global.js +48 -0
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -0
- package/lib/module/reanimated2/js-reanimated/index.js +43 -0
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js +91 -0
- package/lib/module/reanimated2/layoutReanimation/LayoutAnimationRepository.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +90 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +192 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +233 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +2 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/animationBuilder/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +530 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js +40 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Default.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +516 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +199 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +88 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +168 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +372 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +265 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +148 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +643 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/defaultAnimations/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +108 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +166 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +55 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +52 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +41 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +57 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/defaultTransitions/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/layoutReanimation/index.js +1 -0
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -0
- package/lib/module/reanimated2/mock.js +86 -0
- package/lib/module/reanimated2/mock.js.map +1 -0
- package/lib/{reanimated2 → module/reanimated2}/platform-specific/RNRenderer.js +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js +3 -0
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -0
- package/lib/module/reanimated2/utils.js +11 -0
- package/lib/module/reanimated2/utils.js.map +1 -0
- package/lib/{types/setAndForwardRef.d.ts → module/setAndForwardRef.js} +21 -6
- package/lib/module/setAndForwardRef.js.map +1 -0
- package/mock.js +1 -0
- package/package.json +28 -21
- package/plugin.js +7 -6
- package/src/Animated.ts +11 -0
- package/src/index.ts +13 -0
- package/src/index.web.ts +5 -0
- package/src/reanimated2/Colors.ts +1 -1
- package/src/reanimated2/NativeMethods.ts +5 -0
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +10 -1
- package/src/reanimated2/animation/decay.ts +79 -30
- package/src/reanimated2/animation/index.ts +7 -4
- package/src/reanimated2/animation/sequence.ts +0 -5
- package/src/reanimated2/animation/util.ts +8 -1
- package/src/reanimated2/commonTypes.ts +13 -0
- package/src/reanimated2/component/FlatList.tsx +25 -21
- package/src/reanimated2/component/Image.ts +6 -0
- package/src/reanimated2/component/ScrollView.ts +6 -0
- package/src/reanimated2/component/Text.ts +6 -0
- package/src/reanimated2/component/View.ts +6 -0
- package/src/reanimated2/core.ts +8 -13
- package/src/reanimated2/fabricUtils.web.ts +19 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
- package/src/reanimated2/globals.d.ts +3 -0
- package/src/reanimated2/hook/index.ts +14 -14
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
- package/src/reanimated2/hook/useFrameCallback.ts +39 -0
- package/src/reanimated2/jestUtils.ts +11 -3
- package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
- package/src/reanimated2/js-reanimated/global.ts +50 -0
- package/src/reanimated2/js-reanimated/index.ts +0 -36
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -1
- package/src/reanimated2/mock.ts +6 -0
- package/android/local.properties +0 -1
- package/lib/Animated.js +0 -18
- package/lib/ConfigHelper.js +0 -145
- package/lib/ReanimatedEventEmitter.js +0 -3
- package/lib/ReanimatedModule.js +0 -2
- package/lib/ReanimatedModule.macos.js +0 -2
- package/lib/ReanimatedModule.native.js +0 -12
- package/lib/ReanimatedModule.windows.js +0 -2
- package/lib/ReanimatedModuleCompat.js +0 -66
- package/lib/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/lib/__mocks__/ReanimatedModule.native.js +0 -11
- package/lib/createAnimatedComponent.js +0 -375
- package/lib/index.js +0 -18
- package/lib/reanimated2/Bezier.js +0 -126
- package/lib/reanimated2/Colors.js +0 -522
- package/lib/reanimated2/NativeMethods.js +0 -59
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +0 -50
- package/lib/reanimated2/PlatformChecker.js +0 -16
- package/lib/reanimated2/PropAdapters.js +0 -55
- package/lib/reanimated2/UpdateProps.js +0 -70
- package/lib/reanimated2/ViewDescriptorsSet.js +0 -75
- package/lib/reanimated2/WorkletEventHandler.js +0 -37
- package/lib/reanimated2/__mocks__/MutableValue.js +0 -13
- package/lib/reanimated2/__mocks__/NativeReanimated.js +0 -20
- package/lib/reanimated2/__mocks__/NativeReanimated.native.js +0 -20
- package/lib/reanimated2/animation/commonTypes.js +0 -1
- package/lib/reanimated2/animation/decay.js +0 -71
- package/lib/reanimated2/animation/delay.js +0 -64
- package/lib/reanimated2/animation/repeat.js +0 -69
- package/lib/reanimated2/animation/sequence.js +0 -72
- package/lib/reanimated2/animation/spring.js +0 -103
- package/lib/reanimated2/animation/styleAnimation.js +0 -171
- package/lib/reanimated2/animation/timing.js +0 -64
- package/lib/reanimated2/animation/util.js +0 -180
- package/lib/reanimated2/commonTypes.js +0 -1
- package/lib/reanimated2/component/FlatList.js +0 -30
- package/lib/reanimated2/component/WrappedComponents.js +0 -9
- package/lib/reanimated2/component/index.js +0 -4
- package/lib/reanimated2/core.js +0 -276
- package/lib/reanimated2/fabricUtils.js +0 -18
- package/lib/reanimated2/globals.d.ts +0 -76
- package/lib/reanimated2/hook/commonTypes.js +0 -1
- package/lib/reanimated2/hook/index.js +0 -9
- package/lib/reanimated2/hook/useAnimatedGestureHandler.js +0 -49
- package/lib/reanimated2/hook/useAnimatedReaction.js +0 -37
- package/lib/reanimated2/hook/useAnimatedRef.js +0 -29
- package/lib/reanimated2/hook/useAnimatedScrollHandler.js +0 -41
- package/lib/reanimated2/hook/useAnimatedSensor.js +0 -66
- package/lib/reanimated2/hook/useAnimatedStyle.js +0 -393
- package/lib/reanimated2/hook/useDerivedValue.js +0 -36
- package/lib/reanimated2/hook/useSharedValue.js +0 -17
- package/lib/reanimated2/hook/utils.js +0 -173
- package/lib/reanimated2/interpolateColor.js +0 -101
- package/lib/reanimated2/interpolation.js +0 -112
- package/lib/reanimated2/jestUtils.js +0 -160
- package/lib/reanimated2/js-reanimated/JSReanimated.js +0 -99
- package/lib/reanimated2/js-reanimated/Mapper.js +0 -43
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +0 -101
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -29
- package/lib/reanimated2/js-reanimated/commonTypes.js +0 -1
- package/lib/reanimated2/js-reanimated/index.js +0 -62
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +0 -67
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -69
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -133
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +0 -194
- package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +0 -1
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +0 -376
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +0 -275
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +0 -385
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +0 -138
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +0 -81
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +0 -115
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +0 -273
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +0 -203
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +0 -101
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +0 -451
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -90
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +0 -132
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +0 -37
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -41
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +0 -34
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -46
- package/lib/reanimated2/mock.js +0 -69
- package/lib/reanimated2/utils.js +0 -9
- package/lib/setAndForwardRef.js +0 -19
- package/lib/types/ConfigHelper.d.ts +0 -12
- package/lib/types/ReanimatedEventEmitter.d.ts +0 -3
- package/lib/types/ReanimatedModule.d.ts +0 -2
- package/lib/types/ReanimatedModule.macos.d.ts +0 -2
- package/lib/types/ReanimatedModule.native.d.ts +0 -2
- package/lib/types/ReanimatedModule.windows.d.ts +0 -2
- package/lib/types/ReanimatedModuleCompat.d.ts +0 -14
- package/lib/types/createAnimatedComponent.d.ts +0 -33
- package/lib/types/reanimated2/Bezier.d.ts +0 -6
- package/lib/types/reanimated2/Colors.d.ts +0 -31
- package/lib/types/reanimated2/NativeMethods.d.ts +0 -15
- package/lib/types/reanimated2/NativeReanimated/NativeReanimated.d.ts +0 -20
- package/lib/types/reanimated2/NativeReanimated/index.d.ts +0 -3
- package/lib/types/reanimated2/PlatformChecker.d.ts +0 -5
- package/lib/types/reanimated2/PropAdapters.d.ts +0 -4
- package/lib/types/reanimated2/UpdateProps.d.ts +0 -9
- package/lib/types/reanimated2/ViewDescriptorsSet.d.ts +0 -20
- package/lib/types/reanimated2/WorkletEventHandler.d.ts +0 -13
- package/lib/types/reanimated2/__mocks__/MutableValue.d.ts +0 -5
- package/lib/types/reanimated2/__mocks__/NativeReanimated.d.ts +0 -13
- package/lib/types/reanimated2/__mocks__/NativeReanimated.native.d.ts +0 -13
- package/lib/types/reanimated2/animation/commonTypes.d.ts +0 -27
- package/lib/types/reanimated2/animation/decay.d.ts +0 -19
- package/lib/types/reanimated2/animation/delay.d.ts +0 -7
- package/lib/types/reanimated2/animation/index.d.ts +0 -9
- package/lib/types/reanimated2/animation/repeat.d.ts +0 -12
- package/lib/types/reanimated2/animation/sequence.d.ts +0 -7
- package/lib/types/reanimated2/animation/spring.d.ts +0 -22
- package/lib/types/reanimated2/animation/styleAnimation.d.ts +0 -7
- package/lib/types/reanimated2/animation/timing.d.ts +0 -21
- package/lib/types/reanimated2/animation/util.d.ts +0 -9
- package/lib/types/reanimated2/commonTypes.d.ts +0 -80
- package/lib/types/reanimated2/component/FlatList.d.ts +0 -9
- package/lib/types/reanimated2/component/WrappedComponents.d.ts +0 -8
- package/lib/types/reanimated2/component/index.d.ts +0 -9
- package/lib/types/reanimated2/core.d.ts +0 -24
- package/lib/types/reanimated2/fabricUtils.d.ts +0 -4
- package/lib/types/reanimated2/hook/Hooks.d.ts +0 -5
- package/lib/types/reanimated2/hook/commonTypes.d.ts +0 -15
- package/lib/types/reanimated2/hook/index.d.ts +0 -10
- package/lib/types/reanimated2/hook/useAnimatedGestureHandler.d.ts +0 -35
- package/lib/types/reanimated2/hook/useAnimatedReaction.d.ts +0 -12
- package/lib/types/reanimated2/hook/useAnimatedRef.d.ts +0 -3
- package/lib/types/reanimated2/hook/useAnimatedScrollHandler.d.ts +0 -21
- package/lib/types/reanimated2/hook/useAnimatedSensor.d.ts +0 -18
- package/lib/types/reanimated2/hook/useAnimatedStyle.d.ts +0 -11
- package/lib/types/reanimated2/hook/useDerivedValue.d.ts +0 -4
- package/lib/types/reanimated2/hook/useSharedValue.d.ts +0 -2
- package/lib/types/reanimated2/hook/utils.d.ts +0 -28
- package/lib/types/reanimated2/index.d.ts +0 -12
- package/lib/types/reanimated2/interpolateColor.d.ts +0 -31
- package/lib/types/reanimated2/interpolation.d.ts +0 -11
- package/lib/types/reanimated2/jestUtils.d.ts +0 -12
- package/lib/types/reanimated2/js-reanimated/JSReanimated.d.ts +0 -30
- package/lib/types/reanimated2/js-reanimated/Mapper.d.ts +0 -14
- package/lib/types/reanimated2/js-reanimated/MapperRegistry.d.ts +0 -14
- package/lib/types/reanimated2/js-reanimated/MutableValue.d.ts +0 -14
- package/lib/types/reanimated2/js-reanimated/commonTypes.d.ts +0 -44
- package/lib/types/reanimated2/js-reanimated/index.d.ts +0 -15
- package/lib/types/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +0 -1
- package/lib/types/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -22
- package/lib/types/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -38
- package/lib/types/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -25
- package/lib/types/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -77
- package/lib/types/reanimated2/layoutReanimation/animationBuilder/index.d.ts +0 -4
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -62
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +0 -4
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +0 -42
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +0 -50
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -18
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -10
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +0 -18
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -34
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +0 -34
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -18
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -66
- package/lib/types/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +0 -10
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -19
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -13
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -6
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -6
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -7
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -9
- package/lib/types/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +0 -6
- package/lib/types/reanimated2/layoutReanimation/index.d.ts +0 -4
- package/lib/types/reanimated2/mock.d.ts +0 -55
- package/lib/types/reanimated2/platform-specific/RNRenderer.d.ts +0 -1
- package/lib/types/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/reanimated2/utils.d.ts +0 -7
- package/react-native-reanimated.d.ts +0 -1187
- package/src/Animated.js +0 -18
- package/src/ReanimatedEventEmitter.ts +0 -4
- package/src/ReanimatedModule.macos.ts +0 -3
- package/src/ReanimatedModule.native.ts +0 -13
- package/src/ReanimatedModule.ts +0 -3
- package/src/ReanimatedModule.windows.ts +0 -3
- package/src/ReanimatedModuleCompat.ts +0 -51
- package/src/__mocks__/ReanimatedEventEmitter.js +0 -8
- package/src/__mocks__/ReanimatedModule.native.js +0 -11
- package/src/reanimated2/__mocks__/MutableValue.ts +0 -15
- package/src/reanimated2/__mocks__/NativeReanimated.ts +0 -23
- package/src/reanimated2/component/WrappedComponents.ts +0 -11
- package/src/reanimated2/component/index.ts +0 -9
|
@@ -35,10 +35,10 @@ jsi::Value AnimatedSensorModule::registerSensor(
|
|
|
35
35
|
setter = [&, mutableObject](double newValues[]) {
|
|
36
36
|
jsi::Runtime &runtime = *runtimeManager_->runtime.get();
|
|
37
37
|
jsi::Object value(runtime);
|
|
38
|
-
value.setProperty(runtime, "
|
|
39
|
-
value.setProperty(runtime, "
|
|
40
|
-
value.setProperty(runtime, "
|
|
41
|
-
value.setProperty(runtime, "
|
|
38
|
+
value.setProperty(runtime, "qx", newValues[0]);
|
|
39
|
+
value.setProperty(runtime, "qy", newValues[1]);
|
|
40
|
+
value.setProperty(runtime, "qz", newValues[2]);
|
|
41
|
+
value.setProperty(runtime, "qw", newValues[3]);
|
|
42
42
|
value.setProperty(runtime, "yaw", newValues[4]);
|
|
43
43
|
value.setProperty(runtime, "pitch", newValues[5]);
|
|
44
44
|
value.setProperty(runtime, "roll", newValues[6]);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
2
|
|
|
3
|
+
#if RNVERSION < 69
|
|
4
|
+
#error \
|
|
5
|
+
"Reanimated 3 does not support React Native 0.68.x when Fabric is enabled. Please upgrade to React Native 0.69.0 or newer if you want to use Reanimated with the new architecture."
|
|
6
|
+
#endif
|
|
7
|
+
|
|
3
8
|
#include "FabricUtils.h"
|
|
4
9
|
|
|
5
10
|
#include <react/renderer/uimanager/UIManagerBinding.h>
|
|
@@ -84,10 +89,10 @@ LayoutMetrics UIManager_getRelativeLayoutMetrics(
|
|
|
84
89
|
shadowNode.getFamily(), *layoutableAncestorShadowNode, policy);
|
|
85
90
|
}
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
ShadowNode::Shared UIManager_cloneNode(
|
|
88
93
|
const UIManager *uiManager,
|
|
89
94
|
const ShadowNode::Shared &shadowNode,
|
|
90
|
-
const
|
|
95
|
+
const ShadowNode::SharedListOfShared &children,
|
|
91
96
|
const RawProps *rawProps) {
|
|
92
97
|
auto delegate_ = getDelegateFromUIManager(uiManager);
|
|
93
98
|
auto contextContainer_ = getContextContainerFromUIManager(uiManager);
|
|
@@ -17,31 +17,54 @@ void ReanimatedUIManagerBinding::createAndInstallIfNeeded(
|
|
|
17
17
|
&newestShadowNodesRegistry) {
|
|
18
18
|
// adapted from UIManagerBinding.cpp
|
|
19
19
|
auto uiManagerModuleName = "nativeFabricUIManager";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
auto eventHandler = [&]() -> std::unique_ptr<EventHandler const> {
|
|
22
|
+
auto uiManagerValue =
|
|
23
|
+
runtime.global().getProperty(runtime, uiManagerModuleName);
|
|
24
|
+
if (uiManagerValue.isUndefined()) {
|
|
25
|
+
return nullptr;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
auto uiManagerBinding =
|
|
29
|
+
uiManagerValue.asObject(runtime).asHostObject<UIManagerBinding>(
|
|
30
|
+
runtime);
|
|
31
|
+
auto uiManagerBindingPublic =
|
|
32
|
+
reinterpret_cast<UIManagerBindingPublic *>(&*uiManagerBinding);
|
|
33
|
+
return std::move(uiManagerBindingPublic->eventHandler_);
|
|
34
|
+
}();
|
|
35
|
+
|
|
36
|
+
auto reanimatedUiManagerBinding =
|
|
37
|
+
std::make_shared<ReanimatedUIManagerBinding>(
|
|
38
|
+
uiManager,
|
|
39
|
+
runtimeExecutor,
|
|
40
|
+
std::move(eventHandler),
|
|
41
|
+
newestShadowNodesRegistry);
|
|
42
|
+
auto object =
|
|
43
|
+
jsi::Object::createFromHostObject(runtime, reanimatedUiManagerBinding);
|
|
23
44
|
runtime.global().setProperty(runtime, uiManagerModuleName, std::move(object));
|
|
24
45
|
}
|
|
25
46
|
|
|
26
47
|
ReanimatedUIManagerBinding::ReanimatedUIManagerBinding(
|
|
27
48
|
std::shared_ptr<UIManager> uiManager,
|
|
28
49
|
RuntimeExecutor runtimeExecutor,
|
|
50
|
+
std::unique_ptr<EventHandler const> eventHandler,
|
|
29
51
|
std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry)
|
|
30
52
|
: UIManagerBinding(uiManager, runtimeExecutor),
|
|
31
53
|
uiManager_(std::move(uiManager)),
|
|
32
|
-
newestShadowNodesRegistry_(newestShadowNodesRegistry) {
|
|
54
|
+
newestShadowNodesRegistry_(newestShadowNodesRegistry) {
|
|
55
|
+
if (eventHandler != nullptr) {
|
|
56
|
+
reinterpret_cast<UIManagerBindingPublic *>(this)->eventHandler_ =
|
|
57
|
+
std::move(eventHandler);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
33
60
|
|
|
34
61
|
ReanimatedUIManagerBinding::~ReanimatedUIManagerBinding() {}
|
|
35
62
|
|
|
36
|
-
void ReanimatedUIManagerBinding::invalidate() const {
|
|
37
|
-
uiManager_->setDelegate(nullptr);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
63
|
static inline ShadowNode::Shared cloneNode(
|
|
41
64
|
UIManager *uiManager,
|
|
42
65
|
NewestShadowNodesRegistry *newestShadowNodesRegistry,
|
|
43
66
|
const ShadowNode::Shared &shadowNode,
|
|
44
|
-
const
|
|
67
|
+
const ShadowNode::SharedListOfShared &children = nullptr,
|
|
45
68
|
const RawProps *rawProps = nullptr) {
|
|
46
69
|
{
|
|
47
70
|
auto lock = newestShadowNodesRegistry->createLock();
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#include "ShadowTreeCloner.h"
|
|
4
|
+
#include "FabricUtils.h"
|
|
5
|
+
|
|
6
|
+
namespace reanimated {
|
|
7
|
+
|
|
8
|
+
ShadowTreeCloner::ShadowTreeCloner(
|
|
9
|
+
std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry,
|
|
10
|
+
std::shared_ptr<UIManager> uiManager,
|
|
11
|
+
SurfaceId surfaceId)
|
|
12
|
+
: newestShadowNodesRegistry_{newestShadowNodesRegistry},
|
|
13
|
+
propsParserContext_{
|
|
14
|
+
surfaceId,
|
|
15
|
+
*getContextContainerFromUIManager(&*uiManager)} {}
|
|
16
|
+
|
|
17
|
+
ShadowTreeCloner::~ShadowTreeCloner() {
|
|
18
|
+
#ifdef DEBUG
|
|
19
|
+
react_native_assert(
|
|
20
|
+
yogaChildrenUpdates_.empty() &&
|
|
21
|
+
"Deallocating `ShadowTreeCloner` without calling `updateYogaChildren`.");
|
|
22
|
+
#endif
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ShadowNode::Unshared ShadowTreeCloner::cloneWithNewProps(
|
|
26
|
+
const ShadowNode::Shared &oldRootNode,
|
|
27
|
+
const ShadowNodeFamily &family,
|
|
28
|
+
RawProps &&rawProps) {
|
|
29
|
+
// adapted from ShadowNode::cloneTree
|
|
30
|
+
|
|
31
|
+
auto ancestors = family.getAncestors(*oldRootNode);
|
|
32
|
+
|
|
33
|
+
if (ancestors.empty()) {
|
|
34
|
+
return ShadowNode::Unshared{nullptr};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
auto &parent = ancestors.back();
|
|
38
|
+
auto &oldShadowNode = parent.first.get().getChildren().at(parent.second);
|
|
39
|
+
|
|
40
|
+
const auto newest = newestShadowNodesRegistry_->get(oldShadowNode->getTag());
|
|
41
|
+
|
|
42
|
+
const auto &source = newest == nullptr ? oldShadowNode : newest;
|
|
43
|
+
|
|
44
|
+
const auto props = source->getComponentDescriptor().cloneProps(
|
|
45
|
+
propsParserContext_, source->getProps(), rawProps);
|
|
46
|
+
|
|
47
|
+
auto newChildNode = source->clone({/* .props = */ props});
|
|
48
|
+
|
|
49
|
+
for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
|
|
50
|
+
auto &parentNode = it->first.get();
|
|
51
|
+
auto childIndex = it->second;
|
|
52
|
+
|
|
53
|
+
auto children = parentNode.getChildren();
|
|
54
|
+
const auto &oldChildNode = *children.at(childIndex);
|
|
55
|
+
react_native_assert(ShadowNode::sameFamily(oldChildNode, *newChildNode));
|
|
56
|
+
|
|
57
|
+
newestShadowNodesRegistry_->set(newChildNode, parentNode.getTag());
|
|
58
|
+
|
|
59
|
+
if (!parentNode.getSealed()) {
|
|
60
|
+
// Optimization: if a ShadowNode is unsealed, we can directly update its
|
|
61
|
+
// children instead of cloning the whole path to the root node.
|
|
62
|
+
auto &parentNodeNonConst = const_cast<ShadowNode &>(parentNode);
|
|
63
|
+
parentNodeNonConst.replaceChild(oldChildNode, newChildNode, childIndex);
|
|
64
|
+
yogaChildrenUpdates_.insert(&parentNodeNonConst);
|
|
65
|
+
return std::const_pointer_cast<ShadowNode>(oldRootNode);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
children[childIndex] = newChildNode;
|
|
69
|
+
|
|
70
|
+
newChildNode = parentNode.clone({
|
|
71
|
+
ShadowNodeFragment::propsPlaceholder(),
|
|
72
|
+
std::make_shared<ShadowNode::ListOfShared>(children),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return std::const_pointer_cast<ShadowNode>(newChildNode);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
void ShadowTreeCloner::updateYogaChildren() {
|
|
80
|
+
// Unfortunately, `replaceChild` does not update Yoga nodes, so we need to
|
|
81
|
+
// update them manually here.
|
|
82
|
+
for (ShadowNode *shadowNode : yogaChildrenUpdates_) {
|
|
83
|
+
static_cast<YogaLayoutableShadowNode *>(shadowNode)->updateYogaChildren();
|
|
84
|
+
}
|
|
85
|
+
#ifdef DEBUG
|
|
86
|
+
yogaChildrenUpdates_.clear();
|
|
87
|
+
#endif
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
} // namespace reanimated
|
|
91
|
+
|
|
92
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include "FabricUtils.h"
|
|
14
14
|
#include "NewestShadowNodesRegistry.h"
|
|
15
15
|
#include "ReanimatedUIManagerBinding.h"
|
|
16
|
+
#include "ShadowTreeCloner.h"
|
|
16
17
|
#endif
|
|
17
18
|
|
|
18
19
|
#include "EventHandlerRegistry.h"
|
|
@@ -163,6 +164,10 @@ NativeReanimatedModule::NativeReanimatedModule(
|
|
|
163
164
|
#else
|
|
164
165
|
updatePropsFunction = platformDepMethodsHolder.updatePropsFunction;
|
|
165
166
|
#endif
|
|
167
|
+
subscribeForKeyboardEventsFunction =
|
|
168
|
+
platformDepMethodsHolder.subscribeForKeyboardEvents;
|
|
169
|
+
unsubscribeFromKeyboardEventsFunction =
|
|
170
|
+
platformDepMethodsHolder.unsubscribeFromKeyboardEvents;
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
void NativeReanimatedModule::installCoreFunctions(
|
|
@@ -503,56 +508,42 @@ void NativeReanimatedModule::performOperations() {
|
|
|
503
508
|
|
|
504
509
|
react_native_assert(uiManager_ != nullptr);
|
|
505
510
|
const auto &shadowTreeRegistry = uiManager_->getShadowTreeRegistry();
|
|
506
|
-
auto contextContainer = getContextContainerFromUIManager(
|
|
507
|
-
&*uiManager_); // TODO: use Scheduler::getContextContainer
|
|
508
|
-
PropsParserContext propsParserContext{surfaceId_, *contextContainer};
|
|
509
511
|
jsi::Runtime &rt = *runtime.get();
|
|
510
512
|
|
|
511
513
|
shadowTreeRegistry.visit(surfaceId_, [&](ShadowTree const &shadowTree) {
|
|
512
514
|
shadowTree.commit([&](RootShadowNode const &oldRootShadowNode) {
|
|
513
|
-
// lock once due to performance reasons
|
|
514
|
-
auto lock = newestShadowNodesRegistry_->createLock();
|
|
515
|
-
|
|
516
515
|
auto rootNode = oldRootShadowNode.ShadowNode::clone(ShadowNodeFragment{});
|
|
517
516
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
react_native_assert(family.getSurfaceId() == surfaceId_);
|
|
521
|
-
|
|
522
|
-
auto newRootNode =
|
|
523
|
-
rootNode->cloneTree(family, [&](ShadowNode const &oldShadowNode) {
|
|
524
|
-
const auto newest =
|
|
525
|
-
newestShadowNodesRegistry_->get(oldShadowNode.getTag());
|
|
517
|
+
ShadowTreeCloner shadowTreeCloner{
|
|
518
|
+
newestShadowNodesRegistry_, uiManager_, surfaceId_};
|
|
526
519
|
|
|
527
|
-
|
|
520
|
+
{
|
|
521
|
+
// lock once due to performance reasons
|
|
522
|
+
auto lock = newestShadowNodesRegistry_->createLock();
|
|
528
523
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
RawProps(rt, *pair.second));
|
|
524
|
+
for (const auto &pair : copiedOperationsQueue) {
|
|
525
|
+
const ShadowNodeFamily &family = pair.first->getFamily();
|
|
526
|
+
react_native_assert(family.getSurfaceId() == surfaceId_);
|
|
533
527
|
|
|
534
|
-
|
|
535
|
-
|
|
528
|
+
auto newRootNode = shadowTreeCloner.cloneWithNewProps(
|
|
529
|
+
rootNode, family, RawProps(rt, *pair.second));
|
|
536
530
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
531
|
+
if (newRootNode == nullptr) {
|
|
532
|
+
// this happens when React removed the component but Reanimated
|
|
533
|
+
// still tries to animate it, let's skip update for this specific
|
|
534
|
+
// component
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
rootNode = newRootNode;
|
|
541
538
|
}
|
|
542
|
-
rootNode = newRootNode;
|
|
543
539
|
|
|
544
|
-
|
|
545
|
-
for (
|
|
546
|
-
|
|
547
|
-
const auto &child = parent.getChildren().at(pair.second);
|
|
548
|
-
newestShadowNodesRegistry_->set(child, parent.getTag());
|
|
540
|
+
// remove ShadowNodes and its ancestors from NewestShadowNodesRegistry
|
|
541
|
+
for (auto tag : copiedTagsToRemove) {
|
|
542
|
+
newestShadowNodesRegistry_->remove(tag);
|
|
549
543
|
}
|
|
550
544
|
}
|
|
551
545
|
|
|
552
|
-
|
|
553
|
-
for (auto tag : copiedTagsToRemove) {
|
|
554
|
-
newestShadowNodesRegistry_->remove(tag);
|
|
555
|
-
}
|
|
546
|
+
shadowTreeCloner.updateYogaChildren();
|
|
556
547
|
|
|
557
548
|
return std::static_pointer_cast<RootShadowNode>(rootNode);
|
|
558
549
|
});
|
|
@@ -632,4 +623,38 @@ void NativeReanimatedModule::setNewestShadowNodesRegistry(
|
|
|
632
623
|
}
|
|
633
624
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
634
625
|
|
|
626
|
+
jsi::Value NativeReanimatedModule::subscribeForKeyboardEvents(
|
|
627
|
+
jsi::Runtime &rt,
|
|
628
|
+
const jsi::Value &keyboardEventContainer) {
|
|
629
|
+
jsi::Object keyboardEventObj = keyboardEventContainer.getObject(rt);
|
|
630
|
+
std::unordered_map<std::string, std::shared_ptr<ShareableValue>>
|
|
631
|
+
sharedProperties;
|
|
632
|
+
std::shared_ptr<ShareableValue> keyboardStateShared = ShareableValue::adapt(
|
|
633
|
+
rt, keyboardEventObj.getProperty(rt, "state"), this);
|
|
634
|
+
std::shared_ptr<ShareableValue> heightShared = ShareableValue::adapt(
|
|
635
|
+
rt, keyboardEventObj.getProperty(rt, "height"), this);
|
|
636
|
+
|
|
637
|
+
auto keyboardEventDataUpdater =
|
|
638
|
+
[this, &rt, keyboardStateShared, heightShared](
|
|
639
|
+
int keyboardState, int height) {
|
|
640
|
+
auto &keyboardStateValue =
|
|
641
|
+
ValueWrapper::asMutableValue(keyboardStateShared->valueContainer);
|
|
642
|
+
keyboardStateValue->setValue(rt, jsi::Value(keyboardState));
|
|
643
|
+
|
|
644
|
+
auto &heightMutableValue =
|
|
645
|
+
ValueWrapper::asMutableValue(heightShared->valueContainer);
|
|
646
|
+
heightMutableValue->setValue(rt, jsi::Value(height));
|
|
647
|
+
|
|
648
|
+
this->mapperRegistry->execute(*this->runtime);
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
return subscribeForKeyboardEventsFunction(keyboardEventDataUpdater);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
void NativeReanimatedModule::unsubscribeFromKeyboardEvents(
|
|
655
|
+
jsi::Runtime &rt,
|
|
656
|
+
const jsi::Value &listenerId) {
|
|
657
|
+
unsubscribeFromKeyboardEventsFunction(listenerId.asNumber());
|
|
658
|
+
}
|
|
659
|
+
|
|
635
660
|
} // namespace reanimated
|
|
@@ -138,6 +138,25 @@ static jsi::Value SPEC_PREFIX(configureProps)(
|
|
|
138
138
|
return jsi::Value::undefined();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
static jsi::Value SPEC_PREFIX(subscribeForKeyboardEvents)(
|
|
142
|
+
jsi::Runtime &rt,
|
|
143
|
+
TurboModule &turboModule,
|
|
144
|
+
const jsi::Value *args,
|
|
145
|
+
size_t count) {
|
|
146
|
+
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
147
|
+
->subscribeForKeyboardEvents(rt, std::move(args[0]));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static jsi::Value SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
|
|
151
|
+
jsi::Runtime &rt,
|
|
152
|
+
TurboModule &turboModule,
|
|
153
|
+
const jsi::Value *args,
|
|
154
|
+
size_t count) {
|
|
155
|
+
static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
156
|
+
->unsubscribeFromKeyboardEvents(rt, std::move(args[0]));
|
|
157
|
+
return jsi::Value::undefined();
|
|
158
|
+
}
|
|
159
|
+
|
|
141
160
|
NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
142
161
|
std::shared_ptr<CallInvoker> jsInvoker)
|
|
143
162
|
: TurboModule("NativeReanimated", jsInvoker) {
|
|
@@ -163,5 +182,9 @@ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
|
163
182
|
methodMap_["unregisterSensor"] =
|
|
164
183
|
MethodMetadata{1, SPEC_PREFIX(unregisterSensor)};
|
|
165
184
|
methodMap_["configureProps"] = MethodMetadata{2, SPEC_PREFIX(configureProps)};
|
|
185
|
+
methodMap_["subscribeForKeyboardEvents"] =
|
|
186
|
+
MethodMetadata{1, SPEC_PREFIX(subscribeForKeyboardEvents)};
|
|
187
|
+
methodMap_["unsubscribeFromKeyboardEvents"] =
|
|
188
|
+
MethodMetadata{1, SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
|
|
166
189
|
}
|
|
167
190
|
} // namespace reanimated
|
|
@@ -71,21 +71,27 @@ void RuntimeDecorator::decorateRuntime(
|
|
|
71
71
|
1,
|
|
72
72
|
setGlobalConsole));
|
|
73
73
|
|
|
74
|
+
auto chronoNow = [](jsi::Runtime &rt,
|
|
75
|
+
const jsi::Value &thisValue,
|
|
76
|
+
const jsi::Value *args,
|
|
77
|
+
size_t count) -> jsi::Value {
|
|
78
|
+
double now = std::chrono::system_clock::now().time_since_epoch() /
|
|
79
|
+
std::chrono::milliseconds(1);
|
|
80
|
+
return jsi::Value(now);
|
|
81
|
+
};
|
|
82
|
+
|
|
74
83
|
rt.global().setProperty(
|
|
75
84
|
rt,
|
|
76
85
|
"_chronoNow",
|
|
77
86
|
jsi::Function::createFromHostFunction(
|
|
78
|
-
rt,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
std::chrono::milliseconds(1);
|
|
87
|
-
return jsi::Value(now);
|
|
88
|
-
}));
|
|
87
|
+
rt, jsi::PropNameID::forAscii(rt, "_chronoNow"), 0, chronoNow));
|
|
88
|
+
jsi::Object performance(rt);
|
|
89
|
+
performance.setProperty(
|
|
90
|
+
rt,
|
|
91
|
+
"now",
|
|
92
|
+
jsi::Function::createFromHostFunction(
|
|
93
|
+
rt, jsi::PropNameID::forAscii(rt, "now"), 0, chronoNow));
|
|
94
|
+
rt.global().setProperty(rt, "performance", performance);
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
void RuntimeDecorator::decorateUIRuntime(
|
|
@@ -17,6 +17,7 @@ namespace reanimated {
|
|
|
17
17
|
struct UIManagerBindingPublic {
|
|
18
18
|
void *vtable;
|
|
19
19
|
std::shared_ptr<UIManager> uiManager_;
|
|
20
|
+
std::unique_ptr<EventHandler const> eventHandler_;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
struct UIManagerPublic {
|
|
@@ -63,10 +64,10 @@ LayoutMetrics UIManager_getRelativeLayoutMetrics(
|
|
|
63
64
|
ShadowNode const *ancestorShadowNode,
|
|
64
65
|
LayoutableShadowNode::LayoutInspectingPolicy policy);
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
ShadowNode::Shared UIManager_cloneNode(
|
|
67
68
|
const UIManager *uiManager,
|
|
68
69
|
const ShadowNode::Shared &shadowNode,
|
|
69
|
-
const
|
|
70
|
+
const ShadowNode::SharedListOfShared &children = nullptr,
|
|
70
71
|
const RawProps *rawProps = nullptr);
|
|
71
72
|
|
|
72
73
|
void UIManager_appendChild(
|
|
@@ -28,6 +28,7 @@ class ReanimatedUIManagerBinding : public UIManagerBinding {
|
|
|
28
28
|
ReanimatedUIManagerBinding(
|
|
29
29
|
std::shared_ptr<UIManager> uiManager,
|
|
30
30
|
RuntimeExecutor runtimeExecutor,
|
|
31
|
+
std::unique_ptr<EventHandler const> eventHandler,
|
|
31
32
|
std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry);
|
|
32
33
|
|
|
33
34
|
~ReanimatedUIManagerBinding();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
|
|
4
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
5
|
+
#include <react/renderer/uimanager/UIManager.h>
|
|
6
|
+
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <set>
|
|
9
|
+
|
|
10
|
+
#include "NewestShadowNodesRegistry.h"
|
|
11
|
+
|
|
12
|
+
using namespace facebook;
|
|
13
|
+
using namespace react;
|
|
14
|
+
|
|
15
|
+
namespace reanimated {
|
|
16
|
+
|
|
17
|
+
class ShadowTreeCloner {
|
|
18
|
+
public:
|
|
19
|
+
ShadowTreeCloner(
|
|
20
|
+
std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry,
|
|
21
|
+
std::shared_ptr<UIManager> uiManager,
|
|
22
|
+
SurfaceId surfaceId);
|
|
23
|
+
|
|
24
|
+
~ShadowTreeCloner();
|
|
25
|
+
|
|
26
|
+
ShadowNode::Unshared cloneWithNewProps(
|
|
27
|
+
const ShadowNode::Shared &oldRootNode,
|
|
28
|
+
const ShadowNodeFamily &family,
|
|
29
|
+
RawProps &&rawProps);
|
|
30
|
+
|
|
31
|
+
void updateYogaChildren();
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
PropsParserContext propsParserContext_;
|
|
35
|
+
std::shared_ptr<NewestShadowNodesRegistry> newestShadowNodesRegistry_;
|
|
36
|
+
std::set<ShadowNode *> yogaChildrenUpdates_;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
} // namespace reanimated
|
|
40
|
+
|
|
41
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -136,6 +136,12 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
|
|
|
136
136
|
const jsi::Value &interval,
|
|
137
137
|
const jsi::Value &sensorDataContainer) override;
|
|
138
138
|
void unregisterSensor(jsi::Runtime &rt, const jsi::Value &sensorId) override;
|
|
139
|
+
jsi::Value subscribeForKeyboardEvents(
|
|
140
|
+
jsi::Runtime &rt,
|
|
141
|
+
const jsi::Value &keyboardEventContainer) override;
|
|
142
|
+
void unsubscribeFromKeyboardEvents(
|
|
143
|
+
jsi::Runtime &rt,
|
|
144
|
+
const jsi::Value &listenerId) override;
|
|
139
145
|
|
|
140
146
|
private:
|
|
141
147
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -173,6 +179,9 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec,
|
|
|
173
179
|
#endif
|
|
174
180
|
|
|
175
181
|
std::unordered_set<std::string> nativePropNames_; // filled by configureProps
|
|
182
|
+
|
|
183
|
+
KeyboardEventSubscribeFunction subscribeForKeyboardEventsFunction;
|
|
184
|
+
KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction;
|
|
176
185
|
};
|
|
177
186
|
|
|
178
187
|
} // namespace reanimated
|
|
@@ -69,6 +69,14 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
|
|
|
69
69
|
jsi::Runtime &rt,
|
|
70
70
|
const jsi::Value &sensorId) = 0;
|
|
71
71
|
|
|
72
|
+
// keyboard
|
|
73
|
+
virtual jsi::Value subscribeForKeyboardEvents(
|
|
74
|
+
jsi::Runtime &rt,
|
|
75
|
+
const jsi::Value &keyboardEventContainer) = 0;
|
|
76
|
+
virtual void unsubscribeFromKeyboardEvents(
|
|
77
|
+
jsi::Runtime &rt,
|
|
78
|
+
const jsi::Value &listenerId) = 0;
|
|
79
|
+
|
|
72
80
|
// other
|
|
73
81
|
virtual jsi::Value enableLayoutAnimations(
|
|
74
82
|
jsi::Runtime &rt,
|
|
@@ -61,6 +61,9 @@ using ConfigurePropsFunction = std::function<void(
|
|
|
61
61
|
jsi::Runtime &rt,
|
|
62
62
|
const jsi::Value &uiProps,
|
|
63
63
|
const jsi::Value &nativeProps)>;
|
|
64
|
+
using KeyboardEventSubscribeFunction =
|
|
65
|
+
std::function<int(std::function<void(int, int)>)>;
|
|
66
|
+
using KeyboardEventUnsubscribeFunction = std::function<void(int)>;
|
|
64
67
|
|
|
65
68
|
struct PlatformDepMethodsHolder {
|
|
66
69
|
RequestRender requestRender;
|
|
@@ -76,6 +79,8 @@ struct PlatformDepMethodsHolder {
|
|
|
76
79
|
RegisterSensorFunction registerSensor;
|
|
77
80
|
UnregisterSensorFunction unregisterSensor;
|
|
78
81
|
SetGestureStateFunction setGestureStateFunction;
|
|
82
|
+
KeyboardEventSubscribeFunction subscribeForKeyboardEvents;
|
|
83
|
+
KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEvents;
|
|
79
84
|
};
|
|
80
85
|
|
|
81
86
|
} // namespace reanimated
|
package/RNReanimated.podspec
CHANGED
|
@@ -4,14 +4,16 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
|
|
5
5
|
reactVersion = '0.0.0'
|
|
6
6
|
reactTargetTvOS = false
|
|
7
|
+
isUserApp = false
|
|
7
8
|
|
|
8
9
|
begin
|
|
9
|
-
#
|
|
10
|
+
# user app
|
|
10
11
|
# /appName/node_modules/react-native-reanimated/RNReanimated.podspec
|
|
11
12
|
# /appName/node_modules/react-native/package.json
|
|
12
13
|
reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
|
|
13
14
|
reactVersion = reactJson["version"]
|
|
14
15
|
reactTargetTvOS = reactJson["name"] == "react-native-tvos"
|
|
16
|
+
isUserApp = true
|
|
15
17
|
rescue
|
|
16
18
|
begin
|
|
17
19
|
# monorepo
|
|
@@ -24,18 +26,39 @@ rescue
|
|
|
24
26
|
begin
|
|
25
27
|
# Example app in reanimated repo
|
|
26
28
|
# /react-native-reanimated/RNReanimated.podspec
|
|
27
|
-
# /react-native-reanimated/node_modules/react-native/package.json
|
|
28
|
-
|
|
29
|
+
# /react-native-reanimated/{Example,FabricExample,TVOSExample}/node_modules/react-native/package.json
|
|
30
|
+
if ENV["ReanimatedTVOSExample"] == "1" then
|
|
31
|
+
appName = "TVOSExample"
|
|
32
|
+
elsif ENV["RCT_NEW_ARCH_ENABLED"] == "1" then
|
|
33
|
+
appName = "FabricExample"
|
|
34
|
+
else
|
|
35
|
+
appName = "Example"
|
|
36
|
+
end
|
|
37
|
+
reactJson = JSON.parse(File.read(File.join(__dir__, appName, "node_modules", "react-native", "package.json")))
|
|
29
38
|
reactVersion = reactJson["version"]
|
|
30
39
|
reactTargetTvOS = ENV["ReanimatedTVOSExample"] == "1"
|
|
31
40
|
rescue
|
|
32
41
|
# should never happen
|
|
33
42
|
reactVersion = '0.68.0'
|
|
34
|
-
puts "[RNReanimated] Unable to
|
|
43
|
+
puts "[RNReanimated] Unable to recognize your `react-native` version! Default `react-native` version: " + reactVersion
|
|
35
44
|
end
|
|
36
45
|
end
|
|
37
46
|
end
|
|
38
47
|
|
|
48
|
+
if isUserApp
|
|
49
|
+
libInstances = %x[find ../../ -name "package.json" | grep "/react-native-reanimated/package.json"]
|
|
50
|
+
libInstancesArray = libInstances.split("\n")
|
|
51
|
+
if libInstancesArray.length() > 1
|
|
52
|
+
parsedLocation = ''
|
|
53
|
+
for location in libInstancesArray
|
|
54
|
+
location['../../'] = '- '
|
|
55
|
+
location['/package.json'] = ''
|
|
56
|
+
parsedLocation += location + "\n"
|
|
57
|
+
end
|
|
58
|
+
raise "[Reanimated] Multiple versions of Reanimated were detected. Only one instance of react-native-reanimated can be installed in a project. You need to resolve the conflict manually. Check out the documentation: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict between: \n" + parsedLocation
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
39
62
|
rnVersion = reactVersion.split('.')[1]
|
|
40
63
|
|
|
41
64
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
@@ -47,7 +70,6 @@ end
|
|
|
47
70
|
|
|
48
71
|
folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRNVERSION=' + rnVersion
|
|
49
72
|
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
|
|
50
|
-
folly_version = '2021.06.28.00-v2'
|
|
51
73
|
boost_compiler_flags = '-Wno-documentation'
|
|
52
74
|
fabric_flags = ''
|
|
53
75
|
if fabric_enabled
|
|
@@ -94,7 +116,7 @@ Pod::Spec.new do |s|
|
|
|
94
116
|
if fabric_enabled
|
|
95
117
|
s.dependency "React-RCTFabric"
|
|
96
118
|
s.dependency "React-Codegen"
|
|
97
|
-
s.dependency "RCT-Folly"
|
|
119
|
+
s.dependency "RCT-Folly"
|
|
98
120
|
else
|
|
99
121
|
s.dependency "#{folly_prefix}Folly"
|
|
100
122
|
end
|