@supportworks/multi-imagepicker 8.0.7 → 8.0.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/changes.md +7 -0
- package/package.json +1 -1
- package/src/components/AddImages.js +10 -7
- package/src/components/ImageDetailsModal.js +5 -3
- package/src/components/ImageIndicators.js +5 -7
- package/src/components/SelectedImages.js +5 -4
- package/src/components/SingleImage.js +4 -3
- package/src/components/UploadWarningModal.js +1 -1
package/changes.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
# v8.0.9 2025-12-01
|
|
3
|
+
* removed unnecessary props from ImageIndicators
|
|
4
|
+
* added check for Api.getApi().sendPhotosToCRM()
|
|
5
|
+
|
|
6
|
+
# v8.0.8 2025-11-26
|
|
7
|
+
* change a couple safeareaviews to use insets
|
|
8
|
+
|
|
2
9
|
# v8.0.7 2025-11-26
|
|
3
10
|
* fixed issue with landscape mode having keyboard covering text inputs on ImageDetailsModal
|
|
4
11
|
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@ import React, { useCallback, useEffect, useState, useRef, forwardRef, useImperat
|
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Modal,
|
|
5
|
-
SafeAreaView,
|
|
6
5
|
StyleSheet, ScrollView, KeyboardAvoidingView, Platform, PermissionsAndroid, Alert
|
|
7
6
|
} from 'react-native'
|
|
7
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
8
8
|
import Moment from 'moment'
|
|
9
9
|
import { Icons } from '@supportworks/icon-library'
|
|
10
10
|
import loaderHandler from './loaderHandler'
|
|
@@ -49,6 +49,7 @@ const AddImages = forwardRef((
|
|
|
49
49
|
const isMountedRef = useRef(true)
|
|
50
50
|
const STORAGE_KEY_SKIP_DIALOG = '@MIP_UploadWarningsModal_Skip'
|
|
51
51
|
const allowSaveToDevicePlatform = Platform.OS !== 'android' // TODO: set to true when Android support is added
|
|
52
|
+
const insets = useSafeAreaInsets()
|
|
52
53
|
|
|
53
54
|
useEffect(() => {
|
|
54
55
|
return () => {
|
|
@@ -417,7 +418,7 @@ const AddImages = forwardRef((
|
|
|
417
418
|
if (showAdd) {
|
|
418
419
|
return (
|
|
419
420
|
<Modal presentationStyle='fullScreen' animationType='slide'>
|
|
420
|
-
<
|
|
421
|
+
<View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
|
|
421
422
|
<AppBarH8
|
|
422
423
|
variant='regular'
|
|
423
424
|
title='Photos to Add'
|
|
@@ -452,12 +453,14 @@ const AddImages = forwardRef((
|
|
|
452
453
|
disabled={!allImageDataValid}
|
|
453
454
|
/>
|
|
454
455
|
</View>
|
|
455
|
-
</
|
|
456
|
+
</View>
|
|
456
457
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
{Api.getApi().sendPhotosToCRM() && (
|
|
459
|
+
<UploadWarningModal
|
|
460
|
+
visible={showInfoDialog}
|
|
461
|
+
onClose={onCloseInfoDialog}
|
|
462
|
+
/>
|
|
463
|
+
)}
|
|
461
464
|
</Modal>
|
|
462
465
|
)
|
|
463
466
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef, useCallback } from 'react'
|
|
2
|
-
import { Modal,
|
|
2
|
+
import { Modal, View, Image, StyleSheet, TouchableOpacity, Text, KeyboardAvoidingView, Platform } from 'react-native'
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
3
4
|
import { AppBarH8 } from '@supportworks/core-controls'
|
|
4
5
|
import { colors, stdStyles } from '@supportworks/app-styler'
|
|
5
6
|
import { TextInputSWMD } from '@supportworks/swmaterialdesign'
|
|
@@ -18,6 +19,7 @@ const ImageDetailsModal = (
|
|
|
18
19
|
const [localDesc, setLocalDesc] = useState(initialDesc)
|
|
19
20
|
const [inputResetKey, setInputResetKey] = useState(0)
|
|
20
21
|
const titleValidRef = useRef(true)
|
|
22
|
+
const insets = useSafeAreaInsets()
|
|
21
23
|
|
|
22
24
|
const handleClose = useCallback(() => {
|
|
23
25
|
if (onClose) onClose()
|
|
@@ -42,7 +44,7 @@ const ImageDetailsModal = (
|
|
|
42
44
|
visible={visible}
|
|
43
45
|
onRequestClose={handleClose}
|
|
44
46
|
>
|
|
45
|
-
<
|
|
47
|
+
<View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
|
|
46
48
|
<AppBarH8
|
|
47
49
|
variant='regular'
|
|
48
50
|
title=''
|
|
@@ -100,7 +102,7 @@ const ImageDetailsModal = (
|
|
|
100
102
|
</View>
|
|
101
103
|
{/*</ScrollView>*/}
|
|
102
104
|
</KeyboardAvoidingView>
|
|
103
|
-
</
|
|
105
|
+
</View>
|
|
104
106
|
</Modal>
|
|
105
107
|
)
|
|
106
108
|
}
|
|
@@ -11,12 +11,10 @@ import { BlurView } from '@react-native-community/blur'
|
|
|
11
11
|
const ImageIndicators = (
|
|
12
12
|
{
|
|
13
13
|
saveToDevice = false,
|
|
14
|
-
allowSaveToDevice = null,
|
|
15
|
-
allowShowToCustomer = null,
|
|
16
14
|
showToCust = false
|
|
17
15
|
}) => {
|
|
18
16
|
return (
|
|
19
|
-
(
|
|
17
|
+
(showToCust || saveToDevice) && (
|
|
20
18
|
Platform.OS === 'ios'
|
|
21
19
|
? (
|
|
22
20
|
<BlurView
|
|
@@ -24,12 +22,12 @@ const ImageIndicators = (
|
|
|
24
22
|
style={[styles.ImageOverlayPill, { width: showToCust && saveToDevice ? 50 : 24 }]}
|
|
25
23
|
pointerEvents='none'
|
|
26
24
|
>
|
|
27
|
-
{
|
|
25
|
+
{showToCust && (
|
|
28
26
|
<View style={[styles.OverlayIconCircle, styles.OverlayIconCircleEye]}>
|
|
29
27
|
<Icons.IconEye_WithPad size={16} fill={colors.white} fillOpacity={1} />
|
|
30
28
|
</View>
|
|
31
29
|
)}
|
|
32
|
-
{
|
|
30
|
+
{saveToDevice && (
|
|
33
31
|
<View style={[styles.OverlayIconCircle]}>
|
|
34
32
|
<Icons.IconDownloadDone2 size={16} fill={colors.white} fillOpacity={1} />
|
|
35
33
|
</View>
|
|
@@ -42,12 +40,12 @@ const ImageIndicators = (
|
|
|
42
40
|
backgroundColor: 'rgba(0,0,0,0.35)'
|
|
43
41
|
}]} pointerEvents='none'
|
|
44
42
|
>
|
|
45
|
-
{
|
|
43
|
+
{showToCust && (
|
|
46
44
|
<View style={[styles.OverlayIconCircle, styles.OverlayIconCircleEye]}>
|
|
47
45
|
<Icons.IconEye_WithPad size={16} fill={colors.white} fillOpacity={1} />
|
|
48
46
|
</View>
|
|
49
47
|
)}
|
|
50
|
-
{
|
|
48
|
+
{saveToDevice && (
|
|
51
49
|
<View style={[styles.OverlayIconCircle]}>
|
|
52
50
|
<Icons.IconDownloadDone2 size={16} fill={colors.white} fillOpacity={1} />
|
|
53
51
|
</View>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
|
-
Modal
|
|
5
|
-
SafeAreaView
|
|
4
|
+
Modal
|
|
6
5
|
} from 'react-native'
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
7
7
|
import SingleImage from './SingleImage'
|
|
8
8
|
import { Analytics } from '@supportworks/analytics'
|
|
9
9
|
import { MediaPlayer } from '@supportworks/core-controls'
|
|
@@ -64,6 +64,7 @@ const SelectedImages = (
|
|
|
64
64
|
}, [])
|
|
65
65
|
|
|
66
66
|
const closeMedia = useCallback(() => setMediaOpen(false), [])
|
|
67
|
+
const insets = useSafeAreaInsets()
|
|
67
68
|
|
|
68
69
|
// When MediaPlayer saves an annotated image, refresh the list and bust cache
|
|
69
70
|
const handleMediaUpdated = useCallback((newPath) => {
|
|
@@ -125,7 +126,7 @@ const SelectedImages = (
|
|
|
125
126
|
onRequestClose={closeMedia}
|
|
126
127
|
visible
|
|
127
128
|
>
|
|
128
|
-
<
|
|
129
|
+
<View style={{ flex: 1, backgroundColor: colors.black, paddingTop: insets.top, paddingBottom: insets.bottom }}>
|
|
129
130
|
<MediaPlayer
|
|
130
131
|
mediaId={mediaIndex}
|
|
131
132
|
backgroundColor={colors.black}
|
|
@@ -138,7 +139,7 @@ const SelectedImages = (
|
|
|
138
139
|
fullPath={Api.getApi().fullPath}
|
|
139
140
|
fullImagePath={Api.getApi().fullImagePath}
|
|
140
141
|
/>
|
|
141
|
-
</
|
|
142
|
+
</View>
|
|
142
143
|
</Modal>
|
|
143
144
|
)}
|
|
144
145
|
</>
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
Text,
|
|
4
4
|
View,
|
|
5
5
|
Modal,
|
|
6
|
-
SafeAreaView,
|
|
7
6
|
TouchableOpacity,
|
|
8
7
|
StyleSheet,
|
|
9
8
|
Image, Dimensions
|
|
10
9
|
} from 'react-native'
|
|
10
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
11
11
|
import { Block, Grid, Section } from 'react-native-responsive-layout'
|
|
12
12
|
import { Api } from '@supportworks/api-core'
|
|
13
13
|
import { colors, stdStyles } from '@supportworks/app-styler'
|
|
@@ -36,6 +36,7 @@ const SingleImage = (
|
|
|
36
36
|
initialDesc = '',
|
|
37
37
|
cacheVersion = 0
|
|
38
38
|
}) => {
|
|
39
|
+
const insets = useSafeAreaInsets()
|
|
39
40
|
const {
|
|
40
41
|
path: imagePath = '',
|
|
41
42
|
defaultName,
|
|
@@ -194,9 +195,9 @@ const SingleImage = (
|
|
|
194
195
|
if (showCanvas) {
|
|
195
196
|
return (
|
|
196
197
|
<Modal presentationStyle='fullScreen' animationType='slide'>
|
|
197
|
-
<
|
|
198
|
+
<View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
|
|
198
199
|
<Canvas settings={annotationJson.settings} history={annotationJson.history} base64image={'data:image/jpeg;base64,' + canvasData} onSave={onSaveCanvas} onClose={onCloseCanvas} />
|
|
199
|
-
</
|
|
200
|
+
</View>
|
|
200
201
|
</Modal>
|
|
201
202
|
)
|
|
202
203
|
}
|
|
@@ -9,7 +9,7 @@ const UploadWarningModal = (
|
|
|
9
9
|
visible = false,
|
|
10
10
|
onClose = null
|
|
11
11
|
}) => {
|
|
12
|
-
const [skipInfoDialog, setSkipInfoDialog] = useState(
|
|
12
|
+
const [skipInfoDialog, setSkipInfoDialog] = useState(true)
|
|
13
13
|
|
|
14
14
|
const handleClose = useCallback(() => {
|
|
15
15
|
if (onClose) onClose(skipInfoDialog)
|