@supportworks/multi-imagepicker 8.0.6 → 8.0.8
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
CHANGED
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
|
+
{false && (
|
|
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=''
|
|
@@ -56,16 +58,19 @@ const ImageDetailsModal = (
|
|
|
56
58
|
<Text style={[styles.DoneText, !titleValidRef.current ? styles.DoneTextDisabled : null]}>Done</Text>
|
|
57
59
|
</TouchableOpacity>
|
|
58
60
|
}
|
|
59
|
-
bottomShadow
|
|
60
61
|
/>
|
|
62
|
+
<KeyboardAvoidingView style={styles.KeyboardAvoidingView} behavior={Platform.OS === 'ios' ? 'padding' : 'position'} enabled>
|
|
63
|
+
{/*<ScrollView
|
|
64
|
+
keyboardShouldPersistTaps="handled"
|
|
65
|
+
contentContainerStyle={styles.ScrollContent}
|
|
66
|
+
>*/}
|
|
61
67
|
<View style={styles.ImageContainer}>
|
|
62
68
|
<Image
|
|
63
69
|
source={{ uri: imageUri }}
|
|
64
|
-
|
|
70
|
+
resizeMode='contain'
|
|
65
71
|
style={[styles.Image]}
|
|
66
72
|
/>
|
|
67
73
|
</View>
|
|
68
|
-
<KeyboardAvoidingView style={styles.KeyboardAvoidingView} behavior={Platform.OS === 'ios' ? 'padding' : 'position'} enabled>
|
|
69
74
|
<View style={styles.InputContainer}>
|
|
70
75
|
<TextInputSWMD
|
|
71
76
|
key={`title-${inputResetKey}`}
|
|
@@ -95,8 +100,9 @@ const ImageDetailsModal = (
|
|
|
95
100
|
callback={(payload) => setLocalDesc(payload.inputValue)}
|
|
96
101
|
/>
|
|
97
102
|
</View>
|
|
103
|
+
{/*</ScrollView>*/}
|
|
98
104
|
</KeyboardAvoidingView>
|
|
99
|
-
</
|
|
105
|
+
</View>
|
|
100
106
|
</Modal>
|
|
101
107
|
)
|
|
102
108
|
}
|
|
@@ -106,21 +112,30 @@ const styles = StyleSheet.create({
|
|
|
106
112
|
flex: 1,
|
|
107
113
|
backgroundColor: colors.white
|
|
108
114
|
},
|
|
115
|
+
/*ScrollContent: {
|
|
116
|
+
flexGrow: 1,
|
|
117
|
+
alignItems: 'stretch',
|
|
118
|
+
paddingTop: 8,
|
|
119
|
+
paddingBottom: 24
|
|
120
|
+
},*/
|
|
109
121
|
ImageContainer: {
|
|
110
122
|
flex: 1,
|
|
111
|
-
|
|
123
|
+
marginHorizontal: 16,
|
|
124
|
+
marginBottom: 8,
|
|
125
|
+
borderRadius: 16,
|
|
126
|
+
backgroundColor: colors.lightgray,
|
|
112
127
|
},
|
|
113
128
|
Image: {
|
|
114
129
|
flex: 1,
|
|
115
|
-
borderRadius: 16
|
|
130
|
+
borderRadius: 16,
|
|
116
131
|
},
|
|
117
132
|
KeyboardAvoidingView: {
|
|
118
133
|
flex: 1,
|
|
119
|
-
justifyContent: 'flex-
|
|
134
|
+
justifyContent: 'flex-start',
|
|
120
135
|
},
|
|
121
136
|
InputContainer: {
|
|
122
137
|
paddingHorizontal: 16,
|
|
123
|
-
paddingTop: 8
|
|
138
|
+
paddingTop: 8,
|
|
124
139
|
},
|
|
125
140
|
DoneText: {
|
|
126
141
|
...stdStyles.S1,
|
|
@@ -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
|
}
|