@chem-po/react-native 0.0.22 → 0.0.24
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/lib/commonjs/components/form/input/file/index.js +3 -1
- package/lib/commonjs/components/form/input/file/index.js.map +1 -1
- package/lib/commonjs/components/image/ImageViewModal.js +285 -0
- package/lib/commonjs/components/image/ImageViewModal.js.map +1 -0
- package/lib/commonjs/components/image/index.js +17 -0
- package/lib/commonjs/components/image/index.js.map +1 -0
- package/lib/commonjs/components/index.js +8 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/loading/LoadingImage.js +11 -6
- package/lib/commonjs/components/loading/LoadingImage.js.map +1 -1
- package/lib/module/components/form/input/file/index.js +3 -1
- package/lib/module/components/form/input/file/index.js.map +1 -1
- package/lib/module/components/image/ImageViewModal.js +277 -0
- package/lib/module/components/image/ImageViewModal.js.map +1 -0
- package/lib/module/components/image/index.js +2 -0
- package/lib/module/components/image/index.js.map +1 -0
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/loading/LoadingImage.js +11 -6
- package/lib/module/components/loading/LoadingImage.js.map +1 -1
- package/lib/typescript/components/form/input/file/index.d.ts +2 -1
- package/lib/typescript/components/form/input/file/index.d.ts.map +1 -1
- package/lib/typescript/components/image/ImageViewModal.d.ts +9 -0
- package/lib/typescript/components/image/ImageViewModal.d.ts.map +1 -0
- package/lib/typescript/components/image/index.d.ts +2 -0
- package/lib/typescript/components/image/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +1 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/loading/LoadingImage.d.ts +2 -2
- package/lib/typescript/components/loading/LoadingImage.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/form/input/file/index.tsx +3 -0
- package/src/components/image/ImageViewModal.tsx +261 -0
- package/src/components/image/index.ts +1 -0
- package/src/components/index.ts +1 -1
- package/src/components/loading/LoadingImage.tsx +10 -6
- package/lib/commonjs/components/overlay/ImageViewOverlay.js +0 -127
- package/lib/commonjs/components/overlay/ImageViewOverlay.js.map +0 -1
- package/lib/commonjs/components/overlay/index.js +0 -17
- package/lib/commonjs/components/overlay/index.js.map +0 -1
- package/lib/module/components/overlay/ImageViewOverlay.js +0 -119
- package/lib/module/components/overlay/ImageViewOverlay.js.map +0 -1
- package/lib/module/components/overlay/index.js +0 -2
- package/lib/module/components/overlay/index.js.map +0 -1
- package/lib/typescript/components/overlay/ImageViewOverlay.d.ts +0 -6
- package/lib/typescript/components/overlay/ImageViewOverlay.d.ts.map +0 -1
- package/lib/typescript/components/overlay/index.d.ts +0 -2
- package/lib/typescript/components/overlay/index.d.ts.map +0 -1
- package/src/components/overlay/ImageViewOverlay.tsx +0 -104
- package/src/components/overlay/index.ts +0 -1
|
@@ -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.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.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,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E;EACd,CAAC;EACDP,gBAAgB,EAAE;IAChB,GAAGpG,UAAU,CAACyG,kBAAkB;IAChCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/image/index.ts"],"mappings":"AAAA,cAAc,kBAAkB","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@ export * from './box';
|
|
|
2
2
|
export * from './button';
|
|
3
3
|
export * from './feed';
|
|
4
4
|
export * from './form';
|
|
5
|
+
export * from './image';
|
|
5
6
|
export * from './loading';
|
|
6
|
-
export * from './overlay';
|
|
7
7
|
export * from './text';
|
|
8
8
|
export * from './theme';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":"AAAA,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":"AAAA,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,SAAS","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { useMounted } from '@chem-po/react';
|
|
|
2
2
|
import { Ionicons } from '@expo/vector-icons';
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { Image, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
5
|
-
import {
|
|
5
|
+
import { ImageViewModal } from '../image/ImageViewModal';
|
|
6
6
|
import { LoadingLogo } from './Loading';
|
|
7
7
|
const emptyPng = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=';
|
|
8
8
|
export const LoadingImage = ({
|
|
@@ -11,7 +11,7 @@ export const LoadingImage = ({
|
|
|
11
11
|
onLoad,
|
|
12
12
|
width,
|
|
13
13
|
height,
|
|
14
|
-
|
|
14
|
+
withFullView,
|
|
15
15
|
buttonFullView,
|
|
16
16
|
style
|
|
17
17
|
}) => {
|
|
@@ -47,10 +47,13 @@ export const LoadingImage = ({
|
|
|
47
47
|
height: height ?? '100%',
|
|
48
48
|
opacity: mounted ? 1 : 0
|
|
49
49
|
}, style]
|
|
50
|
-
},
|
|
50
|
+
}, !withFullView || buttonFullView ? ImageComponent : /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
51
51
|
activeOpacity: 0.9,
|
|
52
52
|
onPress: () => setViewing(true),
|
|
53
|
-
style:
|
|
53
|
+
style: {
|
|
54
|
+
width: width ? undefined : '100%',
|
|
55
|
+
height: height ? undefined : '100%'
|
|
56
|
+
}
|
|
54
57
|
}, ImageComponent), buttonFullView && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
55
58
|
style: styles.fullViewButton,
|
|
56
59
|
onPress: () => setViewing(true),
|
|
@@ -62,12 +65,14 @@ export const LoadingImage = ({
|
|
|
62
65
|
style: styles.fullViewIcon
|
|
63
66
|
})), /*#__PURE__*/React.createElement(View, {
|
|
64
67
|
style: [styles.loadingContainer, {
|
|
65
|
-
opacity: loading ? 1 : 0
|
|
68
|
+
opacity: loading ? 1 : 0,
|
|
69
|
+
pointerEvents: loading ? 'auto' : 'none'
|
|
66
70
|
}]
|
|
67
71
|
}, /*#__PURE__*/React.createElement(LoadingLogo, {
|
|
68
72
|
isLoading: loading,
|
|
69
73
|
size: 10
|
|
70
|
-
})), viewing && /*#__PURE__*/React.createElement(
|
|
74
|
+
})), viewing && /*#__PURE__*/React.createElement(ImageViewModal, {
|
|
75
|
+
isOpen: true,
|
|
71
76
|
src: src ?? emptyPng,
|
|
72
77
|
onClose: () => setViewing(false)
|
|
73
78
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMounted","Ionicons","React","useCallback","useEffect","useMemo","useRef","useState","Image","StyleSheet","TouchableOpacity","View","
|
|
1
|
+
{"version":3,"names":["useMounted","Ionicons","React","useCallback","useEffect","useMemo","useRef","useState","Image","StyleSheet","TouchableOpacity","View","ImageViewModal","LoadingLogo","emptyPng","LoadingImage","src","loadingOverride","onLoad","width","height","withFullView","buttonFullView","style","imageLoading","setImageLoading","imageRef","viewing","setViewing","mounted","handleImageLoad","e","prevSrc","setPrevSrc","loading","ImageComponent","createElement","ref","source","uri","styles","image","opacity","onLoadEnd","resizeMode","container","activeOpacity","onPress","undefined","fullViewButton","name","size","color","fullViewIcon","loadingContainer","pointerEvents","isLoading","isOpen","onClose","create","overflow","position","imageContainer","absoluteFillObject","justifyContent","alignItems","top","right","borderRadius","backgroundColor"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/loading/LoadingImage.tsx"],"mappings":"AAAA,SAASA,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChF,SAAyBC,KAAK,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAmB,cAAc;AACnG,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,WAAW,QAAQ,WAAW;AAavC,MAAMC,QAAQ,GACZ,oHAAoH;AAEtH,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAC3BC,GAAG;EACHC,eAAe;EACfC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC,YAAY;EACZC,cAAc;EACdC;AACiB,CAAC,KAAK;EACvB,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,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cAAc;IAAC6C,MAAM;IAACzC,GAAG,EAAEA,GAAG,IAAIF,QAAS;IAAC4C,OAAO,EAAEA,CAAA,KAAM9B,UAAU,CAAC,KAAK;EAAE,CAAE,CACxF,CAAC;AAEX,CAAC;AAED,MAAMY,MAAM,GAAG/B,UAAU,CAACkD,MAAM,CAAC;EAC/Bd,SAAS,EAAE;IACTe,QAAQ,EAAE,QAAQ;IAClBC,QAAQ,EAAE;EACZ,CAAC;EACDC,cAAc,EAAE;IACd3C,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDqB,KAAK,EAAE;IACLtB,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDkC,gBAAgB,EAAE;IAChB,GAAG7C,UAAU,CAACsD,kBAAkB;IAChCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDhB,cAAc,EAAE;IACdY,QAAQ,EAAE,UAAU;IACpBK,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRhD,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVgD,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,oBAAoB;IACrCL,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDZ,YAAY,EAAE;IACZX,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,10 +2,11 @@ import { FileValue, InputRef } from '@chem-po/core';
|
|
|
2
2
|
import { FileField } from '@chem-po/react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FieldProps } from '../../types';
|
|
5
|
-
export declare const FileView: ({ value, hasUpload, imageOptions, }: {
|
|
5
|
+
export declare const FileView: ({ value, hasUpload, imageOptions, withFullView, }: {
|
|
6
6
|
value?: FileValue | null;
|
|
7
7
|
hasUpload?: boolean;
|
|
8
8
|
imageOptions?: any;
|
|
9
|
+
withFullView?: boolean;
|
|
9
10
|
}) => React.JSX.Element;
|
|
10
11
|
export declare const FileComponent: React.ForwardRefExoticComponent<FieldProps<FileField> & React.RefAttributes<InputRef>>;
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/file/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAA;AACnE,OAAO,EACL,SAAS,EAMV,MAAM,gBAAgB,CAAA;AAIvB,OAAO,KAA0E,MAAM,OAAO,CAAA;AAG9F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA+BxC,eAAO,MAAM,QAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/input/file/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAA;AACnE,OAAO,EACL,SAAS,EAMV,MAAM,gBAAgB,CAAA;AAIvB,OAAO,KAA0E,MAAM,OAAO,CAAA;AAG9F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA+BxC,eAAO,MAAM,QAAQ,GAAI,mDAKtB;IACD,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,sBAgCA,CAAA;AAED,eAAO,MAAM,aAAa,wFA2FzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageViewModal.d.ts","sourceRoot":"","sources":["../../../../src/components/image/ImageViewModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAKrE,UAAU,mBAAmB;IAC3B,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4MxD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/image/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -2,8 +2,8 @@ export * from './box';
|
|
|
2
2
|
export * from './button';
|
|
3
3
|
export * from './feed';
|
|
4
4
|
export * from './form';
|
|
5
|
+
export * from './image';
|
|
5
6
|
export * from './loading';
|
|
6
|
-
export * from './overlay';
|
|
7
7
|
export * from './text';
|
|
8
8
|
export * from './theme';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
|
@@ -4,11 +4,11 @@ export interface LoadingImageProps {
|
|
|
4
4
|
src?: string | null;
|
|
5
5
|
loadingOverride?: boolean;
|
|
6
6
|
onLoad?: (e: any) => void;
|
|
7
|
-
|
|
7
|
+
withFullView?: boolean;
|
|
8
8
|
buttonFullView?: boolean;
|
|
9
9
|
style?: ViewStyle;
|
|
10
10
|
width?: DimensionValue;
|
|
11
11
|
height?: DimensionValue;
|
|
12
12
|
}
|
|
13
|
-
export declare const LoadingImage: ({ src, loadingOverride, onLoad, width, height,
|
|
13
|
+
export declare const LoadingImage: ({ src, loadingOverride, onLoad, width, height, withFullView, buttonFullView, style, }: LoadingImageProps) => React.JSX.Element;
|
|
14
14
|
//# sourceMappingURL=LoadingImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingImage.d.ts","sourceRoot":"","sources":["../../../../src/components/loading/LoadingImage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,cAAc,EAA6C,SAAS,EAAE,MAAM,cAAc,CAAA;AAInG,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IACzB,
|
|
1
|
+
{"version":3,"file":"LoadingImage.d.ts","sourceRoot":"","sources":["../../../../src/components/loading/LoadingImage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,cAAc,EAA6C,SAAS,EAAE,MAAM,cAAc,CAAA;AAInG,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAKD,eAAO,MAAM,YAAY,GAAI,uFAS1B,iBAAiB,sBAmFnB,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@chem-po/react-native",
|
|
3
3
|
"author": "Elan Canfield",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.24",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
8
|
"source": "src/index.ts",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"react-native-paper-dates": "^0.22.42",
|
|
50
50
|
"react-native-svg": "15.11.2",
|
|
51
51
|
"zustand": "^4.3.3",
|
|
52
|
-
"@chem-po/core": "0.0.
|
|
53
|
-
"@chem-po/react": "0.0.
|
|
52
|
+
"@chem-po/core": "0.0.24",
|
|
53
|
+
"@chem-po/react": "0.0.24"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/core": "^7.26.0",
|
|
@@ -48,10 +48,12 @@ export const FileView = ({
|
|
|
48
48
|
value,
|
|
49
49
|
hasUpload,
|
|
50
50
|
imageOptions,
|
|
51
|
+
withFullView,
|
|
51
52
|
}: {
|
|
52
53
|
value?: FileValue | null
|
|
53
54
|
hasUpload?: boolean
|
|
54
55
|
imageOptions?: any
|
|
56
|
+
withFullView?: boolean
|
|
55
57
|
}) => {
|
|
56
58
|
const { storagePath, dataUrl } = value ?? {}
|
|
57
59
|
const missingFile = !dataUrl && !storagePath
|
|
@@ -72,6 +74,7 @@ export const FileView = ({
|
|
|
72
74
|
loadingOverride={loading}
|
|
73
75
|
width={imageOptions?.width ?? 120}
|
|
74
76
|
height={imageOptions?.height ?? 120}
|
|
77
|
+
withFullView={withFullView}
|
|
75
78
|
style={styles.image}
|
|
76
79
|
/>
|
|
77
80
|
)
|