@supportworks/multi-imagepicker 8.4.7 → 8.4.9
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/package.json +2 -2
- package/src/components/CameraModal.tsx +25 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supportworks/multi-imagepicker",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.9",
|
|
4
4
|
"description": "Android and iOS customized multiple image picker. For react-native >= 0.60.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@supportworks/app-styler": ">=1.0.6",
|
|
20
20
|
"@supportworks/camera": ">=0.2.3",
|
|
21
21
|
"@supportworks/core-controls": ">=5.0.0",
|
|
22
|
-
"@supportworks/icon-library": ">=1.
|
|
22
|
+
"@supportworks/icon-library": ">=1.11.59",
|
|
23
23
|
"@supportworks/navbars": ">=3.0.0",
|
|
24
24
|
"expo-sensors": "*",
|
|
25
25
|
"@supportworks/swmaterialdesign": ">=1.1.3",
|
|
@@ -36,7 +36,6 @@ import {
|
|
|
36
36
|
Platform,
|
|
37
37
|
useWindowDimensions
|
|
38
38
|
} from 'react-native'
|
|
39
|
-
import Svg, { Path } from 'react-native-svg'
|
|
40
39
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
41
40
|
import { check, openSettings, PERMISSIONS, request, RESULTS } from 'react-native-permissions'
|
|
42
41
|
|
|
@@ -205,19 +204,6 @@ const buildZoomRangeForPosition = (cameras: CameraInfo[], position: 'front' | 'b
|
|
|
205
204
|
return { min: minZoom, max: maxZoom }
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
// Outlines from the camera icons in photos-upload_v2.1.sketch.
|
|
209
|
-
const FlipCameraIcon = ({ size = 24, color = colors.white }) => (
|
|
210
|
-
<Svg width={size} height={size} viewBox="0 0 24 24">
|
|
211
|
-
<Path fill={color} fillRule="evenodd" d="M20.0000 5.0000 L16.8300 5.0000 L15.0000 3.0000 L9.0000 3.0000 L7.1700 5.0000 L4.0000 5.0000 C2.9000 5.0000 2.0000 5.9000 2.0000 7.0000 L2.0000 19.0000 C2.0000 20.1000 2.9000 21.0000 4.0000 21.0000 L20.0000 21.0000 C21.1000 21.0000 22.0000 20.1000 22.0000 19.0000 L22.0000 7.0000 C22.0000 5.9000 21.1000 5.0000 20.0000 5.0000 Z M12.0000 18.0000 C9.2400 18.0000 7.0000 15.7600 7.0000 13.0000 L5.0000 13.0000 L7.5000 10.5000 L10.0000 13.0000 L8.0000 13.0000 C8.0000 15.2100 9.7900 17.0000 12.0000 17.0000 C12.5800 17.0000 13.1300 16.8700 13.6200 16.6500 L14.3600 17.3900 C13.6500 17.7600 12.8600 18.0000 12.0000 18.0000 Z M16.5000 15.5000 L14.0000 13.0000 L16.0000 13.0000 C16.0000 10.7900 14.2100 9.0000 12.0000 9.0000 C11.4200 9.0000 10.8700 9.1300 10.3800 9.3500 L9.6400 8.6200 C10.3500 8.2400 11.1400 8.0000 12.0000 8.0000 C14.7600 8.0000 17.0000 10.2400 17.0000 13.0000 L19.0000 13.0000 L16.5000 15.5000 Z" />
|
|
212
|
-
</Svg>
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
const FlashIcon = ({ enabled }: { enabled: boolean }) => (
|
|
216
|
-
<Svg width={24} height={24} viewBox="0 0 24 24">
|
|
217
|
-
<Path fill={colors.white} d={enabled ? 'M7 2v11h3v9l7-12h-4l4-8Z' : 'M17.0000 10.0000 L13.3900 10.0000 L15.6700 12.2800 L17.0000 10.0000 Z M17.0000 2.0000 L7.0000 2.0000 L7.0000 3.6100 L13.1300 9.7400 L17.0000 2.0000 Z M3.4100 2.8600 L2.0000 4.2700 L7.0000 9.2700 L7.0000 13.0000 L10.0000 13.0000 L10.0000 22.0000 L13.5800 15.8500 L17.7300 20.0000 L19.1400 18.5900 L3.4100 2.8600 Z'} />
|
|
218
|
-
</Svg>
|
|
219
|
-
)
|
|
220
|
-
|
|
221
207
|
const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraRef: externalCameraRef, limit, angleGuideEnabled, testImageSource, enableZoomSlider = false }) => {
|
|
222
208
|
const internalCameraRef = useRef<CameraViewRef>(null)
|
|
223
209
|
const cameraRef = externalCameraRef || internalCameraRef
|
|
@@ -730,6 +716,7 @@ const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraR
|
|
|
730
716
|
})
|
|
731
717
|
}
|
|
732
718
|
|
|
719
|
+
const FlashIcon = isFlashEnabled ? Icons.IconFlashOn : Icons.IconFlashOff
|
|
733
720
|
const latestCapturedImage = capturedImages[capturedImages.length - 1]
|
|
734
721
|
const hasCapturedImages = capturedImages.length > 0
|
|
735
722
|
const shouldShowGalleryPreview = limit !== 1
|
|
@@ -865,25 +852,28 @@ const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraR
|
|
|
865
852
|
onResponderTerminate={handlePinchEnd}
|
|
866
853
|
>
|
|
867
854
|
<Pressable style={styles.cameraTouchLayer} onPress={handleCameraPress}>
|
|
868
|
-
{
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
855
|
+
{/* Keep native preview views out of hit testing so this RN surface receives every finger. */}
|
|
856
|
+
<View pointerEvents="none" style={styles.camera} testID="camera-preview-display">
|
|
857
|
+
{testImageSource ? (
|
|
858
|
+
<View style={[styles.camera, { overflow: 'hidden' }]}>
|
|
859
|
+
<Image
|
|
860
|
+
source={testImageSource}
|
|
861
|
+
resizeMode="cover"
|
|
862
|
+
style={[StyleSheet.absoluteFillObject, { width: '100%', height: '100%', transform: [{ scale: currentZoom / 0.5 }, { scaleX: isFrontCamera ? -1 : 1 }] }]}
|
|
863
|
+
/>
|
|
864
|
+
</View>
|
|
865
|
+
) : <CameraView
|
|
866
|
+
ref={cameraRef}
|
|
867
|
+
isDepthEnabled={isDepthEnabled}
|
|
868
|
+
zoomLevel={formatZoomLabel(currentZoom)}
|
|
869
|
+
onStatusChange={handleStatusChange}
|
|
870
|
+
onCamerasAvailable={handleCamerasAvailable}
|
|
871
|
+
onPhotoCaptured={handlePhotoCaptured}
|
|
872
|
+
onCaptureStateChange={handleCaptureStateChange}
|
|
873
|
+
onError={handleCameraError}
|
|
874
|
+
style={styles.camera}
|
|
875
|
+
/>}
|
|
876
|
+
</View>
|
|
887
877
|
{focusPoint ? (
|
|
888
878
|
<Animated.View
|
|
889
879
|
style={[
|
|
@@ -934,7 +924,7 @@ const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraR
|
|
|
934
924
|
onPress={handleToggleFlash}
|
|
935
925
|
disabled={isFrontCamera}
|
|
936
926
|
>
|
|
937
|
-
<FlashIcon
|
|
927
|
+
<FlashIcon width={24} height={24} fill={colors.white} fillOpacity={1} />
|
|
938
928
|
</TouchableOpacity>
|
|
939
929
|
)}
|
|
940
930
|
{showCameraSwitchControl && (
|
|
@@ -944,7 +934,7 @@ const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraR
|
|
|
944
934
|
accessibilityLabel="Switch camera"
|
|
945
935
|
onPress={handleToggleCamera}
|
|
946
936
|
>
|
|
947
|
-
<
|
|
937
|
+
<Icons.IconCameraSwitch width={sideButtonIconSize} height={sideButtonIconSize} fill={colors.white} fillOpacity={1} />
|
|
948
938
|
</TouchableOpacity>
|
|
949
939
|
)}
|
|
950
940
|
</View>
|