@supportworks/multi-imagepicker 8.3.0 → 8.3.2

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
@@ -1,4 +1,10 @@
1
1
 
2
+ # v8.3.2 2026-04-27
3
+ * removed handlebar from AddImagesProvider since we want to force it full screen
4
+
5
+ # v8.3.1 2026-04-20
6
+ * removed unused AddImagesView
7
+
2
8
  # v8.3.0 2026-04-20
3
9
  * added AddImagesProvider, required to wrap AddImages. Updated AddImages to use context from that provider.
4
10
  * updated ReadMe with explanation and AI prompt to use to implement AddImages elsewhere in apps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supportworks/multi-imagepicker",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "description": "Android and iOS customized multiple image picker. For react-native >= 0.60.",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -116,9 +116,9 @@ const AddImagesEditor = ({ editorProps }) => {
116
116
 
117
117
  return (
118
118
  <ScreenSafeAreaView style={styles.Page} edges={['top', 'bottom']} includeProvider>
119
- <Pressable style={styles.KnobWrapper} onPress={onClose}>
119
+ {/*<Pressable style={styles.KnobWrapper} onPress={onClose}>
120
120
  <View style={styles.Knob} />
121
- </Pressable>
121
+ </Pressable>*/}
122
122
  <AppBarH8
123
123
  variant='regular'
124
124
  title='Photos to Add'
@@ -170,7 +170,7 @@ const AddImagesEditor = ({ editorProps }) => {
170
170
  )
171
171
  }
172
172
 
