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
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import type { LayoutAnimationFunction, LayoutAnimationType } from './layoutReanimation';
|
|
2
|
-
|
|
2
|
+
import type { ProgressAnimationCallback, SharedTransitionAnimationsFunction } from './layoutReanimation/animationBuilder/commonTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Lets you update the current configuration of the layout animation or shared element transition for a given component.
|
|
5
|
+
* Configurations are batched and applied at the end of the current execution block, right before sending the response back to native.
|
|
6
|
+
*
|
|
7
|
+
* @param viewTag - The tag of the component you'd like to configure.
|
|
8
|
+
* @param type - The type of the animation you'd like to configure - {@link LayoutAnimationType}.
|
|
9
|
+
* @param config - The animation configuration - {@link LayoutAnimationFunction}, {@link SharedTransitionAnimationsFunction}, {@link ProgressAnimationCallback} or {@link Keyframe}. Passing `undefined` will remove the animation.
|
|
10
|
+
* @param sharedTransitionTag - The tag of the shared element transition you'd like to configure. Passing `undefined` will remove the transition.
|
|
11
|
+
* @param isUnmounting - Determines whether the configuration should be included at the end of the batch, after all the non-deferred configurations (even those that were updated later). This is used to retain the correct ordering of shared elements. Defaults to `false`.
|
|
12
|
+
*/
|
|
13
|
+
export declare let updateLayoutAnimations: (viewTag: number, type: LayoutAnimationType, config?: Keyframe | LayoutAnimationFunction | SharedTransitionAnimationsFunction | ProgressAnimationCallback, sharedTransitionTag?: string, isUnmounting?: boolean) => void;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { NativeSyntheticEvent } from 'react-native';
|
|
2
|
-
import type { EventPayload, ReanimatedEvent } from './hook/commonTypes';
|
|
2
|
+
import type { EventPayload, ReanimatedEvent, IWorkletEventHandler } from './hook/commonTypes';
|
|
3
3
|
type JSEvent<Event extends object> = NativeSyntheticEvent<EventPayload<Event>>;
|
|
4
|
-
|
|
4
|
+
declare class WorkletEventHandlerNative<Event extends object> implements IWorkletEventHandler<Event> {
|
|
5
|
+
#private;
|
|
6
|
+
eventNames: string[];
|
|
5
7
|
worklet: (event: ReanimatedEvent<Event>) => void;
|
|
8
|
+
constructor(worklet: (event: ReanimatedEvent<Event>) => void, eventNames: string[]);
|
|
9
|
+
updateEventHandler(newWorklet: (event: ReanimatedEvent<Event>) => void, newEvents: string[]): void;
|
|
10
|
+
registerForEvents(viewTag: number, fallbackEventName?: string): void;
|
|
11
|
+
unregisterFromEvents(viewTag: number): void;
|
|
12
|
+
}
|
|
13
|
+
declare class WorkletEventHandlerWeb<Event extends object> implements IWorkletEventHandler<Event> {
|
|
6
14
|
eventNames: string[];
|
|
7
|
-
reattachNeeded: boolean;
|
|
8
15
|
listeners: Record<string, (event: ReanimatedEvent<ReanimatedEvent<Event>>) => void> | Record<string, (event: JSEvent<Event>) => void>;
|
|
9
|
-
|
|
10
|
-
registrations: number[];
|
|
16
|
+
worklet: (event: ReanimatedEvent<Event>) => void;
|
|
11
17
|
constructor(worklet: (event: ReanimatedEvent<Event>) => void, eventNames?: string[]);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
unregisterFromEvents(): void;
|
|
18
|
+
setupWebListeners(): void;
|
|
19
|
+
updateEventHandler(newWorklet: (event: ReanimatedEvent<Event>) => void, newEvents: string[]): void;
|
|
20
|
+
registerForEvents(_viewTag: number, _fallbackEventName?: string): void;
|
|
21
|
+
unregisterFromEvents(_viewTag: number): void;
|
|
16
22
|
}
|
|
23
|
+
export declare const WorkletEventHandler: typeof WorkletEventHandlerNative | typeof WorkletEventHandlerWeb;
|
|
17
24
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { StyleLayoutAnimation } from './commonTypes';
|
|
2
2
|
import { ReduceMotion } from '../commonTypes';
|
|
3
3
|
import type { SharedValue, AnimatableValue, AnimationObject } from '../commonTypes';
|
|
4
|
+
import type { EasingFunction, EasingFunctionFactory } from '../Easing';
|
|
5
|
+
export declare function assertEasingIsWorklet(easing: EasingFunction | EasingFunctionFactory): void;
|
|
4
6
|
export declare function initialUpdaterRun<T>(updater: () => T): T;
|
|
5
7
|
interface RecognizedPrefixSuffix {
|
|
6
8
|
prefix?: string;
|
|
@@ -14,7 +14,7 @@ interface LayoutAnimationConfigProps {
|
|
|
14
14
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-animation-config/
|
|
15
15
|
*/
|
|
16
16
|
export declare class LayoutAnimationConfig extends Component<LayoutAnimationConfigProps> {
|
|
17
|
-
getMaybeWrappedChildren(): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.
|
|
17
|
+
getMaybeWrappedChildren(): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.JSX.Element[] | null | undefined;
|
|
18
18
|
setShouldAnimateExiting(): void;
|
|
19
19
|
componentWillUnmount(): void;
|
|
20
20
|
render(): ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { AnimatedKeyboardOptions, SensorConfig, SensorType, SharedValue, Value3D, ValueRotation } from './commonTypes';
|
|
2
|
-
import type {
|
|
3
|
-
import type { LayoutAnimationBatchItem, ProgressAnimationCallback, SharedTransitionAnimationsFunction } from './layoutReanimation/animationBuilder/commonTypes';
|
|
3
|
+
import type { LayoutAnimationBatchItem } from './layoutReanimation/animationBuilder/commonTypes';
|
|
4
4
|
export { startMapper, stopMapper } from './mappers';
|
|
5
5
|
export { runOnJS, runOnUI, executeOnUIRuntimeSync } from './threads';
|
|
6
6
|
export { createWorkletRuntime, runOnRuntime } from './runtimes';
|
|
@@ -19,7 +19,7 @@ export declare const isReanimated3: () => boolean;
|
|
|
19
19
|
* @returns `true` in Reanimated 3, doesn't exist in Reanimated 2
|
|
20
20
|
*/
|
|
21
21
|
export declare const isConfigured: () => boolean;
|
|
22
|
-
export declare function getViewProp<T>(viewTag: number, propName: string): Promise<T>;
|
|
22
|
+
export declare function getViewProp<T>(viewTag: number, propName: string, component?: React.Component): Promise<T>;
|
|
23
23
|
export declare function registerEventHandler<T>(eventHandler: (event: T) => void, eventName: string, emitterReactTag?: number): number;
|
|
24
24
|
export declare function unregisterEventHandler(id: number): void;
|
|
25
25
|
export declare function subscribeForKeyboardEvents(eventHandler: (state: number, height: number) => void, options: AnimatedKeyboardOptions): number;
|
|
@@ -28,7 +28,6 @@ export declare function registerSensor(sensorType: SensorType, config: SensorCon
|
|
|
28
28
|
export declare function initializeSensor(sensorType: SensorType, config: SensorConfig): SharedValue<Value3D | ValueRotation>;
|
|
29
29
|
export declare function unregisterSensor(sensorId: number): void;
|
|
30
30
|
export declare function enableLayoutAnimations(flag: boolean, isCallByUser?: boolean): void;
|
|
31
|
-
export declare function configureLayoutAnimations(viewTag: number | HTMLElement, type: LayoutAnimationType, config: LayoutAnimationFunction | Keyframe | SharedTransitionAnimationsFunction | ProgressAnimationCallback, sharedTransitionTag?: string): void;
|
|
32
31
|
export declare function configureLayoutAnimationBatch(layoutAnimationsBatch: LayoutAnimationBatchItem[]): void;
|
|
33
32
|
export declare function setShouldAnimateExitingForTag(viewTag: number | HTMLElement, shouldAnimate: boolean): void;
|
|
34
33
|
export declare function jsiConfigureProps(uiProps: string[], nativeProps: string[]): void;
|
|
@@ -12,6 +12,7 @@ export interface Descriptor {
|
|
|
12
12
|
export interface AnimatedRef<T extends Component> {
|
|
13
13
|
(component?: T): number | ShadowNodeWrapper | HTMLElement;
|
|
14
14
|
current: T | null;
|
|
15
|
+
getTag: () => number;
|
|
15
16
|
}
|
|
16
17
|
export type AnimatedRefOnJS = AnimatedRef<Component>;
|
|
17
18
|
/**
|
|
@@ -44,6 +45,11 @@ export type NativeEventWrapper<Event extends object> = {
|
|
|
44
45
|
export type DefaultStyle = ViewStyle | ImageStyle | TextStyle;
|
|
45
46
|
export type RNNativeScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
|
|
46
47
|
export type ReanimatedScrollEvent = ReanimatedEvent<RNNativeScrollEvent>;
|
|
48
|
+
export interface IWorkletEventHandler<Event extends object> {
|
|
49
|
+
updateEventHandler: (newWorklet: (event: ReanimatedEvent<Event>) => void, newEvents: string[]) => void;
|
|
50
|
+
registerForEvents: (viewTag: number, fallbackEventName?: string) => void;
|
|
51
|
+
unregisterFromEvents: (viewTag: number) => void;
|
|
52
|
+
}
|
|
47
53
|
export interface AnimatedStyleHandle<Style extends DefaultStyle = DefaultStyle> {
|
|
48
54
|
viewDescriptors: ViewDescriptorsSet;
|
|
49
55
|
initial: {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ReanimatedEvent } from './commonTypes';
|
|
1
|
+
import type { IWorkletEventHandler, ReanimatedEvent } from './commonTypes';
|
|
3
2
|
/**
|
|
4
3
|
* Worklet to provide as an argument to `useEvent` hook.
|
|
5
4
|
*/
|
|
6
5
|
export type EventHandler<Event extends object, Context extends Record<string, unknown> = never> = (event: ReanimatedEvent<Event>, context?: Context) => void;
|
|
7
6
|
export type EventHandlerProcessed<Event extends object, Context extends Record<string, unknown> = never> = (event: Event, context?: Context) => void;
|
|
8
7
|
export type EventHandlerInternal<Event extends object> = {
|
|
9
|
-
workletEventHandler:
|
|
8
|
+
workletEventHandler: IWorkletEventHandler<Event>;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
11
|
* Lets you run a function whenever a specified native event occurs.
|
|
@@ -8,4 +8,6 @@ import type { AnimatedRef } from './commonTypes';
|
|
|
8
8
|
* @returns A shared value which holds the current offset of the `ScrollView`.
|
|
9
9
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/useScrollViewOffset
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare const useScrollViewOffset: typeof useScrollViewOffsetWeb;
|
|
12
|
+
declare function useScrollViewOffsetWeb(animatedRef: AnimatedRef<AnimatedScrollView>, providedOffset?: SharedValue<number>): SharedValue<number>;
|
|
13
|
+
export {};
|
|
@@ -29,7 +29,10 @@ export type { FrameInfo } from './frameCallback';
|
|
|
29
29
|
export { getUseOfValueInStyleWarning } from './pluginUtils';
|
|
30
30
|
export { withReanimatedTimer, advanceAnimationByTime, advanceAnimationByFrame, setUpTests, getAnimatedStyle, } from './jestUtils';
|
|
31
31
|
export { LayoutAnimationConfig } from './component/LayoutAnimationConfig';
|
|
32
|
+
export { PerformanceMonitor } from './component/PerformanceMonitor';
|
|
32
33
|
export type { Adaptable, AdaptTransforms, AnimateProps, AnimatedProps, AnimatedTransform, TransformStyleTypes, TransformArrayItem, AnimateStyle, AnimatedStyle, AnimatedStyleProp, StylesOrDefault, } from './helperTypes';
|
|
33
34
|
export type { AnimatedScrollViewProps } from './component/ScrollView';
|
|
34
35
|
export type { FlatListPropsWithLayout } from './component/FlatList';
|
|
35
36
|
export { startMapper, stopMapper } from './mappers';
|
|
37
|
+
export { startScreenTransition, finishScreenTransition, ScreenTransition, } from './screenTransition';
|
|
38
|
+
export type { AnimatedScreenTransition, GoBackGesture, ScreenTransitionConfig, } from './screenTransition';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { ShareableRef, Value3D, ValueRotation } from '../commonTypes';
|
|
2
3
|
import { SensorType } from '../commonTypes';
|
|
3
4
|
import type { WebSensor } from './WebSensor';
|
|
@@ -13,7 +14,6 @@ export default class JSReanimated {
|
|
|
13
14
|
registerEventHandler<T>(_eventHandler: ShareableRef<T>, _eventName: string, _emitterReactTag: number): number;
|
|
14
15
|
unregisterEventHandler(_: number): void;
|
|
15
16
|
enableLayoutAnimations(): void;
|
|
16
|
-
configureLayoutAnimation(): void;
|
|
17
17
|
configureLayoutAnimationBatch(): void;
|
|
18
18
|
setShouldAnimateExitingForTag(): void;
|
|
19
19
|
registerSensor(sensorType: SensorType, interval: number, _iosReferenceFrame: number, eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>): number;
|
|
@@ -24,7 +24,7 @@ export default class JSReanimated {
|
|
|
24
24
|
initializeSensor(sensorType: SensorType, interval: number): WebSensor;
|
|
25
25
|
getSensorName(sensorType: SensorType): string;
|
|
26
26
|
detectPlatform(): void;
|
|
27
|
-
getViewProp<T>(_viewTag: number, _propName: string, _callback?: (result: T) => void): Promise<T>;
|
|
27
|
+
getViewProp<T>(_viewTag: number, _propName: string, _component?: React.Component, _callback?: (result: T) => void): Promise<T>;
|
|
28
28
|
configureProps(): void;
|
|
29
29
|
executeOnUIRuntimeSync<T, R>(_shareable: ShareableRef<T>): R;
|
|
30
30
|
}
|
|
@@ -89,6 +89,7 @@ export type StylePropsWithArrayTransform = StyleProps & {
|
|
|
89
89
|
export interface LayoutAnimationBatchItem {
|
|
90
90
|
viewTag: number;
|
|
91
91
|
type: LayoutAnimationType;
|
|
92
|
-
config: ShareableRef<Keyframe | LayoutAnimationFunction> | undefined;
|
|
92
|
+
config: ShareableRef<Keyframe | LayoutAnimationFunction | SharedTransitionAnimationsFunction | ProgressAnimationCallback> | undefined;
|
|
93
|
+
sharedTransitionTag?: string;
|
|
93
94
|
}
|
|
94
95
|
export {};
|
|
@@ -3,13 +3,13 @@ export declare class ProgressTransitionManager {
|
|
|
3
3
|
private _sharedElementCount;
|
|
4
4
|
private _eventHandler;
|
|
5
5
|
addProgressAnimation(viewTag: number, progressAnimation: ProgressAnimation): void;
|
|
6
|
-
removeProgressAnimation(viewTag: number): void;
|
|
6
|
+
removeProgressAnimation(viewTag: number, isUnmounting?: boolean): void;
|
|
7
7
|
private registerEventHandlers;
|
|
8
8
|
private unregisterEventHandlers;
|
|
9
9
|
}
|
|
10
10
|
declare function createProgressTransitionRegister(): {
|
|
11
11
|
addProgressAnimation: (viewTag: number, progressAnimation: ProgressAnimation) => void;
|
|
12
|
-
removeProgressAnimation: (viewTag: number) => void;
|
|
12
|
+
removeProgressAnimation: (viewTag: number, isUnmounting: boolean) => void;
|
|
13
13
|
onTransitionStart: (viewTag: number, snapshot: Partial<SharedTransitionAnimationsValues>) => void;
|
|
14
14
|
frame: (progress: number) => void;
|
|
15
15
|
onAndroidFinishTransitioning: () => void;
|
package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export declare class SharedTransition {
|
|
|
23
23
|
duration(duration: number): SharedTransition;
|
|
24
24
|
reduceMotion(_reduceMotion: ReduceMotion): this;
|
|
25
25
|
defaultTransitionType(transitionType: SharedTransitionType): SharedTransition;
|
|
26
|
-
registerTransition(viewTag: number, sharedTransitionTag: string): void;
|
|
27
|
-
unregisterTransition(viewTag: number): void;
|
|
26
|
+
registerTransition(viewTag: number, sharedTransitionTag: string, isUnmounting?: boolean): void;
|
|
27
|
+
unregisterTransition(viewTag: number, isUnmounting?: boolean): void;
|
|
28
28
|
getReduceMotion(): ReduceMotion;
|
|
29
29
|
private getTransitionAnimation;
|
|
30
30
|
private getProgressAnimation;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* with the version used to build the native part of the library in runtime.
|
|
4
4
|
* Remember to keep this in sync with the version declared in `package.json`
|
|
5
5
|
*/
|
|
6
|
-
export declare const jsVersion = "3.
|
|
6
|
+
export declare const jsVersion = "3.9.0-layout-animation-experimental";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MeasuredDimensions, ShadowNodeWrapper, SharedValue } from '../commonTypes';
|
|
2
|
+
export type PanGestureHandlerEventPayload = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
absoluteX: number;
|
|
6
|
+
absoluteY: number;
|
|
7
|
+
translationX: number;
|
|
8
|
+
translationY: number;
|
|
9
|
+
velocityX: number;
|
|
10
|
+
velocityY: number;
|
|
11
|
+
};
|
|
12
|
+
export type AnimatedScreenTransition = {
|
|
13
|
+
topScreenStyle: (event: PanGestureHandlerEventPayload, screenDimensions: MeasuredDimensions) => Record<string, unknown>;
|
|
14
|
+
belowTopScreenStyle: (event: PanGestureHandlerEventPayload, screenDimensions: MeasuredDimensions) => Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
export type GoBackGesture = 'swipeRight' | 'swipeLeft' | 'swipeUp' | 'swipeDown' | 'verticalSwipe' | 'horizontalSwipe' | 'twoDimensionalSwipe';
|
|
17
|
+
export type ScreenTransitionConfig = {
|
|
18
|
+
stackTag: number;
|
|
19
|
+
belowTopScreenId: number | ShadowNodeWrapper;
|
|
20
|
+
topScreenId: number | ShadowNodeWrapper;
|
|
21
|
+
screenTransition: AnimatedScreenTransition;
|
|
22
|
+
sharedEvent: SharedValue<PanGestureHandlerEventPayload>;
|
|
23
|
+
startingGesturePosition: SharedValue<PanGestureHandlerEventPayload>;
|
|
24
|
+
onFinishAnimation?: () => void;
|
|
25
|
+
isTransitionCanceled: boolean;
|
|
26
|
+
goBackGesture: GoBackGesture;
|
|
27
|
+
screenDimensions: MeasuredDimensions;
|
|
28
|
+
};
|
|
29
|
+
export type RNScreensTurboModuleType = {
|
|
30
|
+
startTransition: (stackTag: number) => {
|
|
31
|
+
topScreenId: number | ShadowNodeWrapper;
|
|
32
|
+
belowTopScreenId: number | ShadowNodeWrapper;
|
|
33
|
+
canStartTransition: boolean;
|
|
34
|
+
};
|
|
35
|
+
updateTransition: (stackTag: number, progress: number) => void;
|
|
36
|
+
finishTransition: (stackTag: number, isCanceled: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
export type LockAxis = 'x' | 'y' | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnimatedScreenTransition } from './commonTypes';
|
|
2
|
+
export declare const ScreenTransition: {
|
|
3
|
+
SwipeRight: AnimatedScreenTransition;
|
|
4
|
+
SwipeLeft: AnimatedScreenTransition;
|
|
5
|
+
SwipeDown: AnimatedScreenTransition;
|
|
6
|
+
SwipeUp: AnimatedScreenTransition;
|
|
7
|
+
Horizontal: AnimatedScreenTransition;
|
|
8
|
+
Vertical: AnimatedScreenTransition;
|
|
9
|
+
TwoDimensional: AnimatedScreenTransition;
|
|
10
|
+
SwipeRightFade: AnimatedScreenTransition;
|
|
11
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PanGestureHandlerEventPayload, ScreenTransitionConfig } from './commonTypes';
|
|
2
|
+
export declare function applyStyleForBelowTopScreen(screenTransitionConfig: ScreenTransitionConfig, event: PanGestureHandlerEventPayload): void;
|
|
3
|
+
export declare function applyStyle(screenTransitionConfig: ScreenTransitionConfig, event: PanGestureHandlerEventPayload): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0-layout-animation-experimental",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "yarn run format:js && yarn run lint:js && yarn run test:unit",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"format:js": "prettier --write --list-different src __tests__ __typetests__",
|
|
19
19
|
"format:plugin": "cd plugin && yarn format && cd ..",
|
|
20
20
|
"format:java": "node ./scripts/format-java.js",
|
|
21
|
-
"format:ios": "find apple/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i --Werror",
|
|
21
|
+
"format:ios": "find apple/ -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.mm\" -o -iname \"*.cpp\" | xargs clang-format -i --Werror",
|
|
22
22
|
"format:android": "find android/src/ -iname *.h -o -iname *.cpp | xargs clang-format -i",
|
|
23
23
|
"format:common": "find Common/ -iname *.h -o -iname *.cpp | xargs clang-format -i",
|
|
24
24
|
"format:docs": "cd docs && yarn format && cd ..",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"type:check:tests:0.72+": "./scripts/test-ts.sh __typetests__/0.72+",
|
|
31
31
|
"type:check:tests:legacy": "./scripts/test-ts.sh __typetests__/legacy",
|
|
32
32
|
"type:check:all": "yarn type:check:src && yarn type:check:plugin && ./scripts/test-ts.sh app/src/App.tsx __typetests__/common __typetests__/0.72+ __typetests__/legacy",
|
|
33
|
-
"
|
|
33
|
+
"build": "yarn build:plugin && bob build && husky install && yarn build:app",
|
|
34
|
+
"build:app": "cd app && yarn install && yarn build",
|
|
35
|
+
"build:plugin": "cd plugin && yarn install && yarn build",
|
|
34
36
|
"circular_dependency_check": "yarn madge --extensions js,ts,tsx --circular src lib",
|
|
35
|
-
"use_strict_check": "node ./scripts/validate-use-strict.js"
|
|
36
|
-
"plugin": "cd plugin && yarn && cd ..",
|
|
37
|
-
"app": "cd app && yarn && cd .."
|
|
37
|
+
"use_strict_check": "node ./scripts/validate-use-strict.js"
|
|
38
38
|
},
|
|
39
39
|
"main": "lib/module/index",
|
|
40
40
|
"module": "lib/module/index",
|
|
@@ -101,7 +101,10 @@
|
|
|
101
101
|
"@babel/core": "^7.20.0",
|
|
102
102
|
"@babel/preset-env": "^7.20.0",
|
|
103
103
|
"@babel/types": "^7.20.0",
|
|
104
|
-
"@react-native/
|
|
104
|
+
"@react-native/babel-preset": "0.74.81",
|
|
105
|
+
"@react-native/eslint-config": "0.74.81",
|
|
106
|
+
"@react-native/metro-config": "0.74.81",
|
|
107
|
+
"@react-native/typescript-config": "0.74.81",
|
|
105
108
|
"@testing-library/jest-native": "^4.0.4",
|
|
106
109
|
"@testing-library/react-hooks": "^8.0.0",
|
|
107
110
|
"@testing-library/react-native": "^7.1.0",
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
"@types/jest": "^29.0.0",
|
|
114
117
|
"@types/node": "^18.0.0",
|
|
115
118
|
"@types/react": "^18.0.26",
|
|
116
|
-
"@types/react-test-renderer": "17.0.
|
|
119
|
+
"@types/react-test-renderer": "^17.0.0-0",
|
|
117
120
|
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
118
121
|
"@typescript-eslint/parser": "^6.19.0",
|
|
119
122
|
"@typescript-eslint/rule-tester": "^6.21.0",
|
|
@@ -137,24 +140,24 @@
|
|
|
137
140
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
138
141
|
"husky": "^7.0.4",
|
|
139
142
|
"jest": "^29.0.0",
|
|
140
|
-
"lint-staged": "^
|
|
143
|
+
"lint-staged": "^15.2.2",
|
|
141
144
|
"madge": "^5.0.1",
|
|
142
145
|
"prettier": "^2.5.1",
|
|
143
|
-
"react": "
|
|
144
|
-
"react-native": "0.
|
|
146
|
+
"react": "18.2.0",
|
|
147
|
+
"react-native": "0.74.0",
|
|
145
148
|
"react-native-builder-bob": "^0.18.3",
|
|
146
|
-
"react-native-gesture-handler": "^2.
|
|
149
|
+
"react-native-gesture-handler": "^2.16.0",
|
|
147
150
|
"react-native-web": "~0.18.12",
|
|
148
|
-
"react-test-renderer": "
|
|
151
|
+
"react-test-renderer": "18.2.0",
|
|
149
152
|
"shelljs": "^0.8.5",
|
|
150
153
|
"ts-prune": "^0.10.3",
|
|
151
154
|
"typescript": "^4.1.3"
|
|
152
155
|
},
|
|
153
156
|
"lint-staged": {
|
|
154
157
|
"*.(js|ts|tsx)": [
|
|
155
|
-
"eslint",
|
|
156
|
-
"eslint --quiet --ext '.js,.ts,.tsx' src/",
|
|
157
|
-
"prettier --write"
|
|
158
|
+
"yarn eslint",
|
|
159
|
+
"yarn eslint --quiet --ext '.js,.ts,.tsx' src/",
|
|
160
|
+
"yarn prettier --write"
|
|
158
161
|
],
|
|
159
162
|
"plugin/**/*.ts": "yarn lint:plugin",
|
|
160
163
|
"**/*.{h,cpp}": "yarn lint:cpp",
|
|
@@ -171,8 +174,17 @@
|
|
|
171
174
|
"typescript"
|
|
172
175
|
]
|
|
173
176
|
},
|
|
177
|
+
"codegenConfig": {
|
|
178
|
+
"name": "rnreanimated",
|
|
179
|
+
"type": "modules",
|
|
180
|
+
"jsSrcsDir": "./src/specs",
|
|
181
|
+
"android": {
|
|
182
|
+
"javaPackageName": "com.swmansion.reanimated"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
174
185
|
"sideEffects": [
|
|
175
186
|
"./lib/reanimated2/core",
|
|
176
187
|
"./lib/index"
|
|
177
|
-
]
|
|
188
|
+
],
|
|
189
|
+
"packageManager": "yarn@4.1.1"
|
|
178
190
|
}
|
package/plugin/build/plugin.js
CHANGED
|
@@ -344,7 +344,7 @@ var require_workletFactory = __commonJS({
|
|
|
344
344
|
sourceMaps: true,
|
|
345
345
|
sourceFileName: state.file.opts.filename
|
|
346
346
|
});
|
|
347
|
-
codeObject.code = "(" + (
|
|
347
|
+
codeObject.code = "(" + (fun.isObjectMethod() ? "function " : "") + codeObject.code + "\n)";
|
|
348
348
|
const transformed = (0, core_1.transformSync)(codeObject.code, {
|
|
349
349
|
filename: state.file.opts.filename,
|
|
350
350
|
presets: workletStringTransformPresets,
|
|
@@ -368,7 +368,10 @@ var require_workletFactory = __commonJS({
|
|
|
368
368
|
if (variables.length > 0) {
|
|
369
369
|
lineOffset -= variables.length + 2;
|
|
370
370
|
}
|
|
371
|
-
const pathForStringDefinitions = fun.parentPath.isProgram() ? fun : fun.findParent((path) =>
|
|
371
|
+
const pathForStringDefinitions = fun.parentPath.isProgram() ? fun : fun.findParent((path) => {
|
|
372
|
+
var _a, _b;
|
|
373
|
+
return (_b = (_a = path.parentPath) === null || _a === void 0 ? void 0 : _a.isProgram()) !== null && _b !== void 0 ? _b : false;
|
|
374
|
+
});
|
|
372
375
|
(0, assert_1.strict)(pathForStringDefinitions, "[Reanimated] `pathForStringDefinitions` is null.");
|
|
373
376
|
(0, assert_1.strict)(pathForStringDefinitions.parentPath, "[Reanimated] `pathForStringDefinitions.parentPath` is null.");
|
|
374
377
|
const initDataId = pathForStringDefinitions.parentPath.scope.generateUidIdentifier(`worklet_${workletHash}_init_data`);
|
|
@@ -530,6 +533,8 @@ var require_workletFactoryCall = __commonJS({
|
|
|
530
533
|
const originalWorkletLocation = path.node.loc;
|
|
531
534
|
if (originalWorkletLocation) {
|
|
532
535
|
workletFactoryCall.callee.loc = {
|
|
536
|
+
filename: originalWorkletLocation.filename,
|
|
537
|
+
identifierName: originalWorkletLocation.identifierName,
|
|
533
538
|
start: originalWorkletLocation.start,
|
|
534
539
|
end: originalWorkletLocation.start
|
|
535
540
|
};
|
package/src/ConfigHelper.ts
CHANGED
package/src/animationBuilder.tsx
CHANGED
|
@@ -34,6 +34,8 @@ function getCommonProperties(
|
|
|
34
34
|
? componentStyle.flat()
|
|
35
35
|
: [componentStyle];
|
|
36
36
|
|
|
37
|
+
componentStyleFlat = componentStyleFlat.filter(Boolean);
|
|
38
|
+
|
|
37
39
|
componentStyleFlat = componentStyleFlat.map((style) =>
|
|
38
40
|
'initial' in style
|
|
39
41
|
? style.initial.value // Include properties of animated style
|
|
@@ -111,9 +111,9 @@ export function hasInlineStyles(style: StyleProps): boolean {
|
|
|
111
111
|
|
|
112
112
|
export function getInlineStyle(
|
|
113
113
|
style: Record<string, unknown>,
|
|
114
|
-
|
|
114
|
+
shouldGetInitialStyle: boolean
|
|
115
115
|
) {
|
|
116
|
-
if (
|
|
116
|
+
if (shouldGetInitialStyle) {
|
|
117
117
|
return getInlinePropsUpdate(style);
|
|
118
118
|
}
|
|
119
119
|
const newStyle: StyleProps = {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
NativeModules,
|
|
5
|
-
findNodeHandle,
|
|
6
|
-
} from 'react-native';
|
|
2
|
+
import { NativeEventEmitter, Platform, findNodeHandle } from 'react-native';
|
|
3
|
+
import type { NativeModule } from 'react-native';
|
|
7
4
|
import { shouldBeUseWeb } from '../reanimated2/PlatformChecker';
|
|
8
5
|
import type { StyleProps } from '../reanimated2';
|
|
9
6
|
import { runOnJS, runOnUIImmediately } from '../reanimated2/threads';
|
|
@@ -13,6 +10,7 @@ import type {
|
|
|
13
10
|
IJSPropsUpdater,
|
|
14
11
|
InitialComponentProps,
|
|
15
12
|
} from './commonTypes';
|
|
13
|
+
import NativeReanimatedModule from '../specs/NativeReanimatedModule';
|
|
16
14
|
|
|
17
15
|
interface ListenerData {
|
|
18
16
|
viewTag: number;
|
|
@@ -27,7 +25,10 @@ class JSPropsUpdaterPaper implements IJSPropsUpdater {
|
|
|
27
25
|
|
|
28
26
|
constructor() {
|
|
29
27
|
this._reanimatedEventEmitter = new NativeEventEmitter(
|
|
30
|
-
|
|
28
|
+
// NativeEventEmitter only uses this parameter on iOS.
|
|
29
|
+
Platform.OS === 'ios'
|
|
30
|
+
? (NativeReanimatedModule as unknown as NativeModule)
|
|
31
|
+
: undefined
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import type {
|
|
3
|
+
AnimatedComponentProps,
|
|
4
|
+
IAnimatedComponentInternal,
|
|
5
|
+
InitialComponentProps,
|
|
6
|
+
} from './commonTypes';
|
|
7
|
+
|
|
8
|
+
export default class JSPropsUpdaterWeb {
|
|
9
|
+
public addOnJSPropsChangeListener(
|
|
10
|
+
_animatedComponent: React.Component<
|
|
11
|
+
AnimatedComponentProps<InitialComponentProps>
|
|
12
|
+
> &
|
|
13
|
+
IAnimatedComponentInternal
|
|
14
|
+
) {
|
|
15
|
+
// noop
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public removeOnJSPropsChangeListener(
|
|
19
|
+
_animatedComponent: React.Component<
|
|
20
|
+
AnimatedComponentProps<InitialComponentProps>
|
|
21
|
+
> &
|
|
22
|
+
IAnimatedComponentInternal
|
|
23
|
+
) {
|
|
24
|
+
// noop
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { shallowEqual } from '../reanimated2/hook/utils';
|
|
4
|
+
import type { StyleProps } from '../reanimated2/commonTypes';
|
|
5
|
+
import { isSharedValue } from '../reanimated2/isSharedValue';
|
|
4
6
|
import { isChromeDebugger } from '../reanimated2/PlatformChecker';
|
|
5
|
-
import WorkletEventHandler from '../reanimated2/WorkletEventHandler';
|
|
7
|
+
import { WorkletEventHandler } from '../reanimated2/WorkletEventHandler';
|
|
6
8
|
import { initialUpdaterRun } from '../reanimated2/animation';
|
|
7
9
|
import { hasInlineStyles, getInlineStyle } from './InlinePropManager';
|
|
8
10
|
import type {
|
|
@@ -22,23 +24,32 @@ function dummyListener() {
|
|
|
22
24
|
|
|
23
25
|
export class PropsFilter implements IPropsFilter {
|
|
24
26
|
private _initialStyle = {};
|
|
27
|
+
private _previousProps: React.Component['props'] | null = null;
|
|
28
|
+
private _requiresNewInitials = true;
|
|
25
29
|
|
|
26
30
|
public filterNonAnimatedProps(
|
|
27
31
|
component: React.Component<unknown, unknown> & IAnimatedComponentInternal
|
|
28
32
|
): Record<string, unknown> {
|
|
29
33
|
const inputProps =
|
|
30
34
|
component.props as AnimatedComponentProps<InitialComponentProps>;
|
|
35
|
+
|
|
36
|
+
this._maybePrepareForNewInitials(inputProps);
|
|
37
|
+
|
|
31
38
|
const props: Record<string, unknown> = {};
|
|
32
39
|
for (const key in inputProps) {
|
|
33
40
|
const value = inputProps[key];
|
|
34
41
|
if (key === 'style') {
|
|
35
42
|
const styleProp = inputProps.style;
|
|
36
43
|
const styles = flattenArray<StyleProps>(styleProp ?? []);
|
|
44
|
+
if (this._requiresNewInitials) {
|
|
45
|
+
this._initialStyle = {};
|
|
46
|
+
}
|
|
37
47
|
const processedStyle: StyleProps = styles.map((style) => {
|
|
38
48
|
if (style && style.viewDescriptors) {
|
|
39
49
|
// this is how we recognize styles returned by useAnimatedStyle
|
|
50
|
+
// TODO - refactor, since `viewsRef` is only present on Web
|
|
40
51
|
style.viewsRef?.add(component);
|
|
41
|
-
if (
|
|
52
|
+
if (this._requiresNewInitials) {
|
|
42
53
|
this._initialStyle = {
|
|
43
54
|
...style.initial.value,
|
|
44
55
|
...this._initialStyle,
|
|
@@ -47,7 +58,7 @@ export class PropsFilter implements IPropsFilter {
|
|
|
47
58
|
}
|
|
48
59
|
return this._initialStyle;
|
|
49
60
|
} else if (hasInlineStyles(style)) {
|
|
50
|
-
return getInlineStyle(style,
|
|
61
|
+
return getInlineStyle(style, this._requiresNewInitials);
|
|
51
62
|
} else {
|
|
52
63
|
return style;
|
|
53
64
|
}
|
|
@@ -61,6 +72,7 @@ export class PropsFilter implements IPropsFilter {
|
|
|
61
72
|
Object.keys(animatedProp.initial.value).forEach((initialValueKey) => {
|
|
62
73
|
props[initialValueKey] =
|
|
63
74
|
animatedProp.initial?.value[initialValueKey];
|
|
75
|
+
// TODO - refacotr, since `viewsRef` is only present on Web
|
|
64
76
|
animatedProp.viewsRef?.add(component);
|
|
65
77
|
});
|
|
66
78
|
}
|
|
@@ -80,13 +92,26 @@ export class PropsFilter implements IPropsFilter {
|
|
|
80
92
|
props[key] = dummyListener;
|
|
81
93
|
}
|
|
82
94
|
} else if (isSharedValue(value)) {
|
|
83
|
-
if (
|
|
95
|
+
if (this._requiresNewInitials) {
|
|
84
96
|
props[key] = value.value;
|
|
85
97
|
}
|
|
86
98
|
} else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {
|
|
87
99
|
props[key] = value;
|
|
88
100
|
}
|
|
89
101
|
}
|
|
102
|
+
this._requiresNewInitials = false;
|
|
90
103
|
return props;
|
|
91
104
|
}
|
|
105
|
+
|
|
106
|
+
private _maybePrepareForNewInitials(
|
|
107
|
+
inputProps: AnimatedComponentProps<InitialComponentProps>
|
|
108
|
+
) {
|
|
109
|
+
if (this._previousProps && inputProps.style) {
|
|
110
|
+
this._requiresNewInitials = !shallowEqual(
|
|
111
|
+
this._previousProps,
|
|
112
|
+
inputProps
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
this._previousProps = inputProps;
|
|
116
|
+
}
|
|
92
117
|
}
|