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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Bezier","linear","t","ease","quad","cubic","poly","n","Math","pow","sin","cos","PI","circle","sqrt","exp","elastic","bounciness","arguments","length","undefined","p","back","s","bounce","t2","bezier","x1","y1","x2","y2","factory","bezierFn","in_","easing","out","inOut","steps","roundToNextStep","value","min","max","ceil","floor","EasingObject","in","Easing"],"sources":["Easing.ts"],"sourcesContent":["'use strict';\nimport { Bezier } from './Bezier';\n\n/**\n * The `Easing` module implements common easing functions. This module is used\n * by [Animate.timing()](docs/animate.html#timing) to convey physically\n * believable motion in animations.\n *\n * You can find a visualization of some common easing functions at\n * http://easings.net/\n *\n * ### Predefined animations\n *\n * The `Easing` module provides several predefined animations through the\n * following methods:\n *\n * - [`back`](docs/easing.html#back) provides a simple animation where the\n * object goes slightly back before moving forward\n * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation\n * - [`ease`](docs/easing.html#ease) provides a simple inertial animation\n * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction\n *\n * ### Standard functions\n *\n * Three standard easing functions are provided:\n *\n * - [`linear`](docs/easing.html#linear)\n * - [`quad`](docs/easing.html#quad)\n * - [`cubic`](docs/easing.html#cubic)\n *\n * The [`poly`](docs/easing.html#poly) function can be used to implement\n * quartic, quintic, and other higher power functions.\n *\n * ### Additional functions\n *\n * Additional mathematical functions are provided by the following methods:\n *\n * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve\n * - [`circle`](docs/easing.html#circle) provides a circular function\n * - [`sin`](docs/easing.html#sin) provides a sinusoidal function\n * - [`exp`](docs/easing.html#exp) provides an exponential function\n *\n * The following helpers are used to modify other easing functions.\n *\n * - [`in`](docs/easing.html#in) runs an easing function forwards\n * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical\n * - [`out`](docs/easing.html#out) runs an easing function backwards\n */\n\nexport type EasingFunction = (t: number) => number;\n\n/**\n * @deprecated Please use {@link EasingFunction} type instead.\n */\nexport type EasingFn = EasingFunction;\n\nexport type EasingFunctionFactory = { factory: () => EasingFunction };\n\n/**\n * @deprecated Please use {@link EasingFunctionFactory} type instead.\n */\nexport type EasingFactoryFn = EasingFunctionFactory;\n/**\n * A linear function, `f(t) = t`. Position correlates to elapsed time one to\n * one.\n *\n * http://cubic-bezier.com/#0,0,1,1\n */\nfunction linear(t: number): number {\n 'worklet';\n return t;\n}\n\n/**\n * A simple inertial interaction, similar to an object slowly accelerating to\n * speed.\n *\n * http://cubic-bezier.com/#.42,0,1,1\n */\nfunction ease(t: number): number {\n 'worklet';\n return Bezier(0.42, 0, 1, 1)(t);\n}\n\n/**\n * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed\n * time.\n *\n * http://easings.net/#easeInQuad\n */\nfunction quad(t: number): number {\n 'worklet';\n return t * t;\n}\n\n/**\n * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed\n * time.\n *\n * http://easings.net/#easeInCubic\n */\nfunction cubic(t: number): number {\n 'worklet';\n return t * t * t;\n}\n\n/**\n * A power function. Position is equal to the Nth power of elapsed time.\n *\n * n = 4: http://easings.net/#easeInQuart\n * n = 5: http://easings.net/#easeInQuint\n */\nfunction poly(n: number): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n return Math.pow(t, n);\n };\n}\n\n/**\n * A sinusoidal function.\n *\n * http://easings.net/#easeInSine\n */\nfunction sin(t: number): number {\n 'worklet';\n return 1 - Math.cos((t * Math.PI) / 2);\n}\n\n/**\n * A circular function.\n *\n * http://easings.net/#easeInCirc\n */\nfunction circle(t: number): number {\n 'worklet';\n return 1 - Math.sqrt(1 - t * t);\n}\n\n/**\n * An exponential function.\n *\n * http://easings.net/#easeInExpo\n */\nfunction exp(t: number): number {\n 'worklet';\n return Math.pow(2, 10 * (t - 1));\n}\n\n/**\n * A simple elastic interaction, similar to a spring oscillating back and\n * forth.\n *\n * Default bounciness is 1, which overshoots a little bit once. 0 bounciness\n * doesn't overshoot at all, and bounciness of N \\> 1 will overshoot about N\n * times.\n *\n * http://easings.net/#easeInElastic\n */\nfunction elastic(bounciness = 1): EasingFunction {\n 'worklet';\n const p = bounciness * Math.PI;\n return (t) => {\n 'worklet';\n return 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);\n };\n}\n\n/**\n * Use with `Animated.parallel()` to create a simple effect where the object\n * animates back slightly as the animation starts.\n *\n * Wolfram Plot:\n *\n * - http://tiny.cc/back_default (s = 1.70158, default)\n */\nfunction back(s = 1.70158): (t: number) => number {\n 'worklet';\n return (t) => {\n 'worklet';\n return t * t * ((s + 1) * t - s);\n };\n}\n\n/**\n * Provides a simple bouncing effect.\n *\n * http://easings.net/#easeInBounce\n */\nfunction bounce(t: number): number {\n 'worklet';\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n }\n\n if (t < 2 / 2.75) {\n const t2 = t - 1.5 / 2.75;\n return 7.5625 * t2 * t2 + 0.75;\n }\n\n if (t < 2.5 / 2.75) {\n const t2 = t - 2.25 / 2.75;\n return 7.5625 * t2 * t2 + 0.9375;\n }\n\n const t2 = t - 2.625 / 2.75;\n return 7.5625 * t2 * t2 + 0.984375;\n}\n\n/**\n * Provides a cubic bezier curve, equivalent to CSS Transitions'\n * `transition-timing-function`.\n *\n * A useful tool to visualize cubic bezier curves can be found at\n * http://cubic-bezier.com/\n */\nfunction bezier(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n): { factory: () => (x: number) => number } {\n 'worklet';\n return {\n factory: () => {\n 'worklet';\n return Bezier(x1, y1, x2, y2);\n },\n };\n}\n\nfunction bezierFn(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n): (x: number) => number {\n 'worklet';\n return Bezier(x1, y1, x2, y2);\n}\n\n/**\n * Runs an easing function forwards.\n */\nfunction in_(easing: EasingFunction): EasingFunction {\n 'worklet';\n return easing;\n}\n\n/**\n * Runs an easing function backwards.\n */\nfunction out(easing: EasingFunction): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n return 1 - easing(1 - t);\n };\n}\n\n/**\n * Makes any easing function symmetrical. The easing function will run\n * forwards for half of the duration, then backwards for the rest of the\n * duration.\n */\nfunction inOut(easing: EasingFunction): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n return 1 - easing((1 - t) * 2) / 2;\n };\n}\n\n/**\n * The `steps` easing function jumps between discrete values at regular intervals,\n * creating a stepped animation effect. The `n` parameter determines the number of\n * steps in the animation, and the `roundToNextStep` parameter determines whether the animation\n * should start at the beginning or end of each step.\n */\nfunction steps(n = 10, roundToNextStep = true): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n const value = Math.min(Math.max(t, 0), 1) * n;\n if (roundToNextStep) {\n return Math.ceil(value) / n;\n }\n return Math.floor(value) / n;\n };\n}\n\nconst EasingObject = {\n linear,\n ease,\n quad,\n cubic,\n poly,\n sin,\n circle,\n exp,\n elastic,\n back,\n bounce,\n bezier,\n bezierFn,\n steps,\n in: in_,\n out,\n inOut,\n};\n\nexport const Easing = EasingObject;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,UAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,MAAMA,CAACC,CAAS,EAAU;EACjC,SAAS;;EACT,OAAOA,CAAC;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAACD,CAAS,EAAU;EAC/B,SAAS;;EACT,OAAOF,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAACE,CAAC,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,IAAIA,CAACF,CAAS,EAAU;EAC/B,SAAS;;EACT,OAAOA,CAAC,GAAGA,CAAC;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,KAAKA,CAACH,CAAS,EAAU;EAChC,SAAS;;EACT,OAAOA,CAAC,GAAGA,CAAC,GAAGA,CAAC;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,IAAIA,CAACC,CAAS,EAAkB;EACvC,SAAS;;EACT,OAAQL,CAAC,IAAK;IACZ,SAAS;;IACT,OAAOM,IAAI,CAACC,GAAG,CAACP,CAAC,EAAEK,CAAC,CAAC;EACvB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASG,GAAGA,CAACR,CAAS,EAAU;EAC9B,SAAS;;EACT,OAAO,CAAC,GAAGM,IAAI,CAACG,GAAG,CAAET,CAAC,GAAGM,IAAI,CAACI,EAAE,GAAI,CAAC,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,MAAMA,CAACX,CAAS,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Z,GAAG;EACPE,GAAG;EACHC;AACF,CAAC;AAED,OAAO,MAAMU,MAAM,GAAGF,YAAY"}
|
|
1
|
+
{"version":3,"names":["Bezier","linear","t","ease","quad","cubic","poly","n","Math","pow","sin","cos","PI","circle","sqrt","exp","elastic","bounciness","p","back","s","bounce","t2","bezier","x1","y1","x2","y2","factory","bezierFn","in_","easing","out","inOut","steps","roundToNextStep","value","min","max","ceil","floor","EasingObject","in","Easing"],"sources":["Easing.ts"],"sourcesContent":["'use strict';\nimport { Bezier } from './Bezier';\n\n/**\n * The `Easing` module implements common easing functions. This module is used\n * by [Animate.timing()](docs/animate.html#timing) to convey physically\n * believable motion in animations.\n *\n * You can find a visualization of some common easing functions at\n * http://easings.net/\n *\n * ### Predefined animations\n *\n * The `Easing` module provides several predefined animations through the\n * following methods:\n *\n * - [`back`](docs/easing.html#back) provides a simple animation where the\n * object goes slightly back before moving forward\n * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation\n * - [`ease`](docs/easing.html#ease) provides a simple inertial animation\n * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction\n *\n * ### Standard functions\n *\n * Three standard easing functions are provided:\n *\n * - [`linear`](docs/easing.html#linear)\n * - [`quad`](docs/easing.html#quad)\n * - [`cubic`](docs/easing.html#cubic)\n *\n * The [`poly`](docs/easing.html#poly) function can be used to implement\n * quartic, quintic, and other higher power functions.\n *\n * ### Additional functions\n *\n * Additional mathematical functions are provided by the following methods:\n *\n * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve\n * - [`circle`](docs/easing.html#circle) provides a circular function\n * - [`sin`](docs/easing.html#sin) provides a sinusoidal function\n * - [`exp`](docs/easing.html#exp) provides an exponential function\n *\n * The following helpers are used to modify other easing functions.\n *\n * - [`in`](docs/easing.html#in) runs an easing function forwards\n * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical\n * - [`out`](docs/easing.html#out) runs an easing function backwards\n */\n\nexport type EasingFunction = (t: number) => number;\n\n/**\n * @deprecated Please use {@link EasingFunction} type instead.\n */\nexport type EasingFn = EasingFunction;\n\nexport type EasingFunctionFactory = { factory: () => EasingFunction };\n\n/**\n * @deprecated Please use {@link EasingFunctionFactory} type instead.\n */\nexport type EasingFactoryFn = EasingFunctionFactory;\n/**\n * A linear function, `f(t) = t`. Position correlates to elapsed time one to\n * one.\n *\n * http://cubic-bezier.com/#0,0,1,1\n */\nfunction linear(t: number): number {\n 'worklet';\n return t;\n}\n\n/**\n * A simple inertial interaction, similar to an object slowly accelerating to\n * speed.\n *\n * http://cubic-bezier.com/#.42,0,1,1\n */\nfunction ease(t: number): number {\n 'worklet';\n return Bezier(0.42, 0, 1, 1)(t);\n}\n\n/**\n * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed\n * time.\n *\n * http://easings.net/#easeInQuad\n */\nfunction quad(t: number): number {\n 'worklet';\n return t * t;\n}\n\n/**\n * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed\n * time.\n *\n * http://easings.net/#easeInCubic\n */\nfunction cubic(t: number): number {\n 'worklet';\n return t * t * t;\n}\n\n/**\n * A power function. Position is equal to the Nth power of elapsed time.\n *\n * n = 4: http://easings.net/#easeInQuart\n * n = 5: http://easings.net/#easeInQuint\n */\nfunction poly(n: number): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n return Math.pow(t, n);\n };\n}\n\n/**\n * A sinusoidal function.\n *\n * http://easings.net/#easeInSine\n */\nfunction sin(t: number): number {\n 'worklet';\n return 1 - Math.cos((t * Math.PI) / 2);\n}\n\n/**\n * A circular function.\n *\n * http://easings.net/#easeInCirc\n */\nfunction circle(t: number): number {\n 'worklet';\n return 1 - Math.sqrt(1 - t * t);\n}\n\n/**\n * An exponential function.\n *\n * http://easings.net/#easeInExpo\n */\nfunction exp(t: number): number {\n 'worklet';\n return Math.pow(2, 10 * (t - 1));\n}\n\n/**\n * A simple elastic interaction, similar to a spring oscillating back and\n * forth.\n *\n * Default bounciness is 1, which overshoots a little bit once. 0 bounciness\n * doesn't overshoot at all, and bounciness of N \\> 1 will overshoot about N\n * times.\n *\n * http://easings.net/#easeInElastic\n */\nfunction elastic(bounciness = 1): EasingFunction {\n 'worklet';\n const p = bounciness * Math.PI;\n return (t) => {\n 'worklet';\n return 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);\n };\n}\n\n/**\n * Use with `Animated.parallel()` to create a simple effect where the object\n * animates back slightly as the animation starts.\n *\n * Wolfram Plot:\n *\n * - http://tiny.cc/back_default (s = 1.70158, default)\n */\nfunction back(s = 1.70158): (t: number) => number {\n 'worklet';\n return (t) => {\n 'worklet';\n return t * t * ((s + 1) * t - s);\n };\n}\n\n/**\n * Provides a simple bouncing effect.\n *\n * http://easings.net/#easeInBounce\n */\nfunction bounce(t: number): number {\n 'worklet';\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n }\n\n if (t < 2 / 2.75) {\n const t2 = t - 1.5 / 2.75;\n return 7.5625 * t2 * t2 + 0.75;\n }\n\n if (t < 2.5 / 2.75) {\n const t2 = t - 2.25 / 2.75;\n return 7.5625 * t2 * t2 + 0.9375;\n }\n\n const t2 = t - 2.625 / 2.75;\n return 7.5625 * t2 * t2 + 0.984375;\n}\n\n/**\n * Provides a cubic bezier curve, equivalent to CSS Transitions'\n * `transition-timing-function`.\n *\n * A useful tool to visualize cubic bezier curves can be found at\n * http://cubic-bezier.com/\n */\nfunction bezier(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n): { factory: () => (x: number) => number } {\n 'worklet';\n return {\n factory: () => {\n 'worklet';\n return Bezier(x1, y1, x2, y2);\n },\n };\n}\n\nfunction bezierFn(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n): (x: number) => number {\n 'worklet';\n return Bezier(x1, y1, x2, y2);\n}\n\n/**\n * Runs an easing function forwards.\n */\nfunction in_(easing: EasingFunction): EasingFunction {\n 'worklet';\n return easing;\n}\n\n/**\n * Runs an easing function backwards.\n */\nfunction out(easing: EasingFunction): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n return 1 - easing(1 - t);\n };\n}\n\n/**\n * Makes any easing function symmetrical. The easing function will run\n * forwards for half of the duration, then backwards for the rest of the\n * duration.\n */\nfunction inOut(easing: EasingFunction): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n return 1 - easing((1 - t) * 2) / 2;\n };\n}\n\n/**\n * The `steps` easing function jumps between discrete values at regular intervals,\n * creating a stepped animation effect. The `n` parameter determines the number of\n * steps in the animation, and the `roundToNextStep` parameter determines whether the animation\n * should start at the beginning or end of each step.\n */\nfunction steps(n = 10, roundToNextStep = true): EasingFunction {\n 'worklet';\n return (t) => {\n 'worklet';\n const value = Math.min(Math.max(t, 0), 1) * n;\n if (roundToNextStep) {\n return Math.ceil(value) / n;\n }\n return Math.floor(value) / n;\n };\n}\n\nconst EasingObject = {\n linear,\n ease,\n quad,\n cubic,\n poly,\n sin,\n circle,\n exp,\n elastic,\n back,\n bounce,\n bezier,\n bezierFn,\n steps,\n in: in_,\n out,\n inOut,\n};\n\nexport const Easing = EasingObject;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,UAAU;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,MAAMA,CAACC,CAAS,EAAU;EACjC,SAAS;;EACT,OAAOA,CAAC;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAACD,CAAS,EAAU;EAC/B,SAAS;;EACT,OAAOF,MAAM,CAAC,IAAI,EAAE,CAAC,EA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,CAAC,CAAC,GAAGK,CAAC;IAC7C,IAAI4B,eAAe,EAAE;MACnB,OAAO3B,IAAI,CAAC+B,IAAI,CAACH,KAAK,CAAC,GAAG7B,CAAC;IAC7B;IACA,OAAOC,IAAI,CAACgC,KAAK,CAACJ,KAAK,CAAC,GAAG7B,CAAC;EAC9B,CAAC;AACH;AAEA,MAAMkC,YAAY,GAAG;EACnBxC,MAAM;EACNE,IAAI;EACJC,IAAI;EACJC,KAAK;EACLC,IAAI;EACJI,GAAG;EACHG,MAAM;EACNE,GAAG;EACHC,OAAO;EACPG,IAAI;EACJE,MAAM;EACNE,MAAM;EACNM,QAAQ;EACRK,KAAK;EACLQ,EAAE,EAAEZ,GAAG;EACPE,GAAG;EACHC;AACF,CAAC;AAED,OAAO,MAAMU,MAAM,GAAGF,YAAY","ignoreList":[]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
6
|
-
import { NativeModules } from 'react-native';
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
6
|
import { checkCppVersion } from '../platform-specific/checkCppVersion';
|
|
8
7
|
import { jsVersion } from '../platform-specific/jsVersion';
|
|
9
8
|
import { getValueUnpackerCode } from '../valueUnpacker';
|
|
9
|
+
import { isFabric } from '../PlatformChecker';
|
|
10
|
+
import { getShadowNodeWrapperFromRef } from '../fabricUtils';
|
|
11
|
+
import ReanimatedModule from '../../specs/NativeReanimatedModule';
|
|
10
12
|
|
|
11
13
|
// this is the type of `__reanimatedModuleProxy` which is injected using JSI
|
|
12
14
|
|
|
@@ -25,11 +27,8 @@ export class NativeReanimated {
|
|
|
25
27
|
}
|
|
26
28
|
global._REANIMATED_VERSION_JS = jsVersion;
|
|
27
29
|
if (global.__reanimatedModuleProxy === undefined) {
|
|
28
|
-
const {
|
|
29
|
-
ReanimatedModule
|
|
30
|
-
} = NativeModules;
|
|
31
30
|
const valueUnpackerCode = getValueUnpackerCode();
|
|
32
|
-
ReanimatedModule === null || ReanimatedModule === void 0
|
|
31
|
+
ReanimatedModule === null || ReanimatedModule === void 0 || ReanimatedModule.installTurboModule(valueUnpackerCode);
|
|
33
32
|
}
|
|
34
33
|
if (global.__reanimatedModuleProxy === undefined) {
|
|
35
34
|
throw new Error(`[Reanimated] Native part of Reanimated doesn't seem to be initialized.
|
|
@@ -40,8 +39,8 @@ See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooti
|
|
|
40
39
|
}
|
|
41
40
|
this.InnerNativeModule = global.__reanimatedModuleProxy;
|
|
42
41
|
}
|
|
43
|
-
makeShareableClone(value, shouldPersistRemote) {
|
|
44
|
-
return this.InnerNativeModule.makeShareableClone(value, shouldPersistRemote);
|
|
42
|
+
makeShareableClone(value, shouldPersistRemote, nativeStateSource) {
|
|
43
|
+
return this.InnerNativeModule.makeShareableClone(value, shouldPersistRemote, nativeStateSource);
|
|
45
44
|
}
|
|
46
45
|
scheduleOnUI(shareable) {
|
|
47
46
|
return this.InnerNativeModule.scheduleOnUI(shareable);
|
|
@@ -67,12 +66,16 @@ See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooti
|
|
|
67
66
|
unregisterEventHandler(id) {
|
|
68
67
|
return this.InnerNativeModule.unregisterEventHandler(id);
|
|
69
68
|
}
|
|
70
|
-
getViewProp(viewTag, propName,
|
|
69
|
+
getViewProp(viewTag, propName, component,
|
|
70
|
+
// required on Fabric
|
|
71
|
+
callback) {
|
|
72
|
+
let shadowNodeWrapper;
|
|
73
|
+
if (isFabric()) {
|
|
74
|
+
shadowNodeWrapper = getShadowNodeWrapperFromRef(component);
|
|
75
|
+
return this.InnerNativeModule.getViewProp(shadowNodeWrapper, propName, callback);
|
|
76
|
+
}
|
|
71
77
|
return this.InnerNativeModule.getViewProp(viewTag, propName, callback);
|
|
72
78
|
}
|
|
73
|
-
configureLayoutAnimation(viewTag, type, sharedTransitionTag, config) {
|
|
74
|
-
this.InnerNativeModule.configureLayoutAnimation(viewTag, type, sharedTransitionTag, config);
|
|
75
|
-
}
|
|
76
79
|
configureLayoutAnimationBatch(layoutAnimationsBatch) {
|
|
77
80
|
this.InnerNativeModule.configureLayoutAnimationBatch(layoutAnimationsBatch);
|
|
78
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeModules","checkCppVersion","jsVersion","getValueUnpackerCode","assertSingleReanimatedInstance","global","_REANIMATED_VERSION_JS","Error","NativeReanimated","constructor","__DEV__","__reanimatedModuleProxy","ReanimatedModule","valueUnpackerCode","installTurboModule","InnerNativeModule","makeShareableClone","shouldPersistRemote","scheduleOnUI","shareable","executeOnUIRuntimeSync","createWorkletRuntime","name","initializer","scheduleOnRuntime","workletRuntime","shareableWorklet","registerSensor","sensorType","interval","iosReferenceFrame","handler","unregisterSensor","sensorId","registerEventHandler","eventHandler","eventName","emitterReactTag","unregisterEventHandler","id","getViewProp","viewTag","propName","callback","configureLayoutAnimation","type","sharedTransitionTag","config","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","enableLayoutAnimations","flag","configureProps","uiProps","nativeProps","subscribeForKeyboardEvents","isStatusBarTranslucent","unsubscribeFromKeyboardEvents","listenerId"],"sources":["NativeReanimated.ts"],"sourcesContent":["'use strict';\nimport { NativeModules } from 'react-native';\nimport type { ShareableRef, Value3D, ValueRotation } from '../commonTypes';\nimport type {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from '../layoutReanimation';\nimport { checkCppVersion } from '../platform-specific/checkCppVersion';\nimport { jsVersion } from '../platform-specific/jsVersion';\nimport type { WorkletRuntime } from '../runtimes';\nimport { getValueUnpackerCode } from '../valueUnpacker';\nimport type { LayoutAnimationBatchItem } from '../layoutReanimation/animationBuilder/commonTypes';\n\n// this is the type of `__reanimatedModuleProxy` which is injected using JSI\nexport interface NativeReanimatedModule {\n makeShareableClone<T>(\n value: T,\n shouldPersistRemote: boolean\n ): ShareableRef<T>;\n scheduleOnUI<T>(shareable: ShareableRef<T>): void;\n executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R;\n createWorkletRuntime(\n name: string,\n initializer: ShareableRef<() => void>\n ): WorkletRuntime;\n scheduleOnRuntime<T>(\n workletRuntime: WorkletRuntime,\n worklet: ShareableRef<T>\n ): void;\n registerEventHandler<T>(\n eventHandler: ShareableRef<T>,\n eventName: string,\n emitterReactTag: number\n ): number;\n unregisterEventHandler(id: number): void;\n getViewProp<T>(\n viewTag: number,\n propName: string,\n callback?: (result: T) => void\n ): Promise<T>;\n enableLayoutAnimations(flag: boolean): void;\n registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n handler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ): number;\n unregisterSensor(sensorId: number): void;\n configureProps(uiProps: string[], nativeProps: string[]): void;\n subscribeForKeyboardEvents(\n handler: ShareableRef<number>,\n isStatusBarTranslucent: boolean\n ): number;\n unsubscribeFromKeyboardEvents(listenerId: number): void;\n configureLayoutAnimation(\n viewTag: number,\n type: LayoutAnimationType,\n sharedTransitionTag: string,\n config: ShareableRef<Keyframe | LayoutAnimationFunction>\n ): void;\n configureLayoutAnimationBatch(\n layoutAnimationsBatch: {\n viewTag: number;\n type: LayoutAnimationType;\n config: ShareableRef<Keyframe | LayoutAnimationFunction> | undefined;\n }[]\n ): void;\n setShouldAnimateExitingForTag(viewTag: number, shouldAnimate: boolean): void;\n}\n\nfunction assertSingleReanimatedInstance() {\n if (\n global._REANIMATED_VERSION_JS !== undefined &&\n global._REANIMATED_VERSION_JS !== jsVersion\n ) {\n throw new Error(\n `[Reanimated] Another instance of Reanimated was detected.\nSee \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#another-instance-of-reanimated-was-detected\\` for more details. Previous: ${global._REANIMATED_VERSION_JS}, current: ${jsVersion}.`\n );\n }\n}\n\nexport class NativeReanimated {\n private InnerNativeModule: NativeReanimatedModule;\n\n constructor() {\n // These checks have to split since version checking depend on the execution order\n if (__DEV__) {\n assertSingleReanimatedInstance();\n }\n global._REANIMATED_VERSION_JS = jsVersion;\n if (global.__reanimatedModuleProxy === undefined) {\n const { ReanimatedModule } = NativeModules;\n const valueUnpackerCode = getValueUnpackerCode();\n ReanimatedModule?.installTurboModule(valueUnpackerCode);\n }\n if (global.__reanimatedModuleProxy === undefined) {\n throw new Error(\n `[Reanimated] Native part of Reanimated doesn't seem to be initialized.\nSee https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#native-part-of-reanimated-doesnt-seem-to-be-initialized for more details.`\n );\n }\n if (__DEV__) {\n checkCppVersion();\n }\n this.InnerNativeModule = global.__reanimatedModuleProxy;\n }\n\n makeShareableClone<T>(value: T, shouldPersistRemote: boolean) {\n return this.InnerNativeModule.makeShareableClone(\n value,\n shouldPersistRemote\n );\n }\n\n scheduleOnUI<T>(shareable: ShareableRef<T>) {\n return this.InnerNativeModule.scheduleOnUI(shareable);\n }\n\n executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R {\n return this.InnerNativeModule.executeOnUIRuntimeSync(shareable);\n }\n\n createWorkletRuntime(name: string, initializer: ShareableRef<() => void>) {\n return this.InnerNativeModule.createWorkletRuntime(name, initializer);\n }\n\n scheduleOnRuntime<T>(\n workletRuntime: WorkletRuntime,\n shareableWorklet: ShareableRef<T>\n ) {\n return this.InnerNativeModule.scheduleOnRuntime(\n workletRuntime,\n shareableWorklet\n );\n }\n\n registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n handler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ) {\n return this.InnerNativeModule.registerSensor(\n sensorType,\n interval,\n iosReferenceFrame,\n handler\n );\n }\n\n unregisterSensor(sensorId: number) {\n return this.InnerNativeModule.unregisterSensor(sensorId);\n }\n\n registerEventHandler<T>(\n eventHandler: ShareableRef<T>,\n eventName: string,\n emitterReactTag: number\n ) {\n return this.InnerNativeModule.registerEventHandler(\n eventHandler,\n eventName,\n emitterReactTag\n );\n }\n\n unregisterEventHandler(id: number) {\n return this.InnerNativeModule.unregisterEventHandler(id);\n }\n\n getViewProp<T>(\n viewTag: number,\n propName: string,\n callback?: (result: T) => void\n ) {\n return this.InnerNativeModule.getViewProp(viewTag, propName, callback);\n }\n\n configureLayoutAnimation(\n viewTag: number,\n type: LayoutAnimationType,\n sharedTransitionTag: string,\n config: ShareableRef<Keyframe | LayoutAnimationFunction>\n ) {\n this.InnerNativeModule.configureLayoutAnimation(\n viewTag,\n type,\n sharedTransitionTag,\n config\n );\n }\n\n configureLayoutAnimationBatch(\n layoutAnimationsBatch: LayoutAnimationBatchItem[]\n ) {\n this.InnerNativeModule.configureLayoutAnimationBatch(layoutAnimationsBatch);\n }\n\n setShouldAnimateExitingForTag(viewTag: number, shouldAnimate: boolean) {\n this.InnerNativeModule.setShouldAnimateExitingForTag(\n viewTag,\n shouldAnimate\n );\n }\n\n enableLayoutAnimations(flag: boolean) {\n this.InnerNativeModule.enableLayoutAnimations(flag);\n }\n\n configureProps(uiProps: string[], nativeProps: string[]) {\n this.InnerNativeModule.configureProps(uiProps, nativeProps);\n }\n\n subscribeForKeyboardEvents(\n handler: ShareableRef<number>,\n isStatusBarTranslucent: boolean\n ) {\n return this.InnerNativeModule.subscribeForKeyboardEvents(\n handler,\n isStatusBarTranslucent\n );\n }\n\n unsubscribeFromKeyboardEvents(listenerId: number) {\n this.InnerNativeModule.unsubscribeFromKeyboardEvents(listenerId);\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AACb,SAASU,aAAa,QAAQ,cAAc;AAM5C,SAASC,eAAe,QAAQ,sCAAsC;AACtE,SAASC,SAAS,QAAQ,gCAAgC;AAE1D,SAASC,oBAAoB,QAAQ,kBAAkB;;AAGvD;;AAyDA,SAASC,8BAA8BA,CAAA,EAAG;EACxC,IACEC,MAAM,CAACC,sBAAsB,KAAKX,SAAS,IAC3CU,MAAM,CAACC,sBAAsB,KAAKJ,SAAS,EAC3C;IACA,MAAM,IAAIK,KAAK,CACZ;AACP,iKAAiKF,MAAM,CAACC,sBAA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EAEAC,sBAAsBA,CAACC,IAAa,EAAE;IACpC,IAAI,CAACtC,iBAAiB,CAACqC,sBAAsB,CAACC,IAAI,CAAC;EACrD;EAEAC,cAAcA,CAACC,OAAiB,EAAEC,WAAqB,EAAE;IACvD,IAAI,CAACzC,iBAAiB,CAACuC,cAAc,CAACC,OAAO,EAAEC,WAAW,CAAC;EAC7D;EAEAC,0BAA0BA,CACxB1B,OAA6B,EAC7B2B,sBAA+B,EAC/B;IACA,OAAO,IAAI,CAAC3C,iBAAiB,CAAC0C,0BAA0B,CACtD1B,OAAO,EACP2B,sBAAsB,CACvB;EACH;EAEAC,6BAA6BA,CAACC,UAAkB,EAAE;IAChD,IAAI,CAAC7C,iBAAiB,CAAC4C,6BAA6B,CAACC,UAAU,CAAC;EAClE;AACF"}
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","checkCppVersion","jsVersion","getValueUnpackerCode","isFabric","getShadowNodeWrapperFromRef","ReanimatedModule","assertSingleReanimatedInstance","global","_REANIMATED_VERSION_JS","undefined","Error","NativeReanimated","constructor","__DEV__","__reanimatedModuleProxy","valueUnpackerCode","installTurboModule","InnerNativeModule","makeShareableClone","shouldPersistRemote","nativeStateSource","scheduleOnUI","shareable","executeOnUIRuntimeSync","createWorkletRuntime","name","initializer","scheduleOnRuntime","workletRuntime","shareableWorklet","registerSensor","sensorType","interval","iosReferenceFrame","handler","unregisterSensor","sensorId","registerEventHandler","eventHandler","eventName","emitterReactTag","unregisterEventHandler","id","getViewProp","viewTag","propName","component","callback","shadowNodeWrapper","configureLayoutAnimationBatch","layoutAnimationsBatch","setShouldAnimateExitingForTag","shouldAnimate","enableLayoutAnimations","flag","configureProps","uiProps","nativeProps","subscribeForKeyboardEvents","isStatusBarTranslucent","unsubscribeFromKeyboardEvents","listenerId"],"sources":["NativeReanimated.ts"],"sourcesContent":["'use strict';\nimport type {\n ShadowNodeWrapper,\n Value3D,\n ValueRotation,\n ShareableRef,\n} from '../commonTypes';\nimport { checkCppVersion } from '../platform-specific/checkCppVersion';\nimport { jsVersion } from '../platform-specific/jsVersion';\nimport type { WorkletRuntime } from '../runtimes';\nimport { getValueUnpackerCode } from '../valueUnpacker';\nimport { isFabric } from '../PlatformChecker';\nimport type React from 'react';\nimport { getShadowNodeWrapperFromRef } from '../fabricUtils';\nimport type { LayoutAnimationBatchItem } from '../layoutReanimation/animationBuilder/commonTypes';\nimport ReanimatedModule from '../../specs/NativeReanimatedModule';\n\n// this is the type of `__reanimatedModuleProxy` which is injected using JSI\nexport interface NativeReanimatedModule {\n makeShareableClone<T>(\n value: T,\n shouldPersistRemote: boolean,\n nativeStateSource?: object\n ): ShareableRef<T>;\n scheduleOnUI<T>(shareable: ShareableRef<T>): void;\n executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R;\n createWorkletRuntime(\n name: string,\n initializer: ShareableRef<() => void>\n ): WorkletRuntime;\n scheduleOnRuntime<T>(\n workletRuntime: WorkletRuntime,\n worklet: ShareableRef<T>\n ): void;\n registerEventHandler<T>(\n eventHandler: ShareableRef<T>,\n eventName: string,\n emitterReactTag: number\n ): number;\n unregisterEventHandler(id: number): void;\n getViewProp<T>(\n viewTagOrShadowNodeWrapper: number | ShadowNodeWrapper,\n propName: string,\n callback?: (result: T) => void\n ): Promise<T>;\n enableLayoutAnimations(flag: boolean): void;\n registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n handler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ): number;\n unregisterSensor(sensorId: number): void;\n configureProps(uiProps: string[], nativeProps: string[]): void;\n subscribeForKeyboardEvents(\n handler: ShareableRef<number>,\n isStatusBarTranslucent: boolean\n ): number;\n unsubscribeFromKeyboardEvents(listenerId: number): void;\n configureLayoutAnimationBatch(\n layoutAnimationsBatch: LayoutAnimationBatchItem[]\n ): void;\n setShouldAnimateExitingForTag(viewTag: number, shouldAnimate: boolean): void;\n}\n\nfunction assertSingleReanimatedInstance() {\n if (\n global._REANIMATED_VERSION_JS !== undefined &&\n global._REANIMATED_VERSION_JS !== jsVersion\n ) {\n throw new Error(\n `[Reanimated] Another instance of Reanimated was detected.\nSee \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#another-instance-of-reanimated-was-detected\\` for more details. Previous: ${global._REANIMATED_VERSION_JS}, current: ${jsVersion}.`\n );\n }\n}\n\nexport class NativeReanimated {\n private InnerNativeModule: NativeReanimatedModule;\n\n constructor() {\n // These checks have to split since version checking depend on the execution order\n if (__DEV__) {\n assertSingleReanimatedInstance();\n }\n global._REANIMATED_VERSION_JS = jsVersion;\n if (global.__reanimatedModuleProxy === undefined) {\n const valueUnpackerCode = getValueUnpackerCode();\n ReanimatedModule?.installTurboModule(valueUnpackerCode);\n }\n if (global.__reanimatedModuleProxy === undefined) {\n throw new Error(\n `[Reanimated] Native part of Reanimated doesn't seem to be initialized.\nSee https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#native-part-of-reanimated-doesnt-seem-to-be-initialized for more details.`\n );\n }\n if (__DEV__) {\n checkCppVersion();\n }\n this.InnerNativeModule = global.__reanimatedModuleProxy;\n }\n\n makeShareableClone<T>(\n value: T,\n shouldPersistRemote: boolean,\n nativeStateSource?: object\n ) {\n return this.InnerNativeModule.makeShareableClone(\n value,\n shouldPersistRemote,\n nativeStateSource\n );\n }\n\n scheduleOnUI<T>(shareable: ShareableRef<T>) {\n return this.InnerNativeModule.scheduleOnUI(shareable);\n }\n\n executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R {\n return this.InnerNativeModule.executeOnUIRuntimeSync(shareable);\n }\n\n createWorkletRuntime(name: string, initializer: ShareableRef<() => void>) {\n return this.InnerNativeModule.createWorkletRuntime(name, initializer);\n }\n\n scheduleOnRuntime<T>(\n workletRuntime: WorkletRuntime,\n shareableWorklet: ShareableRef<T>\n ) {\n return this.InnerNativeModule.scheduleOnRuntime(\n workletRuntime,\n shareableWorklet\n );\n }\n\n registerSensor(\n sensorType: number,\n interval: number,\n iosReferenceFrame: number,\n handler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ) {\n return this.InnerNativeModule.registerSensor(\n sensorType,\n interval,\n iosReferenceFrame,\n handler\n );\n }\n\n unregisterSensor(sensorId: number) {\n return this.InnerNativeModule.unregisterSensor(sensorId);\n }\n\n registerEventHandler<T>(\n eventHandler: ShareableRef<T>,\n eventName: string,\n emitterReactTag: number\n ) {\n return this.InnerNativeModule.registerEventHandler(\n eventHandler,\n eventName,\n emitterReactTag\n );\n }\n\n unregisterEventHandler(id: number) {\n return this.InnerNativeModule.unregisterEventHandler(id);\n }\n\n getViewProp<T>(\n viewTag: number,\n propName: string,\n component: React.Component | undefined, // required on Fabric\n callback?: (result: T) => void\n ) {\n let shadowNodeWrapper;\n if (isFabric()) {\n shadowNodeWrapper = getShadowNodeWrapperFromRef(\n component as React.Component\n );\n return this.InnerNativeModule.getViewProp(\n shadowNodeWrapper,\n propName,\n callback\n );\n }\n\n return this.InnerNativeModule.getViewProp(viewTag, propName, callback);\n }\n\n configureLayoutAnimationBatch(\n layoutAnimationsBatch: LayoutAnimationBatchItem[]\n ) {\n this.InnerNativeModule.configureLayoutAnimationBatch(layoutAnimationsBatch);\n }\n\n setShouldAnimateExitingForTag(viewTag: number, shouldAnimate: boolean) {\n this.InnerNativeModule.setShouldAnimateExitingForTag(\n viewTag,\n shouldAnimate\n );\n }\n\n enableLayoutAnimations(flag: boolean) {\n this.InnerNativeModule.enableLayoutAnimations(flag);\n }\n\n configureProps(uiProps: string[], nativeProps: string[]) {\n this.InnerNativeModule.configureProps(uiProps, nativeProps);\n }\n\n subscribeForKeyboardEvents(\n handler: ShareableRef<number>,\n isStatusBarTranslucent: boolean\n ) {\n return this.InnerNativeModule.subscribeForKeyboardEvents(\n handler,\n isStatusBarTranslucent\n );\n }\n\n unsubscribeFromKeyboardEvents(listenerId: number) {\n this.Inn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C,sBAAsBA,CAACC,IAAa,EAAE;IACpC,IAAI,CAACrC,iBAAiB,CAACoC,sBAAsB,CAACC,IAAI,CAAC;EACrD;EAEAC,cAAcA,CAACC,OAAiB,EAAEC,WAAqB,EAAE;IACvD,IAAI,CAACxC,iBAAiB,CAACsC,cAAc,CAACC,OAAO,EAAEC,WAAW,CAAC;EAC7D;EAEAC,0BAA0BA,CACxBxB,OAA6B,EAC7ByB,sBAA+B,EAC/B;IACA,OAAO,IAAI,CAAC1C,iBAAiB,CAACyC,0BAA0B,CACtDxB,OAAO,EACPyB,sBACF,CAAC;EACH;EAEAC,6BAA6BA,CAACC,UAAkB,EAAE;IAChD,IAAI,CAAC5C,iBAAiB,CAAC2C,6BAA6B,CAACC,UAAU,CAAC;EAClE;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["reanimatedJS","shouldBeUseWeb","NativeReanimated"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport reanimatedJS from '../js-reanimated';\nimport { shouldBeUseWeb } from '../PlatformChecker';\nimport { NativeReanimated } from './NativeReanimated';\n\nexport default shouldBeUseWeb() ? reanimatedJS : new NativeReanimated();\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,YAAY,MAAM,kBAAkB;AAC3C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,eAAeD,cAAc,
|
|
1
|
+
{"version":3,"names":["reanimatedJS","shouldBeUseWeb","NativeReanimated"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport reanimatedJS from '../js-reanimated';\nimport { shouldBeUseWeb } from '../PlatformChecker';\nimport { NativeReanimated } from './NativeReanimated';\n\nexport default shouldBeUseWeb() ? reanimatedJS : new NativeReanimated();\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,YAAY,MAAM,kBAAkB;AAC3C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,eAAeD,cAAc,CAAC,CAAC,GAAGD,YAAY,GAAG,IAAIE,gBAAgB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default"],"sources":["index.web.ts"],"sourcesContent":["'use strict';\n// this file was created to prevent NativeReanimated from being included in the web bundle\nexport { default } from '../js-reanimated';\n"],"mappings":"AAAA,YAAY;;AACZ;AACA,SAASA,OAAO,QAAQ,kBAAkB"}
|
|
1
|
+
{"version":3,"names":["default"],"sources":["index.web.ts"],"sourcesContent":["'use strict';\n// this file was created to prevent NativeReanimated from being included in the web bundle\nexport { default } from '../js-reanimated';\n"],"mappings":"AAAA,YAAY;;AACZ;AACA,SAASA,OAAO,QAAQ,kBAAkB","ignoreList":[]}
|
|
@@ -4,13 +4,14 @@ import { Platform } from 'react-native';
|
|
|
4
4
|
|
|
5
5
|
// This type is necessary since some libraries tend to do a lib check
|
|
6
6
|
// and this file causes type errors on `global` access.
|
|
7
|
+
|
|
7
8
|
export function isJest() {
|
|
8
9
|
return !!process.env.JEST_WORKER_ID;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
// `isChromeDebugger` also returns true in Jest environment, so `isJest()` check should always be performed first
|
|
12
13
|
export function isChromeDebugger() {
|
|
13
|
-
return !global.nativeCallSyncHook || !!global.__REMOTEDEV__;
|
|
14
|
+
return (!global.nativeCallSyncHook || !!global.__REMOTEDEV__) && !global.RN$Bridgeless;
|
|
14
15
|
}
|
|
15
16
|
export function isWeb() {
|
|
16
17
|
return Platform.OS === 'web';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","isJest","process","env","JEST_WORKER_ID","isChromeDebugger","global","nativeCallSyncHook","__REMOTEDEV__","isWeb","OS","isAndroid","isWindows","shouldBeUseWeb","isFabric","_IS_FABRIC","isWindowAvailable","window","isReducedMotion","matchMedia","matches","_REANIMATED_IS_REDUCED_MOTION"],"sources":["PlatformChecker.ts"],"sourcesContent":["'use strict';\nimport { Platform } from 'react-native';\n\n// This type is necessary since some libraries tend to do a lib check\n// and this file causes type errors on `global` access.\ntype localGlobal = typeof global & Record<string, unknown>;\n\nexport function isJest(): boolean {\n return !!process.env.JEST_WORKER_ID;\n}\n\n// `isChromeDebugger` also returns true in Jest environment, so `isJest()` check should always be performed first\nexport function isChromeDebugger(): boolean {\n return (\n !(global as localGlobal).nativeCallSyncHook ||\n
|
|
1
|
+
{"version":3,"names":["Platform","isJest","process","env","JEST_WORKER_ID","isChromeDebugger","global","nativeCallSyncHook","__REMOTEDEV__","RN$Bridgeless","isWeb","OS","isAndroid","isWindows","shouldBeUseWeb","isFabric","_IS_FABRIC","isWindowAvailable","window","isReducedMotion","matchMedia","matches","_REANIMATED_IS_REDUCED_MOTION"],"sources":["PlatformChecker.ts"],"sourcesContent":["'use strict';\nimport { Platform } from 'react-native';\n\n// This type is necessary since some libraries tend to do a lib check\n// and this file causes type errors on `global` access.\ntype localGlobal = typeof global & Record<string, unknown>;\n\nexport function isJest(): boolean {\n return !!process.env.JEST_WORKER_ID;\n}\n\n// `isChromeDebugger` also returns true in Jest environment, so `isJest()` check should always be performed first\nexport function isChromeDebugger(): boolean {\n return (\n (!(global as localGlobal).nativeCallSyncHook ||\n !!(global as localGlobal).__REMOTEDEV__) &&\n !(global as localGlobal).RN$Bridgeless\n );\n}\n\nexport function isWeb(): boolean {\n return Platform.OS === 'web';\n}\n\nexport function isAndroid(): boolean {\n return Platform.OS === 'android';\n}\n\nfunction isWindows(): boolean {\n return Platform.OS === 'windows';\n}\n\nexport function shouldBeUseWeb() {\n return isJest() || isChromeDebugger() || isWeb() || isWindows();\n}\n\nexport function isFabric() {\n return !!(global as localGlobal)._IS_FABRIC;\n}\n\nexport function isWindowAvailable() {\n // the window object is unavailable when building the server portion of a site that uses SSG\n // this function shouldn't be used to conditionally render components\n // https://www.joshwcomeau.com/react/the-perils-of-rehydration/\n // @ts-ignore Fallback if `window` is undefined.\n return typeof window !== 'undefined';\n}\n\nexport function isReducedMotion() {\n return isWeb()\n ? isWindowAvailable()\n ? // @ts-ignore Fallback if `window` is undefined.\n !window.matchMedia('(prefers-reduced-motion: no-preference)').matches\n : false\n : !!(global as localGlobal)._REANIMATED_IS_REDUCED_MOTION;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,QAAQ,QAAQ,cAAc;;AAEvC;AACA;;AAGA,OAAO,SAASC,MAAMA,CAAA,EAAY;EAChC,OAAO,CAAC,CAACC,OAAO,CAACC,GAAG,CAACC,cAAc;AACrC;;AAEA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAY;EAC1C,OACE,CAAC,CAAEC,MAAM,CAAiBC,kBAAkB,IAC1C,CAAC,CAAED,MAAM,CAAiBE,aAAa,KACzC,CAAEF,MAAM,CAAiBG,aAAa;AAE1C;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAY;EAC/B,OAAOV,QAAQ,CAACW,EAAE,KAAK,KAAK;AAC9B;AAEA,OAAO,SAASC,SAASA,CAAA,EAAY;EACnC,OAAOZ,QAAQ,CAACW,EAAE,KAAK,SAAS;AAClC;AAEA,SAASE,SAASA,CAAA,EAAY;EAC5B,OAAOb,QAAQ,CAACW,EAAE,KAAK,SAAS;AAClC;AAEA,OAAO,SAASG,cAAcA,CAAA,EAAG;EAC/B,OAAOb,MAAM,CAAC,CAAC,IAAII,gBAAgB,CAAC,CAAC,IAAIK,KAAK,CAAC,CAAC,IAAIG,SAAS,CAAC,CAAC;AACjE;AAEA,OAAO,SAASE,QAAQA,CAAA,EAAG;EACzB,OAAO,CAAC,CAAET,MAAM,CAAiBU,UAAU;AAC7C;AAEA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAClC;EACA;EACA;EACA;EACA,OAAO,OAAOC,MAAM,KAAK,WAAW;AACtC;AAEA,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,OAAOT,KAAK,CAAC,CAAC,GACVO,iBAAiB,CAAC,CAAC;EACjB;EACA,CAACC,MAAM,CAACE,UAAU,CAAC,yCAAyC,CAAC,CAACC,OAAO,GACrE,KAAK,GACP,CAAC,CAAEf,MAAM,CAAiBgB,6BAA6B;AAC7D","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import { addWhitelistedNativeProps } from '../ConfigHelper';
|
|
|
6
6
|
|
|
7
7
|
export function createAnimatedPropAdapter(adapter, nativeProps) {
|
|
8
8
|
const nativePropsToAdd = {};
|
|
9
|
-
nativeProps === null || nativeProps === void 0
|
|
9
|
+
nativeProps === null || nativeProps === void 0 || nativeProps.forEach(prop => {
|
|
10
10
|
nativePropsToAdd[prop] = true;
|
|
11
11
|
});
|
|
12
12
|
addWhitelistedNativeProps(nativePropsToAdd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addWhitelistedNativeProps","createAnimatedPropAdapter","adapter","nativeProps","nativePropsToAdd","forEach","prop"],"sources":["PropAdapters.ts"],"sourcesContent":["'use strict';\nimport { addWhitelistedNativeProps } from '../ConfigHelper';\nimport type {\n AnimatedPropsAdapterFunction,\n AnimatedPropsAdapterWorklet,\n} from './commonTypes';\n\n// @ts-expect-error This overload is required by our API.\nexport function createAnimatedPropAdapter(\n adapter: AnimatedPropsAdapterFunction,\n nativeProps?: string[]\n): AnimatedPropsAdapterFunction;\n\nexport function createAnimatedPropAdapter(\n adapter: AnimatedPropsAdapterWorklet,\n nativeProps?: string[]\n): AnimatedPropsAdapterWorklet {\n const nativePropsToAdd: { [key: string]: boolean } = {};\n nativeProps?.forEach((prop) => {\n nativePropsToAdd[prop] = true;\n });\n addWhitelistedNativeProps(nativePropsToAdd);\n return adapter;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,yBAAyB,QAAQ,iBAAiB;;AAM3D;;AAMA,OAAO,SAASC,yBAAyBA,CACvCC,OAAoC,EACpCC,WAAsB,EACO;EAC7B,MAAMC,gBAA4C,GAAG,CAAC,CAAC;EACvDD,WAAW,aAAXA,WAAW,
|
|
1
|
+
{"version":3,"names":["addWhitelistedNativeProps","createAnimatedPropAdapter","adapter","nativeProps","nativePropsToAdd","forEach","prop"],"sources":["PropAdapters.ts"],"sourcesContent":["'use strict';\nimport { addWhitelistedNativeProps } from '../ConfigHelper';\nimport type {\n AnimatedPropsAdapterFunction,\n AnimatedPropsAdapterWorklet,\n} from './commonTypes';\n\n// @ts-expect-error This overload is required by our API.\nexport function createAnimatedPropAdapter(\n adapter: AnimatedPropsAdapterFunction,\n nativeProps?: string[]\n): AnimatedPropsAdapterFunction;\n\nexport function createAnimatedPropAdapter(\n adapter: AnimatedPropsAdapterWorklet,\n nativeProps?: string[]\n): AnimatedPropsAdapterWorklet {\n const nativePropsToAdd: { [key: string]: boolean } = {};\n nativeProps?.forEach((prop) => {\n nativePropsToAdd[prop] = true;\n });\n addWhitelistedNativeProps(nativePropsToAdd);\n return adapter;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,yBAAyB,QAAQ,iBAAiB;;AAM3D;;AAMA,OAAO,SAASC,yBAAyBA,CACvCC,OAAoC,EACpCC,WAAsB,EACO;EAC7B,MAAMC,gBAA4C,GAAG,CAAC,CAAC;EACvDD,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEE,OAAO,CAAEC,IAAI,IAAK;IAC7BF,gBAAgB,CAACE,IAAI,CAAC,GAAG,IAAI;EAC/B,CAAC,CAAC;EACFN,yBAAyB,CAACI,gBAAgB,CAAC;EAC3C,OAAOF,OAAO;AAChB","ignoreList":[]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { isFabric } from './PlatformChecker';
|
|
4
4
|
import { runOnUI } from './threads';
|
|
5
|
-
const IS_FABRIC = isFabric();
|
|
6
5
|
let VIEW_TAGS = [];
|
|
7
6
|
export function removeFromPropsRegistry(viewTag) {
|
|
8
7
|
VIEW_TAGS.push(viewTag);
|
|
@@ -11,7 +10,7 @@ export function removeFromPropsRegistry(viewTag) {
|
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
function flush() {
|
|
14
|
-
if (__DEV__ && !
|
|
13
|
+
if (__DEV__ && !isFabric()) {
|
|
15
14
|
throw new Error('[Reanimated] PropsRegistry is only available on Fabric.');
|
|
16
15
|
}
|
|
17
16
|
runOnUI(removeFromPropsRegistryOnUI)(VIEW_TAGS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFabric","runOnUI","
|
|
1
|
+
{"version":3,"names":["isFabric","runOnUI","VIEW_TAGS","removeFromPropsRegistry","viewTag","push","length","queueMicrotask","flush","__DEV__","Error","removeFromPropsRegistryOnUI","viewTags","global","_removeFromPropsRegistry"],"sources":["PropsRegistry.ts"],"sourcesContent":["'use strict';\nimport { isFabric } from './PlatformChecker';\nimport { runOnUI } from './threads';\n\nlet VIEW_TAGS: number[] = [];\n\nexport function removeFromPropsRegistry(viewTag: number) {\n VIEW_TAGS.push(viewTag);\n if (VIEW_TAGS.length === 1) {\n queueMicrotask(flush);\n }\n}\n\nfunction flush() {\n if (__DEV__ && !isFabric()) {\n throw new Error('[Reanimated] PropsRegistry is only available on Fabric.');\n }\n runOnUI(removeFromPropsRegistryOnUI)(VIEW_TAGS);\n VIEW_TAGS = [];\n}\n\nfunction removeFromPropsRegistryOnUI(viewTags: number[]) {\n 'worklet';\n global._removeFromPropsRegistry(viewTags);\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,OAAO,QAAQ,WAAW;AAEnC,IAAIC,SAAmB,GAAG,EAAE;AAE5B,OAAO,SAASC,uBAAuBA,CAACC,OAAe,EAAE;EACvDF,SAAS,CAACG,IAAI,CAACD,OAAO,CAAC;EACvB,IAAIF,SAAS,CAACI,MAAM,KAAK,CAAC,EAAE;IAC1BC,cAAc,CAACC,KAAK,CAAC;EACvB;AACF;AAEA,SAASA,KAAKA,CAAA,EAAG;EACf,IAAIC,OAAO,IAAI,CAACT,QAAQ,CAAC,CAAC,EAAE;IAC1B,MAAM,IAAIU,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EACAT,OAAO,CAACU,2BAA2B,CAAC,CAACT,SAAS,CAAC;EAC/CA,SAAS,GAAG,EAAE;AAChB;AAEA,SAASS,2BAA2BA,CAACC,QAAkB,EAAE;EACvD,SAAS;;EACTC,MAAM,CAACC,wBAAwB,CAACF,QAAQ,CAAC;AAC3C","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import NativeReanimatedModule from './NativeReanimated';
|
|
7
7
|
import { SensorType } from './commonTypes';
|
|
8
8
|
import { makeMutable } from './mutables';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","NativeReanimatedModule","SensorType","makeMutable","initSensorData","sensorType","ROTATION","qw","qx","qy","qz","yaw","pitch","roll","interfaceOrientation","x","y","z","Sensor","constructor","config","data","register","eventHandler","sensorId","registerSensor","interval","iosReferenceFrame","isRunning","isAvailable","getSharedValue","unregister","unregisterSensor"],"sources":["Sensor.ts"],"sourcesContent":["'use strict';\nimport NativeReanimatedModule from './NativeReanimated';\nimport type {\n SensorConfig,\n SharedValue,\n Value3D,\n ValueRotation,\n ShareableRef,\n} from './commonTypes';\nimport { SensorType } from './commonTypes';\nimport { makeMutable } from './mutables';\n\nfunction initSensorData(\n sensorType: SensorType\n): SharedValue<Value3D | ValueRotation> {\n if (sensorType === SensorType.ROTATION) {\n return makeMutable<Value3D | ValueRotation>({\n qw: 0,\n qx: 0,\n qy: 0,\n qz: 0,\n yaw: 0,\n pitch: 0,\n roll: 0,\n interfaceOrientation: 0,\n });\n } else {\n return makeMutable<Value3D | ValueRotation>({\n x: 0,\n y: 0,\n z: 0,\n interfaceOrientation: 0,\n });\n }\n}\n\nexport default class Sensor {\n public listenersNumber = 0;\n private sensorId: number | null = null;\n private sensorType: SensorType;\n private data: SharedValue<Value3D | ValueRotation>;\n private config: SensorConfig;\n\n constructor(sensorType: SensorType, config: SensorConfig) {\n this.sensorType = sensorType;\n this.config = config;\n this.data = initSensorData(sensorType);\n }\n\n register(\n eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ) {\n const config = this.config;\n const sensorType = this.sensorType;\n this.sensorId = NativeReanimatedModule.registerSensor(\n sensorType,\n config.interval === 'auto' ? -1 : config.interval,\n config.iosReferenceFrame,\n eventHandler\n );\n return this.sensorId !== -1;\n }\n\n isRunning() {\n return this.sensorId !== -1 && this.sensorId !== null;\n }\n\n isAvailable() {\n return this.sensorId !== -1;\n }\n\n getSharedValue() {\n return this.data;\n }\n\n unregister() {\n if (this.sensorId !== null && this.sensorId !== -1) {\n NativeReanimatedModule.unregisterSensor(this.sensorId);\n }\n this.sensorId = null;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GA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BANjC,CAAC;IAAAA,eAAA,mBACQ,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAMpC,IAAI,CAACyB,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACe,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,IAAI,GAAGjB,cAAc,CAACC,UAAU,CAAC;EACxC;EAEAiB,QAAQA,CACNC,YAAmE,EACnE;IACA,MAAMH,MAAM,GAAG,IAAI,CAACA,MAAM;IAC1B,MAAMf,UAAU,GAAG,IAAI,CAACA,UAAU;IAClC,IAAI,CAACmB,QAAQ,GAAGvB,sBAAsB,CAACwB,cAAc,CACnDpB,UAAU,EACVe,MAAM,CAACM,QAAQ,KAAK,MAAM,GAAG,CAAC,CAAC,GAAGN,MAAM,CAACM,QAAQ,EACjDN,MAAM,CAACO,iBAAiB,EACxBJ,YACF,CAAC;IACD,OAAO,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC;EAC7B;EAEAI,SAASA,CAAA,EAAG;IACV,OAAO,IAAI,CAACJ,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,CAACA,QAAQ,KAAK,IAAI;EACvD;EAEAK,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACL,QAAQ,KAAK,CAAC,CAAC;EAC7B;EAEAM,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAACT,IAAI;EAClB;EAEAU,UAAUA,CAAA,EAAG;IACX,IAAI,IAAI,CAACP,QAAQ,KAAK,IAAI,IAAI,IAAI,CAACA,QAAQ,KAAK,CAAC,CAAC,EAAE;MAClDvB,sBAAsB,CAAC+B,gBAAgB,CAAC,IAAI,CAACR,QAAQ,CAAC;IACxD;IACA,IAAI,CAACA,QAAQ,GAAG,IAAI;EACtB;AACF","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import Sensor from './Sensor';
|
|
7
7
|
export class SensorContainer {
|
|
8
8
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","Sensor","SensorContainer","constructor","Map","getSensorId","sensorType","config","iosReferenceFrame","adjustToInterfaceOrientation","initializeSensor","sensorId","nativeSensors","has","newSensor","set","sensor","get","getSharedValue","registerSensor","handler","isAvailable","isRunning","register","listenersNumber","unregisterSensor","unregister"],"sources":["SensorContainer.ts"],"sourcesContent":["'use strict';\nimport type {\n SensorType,\n SensorConfig,\n Value3D,\n ValueRotation,\n ShareableRef,\n SharedValue,\n} from './commonTypes';\nimport Sensor from './Sensor';\n\nexport class SensorContainer {\n private nativeSensors: Map<number, Sensor> = new Map();\n\n getSensorId(sensorType: SensorType, config: SensorConfig) {\n return (\n sensorType * 100 +\n config.iosReferenceFrame * 10 +\n Number(config.adjustToInterfaceOrientation)\n );\n }\n\n initializeSensor(\n sensorType: SensorType,\n config: SensorConfig\n ): SharedValue<Value3D | ValueRotation> {\n const sensorId = this.getSensorId(sensorType, config);\n\n if (!this.nativeSensors.has(sensorId)) {\n const newSensor = new Sensor(sensorType, config);\n this.nativeSensors.set(sensorId, newSensor);\n }\n\n const sensor = this.nativeSensors.get(sensorId);\n return sensor!.getSharedValue();\n }\n\n registerSensor(\n sensorType: SensorType,\n config: SensorConfig,\n handler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ): number {\n const sensorId = this.getSensorId(sensorType, config);\n\n if (!this.nativeSensors.has(sensorId)) {\n return -1;\n }\n\n const sensor = this.nativeSensors.get(sensorId);\n if (\n sensor &&\n sensor.isAvailable() &&\n (sensor.isRunning() || sensor.register(handler))\n ) {\n sensor.listenersNumber++;\n return sensorId;\n }\n return -1;\n }\n\n unregisterSensor(sensorId: number) {\n if (this.nativeSensors.has(sensorId)) {\n const sensor = this.nativeSensors.get(sensorId);\n if (sensor && sensor.isRunning()) {\n sensor.listenersNumber--;\n if (sensor.listenersNumber === 0) {\n sensor.unregister();\n }\n }\n }\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,Y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SAAS,CAAC,CAAC,IAAIN,MAAM,CAACO,QAAQ,CAACH,OAAO,CAAC,CAAC,EAChD;MACAJ,MAAM,CAACQ,eAAe,EAAE;MACxB,OAAOb,QAAQ;IACjB;IACA,OAAO,CAAC,CAAC;EACX;EAEAc,gBAAgBA,CAACd,QAAgB,EAAE;IACjC,IAAI,IAAI,CAACC,aAAa,CAACC,GAAG,CAACF,QAAQ,CAAC,EAAE;MACpC,MAAMK,MAAM,GAAG,IAAI,CAACJ,aAAa,CAACK,GAAG,CAACN,QAAQ,CAAC;MAC/C,IAAIK,MAAM,IAAIA,MAAM,CAACM,SAAS,CAAC,CAAC,EAAE;QAChCN,MAAM,CAACQ,eAAe,EAAE;QACxB,IAAIR,MAAM,CAACQ,eAAe,KAAK,CAAC,EAAE;UAChCR,MAAM,CAACU,UAAU,CAAC,CAAC;QACrB;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -4,19 +4,40 @@ import { shouldBeUseWeb } from './PlatformChecker';
|
|
|
4
4
|
import { configureLayoutAnimationBatch, makeShareableCloneRecursive } from './core';
|
|
5
5
|
function createUpdateManager() {
|
|
6
6
|
const animations = [];
|
|
7
|
+
// When a stack is rerendered we reconfigure all the shared elements.
|
|
8
|
+
// To do that we want them to appear in our batch in the correct order,
|
|
9
|
+
// so we defer some of the updates to appear at the end of the batch.
|
|
10
|
+
const deferredAnimations = [];
|
|
7
11
|
return {
|
|
8
|
-
update(batchItem) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
update(batchItem, isUnmounting) {
|
|
13
|
+
if (isUnmounting) {
|
|
14
|
+
deferredAnimations.push(batchItem);
|
|
15
|
+
} else {
|
|
16
|
+
animations.push(batchItem);
|
|
17
|
+
}
|
|
18
|
+
if (animations.length + deferredAnimations.length === 1) {
|
|
19
|
+
// setImmediate(this.flush);
|
|
20
|
+
this.flush();
|
|
12
21
|
}
|
|
13
22
|
},
|
|
14
23
|
flush() {
|
|
15
|
-
configureLayoutAnimationBatch(animations);
|
|
24
|
+
configureLayoutAnimationBatch(animations.concat(deferredAnimations));
|
|
16
25
|
animations.length = 0;
|
|
26
|
+
deferredAnimations.length = 0;
|
|
17
27
|
}
|
|
18
28
|
};
|
|
19
29
|
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Lets you update the current configuration of the layout animation or shared element transition for a given component.
|
|
33
|
+
* Configurations are batched and applied at the end of the current execution block, right before sending the response back to native.
|
|
34
|
+
*
|
|
35
|
+
* @param viewTag - The tag of the component you'd like to configure.
|
|
36
|
+
* @param type - The type of the animation you'd like to configure - {@link LayoutAnimationType}.
|
|
37
|
+
* @param config - The animation configuration - {@link LayoutAnimationFunction}, {@link SharedTransitionAnimationsFunction}, {@link ProgressAnimationCallback} or {@link Keyframe}. Passing `undefined` will remove the animation.
|
|
38
|
+
* @param sharedTransitionTag - The tag of the shared element transition you'd like to configure. Passing `undefined` will remove the transition.
|
|
39
|
+
* @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`.
|
|
40
|
+
*/
|
|
20
41
|
export let updateLayoutAnimations;
|
|
21
42
|
if (shouldBeUseWeb()) {
|
|
22
43
|
updateLayoutAnimations = () => {
|
|
@@ -24,10 +45,11 @@ if (shouldBeUseWeb()) {
|
|
|
24
45
|
};
|
|
25
46
|
} else {
|
|
26
47
|
const updateLayoutAnimationsManager = createUpdateManager();
|
|
27
|
-
updateLayoutAnimations = (viewTag, type, config) => updateLayoutAnimationsManager.update({
|
|
48
|
+
updateLayoutAnimations = (viewTag, type, config, sharedTransitionTag, isUnmounting) => updateLayoutAnimationsManager.update({
|
|
28
49
|
viewTag,
|
|
29
50
|
type,
|
|
30
|
-
config: config ? makeShareableCloneRecursive(config) : undefined
|
|
31
|
-
|
|
51
|
+
config: config ? makeShareableCloneRecursive(config) : undefined,
|
|
52
|
+
sharedTransitionTag
|
|
53
|
+
}, isUnmounting);
|
|
32
54
|
}
|
|
33
55
|
//# sourceMappingURL=UpdateLayoutAnimations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldBeUseWeb","configureLayoutAnimationBatch","makeShareableCloneRecursive","createUpdateManager","animations","update","batchItem","push","length","
|
|
1
|
+
{"version":3,"names":["shouldBeUseWeb","configureLayoutAnimationBatch","makeShareableCloneRecursive","createUpdateManager","animations","deferredAnimations","update","batchItem","isUnmounting","push","length","flush","concat","updateLayoutAnimations","updateLayoutAnimationsManager","viewTag","type","config","sharedTransitionTag","undefined"],"sources":["UpdateLayoutAnimations.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport {\n configureLayoutAnimationBatch,\n makeShareableCloneRecursive,\n} from './core';\nimport type {\n LayoutAnimationFunction,\n LayoutAnimationType,\n} from './layoutReanimation';\nimport type {\n LayoutAnimationBatchItem,\n ProgressAnimationCallback,\n SharedTransitionAnimationsFunction,\n} from './layoutReanimation/animationBuilder/commonTypes';\n\nfunction createUpdateManager() {\n const animations: LayoutAnimationBatchItem[] = [];\n // When a stack is rerendered we reconfigure all the shared elements.\n // To do that we want them to appear in our batch in the correct order,\n // so we defer some of the updates to appear at the end of the batch.\n const deferredAnimations: LayoutAnimationBatchItem[] = [];\n\n return {\n update(batchItem: LayoutAnimationBatchItem, isUnmounting?: boolean) {\n if (isUnmounting) {\n deferredAnimations.push(batchItem);\n } else {\n animations.push(batchItem);\n }\n if (animations.length + deferredAnimations.length === 1) {\n // setImmediate(this.flush);\n this.flush();\n }\n },\n flush(this: void) {\n configureLayoutAnimationBatch(animations.concat(deferredAnimations));\n animations.length = 0;\n deferredAnimations.length = 0;\n },\n };\n}\n\n/**\n * Lets you update the current configuration of the layout animation or shared element transition for a given component.\n * Configurations are batched and applied at the end of the current execution block, right before sending the response back to native.\n *\n * @param viewTag - The tag of the component you'd like to configure.\n * @param type - The type of the animation you'd like to configure - {@link LayoutAnimationType}.\n * @param config - The animation configuration - {@link LayoutAnimationFunction}, {@link SharedTransitionAnimationsFunction}, {@link ProgressAnimationCallback} or {@link Keyframe}. Passing `undefined` will remove the animation.\n * @param sharedTransitionTag - The tag of the shared element transition you'd like to configure. Passing `undefined` will remove the transition.\n * @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`.\n */\nexport let updateLayoutAnimations: (\n viewTag: number,\n type: LayoutAnimationType,\n config?:\n | Keyframe\n | LayoutAnimationFunction\n | SharedTransitionAnimationsFunction\n | ProgressAnimationCallback,\n sharedTransitionTag?: string,\n isUnmounting?: boolean\n) => void;\n\nif (shouldBeUseWeb()) {\n updateLayoutAnimations = () => {\n // no-op\n };\n} else {\n const updateLayoutAnimationsManager = createUpdateManager();\n updateLayoutAnimations = (\n viewTag,\n type,\n config,\n sharedTransitionTag,\n isUnmounting\n ) =>\n updateLayoutAnimationsManager.update(\n {\n viewTag,\n type,\n config: config ? makeShareableCloneRecursive(config) : undefined,\n sharedTransitionTag,\n },\n isUnmounting\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAClD,SACEC,6BAA6B,EAC7BC,2BAA2B,QACtB,QAAQ;AAWf,SAASC,mBAAmBA,CAAA,EAAG;EAC7B,MAAMC,UAAsC,GAAG,EAAE;EACjD;EACA;EACA;EACA,MAAMC,kBAA8C,GAAG,EAAE;EAEzD,OAAO;IACLC,MAAMA,CAACC,SAAmC,EAAEC,YAAsB,EAAE;MAClE,IAAIA,YAAY,EAAE;QAChBH,kBAAkB,CAACI,IAAI,CAACF,SAAS,CAAC;MACpC,CAAC,MAAM;QACLH,UAAU,CAACK,IAAI,CAACF,SAAS,CAAC;MAC5B;MACA,IAAIH,UAAU,CAACM,MAAM,GAAGL,kBAAkB,CAACK,MAAM,KAAK,CAAC,EAAE;QACvD;QACA,IAAI,CAACC,KAAK,CAAC,CAAC;MACd;IACF,CAAC;IACDA,KAAKA,CAAA,EAAa;MAChBV,6BAA6B,CAACG,UAAU,CAACQ,MAAM,CAACP,kBAAkB,CAAC,CAAC;MACpED,UAAU,CAACM,MAAM,GAAG,CAAC;MACrBL,kBAAkB,CAACK,MAAM,GAAG,CAAC;IAC/B;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIG,sBAUF;AAET,IAAIb,cAAc,CAAC,CAAC,EAAE;EACpBa,sBAAsB,GAAGA,CAAA,KAAM;IAC7B;EAAA,CACD;AACH,CAAC,MAAM;EACL,MAAMC,6BAA6B,GAAGX,mBAAmB,CAAC,CAAC;EAC3DU,sBAAsB,GAAGA,CACvBE,OAAO,EACPC,IAAI,EACJC,MAAM,EACNC,mBAAmB,EACnBV,YAAY,KAEZM,6BAA6B,CAACR,MAAM,CAClC;IACES,OAAO;IACPC,IAAI;IACJC,MAAM,EAAEA,MAAM,GAAGf,2BAA2B,CAACe,MAAM,CAAC,GAAGE,SAAS;IAChED;EACF,CAAC,EACDV,YACF,CAAC;AACL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["processColorsInProps","_updatePropsJS","isFabric","isJest","shouldBeUseWeb","runOnUIImmediately","updateProps","_","updates","maybeViewRef","isAnimatedProps","items","forEach","item","_index","viewDescriptors","global","UpdatePropsManager","update","updatePropsJestWrapper","animatedStyle","adapters","adapter","current","value","createUpdatePropsManager","operations","viewDescriptor","push","shadowNodeWrapper","length","queueMicrotask","flush","_updatePropsFabric","tag","name","_updatePropsPaper","maybeThrowError","Error","Proxy","get","set"],"sources":["UpdateProps.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n'use strict';\nimport type { MutableRefObject } from 'react';\nimport { processColorsInProps } from './Colors';\nimport type { ShadowNodeWrapper, SharedValue, StyleProps } from './commonTypes';\nimport type { AnimatedStyle } from './helperTypes';\nimport type { Descriptor } from './hook/commonTypes';\nimport { _updatePropsJS } from './js-reanimated';\nimport { isFabric, isJest, shouldBeUseWeb } from './PlatformChecker';\nimport type { ViewRefSet } from './ViewDescriptorsSet';\nimport { runOnUIImmediately } from './threads';\n\nlet updateProps: (\n viewDescriptor: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>,\n maybeViewRef: ViewRefSet<any> | undefined,\n isAnimatedProps?: boolean\n) => void;\n\nif (shouldBeUseWeb()) {\n updateProps = (_, updates, maybeViewRef, isAnimatedProps) => {\n 'worklet';\n if (maybeViewRef) {\n maybeViewRef.items.forEach((item, _index) => {\n _updatePropsJS(updates, item, isAnimatedProps);\n });\n }\n };\n} else {\n updateProps = (viewDescriptors, updates) => {\n 'worklet';\n processColorsInProps(updates);\n global.UpdatePropsManager.update(viewDescriptors, updates);\n };\n}\n\nexport const updatePropsJestWrapper = (\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: AnimatedStyle<any>,\n maybeViewRef: ViewRefSet<any> | undefined,\n animatedStyle: MutableRefObject<AnimatedStyle<any>>,\n adapters: ((updates: AnimatedStyle<any>) => void)[]\n): void => {\n adapters.forEach((adapter) => {\n adapter(updates);\n });\n animatedStyle.current.value = {\n ...animatedStyle.current.value,\n ...updates,\n };\n\n updateProps(viewDescriptors, updates, maybeViewRef);\n};\n\nexport default updateProps;\n\nconst createUpdatePropsManager = isFabric()\n ? () => {\n 'worklet';\n // Fabric\n const operations: {\n shadowNodeWrapper: ShadowNodeWrapper;\n updates: StyleProps | AnimatedStyle<any>;\n }[] = [];\n return {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ) {\n viewDescriptors.value.forEach((viewDescriptor) => {\n operations.push({\n shadowNodeWrapper: viewDescriptor.shadowNodeWrapper,\n updates,\n });\n if (operations.length === 1) {\n queueMicrotask(this.flush);\n }\n });\n },\n flush(this: void) {\n global._updatePropsFabric!(operations);\n operations.length = 0;\n },\n };\n }\n : () => {\n 'worklet';\n // Paper\n const operations: {\n tag: number;\n name: string;\n updates: StyleProps | AnimatedStyle<any>;\n }[] = [];\n return {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ) {\n viewDescriptors.value.forEach((viewDescriptor) => {\n operations.push({\n tag: viewDescriptor.tag,\n name: viewDescriptor.name || 'RCTView',\n updates,\n });\n if (operations.length === 1) {\n queueMicrotask(this.flush);\n }\n });\n },\n flush(this: void) {\n global._updatePropsPaper!(operations);\n operations.length = 0;\n },\n };\n };\n\nif (shouldBeUseWeb()) {\n const maybeThrowError = () => {\n // Jest attempts to access a property of this object to check if it is a Jest mock\n // so we can't throw an error in the getter.\n if (!isJest()) {\n throw new Error(\n '[Reanimated] `UpdatePropsManager` is not available on non-native platform.'\n );\n }\n };\n global.UpdatePropsManager = new Proxy({} as UpdatePropsManager, {\n get: maybeThrowError,\n set: () => {\n maybeThrowError();\n return false;\n },\n });\n} else {\n runOnUIImmediately(() => {\n 'worklet';\n global.UpdatePropsManager = createUpdatePropsManager();\n })();\n}\n\nexport interface UpdatePropsManager {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ): void;\n flush(): void;\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAEZ,SAASA,oBAAoB,QAAQ,UAAU;AAI/C,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,cAAc,QAAQ,mBAAmB;AAEpE,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,IAAIC,WAKK;AAET,IAAIF,cAAc,
|
|
1
|
+
{"version":3,"names":["processColorsInProps","_updatePropsJS","isFabric","isJest","shouldBeUseWeb","runOnUIImmediately","updateProps","_","updates","maybeViewRef","isAnimatedProps","items","forEach","item","_index","viewDescriptors","global","UpdatePropsManager","update","updatePropsJestWrapper","animatedStyle","adapters","adapter","current","value","createUpdatePropsManager","operations","viewDescriptor","push","shadowNodeWrapper","length","queueMicrotask","flush","_updatePropsFabric","tag","name","_updatePropsPaper","maybeThrowError","Error","Proxy","get","set"],"sources":["UpdateProps.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n'use strict';\nimport type { MutableRefObject } from 'react';\nimport { processColorsInProps } from './Colors';\nimport type { ShadowNodeWrapper, SharedValue, StyleProps } from './commonTypes';\nimport type { AnimatedStyle } from './helperTypes';\nimport type { Descriptor } from './hook/commonTypes';\nimport { _updatePropsJS } from './js-reanimated';\nimport { isFabric, isJest, shouldBeUseWeb } from './PlatformChecker';\nimport type { ViewRefSet } from './ViewDescriptorsSet';\nimport { runOnUIImmediately } from './threads';\n\nlet updateProps: (\n viewDescriptor: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>,\n maybeViewRef: ViewRefSet<any> | undefined,\n isAnimatedProps?: boolean\n) => void;\n\nif (shouldBeUseWeb()) {\n updateProps = (_, updates, maybeViewRef, isAnimatedProps) => {\n 'worklet';\n if (maybeViewRef) {\n maybeViewRef.items.forEach((item, _index) => {\n _updatePropsJS(updates, item, isAnimatedProps);\n });\n }\n };\n} else {\n updateProps = (viewDescriptors, updates) => {\n 'worklet';\n processColorsInProps(updates);\n global.UpdatePropsManager.update(viewDescriptors, updates);\n };\n}\n\nexport const updatePropsJestWrapper = (\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: AnimatedStyle<any>,\n maybeViewRef: ViewRefSet<any> | undefined,\n animatedStyle: MutableRefObject<AnimatedStyle<any>>,\n adapters: ((updates: AnimatedStyle<any>) => void)[]\n): void => {\n adapters.forEach((adapter) => {\n adapter(updates);\n });\n animatedStyle.current.value = {\n ...animatedStyle.current.value,\n ...updates,\n };\n\n updateProps(viewDescriptors, updates, maybeViewRef);\n};\n\nexport default updateProps;\n\nconst createUpdatePropsManager = isFabric()\n ? () => {\n 'worklet';\n // Fabric\n const operations: {\n shadowNodeWrapper: ShadowNodeWrapper;\n updates: StyleProps | AnimatedStyle<any>;\n }[] = [];\n return {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ) {\n viewDescriptors.value.forEach((viewDescriptor) => {\n operations.push({\n shadowNodeWrapper: viewDescriptor.shadowNodeWrapper,\n updates,\n });\n if (operations.length === 1) {\n queueMicrotask(this.flush);\n }\n });\n },\n flush(this: void) {\n global._updatePropsFabric!(operations);\n operations.length = 0;\n },\n };\n }\n : () => {\n 'worklet';\n // Paper\n const operations: {\n tag: number;\n name: string;\n updates: StyleProps | AnimatedStyle<any>;\n }[] = [];\n return {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ) {\n viewDescriptors.value.forEach((viewDescriptor) => {\n operations.push({\n tag: viewDescriptor.tag,\n name: viewDescriptor.name || 'RCTView',\n updates,\n });\n if (operations.length === 1) {\n queueMicrotask(this.flush);\n }\n });\n },\n flush(this: void) {\n global._updatePropsPaper!(operations);\n operations.length = 0;\n },\n };\n };\n\nif (shouldBeUseWeb()) {\n const maybeThrowError = () => {\n // Jest attempts to access a property of this object to check if it is a Jest mock\n // so we can't throw an error in the getter.\n if (!isJest()) {\n throw new Error(\n '[Reanimated] `UpdatePropsManager` is not available on non-native platform.'\n );\n }\n };\n global.UpdatePropsManager = new Proxy({} as UpdatePropsManager, {\n get: maybeThrowError,\n set: () => {\n maybeThrowError();\n return false;\n },\n });\n} else {\n runOnUIImmediately(() => {\n 'worklet';\n global.UpdatePropsManager = createUpdatePropsManager();\n })();\n}\n\nexport interface UpdatePropsManager {\n update(\n viewDescriptors: SharedValue<Descriptor[]>,\n updates: StyleProps | AnimatedStyle<any>\n ): void;\n flush(): void;\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAEZ,SAASA,oBAAoB,QAAQ,UAAU;AAI/C,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,cAAc,QAAQ,mBAAmB;AAEpE,SAASC,kBAAkB,QAAQ,WAAW;AAE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KAAM;MACTJ,eAAe,CAAC,CAAC;MACjB,OAAO,KAAK;IACd;EACF,CAAC,CAAC;AACJ,CAAC,MAAM;EACLhC,kBAAkB,CAAC,MAAM;IACvB,SAAS;;IACTW,MAAM,CAACC,kBAAkB,GAAGQ,wBAAwB,CAAC,CAAC;EACxD,CAAC,CAAC,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","makeMutable","shouldBeUseWeb","makeViewDescriptorsSet","shareableViewDescriptors","data","add","item","modify","descriptors","index","findIndex","descriptor","tag","push","remove","viewTag","splice","SHOULD_BE_USE_WEB","useViewRefSet","useViewRefSetJS","useViewRefSetNative","undefined","ref","current","items","Set","has","delete"],"sources":["ViewDescriptorsSet.ts"],"sourcesContent":["'use strict';\nimport { useRef } from 'react';\nimport { makeMutable } from './core';\nimport type { SharedValue } from './commonTypes';\nimport type { Descriptor } from './hook/commonTypes';\nimport { shouldBeUseWeb } from './PlatformChecker';\n\nexport interface ViewRefSet<T> {\n items: Set<T>;\n add: (item: T) => void;\n remove: (item: T) => void;\n}\n\nexport interface ViewDescriptorsSet {\n shareableViewDescriptors: SharedValue<Descriptor[]>;\n add: (item: Descriptor) => void;\n remove: (viewTag: number) => void;\n}\n\nexport function makeViewDescriptorsSet(): ViewDescriptorsSet {\n const shareableViewDescriptors = makeMutable<Descriptor[]>([]);\n const data: ViewDescriptorsSet = {\n shareableViewDescriptors,\n add: (item: Descriptor) => {\n shareableViewDescriptors.modify((descriptors) => {\n 'worklet';\n const index = descriptors.findIndex(\n (descriptor) => descriptor.tag === item.tag\n );\n if (index !== -1) {\n descriptors[index] = item;\n } else {\n descriptors.push(item);\n }\n return descriptors;\n }, false);\n },\n\n remove: (viewTag: number) => {\n shareableViewDescriptors.modify((descriptors) => {\n 'worklet';\n const index = descriptors.findIndex(\n (descriptor) => descriptor.tag === viewTag\n );\n if (index !== -1) {\n descriptors.splice(index, 1);\n }\n return descriptors;\n }, false);\n },\n };\n return data;\n}\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport const useViewRefSet = SHOULD_BE_USE_WEB\n ? useViewRefSetJS\n : useViewRefSetNative;\n\nfunction useViewRefSetNative() {\n // Stub native implementation.\n return undefined;\n}\n\nfunction useViewRefSetJS<T>(): ViewRefSet<T> {\n const ref = useRef<ViewRefSet<T> | null>(null);\n if (ref.current === null) {\n const data: ViewRefSet<T> = {\n items: new Set(),\n\n add: (item: T) => {\n if (data.items.has(item)) return;\n data.items.add(item);\n },\n\n remove: (item: T) => {\n data.items.delete(item);\n },\n };\n ref.current = data;\n }\n\n return ref.current;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,WAAW,QAAQ,QAAQ;AAGpC,SAASC,cAAc,QAAQ,mBAAmB;AAclD,OAAO,SAASC,sBAAsBA,CAAA,EAAuB;EAC3D,MAAMC,wBAAwB,GAAGH,WAAW,CAAe,EAAE,CAAC;EAC9D,MAAMI,IAAwB,GAAG;IAC/BD,wBAAwB;IACxBE,GAAG,EAAGC,IAAgB,IAAK;MACzBH,wBAAwB,CAACI,MAAM,CAAEC,WAAW,IAAK;QAC/C,SAAS;;QACT,MAAMC,KAAK,GAAGD,WAAW,CAACE,SAAS,CAChCC,UAAU,IAAKA,UAAU,CAACC,GAAG,KAAKN,IAAI,CAACM,
|
|
1
|
+
{"version":3,"names":["useRef","makeMutable","shouldBeUseWeb","makeViewDescriptorsSet","shareableViewDescriptors","data","add","item","modify","descriptors","index","findIndex","descriptor","tag","push","remove","viewTag","splice","SHOULD_BE_USE_WEB","useViewRefSet","useViewRefSetJS","useViewRefSetNative","undefined","ref","current","items","Set","has","delete"],"sources":["ViewDescriptorsSet.ts"],"sourcesContent":["'use strict';\nimport { useRef } from 'react';\nimport { makeMutable } from './core';\nimport type { SharedValue } from './commonTypes';\nimport type { Descriptor } from './hook/commonTypes';\nimport { shouldBeUseWeb } from './PlatformChecker';\n\nexport interface ViewRefSet<T> {\n items: Set<T>;\n add: (item: T) => void;\n remove: (item: T) => void;\n}\n\nexport interface ViewDescriptorsSet {\n shareableViewDescriptors: SharedValue<Descriptor[]>;\n add: (item: Descriptor) => void;\n remove: (viewTag: number) => void;\n}\n\nexport function makeViewDescriptorsSet(): ViewDescriptorsSet {\n const shareableViewDescriptors = makeMutable<Descriptor[]>([]);\n const data: ViewDescriptorsSet = {\n shareableViewDescriptors,\n add: (item: Descriptor) => {\n shareableViewDescriptors.modify((descriptors) => {\n 'worklet';\n const index = descriptors.findIndex(\n (descriptor) => descriptor.tag === item.tag\n );\n if (index !== -1) {\n descriptors[index] = item;\n } else {\n descriptors.push(item);\n }\n return descriptors;\n }, false);\n },\n\n remove: (viewTag: number) => {\n shareableViewDescriptors.modify((descriptors) => {\n 'worklet';\n const index = descriptors.findIndex(\n (descriptor) => descriptor.tag === viewTag\n );\n if (index !== -1) {\n descriptors.splice(index, 1);\n }\n return descriptors;\n }, false);\n },\n };\n return data;\n}\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport const useViewRefSet = SHOULD_BE_USE_WEB\n ? useViewRefSetJS\n : useViewRefSetNative;\n\nfunction useViewRefSetNative() {\n // Stub native implementation.\n return undefined;\n}\n\nfunction useViewRefSetJS<T>(): ViewRefSet<T> {\n const ref = useRef<ViewRefSet<T> | null>(null);\n if (ref.current === null) {\n const data: ViewRefSet<T> = {\n items: new Set(),\n\n add: (item: T) => {\n if (data.items.has(item)) return;\n data.items.add(item);\n },\n\n remove: (item: T) => {\n data.items.delete(item);\n },\n };\n ref.current = data;\n }\n\n return ref.current;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,WAAW,QAAQ,QAAQ;AAGpC,SAASC,cAAc,QAAQ,mBAAmB;AAclD,OAAO,SAASC,sBAAsBA,CAAA,EAAuB;EAC3D,MAAMC,wBAAwB,GAAGH,WAAW,CAAe,EAAE,CAA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