173
- const AddImagesProvider = ({ children, sheetTopInset = 32 }) => {
173
+ const AddImagesProvider = ({ children, sheetTopInset = 0 }) => {
174
174
  const [editorState, setEditorState] = useState({
175
175
  visible: false,
176
176
  attaching: false,
@@ -1,173 +0,0 @@
1
- import React from 'react'
2
- import { View, StyleSheet, ScrollView, KeyboardAvoidingView } from 'react-native'
3
- import { Icons } from '@supportworks/icon-library'
4
- import SelectedImages from './SelectedImages'
5
- import { colors } from '@supportworks/app-styler'
6
- import { CheckBox, AppBarH8, CommonButton, ListItem, ScreenSafeAreaView } from '@supportworks/core-controls'
7
- import { Api } from '@supportworks/api-core'
8
- import UploadWarningModal from './UploadWarningModal'
9
-
10
- const AddImagesView = ({
11
- items = [],
12
- annotationAllowed = false,
13
- showToCustomerAllowed = false,
14
- allowSaveToDevice = false,
15
- allImageDataValid = true,
16
- showInfoDialog = false,
17
- onClose = null,
18
- onAttach = null,
19
- onDeleteItem = null,
20
- onItemChange = null,
21
- onCloseInfoDialog = null,
22
- onValidate = null,
23
- onPressCheckboxShowToCust = null,
24
- onPressCheckboxSaveToDevice = null
25
- }) => {
26
- const SaveOptions = () => {
27
- if (!showToCustomerAllowed && !allowSaveToDevice) {
28
- return null
29
- }
30
-
31
- const total = items.length
32
- const saveCount = items.filter(i => !!i.saveToDevice).length
33
- const showCount = items.filter(i => !!i.showToCust).length
34
- const allSave = total > 0 && saveCount === total
35
- const someSave = total > 0 && saveCount > 0 && saveCount < total
36
- const allShow = total > 0 && showCount === total
37
- const someShow = total > 0 && showCount > 0 && showCount < total
38
-
39
- return (
40
- <View style={styles.SaveOptionsContainer}>
41
- {showToCustomerAllowed
42
- ? <ListItem
43
- key='showToCust'
44
- leftContent={
45
- <View style={styles.IconCircle}>
46
- <Icons.IconEye_WithPad fill={colors.buttonPrimary} fillOpacity={1} />
47
- </View>
48
- }
49
- mainAction={onPressCheckboxShowToCust}
50
- rightAction={onPressCheckboxShowToCust}
51
- title='Show all to customer'
52
- subtitle='Select to share all w/ customer.'
53
- rightContent={<CheckBox
54
- checked={allShow}
55
- indeterminate={someShow}
56
- onChange={onPressCheckboxShowToCust}
57
- />}
58
- height={55}
59
- paddingLeft={20}
60
- rightContentWidth={40}
61
- paddingRight={16}
62
- topSeparator={false}
63
- />
64
- : null}
65
- {allowSaveToDevice
66
- ? <ListItem
67
- key='saveToDevice'
68
- leftContent={
69
- <View style={styles.IconCircle}>
70
- <Icons.IconSave_WithPad fill={colors.buttonPrimary} fillOpacity={1} />
71
- </View>
72
- }
73
- mainAction={onPressCheckboxSaveToDevice}
74
- rightAction={onPressCheckboxSaveToDevice}
75
- title='Download all to device'
76
- rightContent={<CheckBox
77
- checked={allSave}
78
- indeterminate={someSave}
79
- onChange={onPressCheckboxSaveToDevice}
80
- />}
81
- height={56}
82
- paddingLeft={20}
83
- rightContentWidth={40}
84
- paddingRight={16}
85
- topSeparator={showToCustomerAllowed}
86
- />
87
- : null}
88
- </View>
89
- )
90
- }
91
-
92
- return (
93
- <ScreenSafeAreaView style={styles.Page} edges={['top', 'bottom']} includeProvider>
94
- <AppBarH8
95
- variant='regular'
96
- title='Photos to Add'
97
- subtitle={items.length + ' Photo' + (items.length > 1 ? 's' : '')}
98
- leftContentType='closeButton'
99
- callback={onClose}
100
- bgColor={colors.backgroundMedium}
101
- bottomShadow
102
- />
103
- <SaveOptions />
104
- <KeyboardAvoidingView behavior='padding' enabled style={styles.Content}>
105
- <ScrollView contentContainerStyle={styles.ScrollViewContainer} keyboardShouldPersistTaps='handled'>
106
- <SelectedImages
107
- items={items}
108
- callback={onValidate}
109
- annotationAllowed={annotationAllowed}
110
- onDeleteItem={onDeleteItem}
111
- onItemChange={onItemChange}
112
- allowSaveToDevice={allowSaveToDevice}
113
- allowShowToCustomer={showToCustomerAllowed}
114
- />
115
- </ScrollView>
116
- </KeyboardAvoidingView>
117
- <View style={styles.ButtonContainer}>
118
- <CommonButton
119
- variant='filled'
120
- size='medium'
121
- fullWidth
122
- label='Attach'
123
- endIcon={<Icons.IconUploadAll />}
124
- onPress={onAttach}
125
- disabled={!allImageDataValid}
126
- />
127
- </View>
128
-
129
- {Api.getApi().sendPhotosToCRM() && (
130
- <UploadWarningModal
131
- visible={showInfoDialog}
132
- onClose={onCloseInfoDialog}
133
- />
134
- )}
135
- </ScreenSafeAreaView>
136
- )
137
- }
138
-
139
- const styles = StyleSheet.create({
140
- Page: {
141
- backgroundColor: colors.backgroundMedium,
142
- flex: 1
143
- },
144
- Content: {
145
- flex: 1
146
- },
147
- ScrollViewContainer: {
148
- paddingBottom: 100,
149
- marginTop: 8
150
- },
151
- SaveOptionsContainer: {
152
- backgroundColor: colors.white,
153
- margin: 16,
154
- borderRadius: 16
155
- },
156
- IconCircle: {
157
- width: 32,
158
- height: 32,
159
- borderRadius: 16,
160
- backgroundColor: colors.buttonPrimaryLight,
161
- justifyContent: 'center',
162
- alignItems: 'center'
163
- },
164
- ButtonContainer: {
165
- height: 56,
166
- paddingHorizontal: 16,
167
- paddingVertical: 8,
168
- borderTopWidth: 1,
169
- borderTopColor: colors.black05
170
- }
171
- })
172
-
173
- export default AddImagesView