react-native-reanimated 3.9.0-rc.0 → 3.9.0
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 +2 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +11 -4
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +5 -3
- package/apple/REAModule.mm +14 -29
- package/apple/REANodesManager.mm +7 -6
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +2 -2
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +4 -4
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -1
- package/lib/module/createAnimatedComponent/PropsFilter.js +5 -5
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +33 -33
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +2 -2
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -1
- 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 +3 -8
- 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 +3 -3
- 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 +1 -0
- 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.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.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.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.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +2 -0
- 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 +3 -4
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -1
- 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 +2 -4
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +7 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +4 -4
- 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 +1 -1
- 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 +14 -6
- 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.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 +4 -5
- 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 +8 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +8 -9
- 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 +1 -2
- 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 +4 -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 +4 -6
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +4 -6
- 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.map +1 -1
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +1 -1
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -1
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +2 -4
- 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.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -1
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +5 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/package.json +18 -14
- package/plugin/build/plugin.js +7 -2
- package/src/createAnimatedComponent/PropsFilter.tsx +1 -1
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +29 -33
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/hook/commonTypes.ts +9 -0
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +21 -5
- package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -3
- 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
|
@@ -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,cAAc,QACT,oBAAoB;AAc3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIC,eAAgC;AAE3C,SAASC,qBAAqBA,CAC5BC,WAA8C,EAC9CC,WAAmB,EACnBC,IAAoB,GAAG,EAAE,EACzB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,iBAAiB,GAAGJ,WAAW,CAAC,CAAsB;EAC5DK,MAAM,CAACC,sBAAsB,CAAEF,iBAAiB,EAAEH,WAAW,EAAEC,IAAI,CAAC;AACtE;AAEA,SAASK,oBAAoBA,CAC3BP,WAA8C,EAC9CC,WAAmB,EACnBC,IAAoB,GAAG,EAAE,EACzB;EACA,SAAS;;EACT,IAAI,CAACC,QAAQ,EAAE;IACb;EACF;EAEA,MAAMK,OAAO,GAAGR,WAAW,CAAC,CAAW;EACvCK,MAAM,CAACI,qBAAqB,CAAED,OAAO,EAAEP,WAAW,EAAEC,IAAI,CAAC;AAC3D;AAEA,SAASQ,mBAAmBA,CAAA,EAAG;EAC7BC,OAAO,CAACC,IAAI,CAAC,4DAA4D,CAAC;AAC5E;AAEA,SAASC,6BAA6BA,CAAA,EAAG;EACvCF,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;AACH;AAEA,SAASE,sBAAsBA,CAAA,EAAG;EAChCH,OAAO,CAACC,IAAI,CACV,wEACF,CAAC;AACH;AAEA,IAAI,CAACf,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdG,eAAe,GAAGC,qBAAmD;EACvE,CAAC,MAAM;IACLD,eAAe,GAAGS,oBAAkD;EACtE;AACF,CAAC,MAAM,IAAIX,MAAM,CAAC,CAAC,EAAE;EACnBE,eAAe,GAAGY,mBAAmB;AACvC,CAAC,MAAM,IAAIhB,gBAAgB,CAAC,CAAC,EAAE;EAC7BI,eAAe,GAAGe,6BAA6B;AACjD,CAAC,MAAM;EACLf,eAAe,GAAGgB,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,QAA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AAO,CAACC,IAAI,CACT,kCACCF,OACD,0MACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIG,QAAQ,CAACG,CAAC,KAAK,CAAC,OAAO,EAAE;IAClCL,OAAO,CAACC,IAAI,CACT,kCACCF,OACD,6FACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM,IAAIO,KAAK,CAACJ,QAAQ,CAACG,CAAC,CAAC,EAAE;IAC5BL,OAAO,CAACC,IAAI,CACT,kCACCF,OACD,6GACH,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAOG,QAAQ;EACjB;AACF;AAEA,SAASO,WAAWA,CAAA,EAAG;EACrBT,OAAO,CAACC,IAAI,CAAC,kDAAkD,CAAC;EAChE,OAAO,IAAI;AACb;AAEA,SAASS,qBAAqBA,CAAA,EAAG;EAC/BV,OAAO,CAACC,IAAI,CAAC,6DAA6D,CAAC;EAC3E,OAAO,IAAI;AACb;AAEA,SAASU,cAAcA,CAAA,EAAG;EACxBX,OAAO,CAACC,IAAI,CACV,gEACF,CAAC;EACD,OAAO,IAAI;AACb;AAEA,IAAI,CAACP,cAAc,CAAC,CAAC,EAAE;EACrB;EACA;EACA;EACA,IAAIF,QAAQ,CAAC,CAAC,EAAE;IACdG,OAAO,GAAGC,aAAmC;EAC/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;I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;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,IAAY,EACZC,WAAuC,EACvB;EAChB,OAAOP,sBAAsB,CAACK,oBAAoB,CAChDC,IAAI,EACJH,2BAA2B,CAAC,MAAM;IAChC,SAAS;;IACTL,cAAc,CAAC,CAAC;IAChBC,YAAY,CAAC,CAAC;IACdQ,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAG,CAAC;EACjB,CAAC,CACH,CAAC;AACH;;AAEA;;AAKA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC1BC,cAA8B,EAC9BC,OAA2C,EAClB;EACzB,SAAS;;EACT,IAAIC,OAAO,IAAI,CAACP,iBAAiB,IAAI,CAACP,iBAAiB,CAACa,OAAO,CAAC,EAAE;IAChE,MAAM,IAAIE,KAAK,CACb,sEAAsE,IACnEC,QAAQ,GACL,8FAA8F,GAC9F,EAAE,CACV,CAAC;EACH;EACA,IAAIA,QAAQ,EAAE;IACZ,OAAO,CAAC,GAAGC,IAAI,KACbC,MAAM,CAACC,kBAAkB,CACvBP,cAAc,EACdP,+BAA+B,CAAC,MAAM;MACpC,SAAS;;MACTQ,OAAO,CAAC,GAAGI,IAAI,CAAC;IAClB,CAAC,CACH,CAAC;EACL;EACA,OAAO,CAAC,GAAGA,IAAI,KACbd,sBAAsB,CAACiB,iBAAiB,CACtCR,cAAc,EACdN,2BAA2B,CAAC,MAAM;IAChC,SAAS;;IACTO,OAAO,CAAC,GAAGI,IAAI,CAAC;EAClB,CAAC,CACH,CAAC;AACL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["noopFactory","defaultReturnValue","console","warn","RNScreensTurboModule","global","startTransition","topScreenId","belowTopScreenId","canStartTransition","updateTransition","finishTransition"],"sources":["RNScreensTurboModule.ts"],"sourcesContent":["'use strict';\nimport type { RNScreensTurboModuleType } from './commonTypes';\n\nfunction noopFactory<T>(defaultReturnValue?: T): () => T {\n return () => {\n 'worklet';\n console.warn(\n '[Reanimated] RNScreensTurboModule has not been found. Check that you have installed `react-native-screens@3.30.0` or newer in your project and rebuilt your app.'\n );\n return defaultReturnValue as T;\n };\n}\n\ntype TransactionConfig = {\n topScreenId: number;\n belowTopScreenId: number;\n canStartTransition: boolean;\n};\n\nexport const RNScreensTurboModule: RNScreensTurboModuleType =\n global.RNScreensTurboModule || {\n startTransition: noopFactory<TransactionConfig>({\n topScreenId: -1,\n belowTopScreenId: -1,\n canStartTransition: false,\n }),\n updateTransition: noopFactory(),\n finishTransition: noopFactory(),\n };\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,WAAWA,CAAIC,kBAAsB,EAAW;EACvD,OAAO,MAAM;IACX,SAAS;;IACTC,OAAO,CAACC,IAAI,CACV,
|
|
1
|
+
{"version":3,"names":["noopFactory","defaultReturnValue","console","warn","RNScreensTurboModule","global","startTransition","topScreenId","belowTopScreenId","canStartTransition","updateTransition","finishTransition"],"sources":["RNScreensTurboModule.ts"],"sourcesContent":["'use strict';\nimport type { RNScreensTurboModuleType } from './commonTypes';\n\nfunction noopFactory<T>(defaultReturnValue?: T): () => T {\n return () => {\n 'worklet';\n console.warn(\n '[Reanimated] RNScreensTurboModule has not been found. Check that you have installed `react-native-screens@3.30.0` or newer in your project and rebuilt your app.'\n );\n return defaultReturnValue as T;\n };\n}\n\ntype TransactionConfig = {\n topScreenId: number;\n belowTopScreenId: number;\n canStartTransition: boolean;\n};\n\nexport const RNScreensTurboModule: RNScreensTurboModuleType =\n global.RNScreensTurboModule || {\n startTransition: noopFactory<TransactionConfig>({\n topScreenId: -1,\n belowTopScreenId: -1,\n canStartTransition: false,\n }),\n updateTransition: noopFactory(),\n finishTransition: noopFactory(),\n };\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,WAAWA,CAAIC,kBAAsB,EAAW;EACvD,OAAO,MAAM;IACX,SAAS;;IACTC,OAAO,CAACC,IAAI,CACV,kKACF,CAAC;IACD,OAAOF,kBAAkB;EAC3B,CAAC;AACH;AAQA,OAAO,MAAMG,oBAA8C,GACzDC,MAAM,CAACD,oBAAoB,IAAI;EAC7BE,eAAe,EAAEN,WAAW,CAAoB;IAC9CO,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,kBAAkB,EAAE;EACtB,CAAC,CAAC;EACFC,gBAAgB,EAAEV,WAAW,CAAC,CAAC;EAC/BW,gBAAgB,EAAEX,WAAW,CAAC;AAChC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configureProps","applyStyle","getSwipeSimulator","startScreenTransition","screenTransitionConfig","stackTag","sharedEvent","addListener","value","getLockAxis","goBackGesture","includes","undefined","finishScreenTransition","removeListener","lockAxis","step"],"sources":["animationManager.ts"],"sourcesContent":["'use strict';\n\nimport type { LockAxis, ScreenTransitionConfig } from './commonTypes';\nimport { configureProps } from '../../ConfigHelper';\nimport { applyStyle } from './styleUpdater';\nimport { getSwipeSimulator } from './swipeSimulator';\n\nconfigureProps();\n\nexport function startScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent } = screenTransitionConfig;\n sharedEvent.addListener(stackTag, () => {\n applyStyle(screenTransitionConfig, sharedEvent.value);\n });\n}\n\nfunction getLockAxis(goBackGesture: string): LockAxis {\n 'worklet';\n if (['swipeRight', 'swipeLeft', 'horizontalSwipe'].includes(goBackGesture)) {\n return 'x';\n } else if (\n ['swipeUp', 'swipeDown', 'verticalSwipe'].includes(goBackGesture)\n ) {\n return 'y';\n }\n return undefined;\n}\n\nexport function finishScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent, goBackGesture } = screenTransitionConfig;\n sharedEvent.removeListener(stackTag);\n const lockAxis = getLockAxis(goBackGesture);\n const step = getSwipeSimulator(\n sharedEvent.value,\n screenTransitionConfig,\n lockAxis\n );\n step();\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpDF,cAAc,
|
|
1
|
+
{"version":3,"names":["configureProps","applyStyle","getSwipeSimulator","startScreenTransition","screenTransitionConfig","stackTag","sharedEvent","addListener","value","getLockAxis","goBackGesture","includes","undefined","finishScreenTransition","removeListener","lockAxis","step"],"sources":["animationManager.ts"],"sourcesContent":["'use strict';\n\nimport type { LockAxis, ScreenTransitionConfig } from './commonTypes';\nimport { configureProps } from '../../ConfigHelper';\nimport { applyStyle } from './styleUpdater';\nimport { getSwipeSimulator } from './swipeSimulator';\n\nconfigureProps();\n\nexport function startScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent } = screenTransitionConfig;\n sharedEvent.addListener(stackTag, () => {\n applyStyle(screenTransitionConfig, sharedEvent.value);\n });\n}\n\nfunction getLockAxis(goBackGesture: string): LockAxis {\n 'worklet';\n if (['swipeRight', 'swipeLeft', 'horizontalSwipe'].includes(goBackGesture)) {\n return 'x';\n } else if (\n ['swipeUp', 'swipeDown', 'verticalSwipe'].includes(goBackGesture)\n ) {\n return 'y';\n }\n return undefined;\n}\n\nexport function finishScreenTransition(\n screenTransitionConfig: ScreenTransitionConfig\n) {\n 'worklet';\n const { stackTag, sharedEvent, goBackGesture } = screenTransitionConfig;\n sharedEvent.removeListener(stackTag);\n const lockAxis = getLockAxis(goBackGesture);\n const step = getSwipeSimulator(\n sharedEvent.value,\n screenTransitionConfig,\n lockAxis\n );\n step();\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpDF,cAAc,CAAC,CAAC;AAEhB,OAAO,SAASG,qBAAqBA,CACnCC,sBAA8C,EAC9C;EACA,SAAS;;EACT,MAAM;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAGF,sBAAsB;EACxDE,WAAW,CAACC,WAAW,CAACF,QAAQ,EAAE,MAAM;IACtCJ,UAAU,CAACG,sBAAsB,EAAEE,WAAW,CAACE,KAAK,CAAC;EACvD,CAAC,CAAC;AACJ;AAEA,SAASC,WAAWA,CAACC,aAAqB,EAAY;EACpD,SAAS;;EACT,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAACC,QAAQ,CAACD,aAAa,CAAC,EAAE;IAC1E,OAAO,GAAG;EACZ,CAAC,MAAM,IACL,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAACC,QAAQ,CAACD,aAAa,CAAC,EACjE;IACA,OAAO,GAAG;EACZ;EACA,OAAOE,SAAS;AAClB;AAEA,OAAO,SAASC,sBAAsBA,CACpCT,sBAA8C,EAC9C;EACA,SAAS;;EACT,MAAM;IAAEC,QAAQ;IAAEC,WAAW;IAAEI;EAAc,CAAC,GAAGN,sBAAsB;EACvEE,WAAW,CAACQ,cAAc,CAACT,QAAQ,CAAC;EACpC,MAAMU,QAAQ,GAAGN,WAAW,CAACC,aAAa,CAAC;EAC3C,MAAMM,IAAI,GAAGd,iBAAiB,CAC5BI,WAAW,CAACE,KAAK,EACjBJ,sBAAsB,EACtBW,QACF,CAAC;EACDC,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\n\nimport type {\n MeasuredDimensions,\n ShadowNodeWrapper,\n SharedValue,\n} from '../commonTypes';\n\nexport type PanGestureHandlerEventPayload = {\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n translationX: number;\n translationY: number;\n velocityX: number;\n velocityY: number;\n};\n\nexport type AnimatedScreenTransition = {\n topScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n belowTopScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n};\n\nexport type GoBackGesture =\n | 'swipeRight'\n | 'swipeLeft'\n | 'swipeUp'\n | 'swipeDown'\n | 'verticalSwipe'\n | 'horizontalSwipe'\n | 'twoDimensionalSwipe';\n\nexport type ScreenTransitionConfig = {\n stackTag: number;\n belowTopScreenId: number | ShadowNodeWrapper;\n topScreenId: number | ShadowNodeWrapper;\n screenTransition: AnimatedScreenTransition;\n sharedEvent: SharedValue<PanGestureHandlerEventPayload>;\n startingGesturePosition: SharedValue<PanGestureHandlerEventPayload>;\n onFinishAnimation?: () => void;\n isTransitionCanceled: boolean;\n goBackGesture: GoBackGesture;\n screenDimensions: MeasuredDimensions;\n};\n\nexport type RNScreensTurboModuleType = {\n startTransition: (stackTag: number) => {\n topScreenId: number | ShadowNodeWrapper;\n belowTopScreenId: number | ShadowNodeWrapper;\n canStartTransition: boolean;\n };\n updateTransition: (stackTag: number, progress: number) => void;\n finishTransition: (stackTag: number, isCanceled: boolean) => void;\n};\n\nexport type LockAxis = 'x' | 'y' | undefined;\n"],"mappings":"AAAA,YAAY;;AAAC"}
|
|
1
|
+
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\n\nimport type {\n MeasuredDimensions,\n ShadowNodeWrapper,\n SharedValue,\n} from '../commonTypes';\n\nexport type PanGestureHandlerEventPayload = {\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n translationX: number;\n translationY: number;\n velocityX: number;\n velocityY: number;\n};\n\nexport type AnimatedScreenTransition = {\n topScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n belowTopScreenStyle: (\n event: PanGestureHandlerEventPayload,\n screenDimensions: MeasuredDimensions\n ) => Record<string, unknown>;\n};\n\nexport type GoBackGesture =\n | 'swipeRight'\n | 'swipeLeft'\n | 'swipeUp'\n | 'swipeDown'\n | 'verticalSwipe'\n | 'horizontalSwipe'\n | 'twoDimensionalSwipe';\n\nexport type ScreenTransitionConfig = {\n stackTag: number;\n belowTopScreenId: number | ShadowNodeWrapper;\n topScreenId: number | ShadowNodeWrapper;\n screenTransition: AnimatedScreenTransition;\n sharedEvent: SharedValue<PanGestureHandlerEventPayload>;\n startingGesturePosition: SharedValue<PanGestureHandlerEventPayload>;\n onFinishAnimation?: () => void;\n isTransitionCanceled: boolean;\n goBackGesture: GoBackGesture;\n screenDimensions: MeasuredDimensions;\n};\n\nexport type RNScreensTurboModuleType = {\n startTransition: (stackTag: number) => {\n topScreenId: number | ShadowNodeWrapper;\n belowTopScreenId: number | ShadowNodeWrapper;\n canStartTransition: boolean;\n };\n updateTransition: (stackTag: number, progress: number) => void;\n finishTransition: (stackTag: number, isCanceled: boolean) => void;\n};\n\nexport type LockAxis = 'x' | 'y' | undefined;\n"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["startScreenTransition","finishScreenTransition","ScreenTransition"],"sources":["index.ts"],"sourcesContent":["'use strict';\n\nexport {\n startScreenTransition,\n finishScreenTransition,\n} from './animationManager';\nexport { ScreenTransition } from './presets';\nexport type {\n AnimatedScreenTransition,\n GoBackGesture,\n ScreenTransitionConfig,\n} from './commonTypes';\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,qBAAqB,EACrBC,sBAAsB,QACjB,oBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,WAAW"}
|
|
1
|
+
{"version":3,"names":["startScreenTransition","finishScreenTransition","ScreenTransition"],"sources":["index.ts"],"sourcesContent":["'use strict';\n\nexport {\n startScreenTransition,\n finishScreenTransition,\n} from './animationManager';\nexport { ScreenTransition } from './presets';\nexport type {\n AnimatedScreenTransition,\n GoBackGesture,\n ScreenTransitionConfig,\n} from './commonTypes';\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,qBAAqB,EACrBC,sBAAsB,QACjB,oBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SwipeRight","topScreenStyle","event","transform","translateX","translationX","belowTopScreenStyle","screenSize","width","SwipeLeft","SwipeDown","translateY","translationY","height","SwipeUp","TwoDimensional","_screenSize","_event","Horizontal","Vertical","SwipeRightFade","opacity","Math","abs","ScreenTransition"],"sources":["presets.ts"],"sourcesContent":["'use strict';\n\nimport type { AnimatedScreenTransition } from './commonTypes';\n\nconst SwipeRight: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: (event.translationX - screenSize.width) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeLeft: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: (event.translationX + screenSize.width) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeDown: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateY: (event.translationY - screenSize.height) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeUp: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateY: (event.translationY + screenSize.height) * 0.3 },\n ],\n };\n },\n};\n\nconst TwoDimensional: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: event.translationX },\n { translateY: event.translationY },\n ],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst Horizontal: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst Vertical: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst SwipeRightFade: AnimatedScreenTransition = {\n topScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n opacity: 1 - Math.abs(event.translationX / screenSize.width),\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nexport const ScreenTransition = {\n SwipeRight,\n SwipeLeft,\n SwipeDown,\n SwipeUp,\n Horizontal,\n Vertical,\n TwoDimensional,\n SwipeRightFade,\n};\n"],"mappings":"AAAA,YAAY;;AAIZ,MAAMA,UAAoC,GAAG;EAC3CC,cAAc,EAAGC,KAAK,IAAK;IACzB,SAAS;;IACT,OAAO;MACLC,SAAS,EAAE,CAAC;QAAEC,UAAU,EAAEF,KAAK,CAACG;MAAa,CAAC;IAChD,CAAC;EACH,CAAC;EACDC,mBAAmB,EAAEA,CAACJ,KAAK,EAAEK,UAAU,KAAK;IAC1C,SAAS;;IACT,OAAO;MACLJ,SAAS,EAAE,CACT;QAAEC,UAAU,EAAE,CAACF,KAAK,CAACG,YAAY,GAAGE,UAAU,CAACC,KAAK,IAAI;MAAI,CAAC;IAEjE,CAAC;EACH;AACF,CAAC;AAED,MAAMC,SAAmC,GAAG;EAC1CR,cAAc,EAAGC,KAAK,IAAK;IACzB,SAAS;;IACT,OAAO;MACLC,SAAS,EAAE,CAAC;QAAEC,UAAU,EAAEF,KAAK,CAACG;MAAa,CAAC;IAChD,CAAC;EACH,CAAC;EACDC,mBAAmB,EAAEA,CAACJ,KAAK,EAAEK,UAAU,KAAK;IAC1C,SAAS;;IACT,OAAO;MACLJ,SAAS,EAAE,CACT;QAAEC,UAAU,EAAE,CAACF,KAAK,CAACG,YAAY,GAAGE,UAAU,CAACC,KAAK,IAAI;MAAI,CAAC;IAEjE,CAAC;EACH;AACF,CAAC;AAED,MAAME,SAAmC,GAAG;EAC1CT,cAAc,EAAGC,KAAK,IAAK;IACzB,SAAS;;IACT,OAAO;MACLC,SAAS,EAAE,CAAC;QAAEQ,UAAU,EAAET,KAAK,CAACU;MAAa,CAAC;IAChD,CAAC;EACH,CAAC;EACDN,mBAAmB,EAAEA,CAACJ,KAAK,EAAEK,UAAU,KAAK;IAC1C,SAAS;;IACT,OAAO;MACLJ,SAAS,EAAE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AAK;IACtC,SAAS;;IACT,OAAO;MACLb,SAAS,EAAE,CAAC;QAAEQ,UAAU,EAAET,KAAK,CAACU;MAAa,CAAC;IAChD,CAAC;EACH,CAAC;EACDN,mBAAmB,EAAEA,CAACW,MAAM,EAAED,WAAW,KAAK;IAC5C,SAAS;;IACT,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAED,MAAMI,cAAwC,GAAG;EAC/CnB,cAAc,EAAEA,CAACC,KAAK,EAAEK,UAAU,KAAK;IACrC,SAAS;;IACT,OAAO;MACLc,OAAO,EAAE,CAAC,GAAGC,IAAI,CAACC,GAAG,CAACrB,KAAK,CAACG,YAAY,GAAGE,UAAU,CAACC,KAAK;IAC7D,CAAC;EACH,CAAC;EACDF,mBAAmB,EAAEA,CAACW,MAAM,EAAED,WAAW,KAAK;IAC5C,SAAS;;IACT,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAED,OAAO,MAAMQ,gBAAgB,GAAG;EAC9BxB,UAAU;EACVS,SAAS;EACTC,SAAS;EACTI,OAAO;EACPI,UAAU;EACVC,QAAQ;EACRJ,cAAc;EACdK;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["SwipeRight","topScreenStyle","event","transform","translateX","translationX","belowTopScreenStyle","screenSize","width","SwipeLeft","SwipeDown","translateY","translationY","height","SwipeUp","TwoDimensional","_screenSize","_event","Horizontal","Vertical","SwipeRightFade","opacity","Math","abs","ScreenTransition"],"sources":["presets.ts"],"sourcesContent":["'use strict';\n\nimport type { AnimatedScreenTransition } from './commonTypes';\n\nconst SwipeRight: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: (event.translationX - screenSize.width) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeLeft: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: (event.translationX + screenSize.width) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeDown: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateY: (event.translationY - screenSize.height) * 0.3 },\n ],\n };\n },\n};\n\nconst SwipeUp: AnimatedScreenTransition = {\n topScreenStyle: (event) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateY: (event.translationY + screenSize.height) * 0.3 },\n ],\n };\n },\n};\n\nconst TwoDimensional: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [\n { translateX: event.translationX },\n { translateY: event.translationY },\n ],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst Horizontal: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [{ translateX: event.translationX }],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst Vertical: AnimatedScreenTransition = {\n topScreenStyle: (event, _screenSize) => {\n 'worklet';\n return {\n transform: [{ translateY: event.translationY }],\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nconst SwipeRightFade: AnimatedScreenTransition = {\n topScreenStyle: (event, screenSize) => {\n 'worklet';\n return {\n opacity: 1 - Math.abs(event.translationX / screenSize.width),\n };\n },\n belowTopScreenStyle: (_event, _screenSize) => {\n 'worklet';\n return {};\n },\n};\n\nexport const ScreenTransition = {\n SwipeRight,\n SwipeLeft,\n SwipeDown,\n SwipeUp,\n Horizontal,\n Vertical,\n TwoDimensional,\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mB,EAAEA,CAACW,MAAM,EAAED,WAAW,KAAK;IAC5C,SAAS;;IACT,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAED,MAAMI,cAAwC,GAAG;EAC/CnB,cAAc,EAAEA,CAACC,KAAK,EAAEK,UAAU,KAAK;IACrC,SAAS;;IACT,OAAO;MACLc,OAAO,EAAE,CAAC,GAAGC,IAAI,CAACC,GAAG,CAACrB,KAAK,CAACG,YAAY,GAAGE,UAAU,CAACC,KAAK;IAC7D,CAAC;EACH,CAAC;EACDF,mBAAmB,EAAEA,CAACW,MAAM,EAAED,WAAW,KAAK;IAC5C,SAAS;;IACT,OAAO,CAAC,CAAC;EACX;AACF,CAAC;AAED,OAAO,MAAMQ,gBAAgB,GAAG;EAC9BxB,UAAU;EACVS,SAAS;EACTC,SAAS;EACTI,OAAO;EACPI,UAAU;EACVC,QAAQ;EACRJ,cAAc;EACdK;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFabric","updateProps","IS_FABRIC","createViewDescriptorPaper","screenId","tag","name","createViewDescriptorFabric","shadowNodeWrapper","createViewDescriptor","applyStyleForTopScreen","screenTransitionConfig","event","screenDimensions","topScreenId","screenTransition","topScreenStyle","computeTopScreenStyle","topScreenDescriptor","value","undefined","applyStyleForBelowTopScreen","belowTopScreenId","belowTopScreenStyle","computeBelowTopScreenStyle","belowTopScreenDescriptor","applyStyle"],"sources":["styleUpdater.ts"],"sourcesContent":["'use strict';\nimport { isFabric } from '../PlatformChecker';\nimport updateProps from '../UpdateProps';\nimport type { ShadowNodeWrapper, SharedValue } from '../commonTypes';\nimport type { Descriptor } from '../hook/commonTypes';\nimport type {\n PanGestureHandlerEventPayload,\n ScreenTransitionConfig,\n} from './commonTypes';\n\nconst IS_FABRIC = isFabric();\n\nfunction createViewDescriptorPaper(screenId: number | ShadowNodeWrapper) {\n 'worklet';\n return { tag: screenId, name: 'RCTView' };\n}\nfunction createViewDescriptorFabric(screenId: number | ShadowNodeWrapper) {\n 'worklet';\n return { shadowNodeWrapper: screenId };\n}\nconst createViewDescriptor = IS_FABRIC\n ? createViewDescriptorFabric\n : createViewDescriptorPaper;\n\nfunction applyStyleForTopScreen(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n const { screenDimensions, topScreenId, screenTransition } =\n screenTransitionConfig;\n const { topScreenStyle: computeTopScreenStyle } = screenTransition;\n const topScreenStyle = computeTopScreenStyle(event, screenDimensions);\n const topScreenDescriptor = {\n value: [createViewDescriptor(topScreenId)],\n };\n updateProps(\n topScreenDescriptor as SharedValue<Descriptor[]>,\n topScreenStyle,\n undefined\n );\n}\n\nexport function applyStyleForBelowTopScreen(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n const { screenDimensions, belowTopScreenId, screenTransition } =\n screenTransitionConfig;\n const { belowTopScreenStyle: computeBelowTopScreenStyle } = screenTransition;\n const belowTopScreenStyle = computeBelowTopScreenStyle(\n event,\n screenDimensions\n );\n const belowTopScreenDescriptor = {\n value: [createViewDescriptor(belowTopScreenId)],\n };\n updateProps(\n belowTopScreenDescriptor as SharedValue<Descriptor[]>,\n belowTopScreenStyle,\n undefined\n );\n}\n\nexport function applyStyle(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n applyStyleForTopScreen(screenTransitionConfig, event);\n applyStyleForBelowTopScreen(screenTransitionConfig, event);\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,WAAW,MAAM,gBAAgB;AAQxC,MAAMC,SAAS,GAAGF,QAAQ,
|
|
1
|
+
{"version":3,"names":["isFabric","updateProps","IS_FABRIC","createViewDescriptorPaper","screenId","tag","name","createViewDescriptorFabric","shadowNodeWrapper","createViewDescriptor","applyStyleForTopScreen","screenTransitionConfig","event","screenDimensions","topScreenId","screenTransition","topScreenStyle","computeTopScreenStyle","topScreenDescriptor","value","undefined","applyStyleForBelowTopScreen","belowTopScreenId","belowTopScreenStyle","computeBelowTopScreenStyle","belowTopScreenDescriptor","applyStyle"],"sources":["styleUpdater.ts"],"sourcesContent":["'use strict';\nimport { isFabric } from '../PlatformChecker';\nimport updateProps from '../UpdateProps';\nimport type { ShadowNodeWrapper, SharedValue } from '../commonTypes';\nimport type { Descriptor } from '../hook/commonTypes';\nimport type {\n PanGestureHandlerEventPayload,\n ScreenTransitionConfig,\n} from './commonTypes';\n\nconst IS_FABRIC = isFabric();\n\nfunction createViewDescriptorPaper(screenId: number | ShadowNodeWrapper) {\n 'worklet';\n return { tag: screenId, name: 'RCTView' };\n}\nfunction createViewDescriptorFabric(screenId: number | ShadowNodeWrapper) {\n 'worklet';\n return { shadowNodeWrapper: screenId };\n}\nconst createViewDescriptor = IS_FABRIC\n ? createViewDescriptorFabric\n : createViewDescriptorPaper;\n\nfunction applyStyleForTopScreen(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n const { screenDimensions, topScreenId, screenTransition } =\n screenTransitionConfig;\n const { topScreenStyle: computeTopScreenStyle } = screenTransition;\n const topScreenStyle = computeTopScreenStyle(event, screenDimensions);\n const topScreenDescriptor = {\n value: [createViewDescriptor(topScreenId)],\n };\n updateProps(\n topScreenDescriptor as SharedValue<Descriptor[]>,\n topScreenStyle,\n undefined\n );\n}\n\nexport function applyStyleForBelowTopScreen(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n const { screenDimensions, belowTopScreenId, screenTransition } =\n screenTransitionConfig;\n const { belowTopScreenStyle: computeBelowTopScreenStyle } = screenTransition;\n const belowTopScreenStyle = computeBelowTopScreenStyle(\n event,\n screenDimensions\n );\n const belowTopScreenDescriptor = {\n value: [createViewDescriptor(belowTopScreenId)],\n };\n updateProps(\n belowTopScreenDescriptor as SharedValue<Descriptor[]>,\n belowTopScreenStyle,\n undefined\n );\n}\n\nexport function applyStyle(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload\n) {\n 'worklet';\n applyStyleForTopScreen(screenTransitionConfig, event);\n applyStyleForBelowTopScreen(screenTransitionConfig, event);\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,WAAW,MAAM,gBAAgB;AAQxC,MAAMC,SAAS,GAAGF,QAAQ,CAAC,CAAC;AAE5B,SAASG,yBAAyBA,CAACC,QAAoC,EAAE;EACvE,SAAS;;EACT,OAAO;IAAEC,GAAG,EAAED,QAAQ;IAAEE,IAAI,EAAE;EAAU,CAAC;AAC3C;AACA,SAASC,0BAA0BA,CAACH,QAAoC,EAAE;EACxE,SAAS;;EACT,OAAO;IAAEI,iBAAiB,EAAEJ;EAAS,CAAC;AACxC;AACA,MAAMK,oBAAoB,GAAGP,SAAS,GAClCK,0BAA0B,GAC1BJ,yBAAyB;AAE7B,SAASO,sBAAsBA,CAC7BC,sBAA8C,EAC9CC,KAAoC,EACpC;EACA,SAAS;;EACT,MAAM;IAAEC,gBAAgB;IAAEC,WAAW;IAAEC;EAAiB,CAAC,GACvDJ,sBAAsB;EACxB,MAAM;IAAEK,cAAc,EAAEC;EAAsB,CAAC,GAAGF,gBAAgB;EAClE,MAAMC,cAAc,GAAGC,qBAAqB,CAACL,KAAK,EAAEC,gBAAgB,CAAC;EACrE,MAAMK,mBAAmB,GAAG;IAC1BC,KAAK,EAAE,CAACV,oBAAoB,CAACK,WAAW,CAAC;EAC3C,CAAC;EACDb,WAAW,CACTiB,mBAAmB,EACnBF,cAAc,EACdI,SACF,CAAC;AACH;AAEA,OAAO,SAASC,2BAA2BA,CACzCV,sBAA8C,EAC9CC,KAAoC,EACpC;EACA,SAAS;;EACT,MAAM;IAAEC,gBAAgB;IAAES,gBAAgB;IAAEP;EAAiB,CAAC,GAC5DJ,sBAAsB;EACxB,MAAM;IAAEY,mBAAmB,EAAEC;EAA2B,CAAC,GAAGT,gBAAgB;EAC5E,MAAMQ,mBAAmB,GAAGC,0BAA0B,CACpDZ,KAAK,EACLC,gBACF,CAAC;EACD,MAAMY,wBAAwB,GAAG;IAC/BN,KAAK,EAAE,CAACV,oBAAoB,CAACa,gBAAgB,CAAC;EAChD,CAAC;EACDrB,WAAW,CACTwB,wBAAwB,EACxBF,mBAAmB,EACnBH,SACF,CAAC;AACH;AAEA,OAAO,SAASM,UAAUA,CACxBf,sBAA8C,EAC9CC,KAAoC,EACpC;EACA,SAAS;;EACTF,sBAAsB,CAACC,sBAAsB,EAAEC,KAAK,CAAC;EACrDS,2BAA2B,CAACV,sBAAsB,EAAEC,KAAK,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -43,7 +43,7 @@ function maybeScheduleNextFrame(step, didScreenReachDestination, screenTransitio
|
|
|
43
43
|
requestAnimationFrame(step);
|
|
44
44
|
} else {
|
|
45
45
|
var _screenTransitionConf;
|
|
46
|
-
(_screenTransitionConf = screenTransitionConfig.onFinishAnimation) === null || _screenTransitionConf === void 0
|
|
46
|
+
(_screenTransitionConf = screenTransitionConfig.onFinishAnimation) === null || _screenTransitionConf === void 0 || _screenTransitionConf.call(screenTransitionConfig);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export function getSwipeSimulator(event, screenTransitionConfig, lockAxis) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["applyStyle","applyStyleForBelowTopScreen","RNScreensTurboModule","BASE_VELOCITY","ADDITIONAL_VELOCITY_FACTOR_X","ADDITIONAL_VELOCITY_FACTOR_Y","ADDITIONAL_VELOCITY_FACTOR_XY","computeEasingProgress","startingTimestamp","distance","velocity","Math","abs","elapsedTime","_getAnimationTimestamp","currentPosition","progress","easing","x","pow","computeProgress","screenTransitionConfig","event","isTransitionCanceled","screenDimensions","progressX","translationX","width","progressY","translationY","height","maxProgress","max","maybeScheduleNextFrame","step","didScreenReachDestination","stackTag","updateTransition","requestAnimationFrame","_screenTransitionConf","onFinishAnimation","call","getSwipeSimulator","lockAxis","startTimestamp","startingPosition","y","direction","sign","finalPosition","euclideanDistance","sqrt","screenDiagonal","velocityVectorLength","didScreenReachDestinationCheck","restoreOriginalStyleForBelowTopScreen","computeFrame","finished"],"sources":["swipeSimulator.ts"],"sourcesContent":["'use strict';\nimport type {\n PanGestureHandlerEventPayload,\n ScreenTransitionConfig,\n LockAxis,\n} from './commonTypes';\nimport { applyStyle, applyStyleForBelowTopScreen } from './styleUpdater';\nimport { RNScreensTurboModule } from './RNScreensTurboModule';\n\nconst BASE_VELOCITY = 400;\nconst ADDITIONAL_VELOCITY_FACTOR_X = 400;\nconst ADDITIONAL_VELOCITY_FACTOR_Y = 500;\nconst ADDITIONAL_VELOCITY_FACTOR_XY = 600;\n\nfunction computeEasingProgress(\n startingTimestamp: number,\n distance: number,\n velocity: number\n) {\n 'worklet';\n if (Math.abs(distance) < 1) {\n return 1;\n }\n const elapsedTime = (_getAnimationTimestamp() - startingTimestamp) / 1000;\n const currentPosition = velocity * elapsedTime;\n const progress = currentPosition / distance;\n return progress;\n}\n\nfunction easing(x: number): number {\n 'worklet';\n // based on https://easings.net/#easeOutQuart\n return 1 - Math.pow(1 - x, 5);\n}\n\nfunction computeProgress(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload,\n isTransitionCanceled: boolean\n) {\n 'worklet';\n const screenDimensions = screenTransitionConfig.screenDimensions;\n const progressX = Math.abs(event.translationX / screenDimensions.width);\n const progressY = Math.abs(event.translationY / screenDimensions.height);\n const maxProgress = Math.max(progressX, progressY);\n const progress = isTransitionCanceled ? maxProgress / 2 : maxProgress;\n return progress;\n}\n\nfunction maybeScheduleNextFrame(\n step: () => void,\n didScreenReachDestination: boolean,\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload,\n isTransitionCanceled: boolean\n) {\n 'worklet';\n if (!didScreenReachDestination) {\n const stackTag = screenTransitionConfig.stackTag;\n const progress = computeProgress(\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n RNScreensTurboModule.updateTransition(stackTag, progress);\n requestAnimationFrame(step);\n } else {\n screenTransitionConfig.onFinishAnimation?.();\n }\n}\n\nexport function getSwipeSimulator(\n event: PanGestureHandlerEventPayload,\n screenTransitionConfig: ScreenTransitionConfig,\n lockAxis?: LockAxis\n) {\n 'worklet';\n const screenDimensions = screenTransitionConfig.screenDimensions;\n const startTimestamp = _getAnimationTimestamp();\n const { isTransitionCanceled } = screenTransitionConfig;\n const startingPosition = {\n x: event.translationX,\n y: event.translationY,\n };\n const direction = {\n x: Math.sign(event.translationX),\n y: Math.sign(event.translationY),\n };\n const finalPosition = isTransitionCanceled\n ? { x: 0, y: 0 }\n : {\n x: direction.x * screenDimensions.width,\n y: direction.y * screenDimensions.height,\n };\n const distance = {\n x: Math.abs(finalPosition.x - startingPosition.x),\n y: Math.abs(finalPosition.y - startingPosition.y),\n };\n const didScreenReachDestination = {\n x: false,\n y: false,\n };\n const velocity = { x: BASE_VELOCITY, y: BASE_VELOCITY };\n if (lockAxis === 'x') {\n velocity.y = 0;\n velocity.x +=\n (ADDITIONAL_VELOCITY_FACTOR_X * distance.x) / screenDimensions.width;\n } else if (lockAxis === 'y') {\n velocity.x = 0;\n velocity.y +=\n (ADDITIONAL_VELOCITY_FACTOR_Y * distance.y) / screenDimensions.height;\n } else {\n const euclideanDistance = Math.sqrt(distance.x ** 2 + distance.y ** 2);\n const screenDiagonal = Math.sqrt(\n screenDimensions.width ** 2 + screenDimensions.height ** 2\n );\n const velocityVectorLength =\n BASE_VELOCITY +\n (ADDITIONAL_VELOCITY_FACTOR_XY * euclideanDistance) / screenDiagonal;\n if (Math.abs(startingPosition.x) > Math.abs(startingPosition.y)) {\n velocity.x = velocityVectorLength;\n velocity.y =\n velocityVectorLength *\n Math.abs(startingPosition.y / startingPosition.x);\n } else {\n velocity.x =\n velocityVectorLength *\n Math.abs(startingPosition.x / startingPosition.y);\n velocity.y = velocityVectorLength;\n }\n }\n\n if (isTransitionCanceled) {\n function didScreenReachDestinationCheck() {\n if (lockAxis === 'x') {\n return didScreenReachDestination.x;\n } else if (lockAxis === 'y') {\n return didScreenReachDestination.y;\n } else {\n return didScreenReachDestination.x && didScreenReachDestination.y;\n }\n }\n\n function restoreOriginalStyleForBelowTopScreen() {\n event.translationX = direction.x * screenDimensions.width;\n event.translationY = direction.y * screenDimensions.height;\n applyStyleForBelowTopScreen(screenTransitionConfig, event);\n }\n\n const computeFrame = () => {\n const progress = {\n x: computeEasingProgress(startTimestamp, distance.x, velocity.x),\n y: computeEasingProgress(startTimestamp, distance.y, velocity.y),\n };\n event.translationX =\n startingPosition.x - direction.x * distance.x * easing(progress.x);\n event.translationY =\n startingPosition.y - direction.y * distance.y * easing(progress.y);\n if (direction.x > 0) {\n if (event.translationX <= 0) {\n didScreenReachDestination.x = true;\n event.translationX = 0;\n }\n } else {\n if (event.translationX >= 0) {\n didScreenReachDestination.x = true;\n event.translationX = 0;\n }\n }\n if (direction.y > 0) {\n if (event.translationY <= 0) {\n didScreenReachDestination.y = true;\n event.translationY = 0;\n }\n } else {\n if (event.translationY >= 0) {\n didScreenReachDestination.y = true;\n event.translationY = 0;\n }\n }\n applyStyle(screenTransitionConfig, event);\n const finished = didScreenReachDestinationCheck();\n if (finished) {\n restoreOriginalStyleForBelowTopScreen();\n }\n maybeScheduleNextFrame(\n computeFrame,\n finished,\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n };\n return computeFrame;\n } else {\n const computeFrame = () => {\n const progress = {\n x: computeEasingProgress(startTimestamp, distance.x, velocity.x),\n y: computeEasingProgress(startTimestamp, distance.y, velocity.y),\n };\n event.translationX =\n startingPosition.x + direction.x * distance.x * easing(progress.x);\n event.translationY =\n startingPosition.y + direction.y * distance.y * easing(progress.y);\n if (direction.x > 0) {\n if (event.translationX >= screenDimensions.width) {\n didScreenReachDestination.x = true;\n event.translationX = screenDimensions.width;\n }\n } else {\n if (event.translationX <= -screenDimensions.width) {\n didScreenReachDestination.x = true;\n event.translationX = -screenDimensions.width;\n }\n }\n if (direction.y > 0) {\n if (event.translationY >= screenDimensions.height) {\n didScreenReachDestination.y = true;\n event.translationY = screenDimensions.height;\n }\n } else {\n if (event.translationY <= -screenDimensions.height) {\n didScreenReachDestination.y = true;\n event.translationY = -screenDimensions.height;\n }\n }\n applyStyle(screenTransitionConfig, event);\n maybeScheduleNextFrame(\n computeFrame,\n didScreenReachDestination.x || didScreenReachDestination.y,\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n };\n return computeFrame;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAMZ,SAASA,UAAU,EAAEC,2BAA2B,QAAQ,gBAAgB;AACxE,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,aAAa,GAAG,GAAG;AACzB,MAAMC,4BAA4B,GAAG,GAAG;AACxC,MAAMC,4BAA4B,GAAG,GAAG;AACxC,MAAMC,6BAA6B,GAAG,GAAG;AAEzC,SAASC,qBAAqBA,CAC5BC,iBAAyB,EACzBC,QAAgB,EAChBC,QAAgB,EAChB;EACA,SAAS;;EACT,IAAIC,IAAI,CAACC,GAAG,CAACH,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC1B,OAAO,CAAC;EACV;EACA,MAAMI,WAAW,GAAG,CAACC,sBAAsB,EAAE,GAAGN,iBAAiB,IAAI,IAAI;EACzE,MAAMO,eAAe,GAAGL,QAAQ,GAAGG,WAAW;EAC9C,MAAMG,QAAQ,GAAGD,eAAe,GAAGN,QAAQ;EAC3C,OAAOO,QAAQ;AACjB;AAEA,SAASC,MAAMA,CAACC,CAAS,EAAU;EACjC,SAAS;;EACT;EACA,OAAO,CAAC,GAAGP,IAAI,CAACQ,GAAG,CAAC,CAAC,GAAGD,CAAC,EAAE,CAAC,CAAC;AAC/B;AAEA,SAASE,eAAeA,CACtBC,sBAA8C,EAC9CC,KAAoC,EACpCC,oBAA6B,EAC7B;EACA,SAA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AAC8B,CAAC,CAAC;MACpE,IAAIC,SAAS,CAAC7B,CAAC,GAAG,CAAC,EAAE;QACnB,IAAII,KAAK,CAACI,YAAY,IAAIF,gBAAgB,CAACG,KAAK,EAAE;UAChDQ,yBAAyB,CAACjB,CAAC,GAAG,IAAI;UAClCI,KAAK,CAACI,YAAY,GAAGF,gBAAgB,CAACG,KAAK;QAC7C;MACF,CAAC,MAAM;QACL,IAAIL,KAAK,CAACI,YAAY,IAAI,CAACF,gBAAgB,CAACG,KAAK,EAAE;UACjDQ,yBAAyB,CAACjB,CAAC,GAAG,IAAI;UAClCI,KAAK,CAACI,YAAY,GAAG,CAACF,gBAAgB,CAACG,KAAK;QAC9C;MACF;MACA,IAAIoB,SAAS,CAACD,CAAC,GAAG,CAAC,EAAE;QACnB,IAAIxB,KAAK,CAACO,YAAY,IAAIL,gBAAgB,CAACM,MAAM,EAAE;UACjDK,yBAAyB,CAACW,CAAC,GAAG,IAAI;UAClCxB,KAAK,CAACO,YAAY,GAAGL,gBAAgB,CAACM,MAAM;QAC9C;MACF,CAAC,MAAM;QACL,IAAIR,KAAK,CAACO,YAAY,IAAI,CAACL,gBAAgB,CAACM,MAAM,EAAE;UAClDK,yBAAyB,CAACW,CAAC,GAAG,IAAI;UAClCxB,KAAK,CAACO,YAAY,GAAG,CAACL,gBAAgB,CAACM,MAAM;QAC/C;MACF;MACA9B,UAAU,CAACqB,sBAAsB,EAAEC,KAAK,CAAC;MACzCW,sBAAsB,CACpBuB,YAAY,EACZrB,yBAAyB,CAACjB,CAAC,IAAIiB,yBAAyB,CAACW,CAAC,EAC1DzB,sBAAsB,EACtBC,KAAK,EACLC,oBAAoB,CACrB;IACH,CAAC;IACD,OAAOiC,YAAY;EACrB;AACF"}
|
|
1
|
+
{"version":3,"names":["applyStyle","applyStyleForBelowTopScreen","RNScreensTurboModule","BASE_VELOCITY","ADDITIONAL_VELOCITY_FACTOR_X","ADDITIONAL_VELOCITY_FACTOR_Y","ADDITIONAL_VELOCITY_FACTOR_XY","computeEasingProgress","startingTimestamp","distance","velocity","Math","abs","elapsedTime","_getAnimationTimestamp","currentPosition","progress","easing","x","pow","computeProgress","screenTransitionConfig","event","isTransitionCanceled","screenDimensions","progressX","translationX","width","progressY","translationY","height","maxProgress","max","maybeScheduleNextFrame","step","didScreenReachDestination","stackTag","updateTransition","requestAnimationFrame","_screenTransitionConf","onFinishAnimation","call","getSwipeSimulator","lockAxis","startTimestamp","startingPosition","y","direction","sign","finalPosition","euclideanDistance","sqrt","screenDiagonal","velocityVectorLength","didScreenReachDestinationCheck","restoreOriginalStyleForBelowTopScreen","computeFrame","finished"],"sources":["swipeSimulator.ts"],"sourcesContent":["'use strict';\nimport type {\n PanGestureHandlerEventPayload,\n ScreenTransitionConfig,\n LockAxis,\n} from './commonTypes';\nimport { applyStyle, applyStyleForBelowTopScreen } from './styleUpdater';\nimport { RNScreensTurboModule } from './RNScreensTurboModule';\n\nconst BASE_VELOCITY = 400;\nconst ADDITIONAL_VELOCITY_FACTOR_X = 400;\nconst ADDITIONAL_VELOCITY_FACTOR_Y = 500;\nconst ADDITIONAL_VELOCITY_FACTOR_XY = 600;\n\nfunction computeEasingProgress(\n startingTimestamp: number,\n distance: number,\n velocity: number\n) {\n 'worklet';\n if (Math.abs(distance) < 1) {\n return 1;\n }\n const elapsedTime = (_getAnimationTimestamp() - startingTimestamp) / 1000;\n const currentPosition = velocity * elapsedTime;\n const progress = currentPosition / distance;\n return progress;\n}\n\nfunction easing(x: number): number {\n 'worklet';\n // based on https://easings.net/#easeOutQuart\n return 1 - Math.pow(1 - x, 5);\n}\n\nfunction computeProgress(\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload,\n isTransitionCanceled: boolean\n) {\n 'worklet';\n const screenDimensions = screenTransitionConfig.screenDimensions;\n const progressX = Math.abs(event.translationX / screenDimensions.width);\n const progressY = Math.abs(event.translationY / screenDimensions.height);\n const maxProgress = Math.max(progressX, progressY);\n const progress = isTransitionCanceled ? maxProgress / 2 : maxProgress;\n return progress;\n}\n\nfunction maybeScheduleNextFrame(\n step: () => void,\n didScreenReachDestination: boolean,\n screenTransitionConfig: ScreenTransitionConfig,\n event: PanGestureHandlerEventPayload,\n isTransitionCanceled: boolean\n) {\n 'worklet';\n if (!didScreenReachDestination) {\n const stackTag = screenTransitionConfig.stackTag;\n const progress = computeProgress(\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n RNScreensTurboModule.updateTransition(stackTag, progress);\n requestAnimationFrame(step);\n } else {\n screenTransitionConfig.onFinishAnimation?.();\n }\n}\n\nexport function getSwipeSimulator(\n event: PanGestureHandlerEventPayload,\n screenTransitionConfig: ScreenTransitionConfig,\n lockAxis?: LockAxis\n) {\n 'worklet';\n const screenDimensions = screenTransitionConfig.screenDimensions;\n const startTimestamp = _getAnimationTimestamp();\n const { isTransitionCanceled } = screenTransitionConfig;\n const startingPosition = {\n x: event.translationX,\n y: event.translationY,\n };\n const direction = {\n x: Math.sign(event.translationX),\n y: Math.sign(event.translationY),\n };\n const finalPosition = isTransitionCanceled\n ? { x: 0, y: 0 }\n : {\n x: direction.x * screenDimensions.width,\n y: direction.y * screenDimensions.height,\n };\n const distance = {\n x: Math.abs(finalPosition.x - startingPosition.x),\n y: Math.abs(finalPosition.y - startingPosition.y),\n };\n const didScreenReachDestination = {\n x: false,\n y: false,\n };\n const velocity = { x: BASE_VELOCITY, y: BASE_VELOCITY };\n if (lockAxis === 'x') {\n velocity.y = 0;\n velocity.x +=\n (ADDITIONAL_VELOCITY_FACTOR_X * distance.x) / screenDimensions.width;\n } else if (lockAxis === 'y') {\n velocity.x = 0;\n velocity.y +=\n (ADDITIONAL_VELOCITY_FACTOR_Y * distance.y) / screenDimensions.height;\n } else {\n const euclideanDistance = Math.sqrt(distance.x ** 2 + distance.y ** 2);\n const screenDiagonal = Math.sqrt(\n screenDimensions.width ** 2 + screenDimensions.height ** 2\n );\n const velocityVectorLength =\n BASE_VELOCITY +\n (ADDITIONAL_VELOCITY_FACTOR_XY * euclideanDistance) / screenDiagonal;\n if (Math.abs(startingPosition.x) > Math.abs(startingPosition.y)) {\n velocity.x = velocityVectorLength;\n velocity.y =\n velocityVectorLength *\n Math.abs(startingPosition.y / startingPosition.x);\n } else {\n velocity.x =\n velocityVectorLength *\n Math.abs(startingPosition.x / startingPosition.y);\n velocity.y = velocityVectorLength;\n }\n }\n\n if (isTransitionCanceled) {\n function didScreenReachDestinationCheck() {\n if (lockAxis === 'x') {\n return didScreenReachDestination.x;\n } else if (lockAxis === 'y') {\n return didScreenReachDestination.y;\n } else {\n return didScreenReachDestination.x && didScreenReachDestination.y;\n }\n }\n\n function restoreOriginalStyleForBelowTopScreen() {\n event.translationX = direction.x * screenDimensions.width;\n event.translationY = direction.y * screenDimensions.height;\n applyStyleForBelowTopScreen(screenTransitionConfig, event);\n }\n\n const computeFrame = () => {\n const progress = {\n x: computeEasingProgress(startTimestamp, distance.x, velocity.x),\n y: computeEasingProgress(startTimestamp, distance.y, velocity.y),\n };\n event.translationX =\n startingPosition.x - direction.x * distance.x * easing(progress.x);\n event.translationY =\n startingPosition.y - direction.y * distance.y * easing(progress.y);\n if (direction.x > 0) {\n if (event.translationX <= 0) {\n didScreenReachDestination.x = true;\n event.translationX = 0;\n }\n } else {\n if (event.translationX >= 0) {\n didScreenReachDestination.x = true;\n event.translationX = 0;\n }\n }\n if (direction.y > 0) {\n if (event.translationY <= 0) {\n didScreenReachDestination.y = true;\n event.translationY = 0;\n }\n } else {\n if (event.translationY >= 0) {\n didScreenReachDestination.y = true;\n event.translationY = 0;\n }\n }\n applyStyle(screenTransitionConfig, event);\n const finished = didScreenReachDestinationCheck();\n if (finished) {\n restoreOriginalStyleForBelowTopScreen();\n }\n maybeScheduleNextFrame(\n computeFrame,\n finished,\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n };\n return computeFrame;\n } else {\n const computeFrame = () => {\n const progress = {\n x: computeEasingProgress(startTimestamp, distance.x, velocity.x),\n y: computeEasingProgress(startTimestamp, distance.y, velocity.y),\n };\n event.translationX =\n startingPosition.x + direction.x * distance.x * easing(progress.x);\n event.translationY =\n startingPosition.y + direction.y * distance.y * easing(progress.y);\n if (direction.x > 0) {\n if (event.translationX >= screenDimensions.width) {\n didScreenReachDestination.x = true;\n event.translationX = screenDimensions.width;\n }\n } else {\n if (event.translationX <= -screenDimensions.width) {\n didScreenReachDestination.x = true;\n event.translationX = -screenDimensions.width;\n }\n }\n if (direction.y > 0) {\n if (event.translationY >= screenDimensions.height) {\n didScreenReachDestination.y = true;\n event.translationY = screenDimensions.height;\n }\n } else {\n if (event.translationY <= -screenDimensions.height) {\n didScreenReachDestination.y = true;\n event.translationY = -screenDimensions.height;\n }\n }\n applyStyle(screenTransitionConfig, event);\n maybeScheduleNextFrame(\n computeFrame,\n didScreenReachDestination.x || didScreenReachDestination.y,\n screenTransitionConfig,\n event,\n isTransitionCanceled\n );\n };\n return computeFrame;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAMZ,SAASA,UAAU,EAAEC,2BAA2B,QAAQ,gBAAgB;AACxE,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,aAAa,GAAG,GAAG;AACzB,MAAMC,4BAA4B,GAAG,GAAG;AACxC,MAAMC,4BAA4B,GAAG,GAAG;AACxC,MAAMC,6BAA6B,GAAG,GAAG;AAEzC,SAASC,qBAAqBA,CAC5BC,iBAAyB,EACzBC,QAAgB,EAChBC,QAAgB,EAChB;EACA,SAAS;;EACT,IAAIC,IAAI,CAACC,GAAG,CAACH,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC1B,OAAO,CAAC;EACV;EACA,MAAMI,WAAW,GAAG,CAACC,sBAAsB,CAAC,CAAC,GAAGN,iBAAiB,IAAI,IAAI;EACzE,MAAMO,eAAe,GAAGL,QAAQ,GAAGG,WAAW;EAC9C,MAAMG,QAAQ,GAAGD,eAAe,GAAGN,QAAQ;EAC3C,OAAOO,QAAQ;AACjB;AAEA,SAASC,MAAMA,CAACC,CA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C,oBACF,CAAC;IACH,CAAC;IACD,OAAOiC,YAAY;EACrB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldBeUseWeb","SHOULD_BE_USE_WEB","shareableMappingFlag","Symbol","cache","WeakMap","shareableMappingCache","set","get","shareable","shareableRef","bind"],"sources":["shareableMappingCache.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport type { ShareableRef } from './commonTypes';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\n/**\n * This symbol is used to represent a mapping from the value to itself.\n *\n * It's used to prevent converting a shareable that's already converted -\n * for example a Shared Value that's in worklet's closure.\n **/\nexport const shareableMappingFlag = Symbol('shareable flag');\n\n/*\nDuring a fast refresh, React holds the same instance of a Mutable\n(that's guaranteed by `useRef`) but `shareableCache` gets regenerated and thus\nbecoming empty. This happens when editing the file that contains the definition of this cache.\n\nBecause of it, `makeShareableCloneRecursive` can't find given mapping\nin `shareableCache` for the Mutable and tries to clone it as if it was a regular JS object.\nDuring cloning we use `Object.entries` to iterate over the keys which throws an error on accessing `_value`.\nFor convenience we moved this cache to a separate file so it doesn't scare us with red squiggles.\n*/\n\nconst cache = SHOULD_BE_USE_WEB\n ? null\n : new WeakMap<object, ShareableRef | symbol>();\n\nexport const shareableMappingCache = SHOULD_BE_USE_WEB\n ? {\n set() {\n // NOOP\n },\n get() {\n return null;\n },\n }\n : {\n set(shareable: object, shareableRef?: ShareableRef): void {\n cache!.set(shareable, shareableRef || shareableMappingFlag);\n },\n get: cache!.get.bind(cache),\n };\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAGlD,MAAMC,iBAAiB,GAAGD,cAAc,
|
|
1
|
+
{"version":3,"names":["shouldBeUseWeb","SHOULD_BE_USE_WEB","shareableMappingFlag","Symbol","cache","WeakMap","shareableMappingCache","set","get","shareable","shareableRef","bind"],"sources":["shareableMappingCache.ts"],"sourcesContent":["'use strict';\nimport { shouldBeUseWeb } from './PlatformChecker';\nimport type { ShareableRef } from './commonTypes';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\n/**\n * This symbol is used to represent a mapping from the value to itself.\n *\n * It's used to prevent converting a shareable that's already converted -\n * for example a Shared Value that's in worklet's closure.\n **/\nexport const shareableMappingFlag = Symbol('shareable flag');\n\n/*\nDuring a fast refresh, React holds the same instance of a Mutable\n(that's guaranteed by `useRef`) but `shareableCache` gets regenerated and thus\nbecoming empty. This happens when editing the file that contains the definition of this cache.\n\nBecause of it, `makeShareableCloneRecursive` can't find given mapping\nin `shareableCache` for the Mutable and tries to clone it as if it was a regular JS object.\nDuring cloning we use `Object.entries` to iterate over the keys which throws an error on accessing `_value`.\nFor convenience we moved this cache to a separate file so it doesn't scare us with red squiggles.\n*/\n\nconst cache = SHOULD_BE_USE_WEB\n ? null\n : new WeakMap<object, ShareableRef | symbol>();\n\nexport const shareableMappingCache = SHOULD_BE_USE_WEB\n ? {\n set() {\n // NOOP\n },\n get() {\n return null;\n },\n }\n : {\n set(shareable: object, shareableRef?: ShareableRef): void {\n cache!.set(shareable, shareableRef || shareableMappingFlag);\n },\n get: cache!.get.bind(cache),\n };\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,cAAc,QAAQ,mBAAmB;AAGlD,MAAMC,iBAAiB,GAAGD,cAAc,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,oBAAoB,GAAGC,MAAM,CAAC,gBAAgB,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,KAAK,GAAGH,iBAAiB,GAC3B,IAAI,GACJ,IAAII,OAAO,CAAgC,CAAC;AAEhD,OAAO,MAAMC,qBAAqB,GAAGL,iBAAiB,GAClD;EACEM,GAAGA,CAAA,EAAG;IACJ;EAAA,CACD;EACDC,GAAGA,CAAA,EAAG;IACJ,OAAO,IAAI;EACb;AACF,CAAC,GACD;EACED,GAAGA,CAACE,SAAiB,EAAEC,YAA2B,EAAQ;IACxDN,KAAK,CAAEG,GAAG,CAACE,SAAS,EAAEC,YAAY,IAAIR,oBAAoB,CAAC;EAC7D,CAAC;EACDM,GAAG,EAAEJ,KAAK,CAAEI,GAAG,CAACG,IAAI,CAACP,KAAK;AAC5B,CAAC","ignoreList":[]}
|
|
@@ -63,9 +63,7 @@ const DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD = 30;
|
|
|
63
63
|
// Below variable stores object that we process in makeShareableCloneRecursive at the specified depth.
|
|
64
64
|
// We use it to check if later on the function reenters with the same object
|
|
65
65
|
let processedObjectAtThresholdDepth;
|
|
66
|
-
export function makeShareableCloneRecursive(value) {
|
|
67
|
-
let shouldPersistRemote = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
68
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
66
|
+
export function makeShareableCloneRecursive(value, shouldPersistRemote = false, depth = 0) {
|
|
69
67
|
if (SHOULD_BE_USE_WEB) {
|
|
70
68
|
return value;
|
|
71
69
|
}
|
|
@@ -224,7 +222,7 @@ const WORKLET_CODE_THRESHOLD = 255;
|
|
|
224
222
|
function getWorkletCode(value) {
|
|
225
223
|
var _value$__initData;
|
|
226
224
|
// @ts-ignore this is fine
|
|
227
|
-
const code = value === null || value === void 0
|
|
225
|
+
const code = value === null || value === void 0 || (_value$__initData = value.__initData) === null || _value$__initData === void 0 ? void 0 : _value$__initData.code;
|
|
228
226
|
if (!code) {
|
|
229
227
|
return 'unknown';
|
|
230
228
|
}
|