@supportworks/multi-imagepicker 8.0.15 → 8.0.17

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/README.md CHANGED
@@ -76,21 +76,19 @@ render() {
76
76
  ```
77
77
  3: Selected Image component - this allows you to display the images that were selected, before saving them, so you can edit their titles and descriptions.
78
78
  ```javascript
79
- setAllImageDataValid(allValid) {
80
- //handle return of selected images from MultiImagePicker <SelectedImages>
81
- //payload expected: (boolean) true if all selected images are valid, false otherwise
82
- let cRef = this;
83
- let initAllValid = cRef.state.allImageDataValid;
84
- if (allValid !== initAllValid) {
85
- //need to set state since overall validity flipped
86
- cRef.setState({allImageDataValid: allValid});
87
- }
79
+
80
+ onItemChange (idx, patch) {
81
+ this.setState((prevState) => {
82
+ const items = prevState.items.map((item, i) => (i === idx ? {...item, ...patch} : item))
83
+ const allValid = items.every(it => it?.isValid !== false)
84
+ return {items, allImageDataValid: allValid}
85
+ })
88
86
  }
89
-
87
+
90
88
  render() {
91
89
  ...
92
90
  <KeyboardAwareScrollView>
93
- <SelectedImages imgArr={cRef.imgArr} imgDescArr={cRef.imgDescArr} imgValidArr={cRef.imgValidArr} callback={cRef.setAllImageDataValid}/>
91
+ <SelectedImages items={cRef.state.items} onItemChange={cRef.onItemChange}/>
94
92
  </KeyboardAwareScrollView>
95
93
  ...
96
94
  }
package/changes.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ # v8.0.17 2026-03-25
3
+ * removed CRM modal to see if that fixes it
4
+
5
+ # v8.0.16 2026-01-22
6
+ * replaced deprecated SafeAreaViews
7
+
2
8
  # v8.0.15 2025-12-23
3
9
  * Minor actionbar and ImageDetailsModal tweaks
4
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supportworks/multi-imagepicker",
3
- "version": "8.0.15",
3
+ "version": "8.0.17",
4
4
  "description": "Android and iOS customized multiple image picker. For react-native >= 0.60.",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -4,7 +4,6 @@ import {
4
4
  Modal,
5
5
  StyleSheet, ScrollView, KeyboardAvoidingView, Platform, PermissionsAndroid, Alert
6
6
  } from 'react-native'
7
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
8
7
  import Moment from 'moment'
9
8
  import { Icons } from '@supportworks/icon-library'
10
9
  import loaderHandler from './loaderHandler'
@@ -12,7 +11,7 @@ import MultiImagePicker from './MultiImagePicker'
12
11
  import SelectedImages from './SelectedImages'
13
12
  import { colors } from '@supportworks/app-styler'
14
13
  import { LoadingOverlay } from '@supportworks/navbars'
15
- import { CheckBox, AppBarH8, CommonButton, ListItem } from '@supportworks/core-controls'
14
+ import { CheckBox, AppBarH8, CommonButton, ListItem, ScreenSafeAreaView } from '@supportworks/core-controls'
16
15
  import { CameraRoll } from '@react-native-camera-roll/camera-roll'
17
16
  import { Api } from '@supportworks/api-core'
18
17
  import { Analytics } from '@supportworks/analytics'
@@ -49,7 +48,6 @@ const AddImages = forwardRef((
49
48
  const isMountedRef = useRef(true)
50
49
  const STORAGE_KEY_SKIP_DIALOG = '@MIP_UploadWarningsModal_Skip'
51
50
  const allowSaveToDevicePlatform = Platform.OS !== 'android' // TODO: set to true when Android support is added
52
- const insets = useSafeAreaInsets()
53
51
 
54
52
  useEffect(() => {
55
53
  return () => {
@@ -418,7 +416,7 @@ const AddImages = forwardRef((
418
416
  if (showAdd) {
419
417
  return (
420
418
  <Modal presentationStyle='fullScreen' animationType='slide'>
421
- <View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
419
+ <ScreenSafeAreaView style={styles.Page} edges={['top','bottom']} includeProvider>
422
420
  <AppBarH8
423
421
  variant='regular'
424
422
  title='Photos to Add'
@@ -453,13 +451,13 @@ const AddImages = forwardRef((
453
451
  disabled={!allImageDataValid}
454
452
  />
455
453
  </View>
456
- </View>
454
+ </ScreenSafeAreaView>
457
455
 
458
- {Api.getApi().sendPhotosToCRM() && (
459
- <UploadWarningModal
460
- visible={showInfoDialog}
461
- onClose={onCloseInfoDialog}
462
- />
456
+ {Api.getApi().sendPhotosToCRM() && false && (
457
+ <UploadWarningModal
458
+ visible={showInfoDialog}
459
+ onClose={onCloseInfoDialog}
460
+ />
463
461
  )}
464
462
  </Modal>
465
463
  )
@@ -1,7 +1,6 @@
1
1
  import React, { useEffect, useState, useRef, useCallback } from 'react'
2
2
  import { Modal, View, Image, StyleSheet, TouchableOpacity, Text, KeyboardAvoidingView, Platform } from 'react-native'
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
- import { AppBarH8 } from '@supportworks/core-controls'
3
+ import { AppBarH8, ScreenSafeAreaView } from '@supportworks/core-controls'
5
4
  import { colors, stdStyles } from '@supportworks/app-styler'
6
5
  import { TextInputSWMD } from '@supportworks/swmaterialdesign'
7
6
 
@@ -19,7 +18,6 @@ const ImageDetailsModal = (
19
18
  const [localDesc, setLocalDesc] = useState(initialDesc)
20
19
  const [inputResetKey, setInputResetKey] = useState(0)
21
20
  const titleValidRef = useRef(true)
22
- const insets = useSafeAreaInsets()
23
21
 
24
22
  const handleClose = useCallback(() => {
25
23
  if (onClose) onClose()
@@ -44,7 +42,7 @@ const ImageDetailsModal = (
44
42
  visible={visible}
45
43
  onRequestClose={handleClose}
46
44
  >
47
- <View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
45
+ <ScreenSafeAreaView style={styles.Page} edges={['top','bottom']} includeProvider>
48
46
  <AppBarH8
49
47
  variant='regular'
50
48
  title=''
@@ -61,13 +59,13 @@ const ImageDetailsModal = (
61
59
  }
62
60
  />
63
61
  <KeyboardAvoidingView style={styles.KeyboardAvoidingView} behavior={Platform.OS === 'ios' ? 'padding' : 'height'} enabled>
64
- <View style={styles.ImageContainer}>
65
- <Image
66
- source={{ uri: imageUri }}
67
- resizeMode='contain'
68
- style={[styles.Image]}
69
- />
70
- </View>
62
+ <View style={styles.ImageContainer}>
63
+ <Image
64
+ source={{ uri: imageUri }}
65
+ resizeMode='contain'
66
+ style={[styles.Image]}
67
+ />
68
+ </View>
71
69
  <View style={styles.InputContainer}>
72
70
  <TextInputSWMD
73
71
  key={`title-${inputResetKey}`}
@@ -98,7 +96,7 @@ const ImageDetailsModal = (
98
96
  />
99
97
  </View>
100
98
  </KeyboardAvoidingView>
101
- </View>
99
+ </ScreenSafeAreaView>
102
100
  </Modal>
103
101
  )
104
102
  }
@@ -3,10 +3,9 @@ import {
3
3
  View,
4
4
  Modal
5
5
  } from 'react-native'
6
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
7
6
  import SingleImage from './SingleImage'
8
7
  import { Analytics } from '@supportworks/analytics'
9
- import { MediaPlayer } from '@supportworks/core-controls'
8
+ import { MediaPlayer, ScreenSafeAreaView } from '@supportworks/core-controls'
10
9
  import { colors } from '@supportworks/app-styler'
11
10
  import { Api } from '@supportworks/api-core'
12
11
 
@@ -64,7 +63,6 @@ const SelectedImages = (
64
63
  }, [])
65
64
 
66
65
  const closeMedia = useCallback(() => setMediaOpen(false), [])
67
- const insets = useSafeAreaInsets()
68
66
 
69
67
  // When MediaPlayer saves an annotated image, refresh the list and bust cache
70
68
  const handleMediaUpdated = useCallback((newPath) => {
@@ -126,7 +124,7 @@ const SelectedImages = (
126
124
  onRequestClose={closeMedia}
127
125
  visible
128
126
  >
129
- <View style={{ flex: 1, backgroundColor: colors.black, paddingTop: insets.top, paddingBottom: insets.bottom }}>
127
+ <ScreenSafeAreaView style={{ flex: 1, backgroundColor: colors.black }} includeProvider>
130
128
  <MediaPlayer
131
129
  mediaId={mediaIndex}
132
130
  backgroundColor={colors.black}
@@ -139,7 +137,7 @@ const SelectedImages = (
139
137
  fullPath={Api.getApi().fullPath}
140
138
  fullImagePath={Api.getApi().fullImagePath}
141
139
  />
142
- </View>
140
+ </ScreenSafeAreaView>
143
141
  </Modal>
144
142
  )}
145
143
  </>
@@ -7,7 +7,6 @@ import {
7
7
  StyleSheet,
8
8
  Image, Dimensions
9
9
  } from 'react-native'
10
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
11
10
  import { Block, Grid, Section } from 'react-native-responsive-layout'
12
11
  import { Api } from '@supportworks/api-core'
13
12
  import { colors, stdStyles } from '@supportworks/app-styler'
@@ -17,6 +16,7 @@ import { Analytics } from '@supportworks/analytics'
17
16
  import ActionBar from './ActionBar'
18
17
  import ImageDetailsModal from './ImageDetailsModal'
19
18
  import ImageIndicators from './ImageIndicators'
19
+ import { ScreenSafeAreaView } from '@supportworks/core-controls'
20
20
 
21
21
  const SingleImage = (
22
22
  {
@@ -36,7 +36,6 @@ const SingleImage = (
36
36
  initialDesc = '',
37
37
  cacheVersion = 0
38
38
  }) => {
39
- const insets = useSafeAreaInsets()
40
39
  const {
41
40
  path: imagePath = '',
42
41
  defaultName,
@@ -195,9 +194,9 @@ const SingleImage = (
195
194
  if (showCanvas) {
196
195
  return (
197
196
  <Modal presentationStyle='fullScreen' animationType='slide'>
198
- <View style={[styles.Page, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
197
+ <ScreenSafeAreaView style={styles.Page} includeProvider>
199
198
  <Canvas settings={annotationJson.settings} history={annotationJson.history} base64image={'data:image/jpeg;base64,' + canvasData} onSave={onSaveCanvas} onClose={onCloseCanvas} />
200
- </View>
199
+ </ScreenSafeAreaView>
201
200
  </Modal>
202
201
  )
203
202
  }