react-native-reanimated 3.8.0 → 3.9.0-layout-animation-experimental
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
- package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
- package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
- package/Common/cpp/SharedItems/Shareables.cpp +31 -5
- package/Common/cpp/SharedItems/Shareables.h +18 -2
- package/Common/cpp/Tools/JSScheduler.cpp +29 -5
- package/Common/cpp/Tools/JSScheduler.h +21 -4
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
- package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
- package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
- package/android/CMakeLists.txt +3 -0
- package/android/build.gradle +17 -5
- package/android/src/main/cpp/NativeProxy.cpp +77 -12
- package/android/src/main/cpp/NativeProxy.h +35 -1
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
- package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
- package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
- package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
- package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
- package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
- package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
- package/apple/LayoutReanimation/REASnapshot.h +1 -0
- package/apple/LayoutReanimation/REASnapshot.m +78 -37
- package/apple/REAModule.h +22 -2
- package/apple/REAModule.mm +97 -46
- package/apple/REANodesManager.h +3 -3
- package/apple/REANodesManager.mm +46 -22
- package/apple/native/NativeProxy.h +28 -2
- package/apple/native/NativeProxy.mm +65 -195
- package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
- package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
- package/apple/sensor/ReanimatedSensor.m +5 -5
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js +1 -0
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
- package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
- package/lib/module/createAnimatedComponent/index.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/mock.js +12 -12
- package/lib/module/mock.js.map +1 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +4 -11
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -7
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js +2 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +1 -1
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/PropsRegistry.js +1 -2
- package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +2 -2
- package/lib/module/reanimated2/Sensor.js.map +1 -1
- package/lib/module/reanimated2/SensorContainer.js +2 -2
- package/lib/module/reanimated2/SensorContainer.js.map +1 -1
- package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
- package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/clamp.js.map +1 -1
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +1 -6
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +1 -5
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/springUtils.js +8 -10
- package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +4 -1
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +22 -2
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +3 -1
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +1 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js +1 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +1 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js +1 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js +1 -0
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -15
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +8 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +33 -8
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/helperTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useEvent.js +4 -5
- package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useHandler.js +3 -1
- package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js +2 -0
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +1 -5
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +2 -6
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +1 -1
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/isSharedValue.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +3 -6
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +2 -2
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +2 -4
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -4
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/publicGlobals.js.map +1 -1
- package/lib/module/reanimated2/runtimes.js +11 -19
- package/lib/module/reanimated2/runtimes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/index.js +5 -0
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/presets.js +157 -0
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +27 -10
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +9 -34
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +1 -2
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/reanimated2/valueUnpacker.js +4 -3
- package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js +5 -0
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
- package/lib/typescript/ConfigHelper.d.ts +1 -0
- package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
- package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
- package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
- package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
- package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
- package/lib/typescript/reanimated2/core.d.ts +3 -4
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
- package/lib/typescript/reanimated2/index.d.ts +3 -0
- package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
- package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
- package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
- package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
- package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
- package/package.json +29 -17
- package/plugin/build/plugin.js +7 -2
- package/src/ConfigHelper.ts +1 -1
- package/src/animationBuilder.tsx +2 -0
- package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
- package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
- package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
- package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
- package/src/createAnimatedComponent/getViewInfo.ts +39 -0
- package/src/mock.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
- package/src/reanimated2/PlatformChecker.ts +3 -2
- package/src/reanimated2/PropsRegistry.ts +1 -3
- package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/animation/timing.ts +9 -1
- package/src/reanimated2/animation/util.ts +28 -3
- package/src/reanimated2/commonTypes.ts +4 -1
- package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
- package/src/reanimated2/core.ts +9 -31
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/fabricUtils.ts +43 -18
- package/src/reanimated2/globals.d.ts +11 -1
- package/src/reanimated2/hook/commonTypes.ts +10 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
- package/src/reanimated2/index.ts +11 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
- package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
- package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
- package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
- package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
- package/src/reanimated2/screenTransition/animationManager.ts +45 -0
- package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
- package/src/reanimated2/screenTransition/index.ts +12 -0
- package/src/reanimated2/screenTransition/presets.ts +137 -0
- package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
- package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
- package/src/reanimated2/shareables.ts +29 -6
- package/src/reanimated2/valueUnpacker.ts +10 -3
- package/src/specs/NativeReanimatedModule.ts +9 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
- package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
package/apple/REAModule.h
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#import <React/RCTInitializing.h>
|
|
3
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74
|
|
4
|
+
#import <React/RCTRuntimeExecutorModule.h>
|
|
5
|
+
#import <ReactCommon/RCTRuntimeExecutor.h>
|
|
6
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74
|
|
7
|
+
#import <rnreanimated/rnreanimated.h>
|
|
8
|
+
#else // RCT_NEW_ARCH_ENABLED
|
|
1
9
|
#import <React/RCTBridgeModule.h>
|
|
10
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
2
11
|
#import <React/RCTEventDispatcher.h>
|
|
3
12
|
#import <React/RCTEventEmitter.h>
|
|
4
13
|
#import <React/RCTUIManager.h>
|
|
@@ -8,13 +17,24 @@
|
|
|
8
17
|
#import <RNReanimated/REAAnimationsManager.h>
|
|
9
18
|
#import <RNReanimated/REANodesManager.h>
|
|
10
19
|
|
|
11
|
-
@interface REAModule : RCTEventEmitter
|
|
20
|
+
@interface REAModule : RCTEventEmitter
|
|
21
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
22
|
+
<NativeReanimatedModuleSpec,
|
|
23
|
+
RCTInitializing,
|
|
24
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74
|
|
25
|
+
RCTRuntimeExecutorModule,
|
|
26
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74
|
|
27
|
+
#else
|
|
28
|
+
<RCTBridgeModule,
|
|
29
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
30
|
+
RCTEventDispatcherObserver,
|
|
31
|
+
RCTUIManagerObserver>
|
|
12
32
|
|
|
13
33
|
@property (nonatomic, readonly) REANodesManager *nodesManager;
|
|
14
34
|
@property REAAnimationsManager *animationsManager;
|
|
15
35
|
|
|
16
36
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
17
37
|
- (void)installReanimatedAfterReload;
|
|
18
|
-
#endif
|
|
38
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
19
39
|
|
|
20
40
|
@end
|
package/apple/REAModule.mm
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
#import <React/RCTSurfaceView.h>
|
|
10
10
|
#if REACT_NATIVE_MINOR_VERSION < 73
|
|
11
11
|
#import <React/RCTRuntimeExecutorFromBridge.h>
|
|
12
|
-
#endif
|
|
13
|
-
#endif
|
|
12
|
+
#endif // REACT_NATIVE_MINOR_VERSION < 73
|
|
13
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
14
14
|
|
|
15
15
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
16
16
|
#import <RNReanimated/REAInitializerRCTFabricSurface.h>
|
|
17
|
-
#endif
|
|
17
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
18
18
|
|
|
19
19
|
#import <RNReanimated/NativeProxy.h>
|
|
20
20
|
#import <RNReanimated/REAModule.h>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
#if __has_include(<UIKit/UIAccessibility.h>)
|
|
30
30
|
#import <UIKit/UIAccessibility.h>
|
|
31
|
-
#endif
|
|
31
|
+
#endif // __has_include(<UIKit/UIAccessibility.h>)
|
|
32
32
|
|
|
33
33
|
using namespace facebook::react;
|
|
34
34
|
using namespace reanimated;
|
|
@@ -46,7 +46,7 @@ using namespace reanimated;
|
|
|
46
46
|
static __strong REAInitializerRCTFabricSurface *reaSurface;
|
|
47
47
|
#else
|
|
48
48
|
typedef void (^AnimatedOperation)(REANodesManager *nodesManager);
|
|
49
|
-
#endif
|
|
49
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
50
50
|
|
|
51
51
|
@implementation REAModule {
|
|
52
52
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -54,13 +54,19 @@ typedef void (^AnimatedOperation)(REANodesManager *nodesManager);
|
|
|
54
54
|
std::weak_ptr<NativeReanimatedModule> weakNativeReanimatedModule_;
|
|
55
55
|
#else
|
|
56
56
|
NSMutableArray<AnimatedOperation> *_operations;
|
|
57
|
-
#endif
|
|
57
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
58
58
|
#ifndef NDEBUG
|
|
59
59
|
SingleInstanceChecker<REAModule> singleInstanceChecker_;
|
|
60
|
-
#endif
|
|
60
|
+
#endif // NDEBUG
|
|
61
61
|
bool hasListeners;
|
|
62
|
+
bool _isBridgeless;
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
@synthesize moduleRegistry = _moduleRegistry;
|
|
66
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
67
|
+
@synthesize runtimeExecutor = _runtimeExecutor;
|
|
68
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
69
|
+
|
|
64
70
|
RCT_EXPORT_MODULE(ReanimatedModule);
|
|
65
71
|
|
|
66
72
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -74,7 +80,7 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
74
80
|
{
|
|
75
81
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
76
82
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
77
|
-
#endif
|
|
83
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
78
84
|
[_nodesManager invalidate];
|
|
79
85
|
[super invalidate];
|
|
80
86
|
}
|
|
@@ -125,7 +131,11 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
125
131
|
|
|
126
132
|
- (void)handleJavaScriptDidLoadNotification:(NSNotification *)notification
|
|
127
133
|
{
|
|
128
|
-
|
|
134
|
+
[self attachReactEventListener];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
- (void)attachReactEventListener
|
|
138
|
+
{
|
|
129
139
|
RCTScheduler *scheduler = [_surfacePresenter scheduler];
|
|
130
140
|
__weak __typeof__(self) weakSelf = self;
|
|
131
141
|
_surfacePresenter.runtimeExecutor(^(jsi::Runtime &runtime) {
|
|
@@ -149,9 +159,30 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
149
159
|
});
|
|
150
160
|
}
|
|
151
161
|
|
|
162
|
+
#pragma mark-- Bridgeless methods
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
* Taken from RCTNativeAnimatedTurboModule:
|
|
166
|
+
* This selector is invoked via BridgelessTurboModuleSetup.
|
|
167
|
+
*/
|
|
168
|
+
- (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
|
|
169
|
+
{
|
|
170
|
+
_surfacePresenter = surfacePresenter;
|
|
171
|
+
_isBridgeless = true;
|
|
172
|
+
}
|
|
173
|
+
|
|
152
174
|
- (void)setBridge:(RCTBridge *)bridge
|
|
153
175
|
{
|
|
154
176
|
[super setBridge:bridge];
|
|
177
|
+
// only within the first loading `self.bridge.surfacePresenter` exists
|
|
178
|
+
// during the reload `self.bridge.surfacePresenter` is null
|
|
179
|
+
if (self.bridge.surfacePresenter) {
|
|
180
|
+
_surfacePresenter = self.bridge.surfacePresenter;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[self setReaSurfacePresenter];
|
|
184
|
+
|
|
185
|
+
_nodesManager = [[REANodesManager alloc] initWithModule:self bridge:bridge surfacePresenter:_surfacePresenter];
|
|
155
186
|
|
|
156
187
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
157
188
|
selector:@selector(handleJavaScriptDidLoadNotification:)
|
|
@@ -159,30 +190,19 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
159
190
|
object:nil];
|
|
160
191
|
|
|
161
192
|
[[self.moduleRegistry moduleForName:"EventDispatcher"] addDispatchObserver:self];
|
|
162
|
-
|
|
193
|
+
}
|
|
163
194
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
_surfacePresenter = self.bridge.surfacePresenter;
|
|
167
|
-
#ifndef NDEBUG
|
|
195
|
+
- (void)setReaSurfacePresenter
|
|
196
|
+
{
|
|
168
197
|
if (reaSurface == nil) {
|
|
169
198
|
// we need only one instance because SurfacePresenter is the same during the application lifetime
|
|
170
199
|
reaSurface = [[REAInitializerRCTFabricSurface alloc] init];
|
|
171
200
|
[_surfacePresenter registerSurface:reaSurface];
|
|
172
201
|
}
|
|
173
202
|
reaSurface.reaModule = self;
|
|
174
|
-
#endif
|
|
175
|
-
|
|
176
|
-
if (_surfacePresenter == nil) {
|
|
177
|
-
// _surfacePresenter will be set in installReanimatedAfterReload
|
|
178
|
-
_nodesManager = [[REANodesManager alloc] initWithModule:self bridge:self.bridge surfacePresenter:nil];
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
_nodesManager = [[REANodesManager alloc] initWithModule:self bridge:self.bridge surfacePresenter:_surfacePresenter];
|
|
183
203
|
}
|
|
184
204
|
|
|
185
|
-
#else
|
|
205
|
+
#else // RCT_NEW_ARCH_ENABLED
|
|
186
206
|
|
|
187
207
|
- (void)setBridge:(RCTBridge *)bridge
|
|
188
208
|
{
|
|
@@ -259,35 +279,66 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
259
279
|
|
|
260
280
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule : (nonnull NSString *)valueUnpackerCode)
|
|
261
281
|
{
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
282
|
+
if (_isBridgeless) {
|
|
283
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
284
|
+
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)[RCTBridge currentBridge];
|
|
285
|
+
auto &rnRuntime = *(jsi::Runtime *)cxxBridge.runtime;
|
|
286
|
+
auto executorFunction = ([executor = _runtimeExecutor](std::function<void(jsi::Runtime & runtime)> &&callback) {
|
|
287
|
+
// Convert to Objective-C block so it can be captured properly.
|
|
288
|
+
__block auto callbackBlock = callback;
|
|
289
|
+
|
|
290
|
+
[executor execute:^(jsi::Runtime &runtime) {
|
|
291
|
+
callbackBlock(runtime);
|
|
292
|
+
}];
|
|
293
|
+
});
|
|
294
|
+
auto nativeReanimatedModule = reanimated::createReanimatedModuleBridgeless(
|
|
295
|
+
_moduleRegistry, rnRuntime, std::string([valueUnpackerCode UTF8String]), executorFunction);
|
|
296
|
+
[self attachReactEventListener];
|
|
297
|
+
[self commonInit:nativeReanimatedModule withRnRuntime:rnRuntime];
|
|
298
|
+
#else // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
299
|
+
[NSException raise:@"Missing bridge" format:@"[Reanimated] Failed to obtain the bridge."];
|
|
300
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
301
|
+
} else {
|
|
302
|
+
facebook::jsi::Runtime *jsiRuntime = [self.bridge respondsToSelector:@selector(runtime)]
|
|
303
|
+
? reinterpret_cast<facebook::jsi::Runtime *>(self.bridge.runtime)
|
|
304
|
+
: nullptr;
|
|
305
|
+
|
|
306
|
+
if (jsiRuntime) {
|
|
307
|
+
auto nativeReanimatedModule = reanimated::createReanimatedModule(
|
|
308
|
+
self.bridge, self.bridge.jsCallInvoker, std::string([valueUnpackerCode UTF8String]));
|
|
309
|
+
jsi::Runtime &rnRuntime = *jsiRuntime;
|
|
310
|
+
|
|
311
|
+
[self commonInit:nativeReanimatedModule withRnRuntime:rnRuntime];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return @YES;
|
|
315
|
+
}
|
|
269
316
|
|
|
270
|
-
|
|
271
|
-
|
|
317
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
318
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
319
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
320
|
+
{
|
|
321
|
+
return std::make_shared<facebook::react::NativeReanimatedModuleSpecJSI>(params);
|
|
322
|
+
}
|
|
323
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
272
324
|
|
|
325
|
+
- (void)commonInit:(std::shared_ptr<NativeReanimatedModule>)nativeReanimatedModule
|
|
326
|
+
withRnRuntime:(jsi::Runtime &)rnRuntime
|
|
327
|
+
{
|
|
273
328
|
#if __has_include(<UIKit/UIAccessibility.h>)
|
|
274
|
-
|
|
329
|
+
auto isReducedMotion = UIAccessibilityIsReduceMotionEnabled();
|
|
275
330
|
#else
|
|
276
|
-
|
|
331
|
+
auto isReducedMotion = NSWorkspace.sharedWorkspace.accessibilityDisplayShouldReduceMotion;
|
|
277
332
|
#endif
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
333
|
+
WorkletRuntimeCollector::install(rnRuntime);
|
|
334
|
+
RNRuntimeDecorator::decorate(rnRuntime, nativeReanimatedModule, isReducedMotion);
|
|
281
335
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
336
|
+
weakNativeReanimatedModule_ = nativeReanimatedModule;
|
|
337
|
+
if (self->_surfacePresenter != nil) {
|
|
338
|
+
// reload, uiManager is null right now, we need to wait for `installReanimatedAfterReload`
|
|
339
|
+
[self injectDependencies:rnRuntime];
|
|
288
340
|
}
|
|
289
|
-
|
|
290
|
-
return nil;
|
|
341
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
291
342
|
}
|
|
292
343
|
|
|
293
344
|
@end
|
package/apple/REANodesManager.h
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
5
|
#import <React/RCTSurfacePresenterStub.h>
|
|
6
|
-
#endif
|
|
6
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
7
7
|
|
|
8
8
|
#import <RNReanimated/READisplayLink.h>
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@ typedef void (^REAPerformOperations)();
|
|
|
33
33
|
surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;
|
|
34
34
|
#else
|
|
35
35
|
- (instancetype)initWithModule:(REAModule *)reanimatedModule uiManager:(RCTUIManager *)uiManager;
|
|
36
|
-
#endif
|
|
36
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
37
37
|
- (void)invalidate;
|
|
38
38
|
- (void)operationsBatchDidComplete;
|
|
39
39
|
|
|
@@ -57,7 +57,7 @@ typedef void (^REAPerformOperations)();
|
|
|
57
57
|
nativeProps:(NSMutableDictionary *)nativeProps
|
|
58
58
|
trySynchronously:(BOOL)trySync;
|
|
59
59
|
- (NSString *)obtainProp:(nonnull NSNumber *)viewTag propName:(nonnull NSString *)propName;
|
|
60
|
-
#endif
|
|
60
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
61
61
|
- (void)maybeFlushUIUpdatesQueue;
|
|
62
62
|
|
|
63
63
|
@end
|
package/apple/REANodesManager.mm
CHANGED
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
#import <react/renderer/uimanager/UIManager.h>
|
|
13
13
|
#else
|
|
14
14
|
#import <stdatomic.h>
|
|
15
|
-
#endif
|
|
15
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
16
16
|
|
|
17
17
|
#if __has_include(<RNScreens/RNSScreenStackHeaderConfig.h>)
|
|
18
18
|
#import <RNScreens/RNSScreenStackHeaderConfig.h>
|
|
19
|
-
#endif
|
|
19
|
+
#endif // __has_include(<RNScreens/RNSScreenStackHeaderConfig.h>)
|
|
20
20
|
|
|
21
21
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
22
22
|
using namespace facebook::react;
|
|
23
|
-
#endif
|
|
23
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
24
24
|
|
|
25
25
|
// Interface below has been added in order to use private methods of RCTUIManager,
|
|
26
26
|
// RCTUIManager#UpdateView is a React Method which is exported to JS but in
|
|
@@ -71,7 +71,7 @@ using namespace facebook::react;
|
|
|
71
71
|
// store reference to the observers array
|
|
72
72
|
id oldObservers = [self.observerCoordinator valueForKey:@"_observers"];
|
|
73
73
|
|
|
74
|
-
// temporarily replace observers with a table
|
|
74
|
+
// temporarily replace observers with a table containing just nodesManager (we need
|
|
75
75
|
// this to capture mounting block)
|
|
76
76
|
NSHashTable<id<RCTUIManagerObserver>> *soleObserver = [NSHashTable new];
|
|
77
77
|
[soleObserver addObject:observer];
|
|
@@ -109,7 +109,7 @@ using namespace facebook::react;
|
|
|
109
109
|
|
|
110
110
|
- (void)dealloc
|
|
111
111
|
{
|
|
112
|
-
RCTAssert(_mounting == nil, @"
|
|
112
|
+
RCTAssert(_mounting == nil, @"Mounting block was set but never executed. This may lead to UI inconsistencies");
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
- (void)unblockUIThread
|
|
@@ -148,7 +148,7 @@ using namespace facebook::react;
|
|
|
148
148
|
|
|
149
149
|
@end
|
|
150
150
|
|
|
151
|
-
#endif
|
|
151
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
152
152
|
|
|
153
153
|
@implementation REANodesManager {
|
|
154
154
|
READisplayLink *_displayLink;
|
|
@@ -166,7 +166,7 @@ using namespace facebook::react;
|
|
|
166
166
|
#else
|
|
167
167
|
NSMutableArray<REANativeAnimationOp> *_operationsInBatch;
|
|
168
168
|
volatile atomic_bool _shouldFlushUpdateBuffer;
|
|
169
|
-
#endif
|
|
169
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
- (READisplayLink *)getDisplayLink
|
|
@@ -177,7 +177,7 @@ using namespace facebook::react;
|
|
|
177
177
|
_displayLink = [READisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
|
|
178
178
|
#if !TARGET_OS_OSX
|
|
179
179
|
_displayLink.preferredFramesPerSecond = 120; // will fallback to 60 fps for devices without Pro Motion display
|
|
180
|
-
#endif
|
|
180
|
+
#endif // TARGET_OS_OSX
|
|
181
181
|
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
|
182
182
|
}
|
|
183
183
|
return _displayLink;
|
|
@@ -226,7 +226,7 @@ using namespace facebook::react;
|
|
|
226
226
|
_viewRegistry = [_uiManager valueForKey:@"_viewRegistry"];
|
|
227
227
|
_shouldFlushUpdateBuffer = false;
|
|
228
228
|
}
|
|
229
|
-
#endif
|
|
229
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
230
230
|
[self useDisplayLinkOnMainQueue:^(READisplayLink *displayLink) {
|
|
231
231
|
[displayLink setPaused:YES];
|
|
232
232
|
}];
|
|
@@ -247,7 +247,7 @@ using namespace facebook::react;
|
|
|
247
247
|
{
|
|
248
248
|
_surfacePresenter = surfacePresenter;
|
|
249
249
|
}
|
|
250
|
-
#endif
|
|
250
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
251
251
|
|
|
252
252
|
- (void)operationsBatchDidComplete
|
|
253
253
|
{
|
|
@@ -279,7 +279,7 @@ using namespace facebook::react;
|
|
|
279
279
|
{
|
|
280
280
|
_performOperations = performOperations;
|
|
281
281
|
}
|
|
282
|
-
#endif
|
|
282
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
283
283
|
|
|
284
284
|
- (void)startUpdatingOnAnimationFrame
|
|
285
285
|
{
|
|
@@ -360,7 +360,7 @@ using namespace facebook::react;
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
_wantRunUpdates = NO;
|
|
363
|
-
#endif
|
|
363
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -378,7 +378,7 @@ using namespace facebook::react;
|
|
|
378
378
|
[uiManager updateView:reactTag viewName:viewName props:nativeProps];
|
|
379
379
|
}];
|
|
380
380
|
}
|
|
381
|
-
#endif
|
|
381
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
382
382
|
|
|
383
383
|
- (void)dispatchEvent:(id<RCTEvent>)event
|
|
384
384
|
{
|
|
@@ -406,7 +406,7 @@ using namespace facebook::react;
|
|
|
406
406
|
_uiProps = uiPropsSet;
|
|
407
407
|
_nativeProps = nativePropsSet;
|
|
408
408
|
}
|
|
409
|
-
#endif
|
|
409
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
410
410
|
|
|
411
411
|
- (BOOL)isNativeViewMounted:(NSNumber *)viewTag
|
|
412
412
|
{
|
|
@@ -418,7 +418,7 @@ using namespace facebook::react;
|
|
|
418
418
|
if ([view isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
|
|
419
419
|
return ((RNSScreenStackHeaderConfig *)view).screenView != nil;
|
|
420
420
|
}
|
|
421
|
-
#endif
|
|
421
|
+
#endif // __has_include(<RNScreens/RNSScreenStackHeaderConfig.h>)
|
|
422
422
|
return NO;
|
|
423
423
|
}
|
|
424
424
|
|
|
@@ -521,22 +521,46 @@ using namespace facebook::react;
|
|
|
521
521
|
{
|
|
522
522
|
REAUIView *view = [self.uiManager viewForReactTag:viewTag];
|
|
523
523
|
|
|
524
|
-
NSString *result =
|
|
525
|
-
[NSString stringWithFormat:@"error: unknown propName %@, currently supported: opacity, zIndex", propName];
|
|
526
|
-
|
|
527
524
|
if ([propName isEqualToString:@"opacity"]) {
|
|
528
525
|
#if !TARGET_OS_OSX
|
|
529
526
|
CGFloat alpha = view.alpha;
|
|
530
527
|
#else
|
|
531
528
|
CGFloat alpha = view.alphaValue;
|
|
532
|
-
#endif
|
|
533
|
-
|
|
529
|
+
#endif // TARGET_OS_OSX
|
|
530
|
+
return [@(alpha) stringValue];
|
|
534
531
|
} else if ([propName isEqualToString:@"zIndex"]) {
|
|
535
532
|
NSInteger zIndex = view.reactZIndex;
|
|
536
|
-
|
|
533
|
+
return [@(zIndex) stringValue];
|
|
534
|
+
} else if ([propName isEqualToString:@"width"]) {
|
|
535
|
+
return [@(view.frame.size.width) stringValue];
|
|
536
|
+
} else if ([propName isEqualToString:@"height"]) {
|
|
537
|
+
return [@(view.frame.size.height) stringValue];
|
|
538
|
+
} else if ([propName isEqualToString:@"top"]) {
|
|
539
|
+
return [@(view.frame.origin.y) stringValue];
|
|
540
|
+
} else if ([propName isEqualToString:@"left"]) {
|
|
541
|
+
return [@(view.frame.origin.x) stringValue];
|
|
542
|
+
} else if ([propName isEqualToString:@"backgroundColor"]) {
|
|
543
|
+
#if !TARGET_OS_OSX
|
|
544
|
+
UIColor *color = view.backgroundColor;
|
|
545
|
+
#else
|
|
546
|
+
NSColor *color = view.backgroundColor;
|
|
547
|
+
#endif
|
|
548
|
+
if (color == nil) {
|
|
549
|
+
return @"nil";
|
|
550
|
+
}
|
|
551
|
+
const size_t totalComponents = CGColorGetNumberOfComponents(color.CGColor);
|
|
552
|
+
const CGFloat *components = CGColorGetComponents(color.CGColor);
|
|
553
|
+
int r = 255 * components[MIN(0, totalComponents - 1)];
|
|
554
|
+
int g = 255 * components[MIN(1, totalComponents - 1)];
|
|
555
|
+
int b = 255 * components[MIN(2, totalComponents - 1)];
|
|
556
|
+
int alpha = 255 * components[MIN(3, totalComponents - 1)];
|
|
557
|
+
return [NSString stringWithFormat:@"#%02x%02x%02x%02x", r, g, b, alpha];
|
|
537
558
|
}
|
|
538
559
|
|
|
539
|
-
return
|
|
560
|
+
return [NSString
|
|
561
|
+
stringWithFormat:
|
|
562
|
+
@"error: unknown propName %@, currently supported: opacity, zIndex, width, height, top, left, backgroundColor",
|
|
563
|
+
propName];
|
|
540
564
|
}
|
|
541
565
|
|
|
542
566
|
- (void)maybeFlushUpdateBuffer
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
#if __cplusplus
|
|
2
2
|
|
|
3
|
+
#import <REAAnimationsManager.h>
|
|
4
|
+
#import <REAKeyboardEventObserver.h>
|
|
5
|
+
#import <REAModule.h>
|
|
6
|
+
#import <REANodesManager.h>
|
|
3
7
|
#import <RNReanimated/NativeReanimatedModule.h>
|
|
4
8
|
#import <React/RCTEventDispatcher.h>
|
|
9
|
+
#import <ReanimatedSensorContainer.h>
|
|
5
10
|
#include <memory>
|
|
6
11
|
|
|
7
12
|
namespace reanimated {
|
|
@@ -11,6 +16,27 @@ std::shared_ptr<reanimated::NativeReanimatedModule> createReanimatedModule(
|
|
|
11
16
|
const std::shared_ptr<facebook::react::CallInvoker> &jsInvoker,
|
|
12
17
|
const std::string &valueUnpackerCode);
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
20
|
+
std::shared_ptr<reanimated::NativeReanimatedModule>
|
|
21
|
+
createReanimatedModuleBridgeless(
|
|
22
|
+
RCTModuleRegistry *moduleRegistry,
|
|
23
|
+
jsi::Runtime &runtime,
|
|
24
|
+
const std::string &valueUnpackerCode,
|
|
25
|
+
RuntimeExecutor runtimeExecutor);
|
|
26
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
15
27
|
|
|
16
|
-
|
|
28
|
+
void commonInit(
|
|
29
|
+
REAModule *reaModule,
|
|
30
|
+
std::shared_ptr<NativeReanimatedModule> nativeReanimatedModule);
|
|
31
|
+
|
|
32
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
33
|
+
// nothing
|
|
34
|
+
#else // RCT_NEW_ARCH_ENABLED
|
|
35
|
+
void setupLayoutAnimationCallbacks(
|
|
36
|
+
std::shared_ptr<NativeReanimatedModule> nativeReanimatedModule,
|
|
37
|
+
REAAnimationsManager *animationsManager);
|
|
38
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
39
|
+
|
|
40
|
+
} // namespace reanimated
|
|
41
|
+
|
|
42
|
+
#endif //__cplusplus
|