TypeScript
fix(mobile): pinch wide images from anywhere in the Android viewer (#30929)
shivamc94ad22ad135
diff --git a/patches/[email protected] b/patches/[email protected]index f85cb5fea13..f24743f93ac 100644--- a/patches/[email protected]+++ b/patches/[email protected]@@ -64,7 +64,7 @@ index 3d7641a9a94864415d207c678b71f8c592c90aa1..2b9ef77c3eb58cd284152ad22b2e711aoffset: SCREEN_WIDTH * index,index,diff --git a/dist/components/ImageItem/ImageItem.android.js b/dist/components/ImageItem/ImageItem.android.js-index 5fcaa9f9a7d893817fee89b85186ee3936118e69..3effe838fa54495d165b81cc7501e72d51fbee1b 100644+index 5fcaa9f9a7d893817fee89b85186ee3936118e69..e166dd14349b4b95f96d648cb64f464ed564c8b8 100644--- a/dist/components/ImageItem/ImageItem.android.js+++ b/dist/components/ImageItem/ImageItem.android.js@@ -6,17 +6,17 @@@@ -72,7 +72,7 @@ index 5fcaa9f9a7d893817fee89b85186ee3936118e69..3effe838fa54495d165b81cc7501e72d*/import React, { useCallback, useRef, useState } from "react";-import { Animated, ScrollView, Dimensions, StyleSheet, } from "react-native";-+import { Animated, ScrollView, Dimensions, } from "react-native";++import { Animated, ScrollView, Dimensions, View, } from "react-native";import useImageDimensions from "../../hooks/useImageDimensions";import usePanResponder from "../../hooks/usePanResponder";import { getImageStyles, getImageTransform } from "../../utils";@@ -102,7 +102,7 @@ index 5fcaa9f9a7d893817fee89b85186ee3936118e69..3effe838fa54495d165b81cc7501e72dconst onLongPressHandler = useCallback(() => {onLongPress(imageSrc);}, [imageSrc, onLongPress]);-@@ -64,7 +64,7 @@ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPre+@@ -64,21 +64,15 @@ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPreconst offsetY = (_c = (_b = (_a = nativeEvent) === null || _a === void 0 ? void 0 : _a.contentOffset) === null || _b === void 0 ? void 0 : _b.y, (_c !== null && _c !== void 0 ? _c : 0));scrollValueY.setValue(offsetY);};@@ -111,8 +111,13 @@ index 5fcaa9f9a7d893817fee89b85186ee3936118e69..3effe838fa54495d165b81cc7501e72donScroll,onScrollEndDrag,})}>-@@ -72,13 +72,4 @@ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPre- {(!isLoaded || !imageDimensions) && <ImageLoading />}+- <Animated.Image {...panHandlers} source={imageSrc} style={imageStylesWithOpacity} onLoad={onLoaded}/>+- {(!isLoaded || !imageDimensions) && <ImageLoading />}++ {/* Pinch from anywhere on screen, not only on the fitted image. */}++ <View {...panHandlers} pointerEvents={isLoaded && imageDimensions ? "auto" : "none"} style={{ width: SCREEN_WIDTH, height: SCREEN_HEIGHT }}>++ <Animated.Image source={imageSrc} style={imageStylesWithOpacity} onLoad={onLoaded}/>++ {(!isLoaded || !imageDimensions) && <ImageLoading />}++ </View></ScrollView>);};-const styles = StyleSheet.create({@@ -254,7 +259,7 @@ index cb5f0f798e5cfeedf459b7d22e92871db3092020..97ca2c9c326b1c53e6a5d90c3bb95d53};export default useImageIndexChange;diff --git a/dist/hooks/usePanResponder.js b/dist/hooks/usePanResponder.js-index 99dcbc7efea4eba86a8bc2bad71dde73c8ebf1b4..3a374c0923879548ec3826a78be16f79c6e01432 100644+index 99dcbc7efea4eba86a8bc2bad71dde73c8ebf1b4..7a7601eef4d330448d876b6460f53bd518a2c18c 100644--- a/dist/hooks/usePanResponder.js+++ b/dist/hooks/usePanResponder.js@@ -8,14 +8,14 @@diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 97a49014763..71ad239cc0d 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -383,7 +383,7 @@ patchedDependencies:[email protected]: cb79edde7eca83bbcaaafb6ceb7b044b81b987314cde4910823b15257ecada67[email protected]: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651[email protected]: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626- [email protected]: 419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf+ [email protected]: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d[email protected]: 6eb6c847ac693b636ec97c83575acd44b77e92ad0d2c776de0cb4e78e8fb9d4f[email protected]: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760[email protected]: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59@@ -742,7 +742,7 @@ importers:version: 3.3.0(patch_hash=abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626)([email protected](@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])react-native-image-viewing:specifier: 0.2.2- version: 0.2.2(patch_hash=419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf)([email protected](@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])+ version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)([email protected](@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])react-native-keyboard-controller:specifier: 1.22.8version: 1.22.8(patch_hash=6eb6c847ac693b636ec97c83575acd44b77e92ad0d2c776de0cb4e78e8fb9d4f)(e2a826d844fe10cdcbda558127861778)@@ -20976,7 +20976,7 @@ snapshots:react: 19.3.0react-native: 0.88.0(@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected])- [email protected](patch_hash=419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf)([email protected](@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]):+ [email protected](patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)([email protected](@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]):dependencies:react: 19.3.0react-native: 0.88.0(@babel/[email protected]([email protected]))(@react-native/[email protected](@babel/[email protected]([email protected]))([email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected])