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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
package com.swmansion.reanimated;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.OptIn;
|
|
4
|
+
|
|
5
|
+
import com.facebook.jni.HybridData;
|
|
6
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
7
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
+
import com.facebook.react.bridge.RuntimeExecutor;
|
|
9
|
+
import com.facebook.react.bridge.queue.MessageQueueThread;
|
|
10
|
+
import com.facebook.react.common.annotations.FrameworkAPI;
|
|
11
|
+
import com.facebook.react.fabric.FabricUIManager;
|
|
12
|
+
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl;
|
|
13
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
14
|
+
import com.facebook.react.uimanager.common.UIManagerType;
|
|
15
|
+
import com.swmansion.reanimated.layoutReanimation.LayoutAnimations;
|
|
16
|
+
import com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder;
|
|
17
|
+
import com.swmansion.reanimated.nativeProxy.NativeProxyCommon;
|
|
18
|
+
|
|
19
|
+
import java.util.HashMap;
|
|
20
|
+
import java.util.Objects;
|
|
21
|
+
|
|
22
|
+
public class NativeProxy extends NativeProxyCommon {
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@SuppressWarnings("unused")
|
|
25
|
+
private final HybridData mHybridData;
|
|
26
|
+
|
|
27
|
+
public @OptIn(markerClass = FrameworkAPI.class) NativeProxy(ReactApplicationContext context, String valueUnpackerCode) {
|
|
28
|
+
super(context);
|
|
29
|
+
ReactFeatureFlagsWrapper.enableMountHooks();
|
|
30
|
+
|
|
31
|
+
FabricUIManager fabricUIManager =
|
|
32
|
+
(FabricUIManager) UIManagerHelper.getUIManager(context, UIManagerType.FABRIC);
|
|
33
|
+
|
|
34
|
+
LayoutAnimations LayoutAnimations = new LayoutAnimations(context);
|
|
35
|
+
|
|
36
|
+
ReanimatedMessageQueueThread messageQueueThread = new ReanimatedMessageQueueThread();
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if (context.isBridgeless()) {
|
|
40
|
+
RuntimeExecutor runtimeExecutor = context.getRuntimeExecutor();
|
|
41
|
+
mHybridData = initHybridBridgeless(
|
|
42
|
+
Objects.requireNonNull(context.getJavaScriptContextHolder()).get(),
|
|
43
|
+
runtimeExecutor,
|
|
44
|
+
mAndroidUIScheduler,
|
|
45
|
+
LayoutAnimations,
|
|
46
|
+
messageQueueThread,
|
|
47
|
+
fabricUIManager,
|
|
48
|
+
valueUnpackerCode
|
|
49
|
+
);
|
|
50
|
+
} else {
|
|
51
|
+
CallInvokerHolderImpl callInvokerHolder = (CallInvokerHolderImpl) context.getCatalystInstance().getJSCallInvokerHolder();
|
|
52
|
+
mHybridData =
|
|
53
|
+
initHybrid(
|
|
54
|
+
Objects.requireNonNull(context.getJavaScriptContextHolder()).get(),
|
|
55
|
+
callInvokerHolder,
|
|
56
|
+
mAndroidUIScheduler,
|
|
57
|
+
LayoutAnimations,
|
|
58
|
+
messageQueueThread,
|
|
59
|
+
fabricUIManager,
|
|
60
|
+
valueUnpackerCode);
|
|
61
|
+
}
|
|
62
|
+
prepareLayoutAnimations(LayoutAnimations);
|
|
63
|
+
installJSIBindings();
|
|
64
|
+
if (BuildConfig.DEBUG) {
|
|
65
|
+
checkCppVersion();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private native HybridData initHybrid(
|
|
70
|
+
long jsContext,
|
|
71
|
+
CallInvokerHolderImpl jsCallInvokerHolder,
|
|
72
|
+
AndroidUIScheduler androidUIScheduler,
|
|
73
|
+
LayoutAnimations LayoutAnimations,
|
|
74
|
+
MessageQueueThread messageQueueThread,
|
|
75
|
+
FabricUIManager fabricUIManager,
|
|
76
|
+
String valueUnpackerCode);
|
|
77
|
+
|
|
78
|
+
private native HybridData initHybridBridgeless(
|
|
79
|
+
long jsContext,
|
|
80
|
+
RuntimeExecutor runtimeExecutor,
|
|
81
|
+
AndroidUIScheduler androidUIScheduler,
|
|
82
|
+
LayoutAnimations LayoutAnimations,
|
|
83
|
+
MessageQueueThread messageQueueThread,
|
|
84
|
+
FabricUIManager fabricUIManager,
|
|
85
|
+
String valueUnpackerCode);
|
|
86
|
+
|
|
87
|
+
public native boolean isAnyHandlerWaitingForEvent(String eventName, int emitterReactTag);
|
|
88
|
+
|
|
89
|
+
public native void performOperations();
|
|
90
|
+
|
|
91
|
+
@Override
|
|
92
|
+
protected HybridData getHybridData() {
|
|
93
|
+
return mHybridData;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public static NativeMethodsHolder createNativeMethodsHolder(LayoutAnimations layoutAnimations) {
|
|
97
|
+
return new NativeMethodsHolder() {
|
|
98
|
+
@Override
|
|
99
|
+
public void startAnimation(int tag, int type, HashMap<String, Object> values) {
|
|
100
|
+
// NOT IMPLEMENTED
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@Override
|
|
104
|
+
public boolean isLayoutAnimationEnabled() {
|
|
105
|
+
// NOT IMPLEMENTED
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@Override
|
|
110
|
+
public int findPrecedingViewTagForTransition(int tag) {
|
|
111
|
+
// NOT IMPLEMENTED
|
|
112
|
+
return -1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@Override
|
|
116
|
+
public boolean shouldAnimateExiting(int tag, boolean shouldAnimate) {
|
|
117
|
+
// NOT IMPLEMENTED
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@Override
|
|
122
|
+
public boolean hasAnimation(int tag, int type) {
|
|
123
|
+
// NOT IMPLEMENTED
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@Override
|
|
128
|
+
public void clearAnimationConfig(int tag) {
|
|
129
|
+
// NOT IMPLEMENTED
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@Override
|
|
133
|
+
public void cancelAnimation(int tag) {
|
|
134
|
+
// NOT IMPLEMENTED
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@Override
|
|
138
|
+
public void checkDuplicateSharedTag(int viewTag, int screenTag) {
|
|
139
|
+
// NOT IMPLEMENTED
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -20,6 +20,7 @@ typedef BOOL (^REAShouldAnimateExitingBlock)(NSNumber *_Nonnull tag, BOOL should
|
|
|
20
20
|
typedef void (
|
|
21
21
|
^REAAnimationStartingBlock)(NSNumber *_Nonnull tag, LayoutAnimationType type, NSDictionary *_Nonnull yogaValues);
|
|
22
22
|
typedef void (^REAAnimationRemovingBlock)(NSNumber *_Nonnull tag);
|
|
23
|
+
typedef void (^REASharedTransitionRemovingBlock)(NSNumber *_Nonnull tag);
|
|
23
24
|
#ifndef NDEBUG
|
|
24
25
|
typedef void (^REACheckDuplicateSharedTagBlock)(REAUIView *view, NSNumber *_Nonnull viewTag);
|
|
25
26
|
#endif
|
|
@@ -35,6 +36,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>));
|
|
|
35
36
|
- (void)setHasAnimationBlock:(REAHasAnimationBlock)hasAnimation;
|
|
36
37
|
- (void)setShouldAnimateExitingBlock:(REAShouldAnimateExitingBlock)shouldAnimateExiting;
|
|
37
38
|
- (void)setAnimationRemovingBlock:(REAAnimationRemovingBlock)clearAnimation;
|
|
39
|
+
- (void)setSharedTransitionRemovingBlock:(REASharedTransitionRemovingBlock)clearSharedTransition;
|
|
38
40
|
#ifndef NDEBUG
|
|
39
41
|
- (void)setCheckDuplicateSharedTagBlock:(REACheckDuplicateSharedTagBlock)checkDuplicateSharedTag;
|
|
40
42
|
#endif
|
|
@@ -61,6 +63,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>));
|
|
|
61
63
|
- (REAUIView *)viewForTag:(NSNumber *)tag;
|
|
62
64
|
- (BOOL)hasAnimationForTag:(NSNumber *)tag type:(LayoutAnimationType)type;
|
|
63
65
|
- (void)clearAnimationConfigForTag:(NSNumber *)tag;
|
|
66
|
+
- (void)clearSharedTransitionConfigForTag:(NSNumber *)tag;
|
|
64
67
|
- (void)startAnimationForTag:(NSNumber *)tag type:(LayoutAnimationType)type yogaValues:(NSDictionary *)yogaValues;
|
|
65
68
|
- (void)onScreenRemoval:(REAUIView *)screen stack:(REAUIView *)stack;
|
|
66
69
|
|
|
@@ -43,6 +43,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
|
|
|
43
43
|
REAHasAnimationBlock _hasAnimationForTag;
|
|
44
44
|
REAShouldAnimateExitingBlock _shouldAnimateExiting;
|
|
45
45
|
REAAnimationRemovingBlock _clearAnimationConfigForTag;
|
|
46
|
+
REASharedTransitionRemovingBlock _clearSharedTransitionConfigForTag;
|
|
46
47
|
REASharedTransitionManager *_sharedTransitionManager;
|
|
47
48
|
#ifndef NDEBUG
|
|
48
49
|
REACheckDuplicateSharedTagBlock _checkDuplicateSharedTag;
|
|
@@ -132,6 +133,11 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
|
|
|
132
133
|
_clearAnimationConfigForTag = clearAnimation;
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
- (void)setSharedTransitionRemovingBlock:(REASharedTransitionRemovingBlock)clearSharedTransition
|
|
137
|
+
{
|
|
138
|
+
_clearSharedTransitionConfigForTag = clearSharedTransition;
|
|
139
|
+
}
|
|
140
|
+
|
|
135
141
|
#ifndef NDEBUG
|
|
136
142
|
- (void)setCheckDuplicateSharedTagBlock:(REACheckDuplicateSharedTagBlock)checkDuplicateSharedTag
|
|
137
143
|
{
|
|
@@ -611,6 +617,11 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
|
|
|
611
617
|
_clearAnimationConfigForTag(tag);
|
|
612
618
|
}
|
|
613
619
|
|
|
620
|
+
- (void)clearSharedTransitionConfigForTag:(NSNumber *)tag
|
|
621
|
+
{
|
|
622
|
+
_clearSharedTransitionConfigForTag(tag);
|
|
623
|
+
}
|
|
624
|
+
|
|
614
625
|
- (void)startAnimationForTag:(NSNumber *)tag type:(LayoutAnimationType)type yogaValues:(NSDictionary *)yogaValues
|
|
615
626
|
{
|
|
616
627
|
_startAnimationForTag(tag, type, yogaValues);
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
BOOL _isAsyncSharedTransitionConfigured;
|
|
30
30
|
BOOL _isConfigured;
|
|
31
31
|
BOOL _clearScreen;
|
|
32
|
+
BOOL _isInteractive;
|
|
33
|
+
REAUIView *_disappearingScreen;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/*
|
|
@@ -121,7 +123,10 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
121
123
|
{
|
|
122
124
|
if ([views count] > 0) {
|
|
123
125
|
NSArray *sharedViews = [self sortViewsByTags:views];
|
|
124
|
-
_sharedElements = [self getSharedElementForCurrentTransition:sharedViews
|
|
126
|
+
_sharedElements = [self getSharedElementForCurrentTransition:sharedViews
|
|
127
|
+
withNewElements:YES
|
|
128
|
+
withOffsetX:0
|
|
129
|
+
withOffsetY:0];
|
|
125
130
|
[self resolveAnimationType:_sharedElements isInteractive:NO];
|
|
126
131
|
_isAsyncSharedTransitionConfigured = YES;
|
|
127
132
|
}
|
|
@@ -169,11 +174,16 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
169
174
|
[self startSharedTransition:sharedElementToRestart];
|
|
170
175
|
}
|
|
171
176
|
|
|
172
|
-
- (BOOL)configureAndStartSharedTransitionForViews:(NSArray<REAUIView *> *)views
|
|
177
|
+
- (BOOL)configureAndStartSharedTransitionForViews:(NSArray<REAUIView *> *)views
|
|
178
|
+
isInteractive:(BOOL)isInteractive
|
|
179
|
+
withOffsetX:(double)offsetX
|
|
180
|
+
withOffsetY:(double)offsetY
|
|
173
181
|
{
|
|
174
182
|
NSArray *sharedViews = [self sortViewsByTags:views];
|
|
175
183
|
NSArray<REASharedElement *> *sharedElements = [self getSharedElementForCurrentTransition:sharedViews
|
|
176
|
-
withNewElements:NO
|
|
184
|
+
withNewElements:NO
|
|
185
|
+
withOffsetX:offsetX
|
|
186
|
+
withOffsetY:offsetY];
|
|
177
187
|
if ([sharedElements count] == 0) {
|
|
178
188
|
return NO;
|
|
179
189
|
}
|
|
@@ -198,6 +208,8 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
198
208
|
|
|
199
209
|
- (NSMutableArray<REASharedElement *> *)getSharedElementForCurrentTransition:(NSArray *)sharedViews
|
|
200
210
|
withNewElements:(BOOL)addedNewScreen
|
|
211
|
+
withOffsetX:(double)offsetX
|
|
212
|
+
withOffsetY:(double)offsetY
|
|
201
213
|
{
|
|
202
214
|
NSMutableArray<REAUIView *> *newTransitionViews = [NSMutableArray new];
|
|
203
215
|
NSMutableArray<REASharedElement *> *newSharedElements = [NSMutableArray new];
|
|
@@ -266,7 +278,7 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
266
278
|
if (![screenUnderStackTop.reactTag isEqual:viewSourceParentScreen.reactTag] && !isInCurrentTransition) {
|
|
267
279
|
continue;
|
|
268
280
|
}
|
|
269
|
-
} else if (!addedNewScreen) {
|
|
281
|
+
} else if (!addedNewScreen && !isModal) {
|
|
270
282
|
// is on top
|
|
271
283
|
REAUIView *viewTargetParentScreen = [REAScreensHelper getScreenForView:viewTarget];
|
|
272
284
|
// TODO macOS navigationController isn't available on macOS
|
|
@@ -282,7 +294,12 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
282
294
|
[_viewsToHide addObject:viewSource.reactTag];
|
|
283
295
|
}
|
|
284
296
|
|
|
285
|
-
REASnapshot *sourceViewSnapshot
|
|
297
|
+
REASnapshot *sourceViewSnapshot;
|
|
298
|
+
if (!addedNewScreen) {
|
|
299
|
+
sourceViewSnapshot = _snapshotRegistry[viewSource.reactTag];
|
|
300
|
+
} else {
|
|
301
|
+
sourceViewSnapshot = [[REASnapshot alloc] initWithAbsolutePosition:viewSource];
|
|
302
|
+
}
|
|
286
303
|
if (addedNewScreen && !_currentSharedTransitionViews[viewSource.reactTag]) {
|
|
287
304
|
_snapshotRegistry[viewSource.reactTag] = sourceViewSnapshot;
|
|
288
305
|
}
|
|
@@ -292,10 +309,9 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
292
309
|
targetViewSnapshot = [[REASnapshot alloc] initWithAbsolutePosition:viewTarget];
|
|
293
310
|
_snapshotRegistry[viewTarget.reactTag] = targetViewSnapshot;
|
|
294
311
|
} else {
|
|
295
|
-
targetViewSnapshot =
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
312
|
+
targetViewSnapshot = [[REASnapshot alloc] initWithAbsolutePosition:viewTarget
|
|
313
|
+
withOffsetX:offsetX
|
|
314
|
+
withOffsetY:offsetY];
|
|
299
315
|
}
|
|
300
316
|
|
|
301
317
|
[newTransitionViews addObject:viewSource];
|
|
@@ -346,10 +362,12 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
346
362
|
dispatch_once(&onceToken, ^{
|
|
347
363
|
SEL viewDidLayoutSubviewsSelector = @selector(viewDidLayoutSubviews);
|
|
348
364
|
SEL notifyWillDisappearSelector = @selector(notifyWillDisappear);
|
|
365
|
+
SEL viewIsAppearingSelector = @selector(viewIsAppearing:);
|
|
349
366
|
Class screenClass = [RNSScreen class];
|
|
350
367
|
Class screenViewClass = [RNSScreenView class];
|
|
351
368
|
BOOL allSelectorsAreAvailable = [RNSScreen instancesRespondToSelector:viewDidLayoutSubviewsSelector] &&
|
|
352
369
|
[RNSScreenView instancesRespondToSelector:notifyWillDisappearSelector] &&
|
|
370
|
+
[RNSScreen instancesRespondToSelector:viewIsAppearingSelector] &&
|
|
353
371
|
[RNSScreenView instancesRespondToSelector:@selector(isModal)]; // used by REAScreenHelper
|
|
354
372
|
|
|
355
373
|
if (allSelectorsAreAvailable) {
|
|
@@ -361,12 +379,37 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
361
379
|
forClass:screenViewClass
|
|
362
380
|
with:@selector(reanimated_notifyWillDisappear)
|
|
363
381
|
fromClass:[self class]];
|
|
382
|
+
[REAUtils swizzleMethod:viewIsAppearingSelector
|
|
383
|
+
forClass:screenClass
|
|
384
|
+
with:@selector(reanimated_viewIsAppearing:)
|
|
385
|
+
fromClass:[self class]];
|
|
364
386
|
_isConfigured = YES;
|
|
365
387
|
}
|
|
366
388
|
});
|
|
367
389
|
#endif
|
|
368
390
|
}
|
|
369
391
|
|
|
392
|
+
- (void)setDisappearingScreen:(REAUIView *)view
|
|
393
|
+
{
|
|
394
|
+
_disappearingScreen = view;
|
|
395
|
+
_isInteractive = [_sharedTransitionManager isInteractiveScreenChange:view];
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
- (REAUIView *)getDisappearingScreen
|
|
399
|
+
{
|
|
400
|
+
return _disappearingScreen;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
- (void)setIsInteractive:(BOOL)isInteractive
|
|
404
|
+
{
|
|
405
|
+
_isInteractive = isInteractive;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
- (BOOL)getIsInteractive
|
|
409
|
+
{
|
|
410
|
+
return _isInteractive;
|
|
411
|
+
}
|
|
412
|
+
|
|
370
413
|
- (void)reanimated_viewDidLayoutSubviews
|
|
371
414
|
{
|
|
372
415
|
// call original method from react-native-screens, self == RNScreen
|
|
@@ -379,7 +422,28 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
379
422
|
{
|
|
380
423
|
// call original method from react-native-screens, self == RNSScreenView
|
|
381
424
|
[self reanimated_notifyWillDisappear];
|
|
382
|
-
[_sharedTransitionManager
|
|
425
|
+
[_sharedTransitionManager makeSnapshotForScreenViews:(REAUIView *)self];
|
|
426
|
+
bool isModal = [REAScreensHelper isScreenModal:(REAUIView *)self];
|
|
427
|
+
if (isModal) {
|
|
428
|
+
[_sharedTransitionManager setIsInteractive:[_sharedTransitionManager isInteractiveScreenChange:(REAUIView *)self]];
|
|
429
|
+
[_sharedTransitionManager screenRemovedFromStack:(REAUIView *)self withOffsetX:0 withOffsetY:0];
|
|
430
|
+
} else {
|
|
431
|
+
[_sharedTransitionManager setDisappearingScreen:(REAUIView *)self];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
- (void)reanimated_viewIsAppearing:(BOOL)animated
|
|
436
|
+
{
|
|
437
|
+
// call original method from react-native-screens, self == RNSScreen
|
|
438
|
+
[self reanimated_viewIsAppearing:animated];
|
|
439
|
+
REAUIView *disappearingScreen = [_sharedTransitionManager getDisappearingScreen];
|
|
440
|
+
REAUIView *targetScreen = [self valueForKey:@"screenView"];
|
|
441
|
+
if (disappearingScreen != NULL) {
|
|
442
|
+
[_sharedTransitionManager screenRemovedFromStack:disappearingScreen
|
|
443
|
+
withOffsetX:-targetScreen.superview.frame.origin.x
|
|
444
|
+
withOffsetY:-targetScreen.superview.frame.origin.y];
|
|
445
|
+
}
|
|
446
|
+
[_sharedTransitionManager setDisappearingScreen:NULL];
|
|
383
447
|
}
|
|
384
448
|
|
|
385
449
|
- (void)screenAddedToStack:(REAUIView *)screen
|
|
@@ -389,14 +453,14 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
389
453
|
}
|
|
390
454
|
}
|
|
391
455
|
|
|
392
|
-
- (void)screenRemovedFromStack:(REAUIView *)screen
|
|
456
|
+
- (void)screenRemovedFromStack:(REAUIView *)screen withOffsetX:(double)offsetX withOffsetY:(double)offsetY
|
|
393
457
|
{
|
|
394
458
|
_isStackDropped = NO;
|
|
395
459
|
REAUIView *stack = [REAScreensHelper getStackForView:screen];
|
|
396
460
|
bool isModal = [REAScreensHelper isScreenModal:screen];
|
|
397
461
|
bool isRemovedInParentStack = [self isRemovedFromHigherStack:screen];
|
|
462
|
+
bool isInteractive = [self getIsInteractive];
|
|
398
463
|
if ((stack != nil || isModal) && !isRemovedInParentStack) {
|
|
399
|
-
bool isInteractive = [self isInteractiveScreenChange:screen];
|
|
400
464
|
// screen is removed from React tree (navigation.navigate(<screenName>))
|
|
401
465
|
bool isScreenRemovedFromReactTree = [self isScreen:screen outsideStack:stack];
|
|
402
466
|
// click on button goBack on native header
|
|
@@ -404,13 +468,16 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
404
468
|
bool shouldRunTransition = (isScreenRemovedFromReactTree || isTriggeredByGoBackButton) &&
|
|
405
469
|
!(isInteractive && [_currentSharedTransitionViews count] > 0);
|
|
406
470
|
if (shouldRunTransition) {
|
|
407
|
-
[self runSharedTransitionForSharedViewsOnScreen:screen
|
|
471
|
+
[self runSharedTransitionForSharedViewsOnScreen:screen
|
|
472
|
+
isInteractive:isInteractive
|
|
473
|
+
withOffsetX:offsetX
|
|
474
|
+
withOffsetY:offsetY];
|
|
408
475
|
} else {
|
|
409
476
|
[self makeSnapshotForScreenViews:screen];
|
|
410
477
|
}
|
|
411
478
|
} else {
|
|
412
479
|
// removed stack
|
|
413
|
-
if (!
|
|
480
|
+
if (!isInteractive) {
|
|
414
481
|
[self clearConfigForStackNow:stack];
|
|
415
482
|
} else {
|
|
416
483
|
_isStackDropped = YES;
|
|
@@ -436,7 +503,9 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
436
503
|
return false;
|
|
437
504
|
}
|
|
438
505
|
if ([self->_animationManager hasAnimationForTag:viewTag type:SHARED_ELEMENT_TRANSITION]) {
|
|
439
|
-
REASnapshot *snapshot = [[REASnapshot alloc] initWithAbsolutePosition:(REAUIView *)view
|
|
506
|
+
REASnapshot *snapshot = [[REASnapshot alloc] initWithAbsolutePosition:(REAUIView *)view
|
|
507
|
+
withOffsetX:0
|
|
508
|
+
withOffsetY:0];
|
|
440
509
|
self->_snapshotRegistry[viewTag] = snapshot;
|
|
441
510
|
}
|
|
442
511
|
return false;
|
|
@@ -487,7 +556,10 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
487
556
|
return NO;
|
|
488
557
|
}
|
|
489
558
|
|
|
490
|
-
- (void)runSharedTransitionForSharedViewsOnScreen:(REAUIView *)screen
|
|
559
|
+
- (void)runSharedTransitionForSharedViewsOnScreen:(REAUIView *)screen
|
|
560
|
+
isInteractive:(BOOL)isInteractive
|
|
561
|
+
withOffsetX:(double)offsetX
|
|
562
|
+
withOffsetY:(double)offsetY
|
|
491
563
|
{
|
|
492
564
|
NSMutableArray<REAUIView *> *removedViews = [NSMutableArray new];
|
|
493
565
|
REANodeFind(screen, ^int(id<RCTComponent> view) {
|
|
@@ -496,7 +568,10 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
496
568
|
}
|
|
497
569
|
return false;
|
|
498
570
|
});
|
|
499
|
-
BOOL startedAnimation = [self configureAndStartSharedTransitionForViews:removedViews
|
|
571
|
+
BOOL startedAnimation = [self configureAndStartSharedTransitionForViews:removedViews
|
|
572
|
+
isInteractive:isInteractive
|
|
573
|
+
withOffsetX:offsetX
|
|
574
|
+
withOffsetY:offsetY];
|
|
500
575
|
if (startedAnimation) {
|
|
501
576
|
_removedViews = removedViews;
|
|
502
577
|
} else if (![self isInteractiveScreenChange:screen]) {
|
|
@@ -616,8 +691,9 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
616
691
|
isSharedTransition:YES];
|
|
617
692
|
float originXByParent = [viewSourcePreviousSnapshot.values[@"originXByParent"] floatValue];
|
|
618
693
|
float originYByParent = [viewSourcePreviousSnapshot.values[@"originYByParent"] floatValue];
|
|
619
|
-
|
|
620
|
-
[
|
|
694
|
+
float height = [viewSourcePreviousSnapshot.values[@"height"] floatValue];
|
|
695
|
+
float width = [viewSourcePreviousSnapshot.values[@"width"] floatValue];
|
|
696
|
+
[view setCenter:CGPointMake(originXByParent + width / 2.0, originYByParent + height / 2.0)];
|
|
621
697
|
}
|
|
622
698
|
[_sharedTransitionParent removeObjectForKey:viewTag];
|
|
623
699
|
[_sharedTransitionInParentIndex removeObjectForKey:viewTag];
|
|
@@ -632,7 +708,7 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
632
708
|
[_removedViews removeObject:view];
|
|
633
709
|
}
|
|
634
710
|
if ([_removedViews containsObject:view]) {
|
|
635
|
-
[_animationManager
|
|
711
|
+
[_animationManager clearSharedTransitionConfigForTag:viewTag];
|
|
636
712
|
}
|
|
637
713
|
if (_removedViewRegistry[view.reactTag]) {
|
|
638
714
|
return;
|
|
@@ -664,7 +740,7 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
664
740
|
{
|
|
665
741
|
if (viewTag != nil) {
|
|
666
742
|
[_snapshotRegistry removeObjectForKey:viewTag];
|
|
667
|
-
[_animationManager
|
|
743
|
+
[_animationManager clearSharedTransitionConfigForTag:viewTag];
|
|
668
744
|
}
|
|
669
745
|
}
|
|
670
746
|
|
|
@@ -716,8 +792,8 @@ static REASharedTransitionManager *_sharedTransitionManager;
|
|
|
716
792
|
{
|
|
717
793
|
NSMutableDictionary *workletValues = [_animationManager prepareDataForLayoutAnimatingWorklet:currentValues
|
|
718
794
|
targetValues:targetValues];
|
|
719
|
-
workletValues[@"currentTransformMatrix"] = currentValues[@"
|
|
720
|
-
workletValues[@"targetTransformMatrix"] = targetValues[@"
|
|
795
|
+
workletValues[@"currentTransformMatrix"] = currentValues[@"combinedTransformMatrix"];
|
|
796
|
+
workletValues[@"targetTransformMatrix"] = targetValues[@"combinedTransformMatrix"];
|
|
721
797
|
workletValues[@"currentBorderRadius"] = currentValues[@"borderRadius"];
|
|
722
798
|
workletValues[@"targetBorderRadius"] = targetValues[@"borderRadius"];
|
|
723
799
|
return workletValues;
|
|
@@ -15,25 +15,35 @@ const int DEFAULT_MODAL_TOP_OFFSET = 69; // Default iOS modal is shifted from sc
|
|
|
15
15
|
- (instancetype)init:(REAUIView *)view
|
|
16
16
|
{
|
|
17
17
|
self = [super init];
|
|
18
|
-
[self makeSnapshotForView:view useAbsolutePositionOnly:NO];
|
|
18
|
+
[self makeSnapshotForView:view useAbsolutePositionOnly:NO withOffsetX:0 withOffsetY:0];
|
|
19
|
+
return self;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (instancetype)initWithAbsolutePosition:(REAUIView *)view withOffsetX:(double)offsetX withOffsetY:(double)offsetY
|
|
23
|
+
{
|
|
24
|
+
self = [super init];
|
|
25
|
+
[self makeSnapshotForView:view useAbsolutePositionOnly:YES withOffsetX:offsetX withOffsetY:offsetY];
|
|
19
26
|
return self;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
- (instancetype)initWithAbsolutePosition:(REAUIView *)view
|
|
23
30
|
{
|
|
24
31
|
self = [super init];
|
|
25
|
-
[self makeSnapshotForView:view useAbsolutePositionOnly:YES];
|
|
32
|
+
[self makeSnapshotForView:view useAbsolutePositionOnly:YES withOffsetX:0 withOffsetY:0];
|
|
26
33
|
return self;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
- (void)makeSnapshotForView:(REAUIView *)view
|
|
36
|
+
- (void)makeSnapshotForView:(REAUIView *)view
|
|
37
|
+
useAbsolutePositionOnly:(BOOL)useAbsolutePositionOnly
|
|
38
|
+
withOffsetX:(double)offsetX
|
|
39
|
+
withOffsetY:(double)offsetY
|
|
30
40
|
{
|
|
31
41
|
#if TARGET_OS_OSX
|
|
32
42
|
REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow;
|
|
33
43
|
#else
|
|
34
44
|
REAUIView *mainWindow = RCTKeyWindow();
|
|
35
45
|
#endif
|
|
36
|
-
CGPoint absolutePosition = [[view superview] convertPoint:view.center toView:
|
|
46
|
+
CGPoint absolutePosition = [[view superview] convertPoint:view.center toView:mainWindow];
|
|
37
47
|
_values = [NSMutableDictionary new];
|
|
38
48
|
#if TARGET_OS_OSX
|
|
39
49
|
_values[@"windowWidth"] = [NSNumber numberWithDouble:mainWindow.frame.size.width];
|
|
@@ -44,8 +54,8 @@ const int DEFAULT_MODAL_TOP_OFFSET = 69; // Default iOS modal is shifted from sc
|
|
|
44
54
|
#endif
|
|
45
55
|
_values[@"width"] = [NSNumber numberWithDouble:(double)(view.bounds.size.width)];
|
|
46
56
|
_values[@"height"] = [NSNumber numberWithDouble:(double)(view.bounds.size.height)];
|
|
47
|
-
_values[@"globalOriginX"] = [NSNumber numberWithDouble:absolutePosition.x - view.bounds.size.width / 2.0];
|
|
48
|
-
_values[@"globalOriginY"] = [NSNumber numberWithDouble:absolutePosition.y - view.bounds.size.height / 2.0];
|
|
57
|
+
_values[@"globalOriginX"] = [NSNumber numberWithDouble:offsetX + absolutePosition.x - view.bounds.size.width / 2.0];
|
|
58
|
+
_values[@"globalOriginY"] = [NSNumber numberWithDouble:offsetY + absolutePosition.y - view.bounds.size.height / 2.0];
|
|
49
59
|
if (useAbsolutePositionOnly) {
|
|
50
60
|
_values[@"originX"] = _values[@"globalOriginX"];
|
|
51
61
|
_values[@"originY"] = _values[@"globalOriginY"];
|
|
@@ -77,22 +87,48 @@ const int DEFAULT_MODAL_TOP_OFFSET = 69; // Default iOS modal is shifted from sc
|
|
|
77
87
|
_values[@"headerHeight"] = @(0);
|
|
78
88
|
}
|
|
79
89
|
|
|
80
|
-
|
|
90
|
+
// store the transofrmMatrix of this view, so that we can reestablish it later
|
|
91
|
+
CGAffineTransform transform = view.transform;
|
|
92
|
+
_values[@"transformMatrix"] = @[
|
|
93
|
+
@(transform.a),
|
|
94
|
+
@(transform.b),
|
|
95
|
+
@(0),
|
|
96
|
+
@(transform.c),
|
|
97
|
+
@(transform.d),
|
|
98
|
+
@(0),
|
|
99
|
+
@(transform.tx),
|
|
100
|
+
@(transform.ty),
|
|
101
|
+
@(1)
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
transform = [self findCombinedTransform:view];
|
|
105
|
+
_values[@"combinedTransformMatrix"] = @[
|
|
106
|
+
@(transform.a),
|
|
107
|
+
@(transform.b),
|
|
108
|
+
@(0),
|
|
109
|
+
@(transform.c),
|
|
110
|
+
@(transform.d),
|
|
111
|
+
@(0),
|
|
112
|
+
@(transform.tx),
|
|
113
|
+
@(transform.ty),
|
|
114
|
+
@(1)
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
REAUIView *transformedView = [self maybeFindTransitionView:view];
|
|
81
118
|
if (transformedView != nil) {
|
|
82
119
|
// iOS affine matrix: https://developer.apple.com/documentation/corefoundation/cgaffinetransform
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
_values[@"transformMatrix"] = @[ @(1), @(0), @(0), @(0), @(1), @(0), @(0), @(0), @(1) ];
|
|
120
|
+
transform = transformedView.transform;
|
|
121
|
+
// revert the transformation that was applied to the view when transition started, since we are intereseted only
|
|
122
|
+
// in the final result of the transition
|
|
123
|
+
CGPoint center = [[view superview] convertPoint:view.center toView:transformedView.superview];
|
|
124
|
+
CGPoint parentCenter = transformedView.center;
|
|
125
|
+
CGFloat x = center.x, y = center.y, a = transform.a, b = transform.b, c = transform.c, d = transform.d,
|
|
126
|
+
tx = transform.tx, ty = transform.ty, parentX = parentCenter.x, parentY = parentCenter.y;
|
|
127
|
+
center.x = (b - a) * (x - parentX - tx) / (b * c - a * d) + parentX;
|
|
128
|
+
center.y = (d - c) * (y - parentY - ty) / (a * d - b * c) + parentY;
|
|
129
|
+
CGPoint absolute = [[transformedView superview] convertPoint:center toView:nil];
|
|
130
|
+
_values[@"originX"] = [NSNumber numberWithDouble:offsetX + absolute.x - view.bounds.size.width / 2.0];
|
|
131
|
+
_values[@"originY"] = [NSNumber numberWithDouble:offsetY + absolute.y - view.bounds.size.height / 2.0];
|
|
96
132
|
}
|
|
97
133
|
#if defined(RCT_NEW_ARCH_ENABLED) || TARGET_OS_TV
|
|
98
134
|
_values[@"borderRadius"] = @(0);
|
|
@@ -110,26 +146,31 @@ const int DEFAULT_MODAL_TOP_OFFSET = 69; // Default iOS modal is shifted from sc
|
|
|
110
146
|
}
|
|
111
147
|
}
|
|
112
148
|
|
|
113
|
-
- (
|
|
149
|
+
- (CGAffineTransform)findCombinedTransform:(REAUIView *)view
|
|
114
150
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
151
|
+
CGAffineTransform transform = view.transform;
|
|
152
|
+
view = view.superview;
|
|
153
|
+
while (view != nil && ![REAScreensHelper isRNSScreenType:view]) {
|
|
154
|
+
// ignore transforms that are caused by transitions
|
|
155
|
+
if (![view.superview isKindOfClass:NSClassFromString(@"UITransitionView")]) {
|
|
156
|
+
CGAffineTransform t = view.transform;
|
|
157
|
+
// we are ignoring translations in superviews, since the positioning obtained by converting the center point (and
|
|
158
|
+
// applying it's view transforms) to the main window is already correct, here we only care about scale, shear and
|
|
159
|
+
// rotation
|
|
160
|
+
transform = CGAffineTransformConcat(transform, CGAffineTransformMake(t.a, t.b, t.c, t.d, 0, 0));
|
|
122
161
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
transformedView != nil
|
|
128
|
-
// Ignore views above screen
|
|
129
|
-
&& ![REAScreensHelper isRNSScreenType:transformedView]);
|
|
162
|
+
view = view.superview;
|
|
163
|
+
}
|
|
164
|
+
return transform;
|
|
165
|
+
}
|
|
130
166
|
|
|
131
|
-
|
|
132
|
-
|
|
167
|
+
- (REAUIView *)maybeFindTransitionView:(REAUIView *)view
|
|
168
|
+
{
|
|
169
|
+
while (view != nil && ![REAScreensHelper isRNSScreenType:view]) {
|
|
170
|
+
if ([view.superview isKindOfClass:NSClassFromString(@"UITransitionView")]) {
|
|
171
|
+
return view;
|
|
172
|
+
}
|
|
173
|
+
view = view.superview;
|
|
133
174
|
}
|
|
134
175
|
return nil;
|
|
135
176
|
}
|