@plusscommunities/pluss-core-app 8.0.23-beta.0 → 8.0.24
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/dist/module/components/PDFPopup.js +4 -0
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/SharingTools.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
- package/dist/module/js/images/detectFaces.js.map +1 -1
- package/package.json +1 -1
- package/src/components/PDFPopup.js +201 -197
- package/src/components/SharingTools.js +174 -174
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +425 -425
- package/src/js/images/detectFaces.js +24 -24
|
@@ -12,214 +12,218 @@ import { StatusBarHeight, getFileName } from "../helper";
|
|
|
12
12
|
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
13
13
|
|
|
14
14
|
class PDFPopup extends Component {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
state = {
|
|
16
|
+
loaded: false,
|
|
17
|
+
};
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
onLoadStarted() {
|
|
20
|
+
this.setState({
|
|
21
|
+
loaded: false,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
onLoadEnded() {
|
|
26
|
+
this.setState({
|
|
27
|
+
loaded: true,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
onChangeIndex(index) {
|
|
32
|
+
this.props.onChangeIndex(index);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
getUrl() {
|
|
36
|
+
const linkPrefix =
|
|
37
|
+
"http://drive.google.com/viewerng/viewer?embedded=true&url=";
|
|
38
|
+
return `${linkPrefix}${this.props.source}`;
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
download = async () => {
|
|
42
|
+
try {
|
|
43
|
+
const file = await File.downloadFileAsync(
|
|
44
|
+
this.props.source,
|
|
45
|
+
new File(Paths.document, getFileName(this.props.source)),
|
|
46
|
+
{ idempotent: true },
|
|
47
|
+
);
|
|
48
|
+
await Sharing.shareAsync(file.uri, {
|
|
49
|
+
UTI: "public.item",
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.log("PDFPopup download error:", error);
|
|
53
|
+
Alert.alert(
|
|
54
|
+
"Download Failed",
|
|
55
|
+
"Unable to download PDF. Please try again.",
|
|
56
|
+
[{ text: "OK" }],
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
closePopup() {
|
|
62
|
+
this.props.onClose();
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
65
|
+
renderFooter() {
|
|
66
|
+
if (this.props.pdfCount && this.props.pdfCount === 1) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return (
|
|
70
|
+
<View style={styles.footerContent}>
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
onPress={this.onChangeIndex.bind(this, -1)}
|
|
73
|
+
activeOpacity={0.6}
|
|
74
|
+
>
|
|
75
|
+
<Icon
|
|
76
|
+
type="font-awesome"
|
|
77
|
+
name="angle-left"
|
|
78
|
+
iconStyle={[styles.chevron]}
|
|
79
|
+
/>
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
<Text style={styles.footerText}>
|
|
82
|
+
{this.props.selectedIndex + 1} / {this.props.pdfCount}
|
|
83
|
+
</Text>
|
|
84
|
+
<TouchableOpacity
|
|
85
|
+
onPress={this.onChangeIndex.bind(this, 1)}
|
|
86
|
+
activeOpacity={0.6}
|
|
87
|
+
>
|
|
88
|
+
<Icon
|
|
89
|
+
type="font-awesome"
|
|
90
|
+
name="angle-right"
|
|
91
|
+
iconStyle={[styles.chevron]}
|
|
92
|
+
/>
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
</View>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
98
|
+
render() {
|
|
99
|
+
if (!this.props.source) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return (
|
|
103
|
+
<Modal
|
|
104
|
+
visible={this.props.visible}
|
|
105
|
+
transparent
|
|
106
|
+
animationType="slide"
|
|
107
|
+
onRequestClose={this.closePopup.bind(this)}
|
|
108
|
+
>
|
|
109
|
+
<View
|
|
110
|
+
style={{
|
|
111
|
+
flex: 1,
|
|
112
|
+
backgroundColor: "#000",
|
|
113
|
+
paddingTop: StatusBarHeight(0),
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<View style={styles.headerContent}>
|
|
117
|
+
<TouchableOpacity
|
|
118
|
+
onPress={this.closePopup.bind(this)}
|
|
119
|
+
activeOpacity={0.6}
|
|
120
|
+
>
|
|
121
|
+
<FontAwesome name="x" style={[styles.menuIcon]} />
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
<View style={styles.titleContainer}>
|
|
124
|
+
<Text style={styles.title}>{this.props.title}</Text>
|
|
125
|
+
</View>
|
|
126
|
+
<TouchableOpacity onPress={this.download} activeOpacity={0.6}>
|
|
127
|
+
<Icon
|
|
128
|
+
type="font-awesome"
|
|
129
|
+
name="cloud-download"
|
|
130
|
+
iconStyle={[styles.menuIcon]}
|
|
131
|
+
/>
|
|
132
|
+
</TouchableOpacity>
|
|
133
|
+
</View>
|
|
134
|
+
<View style={{ flex: 1, backgroundColor: "#fff" }}>
|
|
135
|
+
{this.state.loaded ? null : (
|
|
136
|
+
<Spinner
|
|
137
|
+
style={{
|
|
138
|
+
height: SCREEN_HEIGHT - StatusBarHeight(145),
|
|
139
|
+
flex: 0,
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
142
|
+
)}
|
|
143
|
+
<WebView
|
|
144
|
+
source={{
|
|
145
|
+
uri: this.getUrl(),
|
|
146
|
+
}}
|
|
147
|
+
javaScriptEnabled
|
|
148
|
+
domStorageEnabled
|
|
149
|
+
originWhitelist={["*"]}
|
|
150
|
+
mixedContentMode="always"
|
|
151
|
+
renderError={(e) => {
|
|
152
|
+
console.log("errored");
|
|
153
|
+
console.log(e);
|
|
154
|
+
}}
|
|
155
|
+
style={[
|
|
156
|
+
{
|
|
157
|
+
flex: 1,
|
|
158
|
+
backgroundColor: "#fff",
|
|
159
|
+
},
|
|
160
|
+
]}
|
|
161
|
+
onLoadStart={this.onLoadStarted.bind(this)}
|
|
162
|
+
onLoadEnd={this.onLoadEnded.bind(this)}
|
|
163
|
+
/>
|
|
164
|
+
</View>
|
|
165
|
+
{this.renderFooter()}
|
|
166
|
+
</View>
|
|
167
|
+
</Modal>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
const styles = {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
173
|
+
container: {
|
|
174
|
+
flex: 1,
|
|
175
|
+
position: "relative",
|
|
176
|
+
backgroundColor: "#000",
|
|
177
|
+
},
|
|
178
|
+
innerContainer: {
|
|
179
|
+
flex: 1,
|
|
180
|
+
paddingLeft: 15,
|
|
181
|
+
paddingRight: 15,
|
|
182
|
+
},
|
|
183
|
+
menuIcon: {
|
|
184
|
+
fontSize: 25,
|
|
185
|
+
padding: 15,
|
|
186
|
+
width: 55,
|
|
187
|
+
textAlign: "center",
|
|
188
|
+
color: "#fff",
|
|
189
|
+
zIndex: 3,
|
|
190
|
+
},
|
|
191
|
+
headerContent: {
|
|
192
|
+
flexDirection: "row",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
height: 70,
|
|
195
|
+
},
|
|
196
|
+
titleContainer: {
|
|
197
|
+
flex: 1,
|
|
198
|
+
},
|
|
199
|
+
title: {
|
|
200
|
+
color: "#fff",
|
|
201
|
+
fontFamily: "sf-semibold",
|
|
202
|
+
fontSize: 16,
|
|
203
|
+
textAlign: "center",
|
|
204
|
+
},
|
|
205
|
+
footerContent: {
|
|
206
|
+
flexDirection: "row",
|
|
207
|
+
alignItems: "center",
|
|
208
|
+
justifyContent: "center",
|
|
209
|
+
height: 70,
|
|
210
|
+
//alignSelf: 'flex-end'
|
|
211
|
+
},
|
|
212
|
+
chevron: {
|
|
213
|
+
fontSize: 25,
|
|
214
|
+
padding: 15,
|
|
215
|
+
width: 55,
|
|
216
|
+
textAlign: "center",
|
|
217
|
+
color: "#fff",
|
|
218
|
+
zIndex: 3,
|
|
219
|
+
},
|
|
220
|
+
footerText: {
|
|
221
|
+
fontFamily: "sf-regular",
|
|
222
|
+
fontSize: 14,
|
|
223
|
+
color: "#fff",
|
|
224
|
+
width: 150,
|
|
225
|
+
textAlign: "center",
|
|
226
|
+
},
|
|
223
227
|
};
|
|
224
228
|
|
|
225
229
|
export { PDFPopup };
|