@chem-po/react-native 0.0.24 → 0.0.25

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.
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ImageViewModal = void 0;
7
+ var _react = require("@chem-po/react");
8
+ var _vectorIcons = require("@expo/vector-icons");
9
+ var _react2 = _interopRequireWildcard(require("react"));
10
+ var _reactNative = require("react-native");
11
+ var _reactNativeGestureHandler = require("react-native-gesture-handler");
12
+ var _Loading = require("../loading/Loading");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ const ImageViewModal = ({
15
+ isOpen,
16
+ onClose,
17
+ src
18
+ }) => {
19
+ const [loading, setLoading] = (0, _react2.useState)(true);
20
+ const screenWidth = (0, _react.useScreen)(s => s.width);
21
+ const screenHeight = (0, _react.useScreen)(s => s.height);
22
+ const [imageSize, setImageSize] = (0, _react2.useState)({
23
+ width: screenWidth / 2,
24
+ height: screenHeight / 2
25
+ });
26
+
27
+ // Animated values for zoom and pan
28
+ const scale = (0, _react2.useRef)(new _reactNative.Animated.Value(1)).current;
29
+ const translateX = (0, _react2.useRef)(new _reactNative.Animated.Value(0)).current;
30
+ const translateY = (0, _react2.useRef)(new _reactNative.Animated.Value(0)).current;
31
+
32
+ // Gesture state
33
+ const savedScale = (0, _react2.useRef)(1);
34
+ const savedTranslateX = (0, _react2.useRef)(0);
35
+ const savedTranslateY = (0, _react2.useRef)(0);
36
+ const currentScale = (0, _react2.useRef)(1);
37
+ const currentTranslateX = (0, _react2.useRef)(0);
38
+ const currentTranslateY = (0, _react2.useRef)(0);
39
+ const {
40
+ height,
41
+ width
42
+ } = (0, _react2.useMemo)(() => {
43
+ if (loading) return imageSize;
44
+ const ratio = imageSize.width / imageSize.height;
45
+ let h = Math.min(imageSize.height, screenHeight * 0.9);
46
+ let w = h * ratio;
47
+ if (w > screenWidth * 0.9) {
48
+ w = Math.min(imageSize.width, screenWidth * 0.9);
49
+ h = w / ratio;
50
+ }
51
+ return {
52
+ height: h,
53
+ width: w
54
+ };
55
+ }, [screenHeight, screenWidth, imageSize, loading]);
56
+ const onLoadStart = (0, _react2.useCallback)(() => setLoading(true), []);
57
+ const onLoad = (0, _react2.useCallback)(e => {
58
+ const {
59
+ width: naturalWidth,
60
+ height: naturalHeight
61
+ } = e.nativeEvent.source;
62
+ setImageSize({
63
+ width: naturalWidth,
64
+ height: naturalHeight
65
+ });
66
+ setLoading(false);
67
+ }, []);
68
+
69
+ // Reset zoom and pan when modal opens/closes
70
+ const resetTransform = (0, _react2.useCallback)(() => {
71
+ scale.setValue(1);
72
+ translateX.setValue(0);
73
+ translateY.setValue(0);
74
+ savedScale.current = 1;
75
+ savedTranslateX.current = 0;
76
+ savedTranslateY.current = 0;
77
+ currentScale.current = 1;
78
+ currentTranslateX.current = 0;
79
+ currentTranslateY.current = 0;
80
+ }, [scale, translateX, translateY]);
81
+
82
+ // Reset when modal closes or src changes
83
+ _react2.default.useEffect(() => {
84
+ if (!isOpen || !src) {
85
+ resetTransform();
86
+ }
87
+ }, [isOpen, src, resetTransform]);
88
+
89
+ // Pan gesture
90
+ const panGesture = _reactNativeGestureHandler.Gesture.Pan().onUpdate(event => {
91
+ // Only allow panning if zoomed in
92
+ if (savedScale.current > 1) {
93
+ const newTranslateX = savedTranslateX.current + event.translationX;
94
+ const newTranslateY = savedTranslateY.current + event.translationY;
95
+
96
+ // Calculate bounds to prevent panning too far
97
+ const maxTranslateX = (width * savedScale.current - width) / 2;
98
+ const maxTranslateY = (height * savedScale.current - height) / 2;
99
+ const boundedTranslateX = Math.max(-maxTranslateX, Math.min(maxTranslateX, newTranslateX));
100
+ const boundedTranslateY = Math.max(-maxTranslateY, Math.min(maxTranslateY, newTranslateY));
101
+ translateX.setValue(boundedTranslateX);
102
+ translateY.setValue(boundedTranslateY);
103
+ currentTranslateX.current = boundedTranslateX;
104
+ currentTranslateY.current = boundedTranslateY;
105
+ }
106
+ }).onEnd(() => {
107
+ savedTranslateX.current = currentTranslateX.current;
108
+ savedTranslateY.current = currentTranslateY.current;
109
+ });
110
+
111
+ // Pinch gesture
112
+ const pinchGesture = _reactNativeGestureHandler.Gesture.Pinch().onUpdate(event => {
113
+ const newScale = savedScale.current * event.scale;
114
+ // Limit zoom between 1x and 5x
115
+ const boundedScale = Math.max(1, Math.min(5, newScale));
116
+ scale.setValue(boundedScale);
117
+ currentScale.current = boundedScale;
118
+
119
+ // If zooming out to 1x, reset position
120
+ if (boundedScale <= 1) {
121
+ translateX.setValue(0);
122
+ translateY.setValue(0);
123
+ currentTranslateX.current = 0;
124
+ currentTranslateY.current = 0;
125
+ }
126
+ }).onEnd(() => {
127
+ savedScale.current = currentScale.current;
128
+ // If scale is close to 1, snap back to 1
129
+ if (savedScale.current < 1.1) {
130
+ _reactNative.Animated.parallel([_reactNative.Animated.spring(scale, {
131
+ toValue: 1,
132
+ useNativeDriver: true
133
+ }), _reactNative.Animated.spring(translateX, {
134
+ toValue: 0,
135
+ useNativeDriver: true
136
+ }), _reactNative.Animated.spring(translateY, {
137
+ toValue: 0,
138
+ useNativeDriver: true
139
+ })]).start();
140
+ savedScale.current = 1;
141
+ savedTranslateX.current = 0;
142
+ savedTranslateY.current = 0;
143
+ currentScale.current = 1;
144
+ currentTranslateX.current = 0;
145
+ currentTranslateY.current = 0;
146
+ } else {
147
+ savedTranslateX.current = currentTranslateX.current;
148
+ savedTranslateY.current = currentTranslateY.current;
149
+ }
150
+ });
151
+
152
+ // Double tap to zoom
153
+ const doubleTapGesture = _reactNativeGestureHandler.Gesture.Tap().numberOfTaps(2).onEnd(() => {
154
+ if (savedScale.current > 1) {
155
+ // Zoom out
156
+ _reactNative.Animated.parallel([_reactNative.Animated.spring(scale, {
157
+ toValue: 1,
158
+ useNativeDriver: true
159
+ }), _reactNative.Animated.spring(translateX, {
160
+ toValue: 0,
161
+ useNativeDriver: true
162
+ }), _reactNative.Animated.spring(translateY, {
163
+ toValue: 0,
164
+ useNativeDriver: true
165
+ })]).start();
166
+ savedScale.current = 1;
167
+ savedTranslateX.current = 0;
168
+ savedTranslateY.current = 0;
169
+ currentScale.current = 1;
170
+ currentTranslateX.current = 0;
171
+ currentTranslateY.current = 0;
172
+ } else {
173
+ // Zoom in to 2x
174
+ _reactNative.Animated.spring(scale, {
175
+ toValue: 2,
176
+ useNativeDriver: true
177
+ }).start();
178
+ savedScale.current = 2;
179
+ currentScale.current = 2;
180
+ }
181
+ });
182
+
183
+ // Test simple single tap gesture
184
+
185
+ // Combine gestures - simplified approach
186
+ const combinedGestures = _reactNativeGestureHandler.Gesture.Race(doubleTapGesture, _reactNativeGestureHandler.Gesture.Simultaneous(panGesture, pinchGesture));
187
+ if (!isOpen) {
188
+ return null;
189
+ }
190
+ return /*#__PURE__*/_react2.default.createElement(_reactNative.Modal, {
191
+ visible: isOpen,
192
+ transparent: true,
193
+ animationType: "fade",
194
+ onRequestClose: onClose
195
+ }, /*#__PURE__*/_react2.default.createElement(_reactNativeGestureHandler.GestureHandlerRootView, {
196
+ style: styles.gestureRoot
197
+ }, /*#__PURE__*/_react2.default.createElement(_reactNative.View, {
198
+ style: styles.modalOverlay
199
+ }, /*#__PURE__*/_react2.default.createElement(_reactNative.TouchableOpacity, {
200
+ style: styles.backgroundTouchable,
201
+ activeOpacity: 1,
202
+ onPress: onClose
203
+ }), /*#__PURE__*/_react2.default.createElement(_reactNative.View, {
204
+ style: styles.contentContainer
205
+ }, /*#__PURE__*/_react2.default.createElement(_reactNativeGestureHandler.GestureDetector, {
206
+ gesture: combinedGestures
207
+ }, /*#__PURE__*/_react2.default.createElement(_reactNative.Animated.View, {
208
+ style: [styles.imageContainer, {
209
+ width,
210
+ height,
211
+ opacity: loading ? 0 : 1,
212
+ transform: [{
213
+ scale
214
+ }, {
215
+ translateX
216
+ }, {
217
+ translateY
218
+ }]
219
+ }]
220
+ }, /*#__PURE__*/_react2.default.createElement(_reactNative.Image, {
221
+ source: src ? {
222
+ uri: src
223
+ } : undefined,
224
+ style: styles.image,
225
+ onLoadStart: onLoadStart,
226
+ onLoad: onLoad,
227
+ resizeMode: "contain"
228
+ }))), /*#__PURE__*/_react2.default.createElement(_reactNative.TouchableOpacity, {
229
+ style: styles.closeButton,
230
+ onPress: onClose
231
+ }, /*#__PURE__*/_react2.default.createElement(_vectorIcons.Ionicons, {
232
+ name: "close",
233
+ size: 24,
234
+ color: "white"
235
+ })), loading || !src ? /*#__PURE__*/_react2.default.createElement(_reactNative.View, {
236
+ style: styles.loadingContainer
237
+ }, /*#__PURE__*/_react2.default.createElement(_Loading.LoadingLogo, {
238
+ isLoading: loading,
239
+ size: 70
240
+ })) : null))));
241
+ };
242
+ exports.ImageViewModal = ImageViewModal;
243
+ const styles = _reactNative.StyleSheet.create({
244
+ gestureRoot: {
245
+ flex: 1
246
+ },
247
+ modalOverlay: {
248
+ flex: 1,
249
+ backgroundColor: 'rgba(0, 0, 0, 0.7)'
250
+ },
251
+ backgroundTouchable: {
252
+ ..._reactNative.StyleSheet.absoluteFillObject
253
+ },
254
+ contentContainer: {
255
+ flex: 1,
256
+ justifyContent: 'center',
257
+ alignItems: 'center',
258
+ padding: 16
259
+ },
260
+ imageContainer: {
261
+ overflow: 'hidden',
262
+ borderRadius: 4
263
+ },
264
+ image: {
265
+ width: '100%',
266
+ height: '100%'
267
+ },
268
+ closeButton: {
269
+ position: 'absolute',
270
+ top: 16,
271
+ right: 16,
272
+ width: 40,
273
+ height: 40,
274
+ borderRadius: 20,
275
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
276
+ justifyContent: 'center',
277
+ alignItems: 'center'
278
+ },
279
+ loadingContainer: {
280
+ ..._reactNative.StyleSheet.absoluteFillObject,
281
+ justifyContent: 'center',
282
+ alignItems: 'center'
283
+ }
284
+ });
285
+ //# sourceMappingURL=ImageViewModal.old.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_vectorIcons","_react2","_interopRequireWildcard","_reactNative","_reactNativeGestureHandler","_Loading","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ImageViewModal","isOpen","onClose","src","loading","setLoading","useState","screenWidth","useScreen","s","width","screenHeight","height","imageSize","setImageSize","scale","useRef","Animated","Value","current","translateX","translateY","savedScale","savedTranslateX","savedTranslateY","currentScale","currentTranslateX","currentTranslateY","useMemo","ratio","h","Math","min","w","onLoadStart","useCallback","onLoad","naturalWidth","naturalHeight","nativeEvent","source","resetTransform","setValue","React","useEffect","panGesture","Gesture","Pan","onUpdate","event","newTranslateX","translationX","newTranslateY","translationY","maxTranslateX","maxTranslateY","boundedTranslateX","max","boundedTranslateY","onEnd","pinchGesture","Pinch","newScale","boundedScale","parallel","spring","toValue","useNativeDriver","start","doubleTapGesture","Tap","numberOfTaps","combinedGestures","Race","Simultaneous","createElement","Modal","visible","transparent","animationType","onRequestClose","GestureHandlerRootView","style","styles","gestureRoot","View","modalOverlay","TouchableOpacity","backgroundTouchable","activeOpacity","onPress","contentContainer","GestureDetector","gesture","imageContainer","opacity","transform","Image","uri","undefined","image","resizeMode","closeButton","Ionicons","name","size","color","loadingContainer","LoadingLogo","isLoading","exports","StyleSheet","create","flex","backgroundColor","absoluteFillObject","justifyContent","alignItems","padding","overflow","borderRadius","position","top","right"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/image/ImageViewModal.old.tsx"],"mappings":";;;;;;A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AE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,277 @@
1
+ import { useScreen } from '@chem-po/react';
2
+ import { Ionicons } from '@expo/vector-icons';
3
+ import React, { useCallback, useMemo, useRef, useState } from 'react';
4
+ import { Animated, Image, Modal, StyleSheet, TouchableOpacity, View } from 'react-native';
5
+ import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
6
+ import { LoadingLogo } from '../loading/Loading';
7
+ export const ImageViewModal = ({
8
+ isOpen,
9
+ onClose,
10
+ src
11
+ }) => {
12
+ const [loading, setLoading] = useState(true);
13
+ const screenWidth = useScreen(s => s.width);
14
+ const screenHeight = useScreen(s => s.height);
15
+ const [imageSize, setImageSize] = useState({
16
+ width: screenWidth / 2,
17
+ height: screenHeight / 2
18
+ });
19
+
20
+ // Animated values for zoom and pan
21
+ const scale = useRef(new Animated.Value(1)).current;
22
+ const translateX = useRef(new Animated.Value(0)).current;
23
+ const translateY = useRef(new Animated.Value(0)).current;
24
+
25
+ // Gesture state
26
+ const savedScale = useRef(1);
27
+ const savedTranslateX = useRef(0);
28
+ const savedTranslateY = useRef(0);
29
+ const currentScale = useRef(1);
30
+ const currentTranslateX = useRef(0);
31
+ const currentTranslateY = useRef(0);
32
+ const {
33
+ height,
34
+ width
35
+ } = useMemo(() => {
36
+ if (loading) return imageSize;
37
+ const ratio = imageSize.width / imageSize.height;
38
+ let h = Math.min(imageSize.height, screenHeight * 0.9);
39
+ let w = h * ratio;
40
+ if (w > screenWidth * 0.9) {
41
+ w = Math.min(imageSize.width, screenWidth * 0.9);
42
+ h = w / ratio;
43
+ }
44
+ return {
45
+ height: h,
46
+ width: w
47
+ };
48
+ }, [screenHeight, screenWidth, imageSize, loading]);
49
+ const onLoadStart = useCallback(() => setLoading(true), []);
50
+ const onLoad = useCallback(e => {
51
+ const {
52
+ width: naturalWidth,
53
+ height: naturalHeight
54
+ } = e.nativeEvent.source;
55
+ setImageSize({
56
+ width: naturalWidth,
57
+ height: naturalHeight
58
+ });
59
+ setLoading(false);
60
+ }, []);
61
+
62
+ // Reset zoom and pan when modal opens/closes
63
+ const resetTransform = useCallback(() => {
64
+ scale.setValue(1);
65
+ translateX.setValue(0);
66
+ translateY.setValue(0);
67
+ savedScale.current = 1;
68
+ savedTranslateX.current = 0;
69
+ savedTranslateY.current = 0;
70
+ currentScale.current = 1;
71
+ currentTranslateX.current = 0;
72
+ currentTranslateY.current = 0;
73
+ }, [scale, translateX, translateY]);
74
+
75
+ // Reset when modal closes or src changes
76
+ React.useEffect(() => {
77
+ if (!isOpen || !src) {
78
+ resetTransform();
79
+ }
80
+ }, [isOpen, src, resetTransform]);
81
+
82
+ // Pan gesture
83
+ const panGesture = Gesture.Pan().onUpdate(event => {
84
+ // Only allow panning if zoomed in
85
+ if (savedScale.current > 1) {
86
+ const newTranslateX = savedTranslateX.current + event.translationX;
87
+ const newTranslateY = savedTranslateY.current + event.translationY;
88
+
89
+ // Calculate bounds to prevent panning too far
90
+ const maxTranslateX = (width * savedScale.current - width) / 2;
91
+ const maxTranslateY = (height * savedScale.current - height) / 2;
92
+ const boundedTranslateX = Math.max(-maxTranslateX, Math.min(maxTranslateX, newTranslateX));
93
+ const boundedTranslateY = Math.max(-maxTranslateY, Math.min(maxTranslateY, newTranslateY));
94
+ translateX.setValue(boundedTranslateX);
95
+ translateY.setValue(boundedTranslateY);
96
+ currentTranslateX.current = boundedTranslateX;
97
+ currentTranslateY.current = boundedTranslateY;
98
+ }
99
+ }).onEnd(() => {
100
+ savedTranslateX.current = currentTranslateX.current;
101
+ savedTranslateY.current = currentTranslateY.current;
102
+ });
103
+
104
+ // Pinch gesture
105
+ const pinchGesture = Gesture.Pinch().onUpdate(event => {
106
+ const newScale = savedScale.current * event.scale;
107
+ // Limit zoom between 1x and 5x
108
+ const boundedScale = Math.max(1, Math.min(5, newScale));
109
+ scale.setValue(boundedScale);
110
+ currentScale.current = boundedScale;
111
+
112
+ // If zooming out to 1x, reset position
113
+ if (boundedScale <= 1) {
114
+ translateX.setValue(0);
115
+ translateY.setValue(0);
116
+ currentTranslateX.current = 0;
117
+ currentTranslateY.current = 0;
118
+ }
119
+ }).onEnd(() => {
120
+ savedScale.current = currentScale.current;
121
+ // If scale is close to 1, snap back to 1
122
+ if (savedScale.current < 1.1) {
123
+ Animated.parallel([Animated.spring(scale, {
124
+ toValue: 1,
125
+ useNativeDriver: true
126
+ }), Animated.spring(translateX, {
127
+ toValue: 0,
128
+ useNativeDriver: true
129
+ }), Animated.spring(translateY, {
130
+ toValue: 0,
131
+ useNativeDriver: true
132
+ })]).start();
133
+ savedScale.current = 1;
134
+ savedTranslateX.current = 0;
135
+ savedTranslateY.current = 0;
136
+ currentScale.current = 1;
137
+ currentTranslateX.current = 0;
138
+ currentTranslateY.current = 0;
139
+ } else {
140
+ savedTranslateX.current = currentTranslateX.current;
141
+ savedTranslateY.current = currentTranslateY.current;
142
+ }
143
+ });
144
+
145
+ // Double tap to zoom
146
+ const doubleTapGesture = Gesture.Tap().numberOfTaps(2).onEnd(() => {
147
+ if (savedScale.current > 1) {
148
+ // Zoom out
149
+ Animated.parallel([Animated.spring(scale, {
150
+ toValue: 1,
151
+ useNativeDriver: true
152
+ }), Animated.spring(translateX, {
153
+ toValue: 0,
154
+ useNativeDriver: true
155
+ }), Animated.spring(translateY, {
156
+ toValue: 0,
157
+ useNativeDriver: true
158
+ })]).start();
159
+ savedScale.current = 1;
160
+ savedTranslateX.current = 0;
161
+ savedTranslateY.current = 0;
162
+ currentScale.current = 1;
163
+ currentTranslateX.current = 0;
164
+ currentTranslateY.current = 0;
165
+ } else {
166
+ // Zoom in to 2x
167
+ Animated.spring(scale, {
168
+ toValue: 2,
169
+ useNativeDriver: true
170
+ }).start();
171
+ savedScale.current = 2;
172
+ currentScale.current = 2;
173
+ }
174
+ });
175
+
176
+ // Test simple single tap gesture
177
+
178
+ // Combine gestures - simplified approach
179
+ const combinedGestures = Gesture.Race(doubleTapGesture, Gesture.Simultaneous(panGesture, pinchGesture));
180
+ if (!isOpen) {
181
+ return null;
182
+ }
183
+ return /*#__PURE__*/React.createElement(Modal, {
184
+ visible: isOpen,
185
+ transparent: true,
186
+ animationType: "fade",
187
+ onRequestClose: onClose
188
+ }, /*#__PURE__*/React.createElement(GestureHandlerRootView, {
189
+ style: styles.gestureRoot
190
+ }, /*#__PURE__*/React.createElement(View, {
191
+ style: styles.modalOverlay
192
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
193
+ style: styles.backgroundTouchable,
194
+ activeOpacity: 1,
195
+ onPress: onClose
196
+ }), /*#__PURE__*/React.createElement(View, {
197
+ style: styles.contentContainer
198
+ }, /*#__PURE__*/React.createElement(GestureDetector, {
199
+ gesture: combinedGestures
200
+ }, /*#__PURE__*/React.createElement(Animated.View, {
201
+ style: [styles.imageContainer, {
202
+ width,
203
+ height,
204
+ opacity: loading ? 0 : 1,
205
+ transform: [{
206
+ scale
207
+ }, {
208
+ translateX
209
+ }, {
210
+ translateY
211
+ }]
212
+ }]
213
+ }, /*#__PURE__*/React.createElement(Image, {
214
+ source: src ? {
215
+ uri: src
216
+ } : undefined,
217
+ style: styles.image,
218
+ onLoadStart: onLoadStart,
219
+ onLoad: onLoad,
220
+ resizeMode: "contain"
221
+ }))), /*#__PURE__*/React.createElement(TouchableOpacity, {
222
+ style: styles.closeButton,
223
+ onPress: onClose
224
+ }, /*#__PURE__*/React.createElement(Ionicons, {
225
+ name: "close",
226
+ size: 24,
227
+ color: "white"
228
+ })), loading || !src ? /*#__PURE__*/React.createElement(View, {
229
+ style: styles.loadingContainer
230
+ }, /*#__PURE__*/React.createElement(LoadingLogo, {
231
+ isLoading: loading,
232
+ size: 70
233
+ })) : null))));
234
+ };
235
+ const styles = StyleSheet.create({
236
+ gestureRoot: {
237
+ flex: 1
238
+ },
239
+ modalOverlay: {
240
+ flex: 1,
241
+ backgroundColor: 'rgba(0, 0, 0, 0.7)'
242
+ },
243
+ backgroundTouchable: {
244
+ ...StyleSheet.absoluteFillObject
245
+ },
246
+ contentContainer: {
247
+ flex: 1,
248
+ justifyContent: 'center',
249
+ alignItems: 'center',
250
+ padding: 16
251
+ },
252
+ imageContainer: {
253
+ overflow: 'hidden',
254
+ borderRadius: 4
255
+ },
256
+ image: {
257
+ width: '100%',
258
+ height: '100%'
259
+ },
260
+ closeButton: {
261
+ position: 'absolute',
262
+ top: 16,
263
+ right: 16,
264
+ width: 40,
265
+ height: 40,
266
+ borderRadius: 20,
267
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
268
+ justifyContent: 'center',
269
+ alignItems: 'center'
270
+ },
271
+ loadingContainer: {
272
+ ...StyleSheet.absoluteFillObject,
273
+ justifyContent: 'center',
274
+ alignItems: 'center'
275
+ }
276
+ });
277
+ //# sourceMappingURL=ImageViewModal.backup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useScreen","Ionicons","React","useCallback","useMemo","useRef","useState","Animated","Image","Modal","StyleSheet","TouchableOpacity","View","Gesture","GestureDetector","GestureHandlerRootView","LoadingLogo","ImageViewModal","isOpen","onClose","src","loading","setLoading","screenWidth","s","width","screenHeight","height","imageSize","setImageSize","scale","Value","current","translateX","translateY","savedScale","savedTranslateX","savedTranslateY","currentScale","currentTranslateX","currentTranslateY","ratio","h","Math","min","w","onLoadStart","onLoad","e","naturalWidth","naturalHeight","nativeEvent","source","resetTransform","setValue","useEffect","panGesture","Pan","onUpdate","event","newTranslateX","translationX","newTranslateY","translationY","maxTranslateX","maxTranslateY","boundedTranslateX","max","boundedTranslateY","onEnd","pinchGesture","Pinch","newScale","boundedScale","parallel","spring","toValue","useNativeDriver","start","doubleTapGesture","Tap","numberOfTaps","combinedGestures","Race","Simultaneous","createElement","visible","transparent","animationType","onRequestClose","style","styles","gestureRoot","modalOverlay","backgroundTouchable","activeOpacity","onPress","contentContainer","gesture","imageContainer","opacity","transform","uri","undefined","image","resizeMode","closeButton","name","size","color","loadingContainer","isLoading","create","flex","backgroundColor","absoluteFillObject","justifyContent","alignItems","padding","overflow","borderRadius","position","top","right"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/image/ImageViewModal.backup.tsx"],"mappings":"AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAASC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACzF,SAASC,OAAO,EAAEC,eAAe,EAAEC,sBAAsB,QAAQ,8BAA8B;AAC/F,SAASC,WAAW,QAAQ,oBAAoB;AAQhD,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAI,CAAC,KAAK;EACzF,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGhB,QAAQ,CAAC,IAAI,CAAC;EAC5C,MAAMiB,WAAW,GAAGvB,SAAS,CAACwB,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;EAC3C,MAAMC,YAAY,GAAG1B,SAAS,CAACwB,CAAC,IAAIA,CAAC,CAACG,MAAM,CAAC;EAC7C,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGvB,QAAQ,CAAC;IAAEmB,KAAK,EAAEF,WAAW,GAAG,CAAC;IAAEI,MAAM,EAAED,YAAY,GAAG;EAAE,CAAC,CAAC;;EAEhG;EACA,MAAMI,KAAK,GAAGzB,MAAM,CAAC,IAAIE,QAAQ,CAACwB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACnD,MAAMC,UAAU,GAAG5B,MAAM,CAAC,IAAIE,QAAQ,CAACwB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACxD,MAAME,UAAU,GAAG7B,MAAM,CAAC,IAAIE,QAAQ,CAACwB,KAAK,CAAC,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