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":["LinearTransition","name","transitionData","translateX","translateY","scaleX","scaleY","linearTransition","style","transform","scale","duration"],"sources":["Linear.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function LinearTransition(name: string, transitionData: TransitionData) {\n const { translateX, translateY, scaleX, scaleY } = transitionData;\n\n const linearTransition = {\n name,\n style: {\n 0: {\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n },\n duration: 300,\n };\n\n return linearTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,gBAAgBA,CAACC,IAAY,EAAEC,cAA8B,EAAE;EAC7E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,cAAc;EAEjE,MAAMK,gBAAgB,GAAG;IACvBN,IAAI;IACJO,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,SAAS,EAAE,CACT;UACEN,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BM,KAAK,EAAG,GAAEL,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL;IACF,CAAC;IACDK,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOJ,gBAAgB;AACzB"}
|
|
1
|
+
{"version":3,"names":["LinearTransition","name","transitionData","translateX","translateY","scaleX","scaleY","linearTransition","style","transform","scale","duration"],"sources":["Linear.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function LinearTransition(name: string, transitionData: TransitionData) {\n const { translateX, translateY, scaleX, scaleY } = transitionData;\n\n const linearTransition = {\n name,\n style: {\n 0: {\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n },\n duration: 300,\n };\n\n return linearTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,gBAAgBA,CAACC,IAAY,EAAEC,cAA8B,EAAE;EAC7E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,cAAc;EAEjE,MAAMK,gBAAgB,GAAG;IACvBN,IAAI;IACJO,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,SAAS,EAAE,CACT;UACEN,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BM,KAAK,EAAG,GAAEL,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL;IACF,CAAC;IACDK,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOJ,gBAAgB;AACzB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SequencedTransition","name","transitionData","translateX","translateY","scaleX","scaleY","reversed","scaleValue","sequencedTransition","style","transform","scale","duration"],"sources":["Sequenced.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function SequencedTransition(\n name: string,\n transitionData: TransitionData\n) {\n const { translateX, translateY, scaleX, scaleY, reversed } = transitionData;\n\n const scaleValue = reversed ? `1,${scaleX}` : `${scaleY},1`;\n\n const sequencedTransition = {\n name,\n style: {\n 0: {\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 50: {\n transform: [\n {\n translateX: reversed ? `${translateX}px` : '0px',\n translateY: reversed ? '0px' : `${translateY}px`,\n scale: scaleValue,\n },\n ],\n },\n 100: {\n transform: [{ translateX: '0px', translateY: '0px', scale: '1,1' }],\n },\n },\n duration: 300,\n };\n\n return sequencedTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,mBAAmBA,CACjCC,IAAY,EACZC,cAA8B,EAC9B;EACA,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGL,cAAc;EAE3E,MAAMM,UAAU,GAAGD,QAAQ,GAAI,KAAIF,MAAO,EAAC,GAAI,GAAEC,MAAO,IAAG;EAE3D,MAAMG,mBAAmB,GAAG;IAC1BR,IAAI;IACJS,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,SAAS,EAAE,CACT;UACER,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BQ,KAAK,EAAG,GAAEP,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFK,SAAS,EAAE,CACT;UACER,UAAU,EAAEI,QAAQ,GAAI,GAAEJ,UAAW,IAAG,GAAG,KAAK;UAChDC,UAAU,EAAEG,QAAQ,GAAG,KAAK,GAAI,GAAEH,UAAW,IAAG;UAChDQ,KAAK,EAAEJ;QACT,CAAC;MAEL,CAAC;MACD,GAAG,EAAE;QACHG,SAAS,EAAE,CAAC;UAAER,UAAU,EAAE,KAAK;UAAEC,UAAU,EAAE,KAAK;UAAEQ,KAAK,EAAE;QAAM,CAAC;MACpE;IACF,CAAC;IACDC,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOJ,mBAAmB;AAC5B"}
|
|
1
|
+
{"version":3,"names":["SequencedTransition","name","transitionData","translateX","translateY","scaleX","scaleY","reversed","scaleValue","sequencedTransition","style","transform","scale","duration"],"sources":["Sequenced.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function SequencedTransition(\n name: string,\n transitionData: TransitionData\n) {\n const { translateX, translateY, scaleX, scaleY, reversed } = transitionData;\n\n const scaleValue = reversed ? `1,${scaleX}` : `${scaleY},1`;\n\n const sequencedTransition = {\n name,\n style: {\n 0: {\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 50: {\n transform: [\n {\n translateX: reversed ? `${translateX}px` : '0px',\n translateY: reversed ? '0px' : `${translateY}px`,\n scale: scaleValue,\n },\n ],\n },\n 100: {\n transform: [{ translateX: '0px', translateY: '0px', scale: '1,1' }],\n },\n },\n duration: 300,\n };\n\n return sequencedTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,mBAAmBA,CACjCC,IAAY,EACZC,cAA8B,EAC9B;EACA,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGL,cAAc;EAE3E,MAAMM,UAAU,GAAGD,QAAQ,GAAI,KAAIF,MAAO,EAAC,GAAI,GAAEC,MAAO,IAAG;EAE3D,MAAMG,mBAAmB,GAAG;IAC1BR,IAAI;IACJS,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,SAAS,EAAE,CACT;UACER,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BQ,KAAK,EAAG,GAAEP,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFK,SAAS,EAAE,CACT;UACER,UAAU,EAAEI,QAAQ,GAAI,GAAEJ,UAAW,IAAG,GAAG,KAAK;UAChDC,UAAU,EAAEG,QAAQ,GAAG,KAAK,GAAI,GAAEH,UAAW,IAAG;UAChDQ,KAAK,EAAEJ;QACT,CAAC;MAEL,CAAC;MACD,GAAG,EAAE;QACHG,SAAS,EAAE,CAAC;UAAER,UAAU,EAAE,KAAK;UAAEC,UAAU,EAAE,KAAK;UAAEQ,KAAK,EAAE;QAAM,CAAC;MACpE;IACF,CAAC;IACDC,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOJ,mBAAmB;AAC5B","ignoreList":[]}
|
|
@@ -166,9 +166,7 @@ function createMapperRegistry() {
|
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
168
|
let MAPPER_ID = 9999;
|
|
169
|
-
export function startMapper(worklet) {
|
|
170
|
-
let inputs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
171
|
-
let outputs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
169
|
+
export function startMapper(worklet, inputs = [], outputs = []) {
|
|
172
170
|
const mapperID = MAPPER_ID += 1;
|
|
173
171
|
runOnUI(() => {
|
|
174
172
|
let mapperRegistry = global.__mapperRegistry;
|
|
@@ -182,7 +180,7 @@ export function startMapper(worklet) {
|
|
|
182
180
|
export function stopMapper(mapperID) {
|
|
183
181
|
runOnUI(() => {
|
|
184
182
|
const mapperRegistry = global.__mapperRegistry;
|
|
185
|
-
mapperRegistry === null || mapperRegistry === void 0
|
|
183
|
+
mapperRegistry === null || mapperRegistry === void 0 || mapperRegistry.stop(mapperID);
|
|
186
184
|
})();
|
|
187
185
|
}
|
|
188
186
|
//# sourceMappingURL=mappers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isJest","runOnUI","isSharedValue","IS_JEST","createMapperRegistry","mappers","Map","sortedMappers","runRequested","processingMappers","updateMappersOrder","pre","forEach","mapper","outputs","output","preMappers","get","undefined","set","push","visited","Set","newOrder","dfs","add","input","inputs","preMapper","has","mapperRun","size","length","dirty","worklet","maybeRequestUpdates","requestAnimationFrame","queueMicrotask","extractInputs","resultArray","Array","isArray","Object","getPrototypeOf","prototype","element","values","start","mapperID","id","sv","addListener","stop","delete","removeListener","MAPPER_ID","startMapper","arguments","mapperRegistry","global","__mapperRegistry","stopMapper"],"sources":["mappers.ts"],"sourcesContent":["'use strict';\nimport type {\n MapperRawInputs,\n MapperOutputs,\n SharedValue,\n} from './commonTypes';\nimport { isJest } from './PlatformChecker';\nimport { runOnUI } from './threads';\nimport { isSharedValue } from './isSharedValue';\n\nconst IS_JEST = isJest();\n\ntype MapperExtractedInputs = SharedValue[];\n\ntype Mapper = {\n id: number;\n dirty: boolean;\n worklet: () => void;\n inputs: MapperExtractedInputs;\n outputs?: MapperOutputs;\n};\n\nfunction createMapperRegistry() {\n 'worklet';\n const mappers = new Map<number, Mapper>();\n let sortedMappers: Mapper[] = [];\n\n let runRequested = false;\n let processingMappers = false;\n\n function updateMappersOrder() {\n // sort mappers topologically\n // the algorithm here takes adventage of a fact that the topological order\n // of a transposed graph is a reverse topological order of the original graph\n // The graph in our case consists of mappers and an edge between two mappers\n // A and B exists if there is a shared value that's on A's output lists and on\n // B's input list.\n //\n // We don't need however to calculate that graph as it is easier to work with\n // the transposed version of it that can be calculated ad-hoc. For the transposed\n // version to be traversed we use \"pre\" map that maps share value to mappers that\n // output that shared value. Then we can infer all the outgoing edges for a given\n // mapper simply by scanning it's input list and checking if any of the shared values\n // from that list exists in the \"pre\" map. If they do, then we have an edge between\n // that mapper and the mappers from the \"pre\" list for the given shared value.\n //\n // For topological sorting we use a dfs-based approach that requires the graph to\n // be traversed in dfs order and each node after being processed lands at the\n // beginning of the topological order list. Since we traverse a transposed graph,\n // instead of reversing that order we can use a normal array and push processed\n // mappers to the end. There is no need to reverse that array after we are done.\n const pre = new Map(); // map from sv -> mapper that outputs that sv\n mappers.forEach((mapper) => {\n if (mapper.outputs) {\n for (const output of mapper.outputs) {\n const preMappers = pre.get(output);\n if (preMappers === undefined) {\n pre.set(output, [mapper]);\n } else {\n preMappers.push(mapper);\n }\n }\n }\n });\n const visited = new Set();\n const newOrder: Mapper[] = [];\n function dfs(mapper: Mapper) {\n visited.add(mapper);\n for (const input of mapper.inputs) {\n const preMappers = pre.get(input);\n if (preMappers) {\n for (const preMapper of preMappers) {\n if (!visited.has(preMapper)) {\n dfs(preMapper);\n }\n }\n }\n }\n newOrder.push(mapper);\n }\n mappers.forEach((mapper) => {\n if (!visited.has(mapper)) {\n dfs(mapper);\n }\n });\n sortedMappers = newOrder;\n }\n\n function mapperRun() {\n runRequested = false;\n if (processingMappers) {\n return;\n }\n try {\n processingMappers = true;\n if (mappers.size !== sortedMappers.length) {\n updateMappersOrder();\n }\n for (const mapper of sortedMappers) {\n if (mapper.dirty) {\n mapper.dirty = false;\n mapper.worklet();\n }\n }\n } finally {\n processingMappers = false;\n }\n }\n\n function maybeRequestUpdates() {\n if (IS_JEST) {\n // On Jest environment we avoid using queueMicrotask as that'd require test\n // to advance the clock manually. This on other hand would require tests\n // to know how many times mappers need to run. As we don't want tests to\n // make any assumptions on that number it is easier to execute mappers\n // immediately for testing purposes and only expect test to advance timers\n // if they want to make any assertions on the effects of animations being run.\n mapperRun();\n } else if (!runRequested) {\n if (processingMappers) {\n // In general, we should avoid having mappers trigger updates as this may\n // result in unpredictable behavior. Specifically, the updated value can\n // be read by mappers that run later in the same frame but previous mappers\n // would access the old value. Updating mappers during the mapper-run phase\n // breaks the order in which we should execute the mappers. However, doing\n // that is still a possibility and there are some instances where people use\n // the API in that way, hence we need to prevent mapper-run phase falling into\n // an infinite loop. We do that by detecting when mapper-run is requested while\n // we are already in mapper-run phase, and in that case we use `requestAnimationFrame`\n // instead of `queueMicrotask` which will schedule mapper run for the next\n // frame instead of queuing another set of updates in the same frame.\n requestAnimationFrame(mapperRun);\n } else {\n queueMicrotask(mapperRun);\n }\n runRequested = true;\n }\n }\n\n function extractInputs(\n inputs: unknown,\n resultArray: MapperExtractedInputs\n ): MapperExtractedInputs {\n if (Array.isArray(inputs)) {\n for (const input of inputs) {\n input && extractInputs(input, resultArray);\n }\n } else if (isSharedValue(inputs)) {\n resultArray.push(inputs);\n } else if (Object.getPrototypeOf(inputs) === Object.prototype) {\n // we only extract inputs recursively from \"plain\" objects here, if object\n // is of a derivative class (e.g. HostObject on web, or Map) we don't scan\n // it recursively\n for (const element of Object.values(inputs as Record<string, unknown>)) {\n element && extractInputs(element, resultArray);\n }\n }\n return resultArray;\n }\n\n return {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => {\n const mapper: Mapper = {\n id: mapperID,\n dirty: true,\n worklet,\n inputs: extractInputs(inputs, []),\n outputs,\n };\n mappers.set(mapper.id, mapper);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.addListener(mapper.id, () => {\n mapper.dirty = true;\n maybeRequestUpdates();\n });\n }\n maybeRequestUpdates();\n },\n stop: (mapperID: number) => {\n const mapper = mappers.get(mapperID);\n if (mapper) {\n mappers.delete(mapper.id);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.removeListener(mapper.id);\n }\n }\n },\n };\n}\n\nlet MAPPER_ID = 9999;\n\nexport function startMapper(\n worklet: () => void,\n inputs: MapperRawInputs = [],\n outputs: MapperOutputs = []\n): number {\n const mapperID = (MAPPER_ID += 1);\n\n runOnUI(() => {\n let mapperRegistry = global.__mapperRegistry;\n if (mapperRegistry === undefined) {\n mapperRegistry = global.__mapperRegistry = createMapperRegistry();\n }\n mapperRegistry.start(mapperID, worklet, inputs, outputs);\n })();\n\n return mapperID;\n}\n\nexport function stopMapper(mapperID: number): void {\n runOnUI(() => {\n const mapperRegistry = global.__mapperRegistry;\n mapperRegistry?.stop(mapperID);\n })();\n}\n"],"mappings":"AAAA,YAAY;;AAMZ,SAASA,MAAM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haredValue","IS_JEST","createMapperRegistry","mappers","Map","sortedMappers","runRequested","processingMappers","updateMappersOrder","pre","forEach","mapper","outputs","output","preMappers","get","undefined","set","push","visited","Set","newOrder","dfs","add","input","inputs","preMapper","has","mapperRun","size","length","dirty","worklet","maybeRequestUpdates","requestAnimationFrame","queueMicrotask","extractInputs","resultArray","Array","isArray","Object","getPrototypeOf","prototype","element","values","start","mapperID","id","sv","addListener","stop","delete","removeListener","MAPPER_ID","startMapper","mapperRegistry","global","__mapperRegistry","stopMapper"],"sources":["mappers.ts"],"sourcesContent":["'use strict';\nimport type {\n MapperRawInputs,\n MapperOutputs,\n SharedValue,\n} from './commonTypes';\nimport { isJest } from './PlatformChecker';\nimport { runOnUI } from './threads';\nimport { isSharedValue } from './isSharedValue';\n\nconst IS_JEST = isJest();\n\ntype MapperExtractedInputs = SharedValue[];\n\ntype Mapper = {\n id: number;\n dirty: boolean;\n worklet: () => void;\n inputs: MapperExtractedInputs;\n outputs?: MapperOutputs;\n};\n\nfunction createMapperRegistry() {\n 'worklet';\n const mappers = new Map<number, Mapper>();\n let sortedMappers: Mapper[] = [];\n\n let runRequested = false;\n let processingMappers = false;\n\n function updateMappersOrder() {\n // sort mappers topologically\n // the algorithm here takes adventage of a fact that the topological order\n // of a transposed graph is a reverse topological order of the original graph\n // The graph in our case consists of mappers and an edge between two mappers\n // A and B exists if there is a shared value that's on A's output lists and on\n // B's input list.\n //\n // We don't need however to calculate that graph as it is easier to work with\n // the transposed version of it that can be calculated ad-hoc. For the transposed\n // version to be traversed we use \"pre\" map that maps share value to mappers that\n // output that shared value. Then we can infer all the outgoing edges for a given\n // mapper simply by scanning it's input list and checking if any of the shared values\n // from that list exists in the \"pre\" map. If they do, then we have an edge between\n // that mapper and the mappers from the \"pre\" list for the given shared value.\n //\n // For topological sorting we use a dfs-based approach that requires the graph to\n // be traversed in dfs order and each node after being processed lands at the\n // beginning of the topological order list. Since we traverse a transposed graph,\n // instead of reversing that order we can use a normal array and push processed\n // mappers to the end. There is no need to reverse that array after we are done.\n const pre = new Map(); // map from sv -> mapper that outputs that sv\n mappers.forEach((mapper) => {\n if (mapper.outputs) {\n for (const output of mapper.outputs) {\n const preMappers = pre.get(output);\n if (preMappers === undefined) {\n pre.set(output, [mapper]);\n } else {\n preMappers.push(mapper);\n }\n }\n }\n });\n const visited = new Set();\n const newOrder: Mapper[] = [];\n function dfs(mapper: Mapper) {\n visited.add(mapper);\n for (const input of mapper.inputs) {\n const preMappers = pre.get(input);\n if (preMappers) {\n for (const preMapper of preMappers) {\n if (!visited.has(preMapper)) {\n dfs(preMapper);\n }\n }\n }\n }\n newOrder.push(mapper);\n }\n mappers.forEach((mapper) => {\n if (!visited.has(mapper)) {\n dfs(mapper);\n }\n });\n sortedMappers = newOrder;\n }\n\n function mapperRun() {\n runRequested = false;\n if (processingMappers) {\n return;\n }\n try {\n processingMappers = true;\n if (mappers.size !== sortedMappers.length) {\n updateMappersOrder();\n }\n for (const mapper of sortedMappers) {\n if (mapper.dirty) {\n mapper.dirty = false;\n mapper.worklet();\n }\n }\n } finally {\n processingMappers = false;\n }\n }\n\n function maybeRequestUpdates() {\n if (IS_JEST) {\n // On Jest environment we avoid using queueMicrotask as that'd require test\n // to advance the clock manually. This on other hand would require tests\n // to know how many times mappers need to run. As we don't want tests to\n // make any assumptions on that number it is easier to execute mappers\n // immediately for testing purposes and only expect test to advance timers\n // if they want to make any assertions on the effects of animations being run.\n mapperRun();\n } else if (!runRequested) {\n if (processingMappers) {\n // In general, we should avoid having mappers trigger updates as this may\n // result in unpredictable behavior. Specifically, the updated value can\n // be read by mappers that run later in the same frame but previous mappers\n // would access the old value. Updating mappers during the mapper-run phase\n // breaks the order in which we should execute the mappers. However, doing\n // that is still a possibility and there are some instances where people use\n // the API in that way, hence we need to prevent mapper-run phase falling into\n // an infinite loop. We do that by detecting when mapper-run is requested while\n // we are already in mapper-run phase, and in that case we use `requestAnimationFrame`\n // instead of `queueMicrotask` which will schedule mapper run for the next\n // frame instead of queuing another set of updates in the same frame.\n requestAnimationFrame(mapperRun);\n } else {\n queueMicrotask(mapperRun);\n }\n runRequested = true;\n }\n }\n\n function extractInputs(\n inputs: unknown,\n resultArray: MapperExtractedInputs\n ): MapperExtractedInputs {\n if (Array.isArray(inputs)) {\n for (const input of inputs) {\n input && extractInputs(input, resultArray);\n }\n } else if (isSharedValue(inputs)) {\n resultArray.push(inputs);\n } else if (Object.getPrototypeOf(inputs) === Object.prototype) {\n // we only extract inputs recursively from \"plain\" objects here, if object\n // is of a derivative class (e.g. HostObject on web, or Map) we don't scan\n // it recursively\n for (const element of Object.values(inputs as Record<string, unknown>)) {\n element && extractInputs(element, resultArray);\n }\n }\n return resultArray;\n }\n\n return {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => {\n const mapper: Mapper = {\n id: mapperID,\n dirty: true,\n worklet,\n inputs: extractInputs(inputs, []),\n outputs,\n };\n mappers.set(mapper.id, mapper);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.addListener(mapper.id, () => {\n mapper.dirty = true;\n maybeRequestUpdates();\n });\n }\n maybeRequestUpdates();\n },\n stop: (mapperID: number) => {\n const mapper = mappers.get(mapperID);\n if (mapper) {\n mappers.delete(mapper.id);\n sortedMappers = [];\n for (const sv of mapper.inputs) {\n sv.removeListener(mapper.id);\n }\n }\n },\n };\n}\n\nlet MAPPER_ID = 9999;\n\nexport function startMapper(\n worklet: () => void,\n inputs: MapperRawInputs = [],\n outputs: MapperOutputs = []\n): number {\n const mapperID = (MAPPER_ID += 1);\n\n runOnUI(() => {\n let mapperRegistry = global.__mapperRegistry;\n if (mapperRegistry === undefined) {\n mapperRegistry = global.__mapperRegistry = createMapperRegistry();\n }\n mapperRegistry.start(mapperID, worklet, inputs, outputs);\n })();\n\n return mapperID;\n}\n\nexport function stopMapper(mapperID: number): void {\n runOnUI(() => {\n const mapperRegistry = global.__mapperRegistry;\n mapperRegistry?.stop(mapperID);\n })();\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imeout","performance","now"],"sources":["mockedRequestAnimationFrame.ts"],"sourcesContent":["'use strict';\n\n// This is Jest implementation of `requestAnimationFrame` that is required\n// by React Native for test purposes.\nexport function mockedRequestAnimationFrame(\n callback: (timestamp: number) => void\n): ReturnType<typeof setTimeout> {\n return setTimeout(() => callback(performance.now()), 0);\n}\n"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA,OAAO,SAASA,2BAA2BA,CACzCC,QAAqC,EACN;EAC/B,OAAOC,UAAU,CAAC,MAAMD,QAAQ,CAACE,WAAW,CAACC,GAAG,
|
|
1
|
+
{"version":3,"names":["mockedRequestAnimationFrame","callback","setTimeout","performance","now"],"sources":["mockedRequestAnimationFrame.ts"],"sourcesContent":["'use strict';\n\n// This is Jest implementation of `requestAnimationFrame` that is required\n// by React Native for test purposes.\nexport function mockedRequestAnimationFrame(\n callback: (timestamp: number) => void\n): ReturnType<typeof setTimeout> {\n return setTimeout(() => callback(performance.now()), 0);\n}\n"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA,OAAO,SAASA,2BAA2BA,CACzCC,QAAqC,EACN;EAC/B,OAAOC,UAAU,CAAC,MAAMD,QAAQ,CAACE,WAAW,CAACC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzD","ignoreList":[]}
|
|
@@ -33,8 +33,7 @@ export function makeUIMutable(initial) {
|
|
|
33
33
|
get _value() {
|
|
34
34
|
return value;
|
|
35
35
|
},
|
|
36
|
-
modify:
|
|
37
|
-
let forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
36
|
+
modify: (modifier, forceUpdate = true) => {
|
|
38
37
|
valueSetter(self, modifier !== undefined ? modifier(value) : value, forceUpdate);
|
|
39
38
|
},
|
|
40
39
|
addListener: (id, listener) => {
|
|
@@ -93,8 +92,7 @@ export function makeMutable(initial) {
|
|
|
93
92
|
}
|
|
94
93
|
throw new Error('[Reanimated] Reading from `_value` directly is only possible on the UI runtime. Perhaps you passed an Animated Style to a non-animated component?');
|
|
95
94
|
},
|
|
96
|
-
modify:
|
|
97
|
-
let forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
95
|
+
modify: (modifier, forceUpdate = true) => {
|
|
98
96
|
if (!SHOULD_BE_USE_WEB) {
|
|
99
97
|
runOnUI(() => {
|
|
100
98
|
mutable.modify(modifier, forceUpdate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldBeUseWeb","makeShareableCloneRecursive","shareableMappingCache","executeOnUIRuntimeSync","runOnUI","valueSetter","SHOULD_BE_USE_WEB","makeUIMutable","initial","listeners","Map","value","self","newValue","_value","forEach","listener","modify","modifier","forceUpdate","
|
|
1
|
+
{"version":3,"names":["shouldBeUseWeb","makeShareableCloneRecursive","shareableMappingCache","executeOnUIRuntimeSync","runOnUI","valueSetter","SHOULD_BE_USE_WEB","makeUIMutable","initial","listeners","Map","value","self","newValue","_value","forEach","listener","modify","modifier","forceUpdate","undefined","addListener","id","set","removeListener","delete","_animation","_isReanimatedSharedValue","makeMutable","handle","__init","mutable","uiValueGetter","sv","Error"],"sources":["mutables.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport type { Mutable } from './commonTypes';\nimport { makeShareableCloneRecursive } from './shareables';\nimport { shareableMappingCache } from './shareableMappingCache';\nimport { executeOnUIRuntimeSync, runOnUI } from './threads';\nimport { valueSetter } from './valueSetter';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\ntype Listener<Value> = (newValue: Value) => void;\n\nexport function makeUIMutable<Value>(initial: Value): Mutable<Value> {\n 'worklet';\n\n const listeners = new Map<number, Listener<Value>>();\n let value = initial;\n\n const self: Mutable<Value> = {\n set value(newValue) {\n valueSetter(self, newValue);\n },\n get value() {\n return value;\n },\n /**\n * _value prop should only be accessed by the valueSetter implementation\n * which may make the decision about updating the mutable value depending\n * on the provided new value. All other places should only attempt to modify\n * the mutable by assigning to value prop directly.\n */\n set _value(newValue: Value) {\n value = newValue;\n listeners.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n return value;\n },\n modify: (modifier, forceUpdate = true) => {\n valueSetter(\n self,\n modifier !== undefined ? modifier(value) : value,\n forceUpdate\n );\n },\n addListener: (id: number, listener: Listener<Value>) => {\n listeners.set(id, listener);\n },\n removeListener: (id: number) => {\n listeners.delete(id);\n },\n _animation: null,\n _isReanimatedSharedValue: true,\n };\n return self;\n}\n\nexport function makeMutable<Value>(initial: Value): Mutable<Value> {\n let value: Value = initial;\n const handle = makeShareableCloneRecursive({\n __init: () => {\n 'worklet';\n return makeUIMutable(initial);\n },\n });\n // listeners can only work on JS thread on Web and jest environments\n const listeners = SHOULD_BE_USE_WEB\n ? new Map<number, Listener<Value>>()\n : undefined;\n const mutable: Mutable<Value> = {\n set value(newValue) {\n if (SHOULD_BE_USE_WEB) {\n valueSetter(mutable, newValue);\n } else {\n runOnUI(() => {\n mutable.value = newValue;\n })();\n }\n },\n get value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n const uiValueGetter = executeOnUIRuntimeSync((sv: Mutable<Value>) => {\n return sv.value;\n });\n return uiValueGetter(mutable);\n },\n set _value(newValue: Value) {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Setting `_value` directly is only possible on the UI runtime. Perhaps you want to assign to `value` instead?'\n );\n }\n value = newValue;\n listeners!.forEach((listener) => {\n listener(newValue);\n });\n },\n get _value(): Value {\n if (SHOULD_BE_USE_WEB) {\n return value;\n }\n throw new Error(\n '[Reanimated] Reading from `_value` directly is only possible on the UI runtime. Perhaps you passed an Animated Style to a non-animated component?'\n );\n },\n\n modify: (modifier, forceUpdate = true) => {\n if (!SHOULD_BE_USE_WEB) {\n runOnUI(() => {\n mutable.modify(modifier, forceUpdate);\n })();\n } else {\n valueSetter(\n mutable,\n modifier !== undefined ? modifier(mutable.value) : mutable.value,\n forceUpdate\n );\n }\n },\n addListener: (id: number, listener: Listener<Value>) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Adding listeners is only possible on the UI runtime.'\n );\n }\n listeners!.set(id, listener);\n },\n removeListener: (id: number) => {\n if (!SHOULD_BE_USE_WEB) {\n throw new Error(\n '[Reanimated] Removing listeners is only possible on the UI runtime.'\n );\n }\n listeners!.delete(id);\n },\n _isReanimatedSharedValue: true,\n };\n shareableMappingCache.set(mutable, handle);\n return mutable;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,2BAA2B,QAAQ,cAAc;AAC1D,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,sBAAsB,EAAEC,OAAO,QAAQ,WAAW;AAC3D,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,iBAAiB,GAAGN,cAAc,CAAC,CAAC;AAI1C,OAAO,SAASO,aAAaA,CAAQC,OAAc,EAAkB;EACnE,SAAS;;EAET,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAA0B,CAAC;EACpD,IAAIC,KAAK,GAAGH,OAAO;EAEnB,MAAMI,IAAoB,GAAG;IAC3B,IAAID,KAAKA,CAACE,QAAQ,EAAE;MAClBR,WAAW,CAACO,IAAI,EAAEC,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAIF,KAAKA,CAAA,EAAG;MACV,OAAOA,KAAK;IACd,CAAC;IACD;AACJ;AACA;AACA;AACA;AACA;IACI,IAAIG,MAAMA,CAACD,QAAe,EAAE;MAC1BF,KAAK,GAAGE,QAAQ;MAChBJ,SAAS,CAACM,OAAO,CAAEC,QAAQ,IAAK;QAC9BA,QAAQ,CAACH,QAAQ,CAAC;MACpB,CAAC,CAAC;IACJ,CAAC;IACD,IAAIC,MAAMA,CAAA,EAAU;MAClB,OAAOH,KAAK;IACd,CAAC;IACDM,MAAM,EAAEA,CAACC,QAAQ,EAAEC,WAAW,GAAG,IAAI,KAAK;MACxCd,WAAW,CACTO,IAAI,EACJ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AAO,EAAEF,MAAM,CAAC;EAC1C,OAAOE,OAAO;AAChB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","RNRenderer"],"sources":["RNRenderer.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n'use strict';\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AACZ,SAASA,OAAO,IAAIC,UAAU,QAAQ,mDAAmD"}
|
|
1
|
+
{"version":3,"names":["default","RNRenderer"],"sources":["RNRenderer.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n'use strict';\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"],"mappings":"AAAA;AACA;AACA,YAAY;;AACZ,SAASA,OAAO,IAAIC,UAAU,QAAQ,mDAAmD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["module","exports"],"sources":["RNRenderer.web.ts"],"sourcesContent":["'use strict';\n// RNRender is not used for web. An export is still defined to eliminate warnings from bundlers such as esbuild.\nmodule.exports = null;\n"],"mappings":"AAAA,YAAY;;AACZ;AACAA,MAAM,CAACC,OAAO,GAAG,IAAI"}
|
|
1
|
+
{"version":3,"names":["module","exports"],"sources":["RNRenderer.web.ts"],"sourcesContent":["'use strict';\n// RNRender is not used for web. An export is still defined to eliminate warnings from bundlers such as esbuild.\nmodule.exports = null;\n"],"mappings":"AAAA,YAAY;;AACZ;AACAA,MAAM,CAACC,OAAO,GAAG,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsVersion","checkCppVersion","cppVersion","global","_REANIMATED_VERSION_CPP","undefined","console","warn","ok","matchVersion","Error","version1","version2","match","major1","minor1","split","major2","minor2"],"sources":["checkCppVersion.ts"],"sourcesContent":["'use strict';\nimport { jsVersion } from './jsVersion';\n\nexport function checkCppVersion() {\n const cppVersion = global._REANIMATED_VERSION_CPP;\n if (cppVersion === undefined) {\n console.warn(\n `[Reanimated] Couldn't determine the version of the native part of Reanimated.\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-reanimated\\` for more details.`\n );\n return;\n }\n const ok = matchVersion(jsVersion, cppVersion);\n if (!ok) {\n throw new Error(\n `[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs ${cppVersion}).\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-reanimated\\` for more details.`\n );\n }\n}\n\n// This is used only in test files, therefore it is reported by ts-prune (which is desired)\n// ts-prune-ignore-next\nexport function matchVersion(version1: string, version2: string) {\n if (version1.match(/^\\d+\\.\\d+\\.\\d+$/) && version2.match(/^\\d+\\.\\d+\\.\\d+$/)) {\n // x.y.z, compare only major and minor, skip patch\n const [major1, minor1] = version1.split('.');\n const [major2, minor2] = version2.split('.');\n return major1 === major2 && minor1 === minor2;\n } else {\n // alpha, beta or rc, compare everything\n return version1 === version2;\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,SAAS,QAAQ,aAAa;AAEvC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,UAAU,GAAGC,MAAM,CAACC,uBAAuB;EACjD,IAAIF,UAAU,KAAKG,SAAS,EAAE;IAC5BC,OAAO,CAACC,IAAI,CACT;AACP,
|
|
1
|
+
{"version":3,"names":["jsVersion","checkCppVersion","cppVersion","global","_REANIMATED_VERSION_CPP","undefined","console","warn","ok","matchVersion","Error","version1","version2","match","major1","minor1","split","major2","minor2"],"sources":["checkCppVersion.ts"],"sourcesContent":["'use strict';\nimport { jsVersion } from './jsVersion';\n\nexport function checkCppVersion() {\n const cppVersion = global._REANIMATED_VERSION_CPP;\n if (cppVersion === undefined) {\n console.warn(\n `[Reanimated] Couldn't determine the version of the native part of Reanimated.\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-reanimated\\` for more details.`\n );\n return;\n }\n const ok = matchVersion(jsVersion, cppVersion);\n if (!ok) {\n throw new Error(\n `[Reanimated] Mismatch between JavaScript part and native part of Reanimated (${jsVersion} vs ${cppVersion}).\n See \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-reanimated\\` for more details.`\n );\n }\n}\n\n// This is used only in test files, therefore it is reported by ts-prune (which is desired)\n// ts-prune-ignore-next\nexport function matchVersion(version1: string, version2: string) {\n if (version1.match(/^\\d+\\.\\d+\\.\\d+$/) && version2.match(/^\\d+\\.\\d+\\.\\d+$/)) {\n // x.y.z, compare only major and minor, skip patch\n const [major1, minor1] = version1.split('.');\n const [major2, minor2] = version2.split('.');\n return major1 === major2 && minor1 === minor2;\n } else {\n // alpha, beta or rc, compare everything\n return version1 === version2;\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,SAAS,QAAQ,aAAa;AAEvC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,UAAU,GAAGC,MAAM,CAACC,uBAAuB;EACjD,IAAIF,UAAU,KAAKG,SAAS,EAAE;IAC5BC,OAAO,CAACC,IAAI,CACT;AACP,4KACI,CAAC;IACD;EACF;EACA,MAAMC,EAAE,GAAGC,YAAY,CAACT,SAAS,EAAEE,UAAU,CAAC;EAC9C,IAAI,CAACM,EAAE,EAAE;IACP,MAAM,IAAIE,KAAK,CACZ,gFAA+EV,SAAU,OAAME,UAAW;AACjH,4KACI,CAAC;EACH;AACF;;AAEA;AACA;AACA,OAAO,SAASO,YAAYA,CAACE,QAAgB,EAAEC,QAAgB,EAAE;EAC/D,IAAID,QAAQ,CAACE,KAAK,CAAC,iBAAiB,CAAC,IAAID,QAAQ,CAACC,KAAK,CAAC,iBAAiB,CAAC,EAAE;IAC1E;IACA,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC;IAC5C,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGN,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IAC5C,OAAOF,MAAM,KAAKG,MAAM,IAAIF,MAAM,KAAKG,MAAM;EAC/C,CAAC,MAAM;IACL;IACA,OAAOP,QAAQ,KAAKC,QAAQ;EAC9B;AACF","ignoreList":[]}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* with the version used to build the native part of the library in runtime.
|
|
6
6
|
* Remember to keep this in sync with the version declared in `package.json`
|
|
7
7
|
*/
|
|
8
|
-
export const jsVersion = '3.
|
|
8
|
+
export const jsVersion = '3.9.0-layout-animation-experimental';
|
|
9
9
|
//# sourceMappingURL=jsVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["'use strict';\n/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.
|
|
1
|
+
{"version":3,"names":["jsVersion"],"sources":["jsVersion.ts"],"sourcesContent":["'use strict';\n/**\n * We hardcode the version of Reanimated here in order to compare it\n * with the version used to build the native part of the library in runtime.\n * Remember to keep this in sync with the version declared in `package.json`\n */\nexport const jsVersion = '3.9.0-layout-animation-experimental';\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG,qCAAqC","ignoreList":[]}
|
|
@@ -10,20 +10,18 @@ import { isChromeDebugger, isFabric, isJest, shouldBeUseWeb } from '../PlatformC
|
|
|
10
10
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand
|
|
11
11
|
*/
|
|
12
12
|
export let dispatchCommand;
|
|
13
|
-
function dispatchCommandFabric(animatedRef, commandName) {
|
|
13
|
+
function dispatchCommandFabric(animatedRef, commandName, args = []) {
|
|
14
14
|
'worklet';
|
|
15
15
|
|
|
16
|
-
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
17
16
|
if (!_WORKLET) {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
19
|
const shadowNodeWrapper = animatedRef();
|
|
21
20
|
global._dispatchCommandFabric(shadowNodeWrapper, commandName, args);
|
|
22
21
|
}
|
|
23
|
-
function dispatchCommandPaper(animatedRef, commandName) {
|
|
22
|
+
function dispatchCommandPaper(animatedRef, commandName, args = []) {
|
|
24
23
|
'worklet';
|
|
25
24
|
|
|
26
|
-
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
27
25
|
if (!_WORKLET) {
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","dispatchCommandFabric","animatedRef","commandName","args","
|
|
1
|
+
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","dispatchCommandFabric","animatedRef","commandName","args","_WORKLET","shadowNodeWrapper","global","_dispatchCommandFabric","dispatchCommandPaper","viewTag","_dispatchCommandPaper","dispatchCommandJest","console","warn","dispatchCommandChromeDebugger","dispatchCommandDefault"],"sources":["dispatchCommand.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype DispatchCommand = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n commandName: string,\n args?: unknown[]\n) => void;\n\n/**\n * Lets you synchronously call a command of a native component.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to call the command on.\n * @param commandName - The name of the command to dispatch (e.g. `\"focus\"` or `\"scrollToEnd\"`).\n * @param args - An optional array of arguments for the command.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/dispatchCommand\n */\nexport let dispatchCommand: DispatchCommand;\n\nfunction dispatchCommandFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n global._dispatchCommandFabric!(shadowNodeWrapper, commandName, args);\n}\n\nfunction dispatchCommandPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n commandName: string,\n args: Array<unknown> = []\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._dispatchCommandPaper!(viewTag, commandName, args);\n}\n\nfunction dispatchCommandJest() {\n console.warn('[Reanimated] dispatchCommand() is not supported with Jest.');\n}\n\nfunction dispatchCommandChromeDebugger() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported with Chrome Debugger.'\n );\n}\n\nfunction dispatchCommandDefault() {\n console.warn(\n '[Reanimated] dispatchCommand() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n dispatchCommand = dispatchCommandFabric as unknown as DispatchCommand;\n } else {\n dispatchCommand = dispatchCommandPaper as unknown as DispatchCommand;\n }\n} else if (isJest()) {\n dispatchCommand = dispatchCommandJest;\n} else if (isChromeDebugger()) {\n dispatchCommand = dispatchCommandChromeDebugger;\n} else {\n dispatchCommand = dispatchCommandDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,c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AAGgB,sBAAsB;AAC1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dispatchCommand","console","warn"],"sources":["dispatchCommand.web.ts"],"sourcesContent":["'use strict';\n\nexport function dispatchCommand() {\n console.warn('[Reanimated] dispatchCommand() is not supported on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE"}
|
|
1
|
+
{"version":3,"names":["dispatchCommand","console","warn"],"sources":["dispatchCommand.web.ts"],"sourcesContent":["'use strict';\n\nexport function dispatchCommand() {\n console.warn('[Reanimated] dispatchCommand() is not supported on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE","ignoreList":[]}
|
|
@@ -23,8 +23,8 @@ export function getRelativeCoords(animatedRef, absoluteX, absoluteY) {
|
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
return {
|
|
26
|
-
x: absoluteX - parentCoords.
|
|
27
|
-
y: absoluteY - parentCoords.
|
|
26
|
+
x: absoluteX - parentCoords.pageX,
|
|
27
|
+
y: absoluteY - parentCoords.pageY
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=getRelativeCoords.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measure","getRelativeCoords","animatedRef","absoluteX","absoluteY","parentCoords","x","y"],"sources":["getRelativeCoords.ts"],"sourcesContent":["'use strict';\nimport type { Component } from 'react';\nimport { measure } from './measure';\nimport type { AnimatedRef } from '../hook/commonTypes';\n\n/**\n * An object which contains relative coordinates.\n */\nexport interface ComponentCoords {\n x: number;\n y: number;\n}\n\n/**\n * Lets you determines the location on the screen, relative to the given view.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the coordinates from.\n * @param absoluteX - A number which is an absolute x coordinate.\n * @param absoluteY - A number which is an absolute y coordinate.\n * @returns An object which contains relative coordinates - {@link ComponentCoords}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords\n */\nexport function getRelativeCoords(\n animatedRef: AnimatedRef<Component>,\n absoluteX: number,\n absoluteY: number\n): ComponentCoords | null {\n 'worklet';\n const parentCoords = measure(animatedRef);\n if (parentCoords === null) {\n return null;\n }\n return {\n x: absoluteX - parentCoords.
|
|
1
|
+
{"version":3,"names":["measure","getRelativeCoords","animatedRef","absoluteX","absoluteY","parentCoords","x","pageX","y","pageY"],"sources":["getRelativeCoords.ts"],"sourcesContent":["'use strict';\nimport type { Component } from 'react';\nimport { measure } from './measure';\nimport type { AnimatedRef } from '../hook/commonTypes';\n\n/**\n * An object which contains relative coordinates.\n */\nexport interface ComponentCoords {\n x: number;\n y: number;\n}\n\n/**\n * Lets you determines the location on the screen, relative to the given view.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the coordinates from.\n * @param absoluteX - A number which is an absolute x coordinate.\n * @param absoluteY - A number which is an absolute y coordinate.\n * @returns An object which contains relative coordinates - {@link ComponentCoords}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords\n */\nexport function getRelativeCoords(\n animatedRef: AnimatedRef<Component>,\n absoluteX: number,\n absoluteY: number\n): ComponentCoords | null {\n 'worklet';\n const parentCoords = measure(animatedRef);\n if (parentCoords === null) {\n return null;\n }\n return {\n x: absoluteX - parentCoords.pageX,\n y: absoluteY - parentCoords.pageY,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,WAAW;;AAGnC;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,WAAmC,EACnCC,SAAiB,EACjBC,SAAiB,EACO;EACxB,SAAS;;EACT,MAAMC,YAAY,GAAGL,OAAO,CAACE,WAAW,CAAC;EACzC,IAAIG,YAAY,KAAK,IAAI,EAAE;IACzB,OAAO,IAAI;EACb;EACA,OAAO;IACLC,CAAC,EAAEH,SAAS,GAAGE,YAAY,CAACE,KAAK;IACjCC,CAAC,EAAEJ,SAAS,GAAGC,YAAY,CAACI;EAC9B,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dispatchCommand","measure","scrollTo","setGestureState","setNativeProps","getRelativeCoords"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { dispatchCommand } from './dispatchCommand';\nexport { measure } from './measure';\nexport { scrollTo } from './scrollTo';\nexport { setGestureState } from './setGestureState';\nexport { setNativeProps } from './setNativeProps';\nexport { getRelativeCoords } from './getRelativeCoords';\nexport type { ComponentCoords } from './getRelativeCoords';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,QAAQ,qBAAqB"}
|
|
1
|
+
{"version":3,"names":["dispatchCommand","measure","scrollTo","setGestureState","setNativeProps","getRelativeCoords"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { dispatchCommand } from './dispatchCommand';\nexport { measure } from './measure';\nexport { scrollTo } from './scrollTo';\nexport { setGestureState } from './setGestureState';\nexport { setNativeProps } from './setNativeProps';\nexport { getRelativeCoords } from './getRelativeCoords';\nexport type { ComponentCoords } from './getRelativeCoords';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,QAAQ,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","measure","measureFabric","animatedRef","_WORKLET","viewTag","console","warn","measured","global","_measureFabric","x","isNaN","measurePaper","_measurePaper","measureJest","measureChromeDebugger","measureDefault"],"sources":["measure.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions, ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype Measure = <T extends Component>(\n animatedRef: AnimatedRef<T>\n) => MeasuredDimensions | null;\n\n/**\n * Lets you synchronously get the dimensions and position of a view on the screen.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the measurements from.\n * @returns An object containing component measurements or null when the measurement couldn't be performed- {@link MeasuredDimensions}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure/\n */\nexport let measure: Measure;\n\nfunction measureFabric(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measureFabric!(viewTag as ShadowNodeWrapper);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measurePaper(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measurePaper!(viewTag as number);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measureJest() {\n console.warn('[Reanimated] measure() cannot be used with Jest.');\n return null;\n}\n\nfunction measureChromeDebugger() {\n console.warn('[Reanimated] measure() cannot be used with Chrome Debugger.');\n return null;\n}\n\nfunction measureDefault() {\n console.warn(\n '[Reanimated] measure() is not supported on this configuration.'\n );\n return null;\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n measure = measureFabric as unknown as Measure;\n } else {\n measure = measurePaper as unknown as Measure;\n }\n} else if (isJest()) {\n measure = measureJest;\n} else if (isChromeDebugger()) {\n measure = measureChromeDebugger;\n} else {\n measure = measureDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAY3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,OAAgB;AAE3B,SAASC,aAAaA,CAACC,WAA8C,EAAE;EACrE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,MAAMC,OAAO,GAAGF,WAAW,
|
|
1
|
+
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","measure","measureFabric","animatedRef","_WORKLET","viewTag","console","warn","measured","global","_measureFabric","x","isNaN","measurePaper","_measurePaper","measureJest","measureChromeDebugger","measureDefault"],"sources":["measure.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions, ShadowNodeWrapper } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype Measure = <T extends Component>(\n animatedRef: AnimatedRef<T>\n) => MeasuredDimensions | null;\n\n/**\n * Lets you synchronously get the dimensions and position of a view on the screen.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to get the measurements from.\n * @returns An object containing component measurements or null when the measurement couldn't be performed- {@link MeasuredDimensions}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure/\n */\nexport let measure: Measure;\n\nfunction measureFabric(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measureFabric!(viewTag as ShadowNodeWrapper);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measurePaper(animatedRef: AnimatedRefOnJS | AnimatedRefOnUI) {\n 'worklet';\n if (!_WORKLET) {\n return null;\n }\n\n const viewTag = animatedRef();\n if (viewTag === -1) {\n console.warn(\n `[Reanimated] The view with tag ${viewTag} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const measured = global._measurePaper!(viewTag as number);\n if (measured === null) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } has some undefined, not-yet-computed or meaningless value of \\`LayoutMetrics\\` type. This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n } else if (measured.x === -1234567) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } returned an invalid measurement response. Please make sure the view is currently rendered.`\n );\n return null;\n } else if (isNaN(measured.x)) {\n console.warn(\n `[Reanimated] The view with tag ${\n viewTag as number\n } gets view-flattened on Android. To disable view-flattening, set \\`collapsable={false}\\` on this component.`\n );\n return null;\n } else {\n return measured;\n }\n}\n\nfunction measureJest() {\n console.warn('[Reanimated] measure() cannot be used with Jest.');\n return null;\n}\n\nfunction measureChromeDebugger() {\n console.warn('[Reanimated] measure() cannot be used with Chrome Debugger.');\n return null;\n}\n\nfunction measureDefault() {\n console.warn(\n '[Reanimated] measure() is not supported on this configuration.'\n );\n return null;\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n measure = measureFabric as unknown as Measure;\n } else {\n measure = measurePaper as unknown as Measure;\n }\n} else if (isJest()) {\n measure = measureJest;\n} else if (isChromeDebugger()) {\n measure = measureChromeDebugger;\n} else {\n measure = measureDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAY3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,OAAgB;AAE3B,SAASC,aAAaA,CAACC,WAA8C,EAAE;EACrE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,MAAMC,OAAO,GAAGF,WAAW,CAAC,CAAC;EAC7B,IAAIE,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAC5C,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,QAAQ,GAAGC,MAAM,CAACC,cAAc,CAAEL,OAA4B,CAAC;EACrE,IAAIG,QAAQ,KAAK,IAAI,EAAE;IACrBF,OAAO,CAACC,IAAI,CACT,+NACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIC,QAAQ,CAACG,CAAC,KAAK,CAAC,OAAO,EAAE;IAClCL,OAAO,CAACC,IAAI,CACT,kHACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIK,KAAK,CAACJ,QAAQ,CAACG,CAAC,CAAC,EAAE;IAC5BL,OAAO,CAACC,IAAI,CACT,kIACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MA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AC/C,CAAC,MAAM;IACLD,OAAO,GAAGY,YAAkC;EAC9C;AACF,CAAC,MAAM,IAAId,MAAM,CAAC,CAAC,EAAE;EACnBE,OAAO,GAAGc,WAAW;AACvB,CAAC,MAAM,IAAIlB,gBAAgB,CAAC,CAAC,EAAE;EAC7BI,OAAO,GAAGe,qBAAqB;AACjC,CAAC,MAAM;EACLf,OAAO,GAAGgB,cAAc;AAC1B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measure","animatedRef","element","console","warn","viewportOffset","getBoundingClientRect","width","offsetWidth","height","offsetHeight","x","offsetLeft","y","offsetTop","pageX","left","pageY","top"],"sources":["measure.web.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function measure<T extends Component>(\n animatedRef: AnimatedRef<T>\n): MeasuredDimensions | null {\n const element = animatedRef() as HTMLElement | -1;\n\n if (element === -1) {\n console.warn(\n `[Reanimated] The view with tag ${element} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const viewportOffset = element.getBoundingClientRect();\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop,\n pageX: viewportOffset.left,\n pageY: viewportOffset.top,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,OAAOA,CACrBC,WAA2B,EACA;EAC3B,MAAMC,OAAO,GAAGD,WAAW,
|
|
1
|
+
{"version":3,"names":["measure","animatedRef","element","console","warn","viewportOffset","getBoundingClientRect","width","offsetWidth","height","offsetHeight","x","offsetLeft","y","offsetTop","pageX","left","pageY","top"],"sources":["measure.web.ts"],"sourcesContent":["'use strict';\nimport type { MeasuredDimensions } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function measure<T extends Component>(\n animatedRef: AnimatedRef<T>\n): MeasuredDimensions | null {\n const element = animatedRef() as HTMLElement | -1;\n\n if (element === -1) {\n console.warn(\n `[Reanimated] The view with tag ${element} is not a valid argument for measure(). This may be because the view is not currently rendered, which may not be a bug (e.g. an off-screen FlatList item).`\n );\n return null;\n }\n\n const viewportOffset = element.getBoundingClientRect();\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n x: element.offsetLeft,\n y: element.offsetTop,\n pageX: viewportOffset.left,\n pageY: viewportOffset.top,\n };\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,OAAOA,CACrBC,WAA2B,EACA;EAC3B,MAAMC,OAAO,GAAGD,WAAW,CAAC,CAAqB;EAEjD,IAAIC,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBC,OAAO,CAACC,IAAI,CACT,kCAAiCF,OAAQ,4JAC5C,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,cAAc,GAAGH,OAAO,CAACI,qBAAqB,CAAC,CAAC;EACtD,OAAO;IACLC,KAAK,EAAEL,OAAO,CAACM,WAAW;IAC1BC,MAAM,EAAEP,OAAO,CAACQ,YAAY;IAC5BC,CAAC,EAAET,OAAO,CAACU,UAAU;IACrBC,CAAC,EAAEX,OAAO,CAACY,SAAS;IACpBC,KAAK,EAAEV,cAAc,CAACW,IAAI;IAC1BC,KAAK,EAAEZ,cAAc,CAACa;EACxB,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","scrollTo","scrollToFabric","animatedRef","x","y","animated","scrollToPaper","_WORKLET","viewTag","global","_scrollToPaper","scrollToJest","console","warn","scrollToChromeDebugger","scrollToDefault"],"sources":["scrollTo.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport { dispatchCommand } from './dispatchCommand';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype ScrollTo = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) => void;\n\n/**\n * Lets you synchronously scroll to a given position of a `ScrollView`.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an `Animated.ScrollView` component.\n * @param x - The x position you want to scroll to.\n * @param y - The y position you want to scroll to.\n * @param animated - Whether the scrolling should be smooth or instant.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/scrollTo\n */\nexport let scrollTo: ScrollTo;\n\nfunction scrollToFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n dispatchCommand(\n // This assertion is needed to comply to `dispatchCommand` interface\n animatedRef as unknown as AnimatedRef<Component>,\n 'scrollTo',\n [x, y, animated]\n );\n}\n\nfunction scrollToPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._scrollToPaper!(viewTag, x, y, animated);\n}\n\nfunction scrollToJest() {\n console.warn('[Reanimated] scrollTo() is not supported with Jest.');\n}\n\nfunction scrollToChromeDebugger() {\n console.warn(\n '[Reanimated] scrollTo() is not supported with Chrome Debugger.'\n );\n}\n\nfunction scrollToDefault() {\n console.warn(\n '[Reanimated] scrollTo() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n scrollTo = scrollToFabric as unknown as ScrollTo;\n } else {\n scrollTo = scrollToPaper as unknown as ScrollTo;\n }\n} else if (isJest()) {\n scrollTo = scrollToJest;\n} else if (isChromeDebugger()) {\n scrollTo = scrollToChromeDebugger;\n} else {\n scrollTo = scrollToDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAAmB;AAenD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,QAAkB;AAE7B,SAASC,cAAcA,CACrBC,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACTN,eAAe;EACb;EACAG,WAAW,EACX,UAAU,EACV,CAACC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CAAC
|
|
1
|
+
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","dispatchCommand","scrollTo","scrollToFabric","animatedRef","x","y","animated","scrollToPaper","_WORKLET","viewTag","global","_scrollToPaper","scrollToJest","console","warn","scrollToChromeDebugger","scrollToDefault"],"sources":["scrollTo.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport { dispatchCommand } from './dispatchCommand';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\n\ntype ScrollTo = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) => void;\n\n/**\n * Lets you synchronously scroll to a given position of a `ScrollView`.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an `Animated.ScrollView` component.\n * @param x - The x position you want to scroll to.\n * @param y - The y position you want to scroll to.\n * @param animated - Whether the scrolling should be smooth or instant.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/scrollTo\n */\nexport let scrollTo: ScrollTo;\n\nfunction scrollToFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n dispatchCommand(\n // This assertion is needed to comply to `dispatchCommand` interface\n animatedRef as unknown as AnimatedRef<Component>,\n 'scrollTo',\n [x, y, animated]\n );\n}\n\nfunction scrollToPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n x: number,\n y: number,\n animated: boolean\n) {\n 'worklet';\n if (!_WORKLET) {\n return;\n }\n\n const viewTag = animatedRef() as number;\n global._scrollToPaper!(viewTag, x, y, animated);\n}\n\nfunction scrollToJest() {\n console.warn('[Reanimated] scrollTo() is not supported with Jest.');\n}\n\nfunction scrollToChromeDebugger() {\n console.warn(\n '[Reanimated] scrollTo() is not supported with Chrome Debugger.'\n );\n}\n\nfunction scrollToDefault() {\n console.warn(\n '[Reanimated] scrollTo() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n scrollTo = scrollToFabric as unknown as ScrollTo;\n } else {\n scrollTo = scrollToPaper as unknown as ScrollTo;\n }\n} else if (isJest()) {\n scrollTo = scrollToJest;\n} else if (isChromeDebugger()) {\n scrollTo = scrollToChromeDebugger;\n} else {\n scrollTo = scrollToDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAAmB;AAenD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,QAAkB;AAE7B,SAASC,cAAcA,CACrBC,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACTN,eAAe;EACb;EACAG,WAAW,EACX,UAAU,EACV,CAACC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CACjB,CAAC;AACH;AAEA,SAASC,aAAaA,CACpBJ,WAA8C,EAC9CC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,SAAS;;EACT,IAAI,CAACE,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,OAAO,GAAGN,WAAW,CAAC,CAAW;EACvCO,MAAM,CAACC,cAAc,CAAEF,OAAO,EAAEL,CAAC,EAAEC,CAAC,EAAEC,QAAQ,CAAC;AACjD;AAEA,SAASM,YAAYA,CAAA,EAAG;EACtBC,OAAO,CAACC,IAAI,CAAC,qDAAqD,CAAC;AACrE;AAEA,SAASC,sBAAsBA,CAAA,EAAG;EAChCF,OAAO,CAACC,IAAI,CACV,gEACF,CAAC;AACH;AAEA,SAASE,eAAeA,CAAA,EAAG;EACzBH,OAAO,CAACC,IAAI,CACV,iEACF,CAAC;AACH;AAEA,IAAI,CAACf,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdI,QAAQ,GAAGC,cAAqC;EAClD,CAAC,MAAM;IACLD,QAAQ,GAAGM,aAAoC;EACjD;AACF,CAAC,MAAM,IAAIT,MAAM,CAAC,CAAC,EAAE;EACnBG,QAAQ,GAAGW,YAAY;AACzB,CAAC,MAAM,IAAIhB,gBAAgB,CAAC,CAAC,EAAE;EAC7BK,QAAQ,GAAGc,sBAAsB;AACnC,CAAC,MAAM;EACLd,QAAQ,GAAGe,eAAe;AAC5B","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ export function scrollTo(animatedRef, x, y, animated) {
|
|
|
7
7
|
if (element !== -1) {
|
|
8
8
|
// By ScrollView we mean any scrollable component
|
|
9
9
|
const scrollView = element;
|
|
10
|
-
scrollView === null || scrollView === void 0
|
|
10
|
+
scrollView === null || scrollView === void 0 || scrollView.scrollTo({
|
|
11
11
|
x,
|
|
12
12
|
y,
|
|
13
13
|
animated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["scrollTo","animatedRef","x","y","animated","element","scrollView"],"sources":["scrollTo.web.ts"],"sourcesContent":["'use strict';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport type { ScrollView } from 'react-native';\n\nexport function scrollTo<T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) {\n const element = animatedRef();\n\n // This prevents crashes if ref has not been set yet\n if (element !== -1) {\n // By ScrollView we mean any scrollable component\n const scrollView = element as HTMLElement as unknown as ScrollView;\n scrollView?.scrollTo({ x, y, animated });\n }\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,QAAQA,CACtBC,WAA2B,EAC3BC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,MAAMC,OAAO,GAAGJ,WAAW,
|
|
1
|
+
{"version":3,"names":["scrollTo","animatedRef","x","y","animated","element","scrollView"],"sources":["scrollTo.web.ts"],"sourcesContent":["'use strict';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport type { ScrollView } from 'react-native';\n\nexport function scrollTo<T extends Component>(\n animatedRef: AnimatedRef<T>,\n x: number,\n y: number,\n animated: boolean\n) {\n const element = animatedRef();\n\n // This prevents crashes if ref has not been set yet\n if (element !== -1) {\n // By ScrollView we mean any scrollable component\n const scrollView = element as HTMLElement as unknown as ScrollView;\n scrollView?.scrollTo({ x, y, animated });\n }\n}\n"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,QAAQA,CACtBC,WAA2B,EAC3BC,CAAS,EACTC,CAAS,EACTC,QAAiB,EACjB;EACA,MAAMC,OAAO,GAAGJ,WAAW,CAAC,CAAC;;EAE7B;EACA,IAAII,OAAO,KAAK,CAAC,CAAC,EAAE;IAClB;IACA,MAAMC,UAAU,GAAGD,OAA+C;IAClEC,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEN,QAAQ,CAAC;MAAEE,CAAC;MAAEC,CAAC;MAAEC;IAAS,CAAC,CAAC;EAC1C;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isChromeDebugger","isJest","shouldBeUseWeb","setGestureState","setGestureStateNative","handlerTag","newState","_WORKLET","console","warn","global","_setGestureState","setGestureStateJest","setGestureStateChromeDebugger","setGestureStateDefault"],"sources":["setGestureState.ts"],"sourcesContent":["'use strict';\nimport { isChromeDebugger, isJest, shouldBeUseWeb } from '../PlatformChecker';\n\ntype SetGestureState = (handlerTag: number, newState: number) => void;\n\nexport let setGestureState: SetGestureState;\n\nfunction setGestureStateNative(handlerTag: number, newState: number) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] You can not use setGestureState in non-worklet function.'\n );\n return;\n }\n global._setGestureState(handlerTag, newState);\n}\n\nfunction setGestureStateJest() {\n console.warn('[Reanimated] setGestureState() cannot be used with Jest.');\n}\n\nfunction setGestureStateChromeDebugger() {\n console.warn(\n '[Reanimated] setGestureState() cannot be used with Chrome Debugger.'\n );\n}\n\nfunction setGestureStateDefault() {\n console.warn(\n '[Reanimated] setGestureState() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n setGestureState = setGestureStateNative;\n} else if (isJest()) {\n setGestureState = setGestureStateJest;\n} else if (isChromeDebugger()) {\n setGestureState = setGestureStateChromeDebugger;\n} else {\n setGestureState = setGestureStateDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gBAAgB,EAAEC,MAAM,EAAEC,cAAc,QAAQ,oBAAoB;AAI7E,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAACC,UAAkB,EAAEC,QAAgB,EAAE;EACnE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,
|
|
1
|
+
{"version":3,"names":["isChromeDebugger","isJest","shouldBeUseWeb","setGestureState","setGestureStateNative","handlerTag","newState","_WORKLET","console","warn","global","_setGestureState","setGestureStateJest","setGestureStateChromeDebugger","setGestureStateDefault"],"sources":["setGestureState.ts"],"sourcesContent":["'use strict';\nimport { isChromeDebugger, isJest, shouldBeUseWeb } from '../PlatformChecker';\n\ntype SetGestureState = (handlerTag: number, newState: number) => void;\n\nexport let setGestureState: SetGestureState;\n\nfunction setGestureStateNative(handlerTag: number, newState: number) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] You can not use setGestureState in non-worklet function.'\n );\n return;\n }\n global._setGestureState(handlerTag, newState);\n}\n\nfunction setGestureStateJest() {\n console.warn('[Reanimated] setGestureState() cannot be used with Jest.');\n}\n\nfunction setGestureStateChromeDebugger() {\n console.warn(\n '[Reanimated] setGestureState() cannot be used with Chrome Debugger.'\n );\n}\n\nfunction setGestureStateDefault() {\n console.warn(\n '[Reanimated] setGestureState() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n setGestureState = setGestureStateNative;\n} else if (isJest()) {\n setGestureState = setGestureStateJest;\n} else if (isChromeDebugger()) {\n setGestureState = setGestureStateChromeDebugger;\n} else {\n setGestureState = setGestureStateDefault;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gBAAgB,EAAEC,MAAM,EAAEC,cAAc,QAAQ,oBAAoB;AAI7E,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAACC,UAAkB,EAAEC,QAAgB,EAAE;EACnE,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;IACD;EACF;EACAC,MAAM,CAACC,gBAAgB,CAACN,UAAU,EAAEC,QAAQ,CAAC;AAC/C;AAEA,SAASM,mBAAmBA,CAAA,EAAG;EAC7BJ,OAAO,CAACC,IAAI,CAAC,0DAA0D,CAAC;AAC1E;AAEA,SAASI,6BAA6BA,CAAA,EAAG;EACvCL,OAAO,CAACC,IAAI,CACV,qEACF,CAAC;AACH;AAEA,SAASK,sBAAsBA,CAAA,EAAG;EAChCN,OAAO,CAACC,IAAI,CACV,wEACF,CAAC;AACH;AAEA,IAAI,CAACP,cAAc,CAAC,CAAC,EAAE;EACrBC,eAAe,GAAGC,qBAAqB;AACzC,CAAC,MAAM,IAAIH,MAAM,CAAC,CAAC,EAAE;EACnBE,eAAe,GAAGS,mBAAmB;AACvC,CAAC,MAAM,IAAIZ,gBAAgB,CAAC,CAAC,EAAE;EAC7BG,eAAe,GAAGU,6BAA6B;AACjD,CAAC,MAAM;EACLV,eAAe,GAAGW,sBAAsB;AAC1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setGestureState","console","warn"],"sources":["setGestureState.web.ts"],"sourcesContent":["'use strict';\n\nexport function setGestureState() {\n console.warn('[Reanimated] setGestureState() is not available on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE"}
|
|
1
|
+
{"version":3,"names":["setGestureState","console","warn"],"sources":["setGestureState.web.ts"],"sourcesContent":["'use strict';\n\nexport function setGestureState() {\n console.warn('[Reanimated] setGestureState() is not available on web.');\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,eAAeA,CAAA,EAAG;EAChCC,OAAO,CAACC,IAAI,CAAC,yDAAyD,CAAC;AACzE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","processColorsInProps","setNativeProps","setNativePropsFabric","animatedRef","updates","_WORKLET","console","warn","shadowNodeWrapper","global","_updatePropsFabric","setNativePropsPaper","tag","name","viewName","value","_updatePropsPaper","setNativePropsJest","setNativePropsChromeDebugger","setNativePropsDefault"],"sources":["setNativeProps.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper, StyleProps } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport { processColorsInProps } from '../Colors';\n\ntype SetNativeProps = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) => void;\n/**\n * Lets you imperatively update component properties. You should always reach for [useAnimatedStyle](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle) and [useAnimatedProps](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps) first when animating styles or properties.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to update.\n * @param updates - An object with properties you want to update.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/setNativeProps\n */\nexport let setNativeProps: SetNativeProps;\n\nfunction setNativePropsFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n processColorsInProps(updates);\n global._updatePropsFabric!([{ shadowNodeWrapper, updates }]);\n}\n\nfunction setNativePropsPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const tag = animatedRef() as number;\n const name = (animatedRef as AnimatedRefOnUI).viewName.value;\n processColorsInProps(updates);\n global._updatePropsPaper!([{ tag, name, updates }]);\n}\n\nfunction setNativePropsJest() {\n console.warn('[Reanimated] setNativeProps() is not supported with Jest.');\n}\n\nfunction setNativePropsChromeDebugger() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported with Chrome Debugger.'\n );\n}\n\nfunction setNativePropsDefault() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n setNativeProps = setNativePropsFabric as unknown as SetNativeProps;\n } else {\n setNativeProps = setNativePropsPaper as unknown as SetNativeProps;\n }\n} else if (isJest()) {\n setNativeProps = setNativePropsJest;\n} else if (isChromeDebugger()) {\n setNativeProps = setNativePropsChromeDebugger;\n} else {\n setNativeProps = setNativePropsDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAO3B,SAASC,oBAAoB,QAAQ,WAAW;AAMhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,cAA8B;AAEzC,SAASC,oBAAoBA,CAC3BC,WAA8C,EAC9CC,OAAmB,EACnB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,
|
|
1
|
+
{"version":3,"names":["isChromeDebugger","isFabric","isJest","shouldBeUseWeb","processColorsInProps","setNativeProps","setNativePropsFabric","animatedRef","updates","_WORKLET","console","warn","shadowNodeWrapper","global","_updatePropsFabric","setNativePropsPaper","tag","name","viewName","value","_updatePropsPaper","setNativePropsJest","setNativePropsChromeDebugger","setNativePropsDefault"],"sources":["setNativeProps.ts"],"sourcesContent":["'use strict';\nimport type { ShadowNodeWrapper, StyleProps } from '../commonTypes';\nimport {\n isChromeDebugger,\n isFabric,\n isJest,\n shouldBeUseWeb,\n} from '../PlatformChecker';\nimport type {\n AnimatedRef,\n AnimatedRefOnJS,\n AnimatedRefOnUI,\n} from '../hook/commonTypes';\nimport type { Component } from 'react';\nimport { processColorsInProps } from '../Colors';\n\ntype SetNativeProps = <T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) => void;\n/**\n * Lets you imperatively update component properties. You should always reach for [useAnimatedStyle](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle) and [useAnimatedProps](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps) first when animating styles or properties.\n *\n * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns) connected to the component you'd want to update.\n * @param updates - An object with properties you want to update.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/setNativeProps\n */\nexport let setNativeProps: SetNativeProps;\n\nfunction setNativePropsFabric(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const shadowNodeWrapper = animatedRef() as ShadowNodeWrapper;\n processColorsInProps(updates);\n global._updatePropsFabric!([{ shadowNodeWrapper, updates }]);\n}\n\nfunction setNativePropsPaper(\n animatedRef: AnimatedRefOnJS | AnimatedRefOnUI,\n updates: StyleProps\n) {\n 'worklet';\n if (!_WORKLET) {\n console.warn(\n '[Reanimated] setNativeProps() can only be used on the UI runtime.'\n );\n return;\n }\n const tag = animatedRef() as number;\n const name = (animatedRef as AnimatedRefOnUI).viewName.value;\n processColorsInProps(updates);\n global._updatePropsPaper!([{ tag, name, updates }]);\n}\n\nfunction setNativePropsJest() {\n console.warn('[Reanimated] setNativeProps() is not supported with Jest.');\n}\n\nfunction setNativePropsChromeDebugger() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported with Chrome Debugger.'\n );\n}\n\nfunction setNativePropsDefault() {\n console.warn(\n '[Reanimated] setNativeProps() is not supported on this configuration.'\n );\n}\n\nif (!shouldBeUseWeb()) {\n // Those assertions are actually correct since on Native platforms `AnimatedRef` is\n // mapped as a different function in `shareableMappingCache` and\n // TypeScript is not able to infer that.\n if (isFabric()) {\n setNativeProps = setNativePropsFabric as unknown as SetNativeProps;\n } else {\n setNativeProps = setNativePropsPaper as unknown as SetNativeProps;\n }\n} else if (isJest()) {\n setNativeProps = setNativePropsJest;\n} else if (isChromeDebugger()) {\n setNativeProps = setNativePropsChromeDebugger;\n} else {\n setNativeProps = setNativePropsDefault;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,MAAM,EACNC,cAAc,QACT,oBAAoB;AAO3B,SAASC,oBAAoB,QAAQ,WAAW;AAMhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,cAA8B;AAEzC,SAASC,oBAAoBA,CAC3BC,WAA8C,EAC9CC,OAAmB,EACnB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,mEACF,CAAC;IACD;EACF;EACA,MAAMC,iBAAiB,GAAGL,WAAW,CAAC,CAAsB;EAC5DH,oBAAoB,CAACI,OAAO,CAAC;EAC7BK,MAAM,CAACC,kBAAkB,CAAE,CAAC;IAAEF,iBAAiB;IAAEJ;EAAQ,CAAC,CAAC,CAAC;AAC9D;AAEA,SAASO,mBAAmBA,CAC1BR,WAA8C,EAC9CC,OAAmB,EACnB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACbC,OAAO,CAACC,IAAI,CACV,mEACF,CAAC;IACD;EACF;EACA,MAAMK,GAAG,GAAGT,WAAW,CAAC,CAAW;EACnC,MAAMU,IAAI,GAAIV,WAAW,CAAqBW,QAAQ,CAACC,KAAK;EAC5Df,oBAAoB,CAACI,OAAO,CAAC;EAC7BK,MAAM,CAACO,iBAAiB,CAAE,CAAC;IAAEJ,GAAG;IAAEC,IAAI;IAAET;EAAQ,CAAC,CAAC,CAAC;AACrD;AAEA,SAASa,kBAAkBA,CAAA,EAAG;EAC5BX,OAAO,CAACC,IAAI,CAAC,2DAA2D,CAAC;AAC3E;AAEA,SAASW,4BAA4BA,CAAA,EAAG;EACtCZ,OAAO,CAACC,IAAI,CACV,sEACF,CAAC;AACH;AAEA,SAASY,qBAAqBA,CAAA,EAAG;EAC/Bb,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;AACH;AAEA,IAAI,CAACR,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdI,cAAc,GAAGC,oBAAiD;EACpE,CAAC,MAAM;IACLD,cAAc,GAAGU,mBAAgD;EACnE;AACF,CAAC,MAAM,IAAIb,MAAM,CAAC,CAAC,EAAE;EACnBG,cAAc,GAAGgB,kBAAkB;AACrC,CAAC,MAAM,IAAIrB,gBAAgB,CAAC,CAAC,EAAE;EAC7BK,cAAc,GAAGiB,4BAA4B;AAC/C,CAAC,MAAM;EACLjB,cAAc,GAAGkB,qBAAqB;AACxC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_updatePropsJS","setNativeProps","animatedRef","updates","component","_component"],"sources":["setNativeProps.web.ts"],"sourcesContent":["'use strict';\nimport type { ReanimatedHTMLElement } from '../js-reanimated';\nimport { _updatePropsJS } from '../js-reanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function setNativeProps<T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) {\n const component = animatedRef() as ReanimatedHTMLElement;\n _updatePropsJS(updates, { _component: component });\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kBAAkB;AAKjD,OAAO,SAASC,cAAcA,CAC5BC,WAA2B,EAC3BC,OAAmB,EACnB;EACA,MAAMC,SAAS,GAAGF,WAAW,
|
|
1
|
+
{"version":3,"names":["_updatePropsJS","setNativeProps","animatedRef","updates","component","_component"],"sources":["setNativeProps.web.ts"],"sourcesContent":["'use strict';\nimport type { ReanimatedHTMLElement } from '../js-reanimated';\nimport { _updatePropsJS } from '../js-reanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedRef } from '../hook/commonTypes';\nimport type { Component } from 'react';\n\nexport function setNativeProps<T extends Component>(\n animatedRef: AnimatedRef<T>,\n updates: StyleProps\n) {\n const component = animatedRef() as ReanimatedHTMLElement;\n _updatePropsJS(updates, { _component: component });\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kBAAkB;AAKjD,OAAO,SAASC,cAAcA,CAC5BC,WAA2B,EAC3BC,OAAmB,EACnB;EACA,MAAMC,SAAS,GAAGF,WAAW,CAAC,CAA0B;EACxDF,cAAc,CAACG,OAAO,EAAE;IAAEE,UAAU,EAAED;EAAU,CAAC,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getUseOfValueInStyleWarning"],"sources":["pluginUtils.ts"],"sourcesContent":["'use strict';\nexport function getUseOfValueInStyleWarning() {\n return (\n \"It looks like you might be using shared value's .value inside reanimated inline style. \" +\n 'If you want a component to update when shared value changes you should use the shared value' +\n ' directly instead of its current state represented by `.value`. See documentation here: ' +\n 'https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animations-in-inline-styling'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,OACE,yFAAyF,GACzF,6FAA6F,GAC7F,0FAA0F,GAC1F,6GAA6G;AAEjH"}
|
|
1
|
+
{"version":3,"names":["getUseOfValueInStyleWarning"],"sources":["pluginUtils.ts"],"sourcesContent":["'use strict';\nexport function getUseOfValueInStyleWarning() {\n return (\n \"It looks like you might be using shared value's .value inside reanimated inline style. \" +\n 'If you want a component to update when shared value changes you should use the shared value' +\n ' directly instead of its current state represented by `.value`. See documentation here: ' +\n 'https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animations-in-inline-styling'\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,SAASA,2BAA2BA,CAAA,EAAG;EAC5C,OACE,yFAAyF,GACzF,6FAA6F,GAC7F,0FAA0F,GAC1F,6GAA6G;AAEjH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["publicGlobals.ts"],"sourcesContent":["'use strict';\n/* eslint-disable no-var */\nexport {};\n\ndeclare global {\n /**\n * This global variable is a diagnostic/development tool.\n *\n * It is `true` on the UI thread and `false` on the JS thread.\n *\n * It used to be necessary in the past for some of the\n * functionalities of react-native-reanimated to work\n * properly but it's no longer the case. Your code\n * shouldn't depend on it, we keep it here\n * mainly for backward compatibility for our users.\n */\n var _WORKLET: boolean | undefined;\n\n /**\n * This ArrayBuffer contains the memory address of `jsi::Runtime`\n * which is the Reanimated UI runtime.\n */\n var _WORKLET_RUNTIME: ArrayBuffer;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AACA"}
|
|
1
|
+
{"version":3,"names":[],"sources":["publicGlobals.ts"],"sourcesContent":["'use strict';\n/* eslint-disable no-var */\nexport {};\n\ndeclare global {\n /**\n * This global variable is a diagnostic/development tool.\n *\n * It is `true` on the UI thread and `false` on the JS thread.\n *\n * It used to be necessary in the past for some of the\n * functionalities of react-native-reanimated to work\n * properly but it's no longer the case. Your code\n * shouldn't depend on it, we keep it here\n * mainly for backward compatibility for our users.\n */\n var _WORKLET: boolean | undefined;\n\n /**\n * This ArrayBuffer contains the memory address of `jsi::Runtime`\n * which is the Reanimated UI runtime.\n */\n var _WORKLET_RUNTIME: ArrayBuffer;\n}\n"],"mappings":"AAAA,YAAY;;AACZ;AACA","ignoreList":[]}
|
|
@@ -14,14 +14,16 @@ const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
|
|
14
14
|
* @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.
|
|
15
15
|
* @returns WorkletRuntime which is a jsi::HostObject\<reanimated::WorkletRuntime\> - {@link WorkletRuntime}
|
|
16
16
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime
|
|
17
|
-
*/
|
|
17
|
+
*/
|
|
18
|
+
// @ts-expect-error Check `runOnUI` overload.
|
|
19
|
+
|
|
18
20
|
export function createWorkletRuntime(name, initializer) {
|
|
19
21
|
return NativeReanimatedModule.createWorkletRuntime(name, makeShareableCloneRecursive(() => {
|
|
20
22
|
'worklet';
|
|
21
23
|
|
|
22
24
|
setupCallGuard();
|
|
23
25
|
setupConsole();
|
|
24
|
-
initializer === null || initializer === void 0
|
|
26
|
+
initializer === null || initializer === void 0 || initializer();
|
|
25
27
|
}));
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -37,26 +39,16 @@ export function runOnRuntime(workletRuntime, worklet) {
|
|
|
37
39
|
throw new Error('[Reanimated] The function passed to `runOnRuntime` is not a worklet.' + (_WORKLET ? ' Please make sure that `processNestedWorklets` option in Reanimated Babel plugin is enabled.' : ''));
|
|
38
40
|
}
|
|
39
41
|
if (_WORKLET) {
|
|
40
|
-
return
|
|
41
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
-
args[_key] = arguments[_key];
|
|
43
|
-
}
|
|
44
|
-
return global._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => {
|
|
45
|
-
'worklet';
|
|
46
|
-
|
|
47
|
-
worklet(...args);
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return function () {
|
|
52
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
53
|
-
args[_key2] = arguments[_key2];
|
|
54
|
-
}
|
|
55
|
-
return NativeReanimatedModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => {
|
|
42
|
+
return (...args) => global._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => {
|
|
56
43
|
'worklet';
|
|
57
44
|
|
|
58
45
|
worklet(...args);
|
|
59
46
|
}));
|
|
60
|
-
}
|
|
47
|
+
}
|
|
48
|
+
return (...args) => NativeReanimatedModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => {
|
|
49
|
+
'worklet';
|
|
50
|
+
|
|
51
|
+
worklet(...args);
|
|
52
|
+
}));
|
|
61
53
|
}
|
|
62
54
|
//# sourceMappingURL=runtimes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isWorkletFunction","setupCallGuard","setupConsole","NativeReanimatedModule","shouldBeUseWeb","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","SHOULD_BE_USE_WEB","createWorkletRuntime","name","initializer","runOnRuntime","workletRuntime","worklet","__DEV__","Error","_WORKLET","
|
|
1
|
+
{"version":3,"names":["isWorkletFunction","setupCallGuard","setupConsole","NativeReanimatedModule","shouldBeUseWeb","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","SHOULD_BE_USE_WEB","createWorkletRuntime","name","initializer","runOnRuntime","workletRuntime","worklet","__DEV__","Error","_WORKLET","args","global","_scheduleOnRuntime","scheduleOnRuntime"],"sources":["runtimes.ts"],"sourcesContent":["'use strict';\nimport { isWorkletFunction } from './commonTypes';\nimport type { WorkletFunction } from './commonTypes';\nimport { setupCallGuard, setupConsole } from './initializers';\nimport NativeReanimatedModule from './NativeReanimated';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport {\n makeShareableCloneOnUIRecursive,\n makeShareableCloneRecursive,\n} from './shareables';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport type WorkletRuntime = {\n __hostObjectWorkletRuntime: never;\n readonly name: string;\n};\n\n/**\n * Lets you create a new JS runtime which can be used to run worklets possibly on different threads than JS or UI thread.\n *\n * @param name - A name used to identify the runtime which will appear in devices list in Chrome DevTools.\n * @param initializer - An optional worklet that will be run synchronously on the same thread immediately after the runtime is created.\n * @returns WorkletRuntime which is a jsi::HostObject\\<reanimated::WorkletRuntime\\> - {@link WorkletRuntime}\n * @see https://docs.swmansion.com/react-native-reanimated/docs/threading/createWorkletRuntime\n */\n// @ts-expect-error Check `runOnUI` overload.\nexport function createWorkletRuntime(\n name: string,\n initializer?: () => void\n): WorkletRuntime;\n\nexport function createWorkletRuntime(\n name: string,\n initializer?: WorkletFunction<[], void>\n): WorkletRuntime {\n return NativeReanimatedModule.createWorkletRuntime(\n name,\n makeShareableCloneRecursive(() => {\n 'worklet';\n setupCallGuard();\n setupConsole();\n initializer?.();\n })\n );\n}\n\n// @ts-expect-error Check `runOnUI` overload.\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: (...args: Args) => ReturnValue\n): WorkletFunction<Args, ReturnValue>;\n/**\n * Schedule a worklet to execute on the background queue.\n */\nexport function runOnRuntime<Args extends unknown[], ReturnValue>(\n workletRuntime: WorkletRuntime,\n worklet: WorkletFunction<Args, ReturnValue>\n): (...args: Args) => void {\n 'worklet';\n if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) {\n throw new Error(\n '[Reanimated] The function passed to `runOnRuntime` is not a worklet.' +\n (_WORKLET\n ? ' Please make sure that `processNestedWorklets` option in Reanimated Babel plugin is enabled.'\n : '')\n );\n }\n if (_WORKLET) {\n return (...args) =>\n global._scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneOnUIRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n }\n return (...args) =>\n NativeReanimatedModule.scheduleOnRuntime(\n workletRuntime,\n makeShareableCloneRecursive(() => {\n 'worklet';\n worklet(...args);\n })\n );\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iBAAiB,QAAQ,eAAe;AAEjD,SAASC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAC7D,OAAOC,sBAAsB,MAAM,oBAAoB;AACvD,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SACEC,+BAA+B,EAC/BC,2BAA2B,QACtB,cAAc;AAErB,MAAMC,iBAAiB,GAAGH,cAAc,CAAC,CAAC;;AAO1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASI,oBAAoBA,CAClCC,IAA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