react-native-expo-cropper 1.2.44 → 1.2.46

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.
@@ -1,244 +1,255 @@
1
- import { StyleSheet, Dimensions } from 'react-native';
2
-
3
- const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
4
- const IMAGE_HEIGHT = SCREEN_HEIGHT;
5
- const IMAGE_WIDTH = SCREEN_WIDTH;
6
-
7
- const PRIMARY_GREEN = '#198754';
8
- const DEEP_BLACK = '#0B0B0B';
9
- const GLOW_WHITE = 'rgba(255, 255, 255, 0.85)';
10
-
11
- const styles = StyleSheet.create({
12
- container: {
13
- flex: 1,
14
- alignItems: 'center',
15
- justifyContent: 'flex-start', // ✅ Start from top, allow content to flow down
16
- backgroundColor: DEEP_BLACK,
17
- },
18
- buttonContainer: {
19
- position: 'absolute',
20
- bottom: 50,
21
- left: 0,
22
- right: 0,
23
- flexDirection: 'row',
24
- flexWrap: 'wrap',
25
- justifyContent: 'center',
26
- alignItems: 'center',
27
- paddingHorizontal: 10,
28
- zIndex: 10,
29
- gap: 10,
30
- },
31
- buttonContainerBelow: {
32
- // ✅ Buttons positioned BELOW image, not overlapping, above Android navigation bar
33
- position: 'absolute',
34
- bottom: 0,
35
- left: 0,
36
- right: 0,
37
- flexDirection: 'row',
38
- justifyContent: 'center',
39
- alignItems: 'center',
40
- paddingHorizontal: 10,
41
- paddingTop: 16,
42
- gap: 8,
43
- backgroundColor: DEEP_BLACK, // Fond noir pour séparer visuellement
44
- },
45
- iconButton: {
46
- backgroundColor: PRIMARY_GREEN,
47
- width: 60,
48
- height: 60,
49
- borderRadius: 30,
50
- alignItems: 'center',
51
- justifyContent: 'center',
52
- marginRight: 5,
53
- },
54
- rotationButton: {
55
- // Cercle, même couleur que Reset/Confirm (#549433), même hauteur que les autres boutons
56
- backgroundColor: '#549433',
57
- width: 56,
58
- height: 48, // Même hauteur approximative que les boutons rectangulaires (padding 10 + texte)
59
- borderRadius: 28,
60
- alignItems: 'center',
61
- justifyContent: 'center',
62
- },
63
- button: {
64
- flex: 1,
65
- minHeight: 48, // Même hauteur que le bouton de rotation
66
- paddingVertical: 12,
67
- paddingHorizontal: 10,
68
- alignItems: "center",
69
- justifyContent: "center",
70
- backgroundColor: "#549433",
71
- borderRadius: 5,
72
- },
73
- buttonText: {
74
- color: 'white',
75
- fontSize: 18,
76
- fontWeight: '600',
77
- textAlign: 'center',
78
- },
79
- iconText: {
80
- color: PRIMARY_GREEN,
81
- fontSize: 16,
82
- fontWeight: '600',
83
- textAlign: 'center',
84
- },
85
- imageContainer: {
86
- width: IMAGE_WIDTH,
87
- height: "80%",
88
- justifyContent: 'center',
89
- alignItems: 'center',
90
- overflow: 'hidden',
91
- backgroundColor: 'black',
92
- },
93
-
94
- image: {
95
- width: '100%',
96
- height: '100%',
97
- resizeMode: 'contain',
98
- },
99
-
100
- overlay: {
101
- position: 'absolute',
102
- top: 0,
103
- left: 0,
104
- width: '100%',
105
- height: '100%',
106
- zIndex: 1,
107
- },
108
-
109
- croppedImage: {
110
- width: IMAGE_WIDTH,
111
- height: IMAGE_HEIGHT,
112
- resizeMode: 'cover',
113
- marginTop: 10,
114
- borderWidth: 2,
115
- borderColor: 'white',
116
- borderRadius: 10,
117
- },
118
- fixedButtonContainer: {
119
- position: 'absolute',
120
- bottom: 100,
121
- left: 0,
122
- right: 0,
123
- flexDirection: 'row',
124
- justifyContent: 'center',
125
- flexWrap: 'wrap',
126
- gap: 10,
127
- paddingHorizontal: 10,
128
- },
129
- fixedButton: {
130
- backgroundColor: PRIMARY_GREEN,
131
- paddingVertical: 18,
132
- paddingHorizontal: 30,
133
- borderRadius: 12,
134
- margin: 6,
135
- alignItems: 'center',
136
- justifyContent: 'center',
137
- borderWidth: 0,
138
- width: SCREEN_WIDTH * 0.4,
139
- height: 60,
140
- },
141
- centerButtonsContainer: {
142
- position: 'absolute',
143
- bottom: 20,
144
- left: 0,
145
- right: 0,
146
- alignItems: 'center',
147
- justifyContent: 'center',
148
- zIndex: 10,
149
- gap: 10,
150
- },
151
- welcomeText: {
152
- position: 'absolute',
153
- top: '40%',
154
- left: 20,
155
- right: 20,
156
- textAlign: 'center',
157
- color: GLOW_WHITE,
158
- fontSize: 40,
159
- fontWeight: '800',
160
- zIndex: 10,
161
- },
162
- startButton: {
163
- backgroundColor: PRIMARY_GREEN,
164
- paddingVertical: 18,
165
- paddingHorizontal: 30,
166
- borderRadius: 12,
167
- margin: 6,
168
- alignItems: 'center',
169
- justifyContent: 'center',
170
- borderWidth: 0,
171
- width: SCREEN_WIDTH * 0.9,
172
- height: 70,
173
- },
174
- startButtonText: {
175
- color: 'white',
176
- fontSize: 18,
177
- fontWeight: '600',
178
- textAlign: 'center',
179
- },
180
-
181
- loadingOverlay: {
182
- flex: 1,
183
- backgroundColor: 'rgba(0,0,0,0.5)',
184
- justifyContent: 'center',
185
- alignItems: 'center',
186
- position: 'absolute',
187
- top: 0,
188
- bottom: 0,
189
- left: 0,
190
- right: 0,
191
- zIndex: 9999,
192
- },
193
- loadingGif: {
194
- width: 120,
195
- height: 120,
196
- },
197
-
198
- fullscreenImageContainer: {
199
- position: 'absolute',
200
- top: 0,
201
- left: 0,
202
- width: SCREEN_WIDTH,
203
- height: SCREEN_HEIGHT,
204
- backgroundColor: 'black',
205
- justifyContent: 'center',
206
- alignItems: 'center',
207
- zIndex: 9999,
208
- },
209
- previewContainer: {
210
- flex: 1,
211
- backgroundColor: DEEP_BLACK,
212
- justifyContent: 'center',
213
- alignItems: 'center',
214
- width: '100%',
215
- },
216
- previewImage: {
217
- width: SCREEN_WIDTH,
218
- height: '80%',
219
- },
220
- previewButtonContainer: {
221
- position: 'absolute',
222
- bottom: 50,
223
- left: 0,
224
- right: 0,
225
- flexDirection: 'row',
226
- justifyContent: 'space-around',
227
- paddingHorizontal: 20,
228
- },
229
- previewButton: {
230
- backgroundColor: PRIMARY_GREEN,
231
- width: 60,
232
- height: 60,
233
- borderRadius: 30,
234
- alignItems: 'center',
235
- justifyContent: 'center',
236
- },
237
- useButton: {
238
- backgroundColor: GLOW_WHITE,
239
- },
240
-
241
-
242
- });
243
-
244
- export default styles;
1
+ import { StyleSheet, Dimensions } from 'react-native';
2
+
3
+ const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
4
+ const IMAGE_HEIGHT = SCREEN_HEIGHT;
5
+ const IMAGE_WIDTH = SCREEN_WIDTH;
6
+
7
+ const PRIMARY_GREEN = '#198754';
8
+ const DEEP_BLACK = '#0B0B0B';
9
+ const GLOW_WHITE = 'rgba(255, 255, 255, 0.85)';
10
+
11
+ const styles = StyleSheet.create({
12
+ container: {
13
+ flex: 1,
14
+ alignItems: 'center',
15
+ justifyContent: 'flex-start', // ✅ Start from top, allow content to flow down
16
+ backgroundColor: DEEP_BLACK,
17
+ },
18
+ // Wrapper for crop preview (9/16, same as CustomCamera); width set dynamically for tablet
19
+ commonWrapper: {
20
+ aspectRatio: 9 / 16,
21
+ borderRadius: 30,
22
+ overflow: 'hidden',
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ position: 'relative',
26
+ backgroundColor: 'black',
27
+ marginBottom: 0,
28
+ },
29
+ buttonContainer: {
30
+ position: 'absolute',
31
+ bottom: 50,
32
+ left: 0,
33
+ right: 0,
34
+ flexDirection: 'row',
35
+ flexWrap: 'wrap',
36
+ justifyContent: 'center',
37
+ alignItems: 'center',
38
+ paddingHorizontal: 10,
39
+ zIndex: 10,
40
+ gap: 10,
41
+ },
42
+ buttonContainerBelow: {
43
+ // ✅ Buttons positioned BELOW image, not overlapping, above Android navigation bar
44
+ position: 'absolute',
45
+ bottom: 0,
46
+ left: 0,
47
+ right: 0,
48
+ flexDirection: 'row',
49
+ justifyContent: 'center',
50
+ alignItems: 'center',
51
+ paddingHorizontal: 10,
52
+ paddingTop: 16,
53
+ gap: 8,
54
+ backgroundColor: DEEP_BLACK, // Fond noir pour séparer visuellement
55
+ },
56
+ iconButton: {
57
+ backgroundColor: PRIMARY_GREEN,
58
+ width: 60,
59
+ height: 60,
60
+ borderRadius: 30,
61
+ alignItems: 'center',
62
+ justifyContent: 'center',
63
+ marginRight: 5,
64
+ },
65
+ rotationButton: {
66
+ // Cercle, même couleur que Reset/Confirm (#549433), même hauteur que les autres boutons
67
+ backgroundColor: '#549433',
68
+ width: 56,
69
+ height: 48, // Même hauteur approximative que les boutons rectangulaires (padding 10 + texte)
70
+ borderRadius: 28,
71
+ alignItems: 'center',
72
+ justifyContent: 'center',
73
+ },
74
+ button: {
75
+ flex: 1,
76
+ minHeight: 48, // Même hauteur que le bouton de rotation
77
+ paddingVertical: 12,
78
+ paddingHorizontal: 10,
79
+ alignItems: "center",
80
+ justifyContent: "center",
81
+ backgroundColor: "#549433",
82
+ borderRadius: 5,
83
+ },
84
+ buttonText: {
85
+ color: 'white',
86
+ fontSize: 18,
87
+ fontWeight: '600',
88
+ textAlign: 'center',
89
+ },
90
+ iconText: {
91
+ color: PRIMARY_GREEN,
92
+ fontSize: 16,
93
+ fontWeight: '600',
94
+ textAlign: 'center',
95
+ },
96
+ imageContainer: {
97
+ width: IMAGE_WIDTH,
98
+ height: "80%",
99
+ justifyContent: 'center',
100
+ alignItems: 'center',
101
+ overflow: 'hidden',
102
+ backgroundColor: 'black',
103
+ },
104
+
105
+ image: {
106
+ width: '100%',
107
+ height: '100%',
108
+ resizeMode: 'contain',
109
+ },
110
+
111
+ overlay: {
112
+ position: 'absolute',
113
+ top: 0,
114
+ left: 0,
115
+ width: '100%',
116
+ height: '100%',
117
+ zIndex: 1,
118
+ },
119
+
120
+ croppedImage: {
121
+ width: IMAGE_WIDTH,
122
+ height: IMAGE_HEIGHT,
123
+ resizeMode: 'cover',
124
+ marginTop: 10,
125
+ borderWidth: 2,
126
+ borderColor: 'white',
127
+ borderRadius: 10,
128
+ },
129
+ fixedButtonContainer: {
130
+ position: 'absolute',
131
+ bottom: 100,
132
+ left: 0,
133
+ right: 0,
134
+ flexDirection: 'row',
135
+ justifyContent: 'center',
136
+ flexWrap: 'wrap',
137
+ gap: 10,
138
+ paddingHorizontal: 10,
139
+ },
140
+ fixedButton: {
141
+ backgroundColor: PRIMARY_GREEN,
142
+ paddingVertical: 18,
143
+ paddingHorizontal: 30,
144
+ borderRadius: 12,
145
+ margin: 6,
146
+ alignItems: 'center',
147
+ justifyContent: 'center',
148
+ borderWidth: 0,
149
+ width: SCREEN_WIDTH * 0.4,
150
+ height: 60,
151
+ },
152
+ centerButtonsContainer: {
153
+ position: 'absolute',
154
+ bottom: 20,
155
+ left: 0,
156
+ right: 0,
157
+ alignItems: 'center',
158
+ justifyContent: 'center',
159
+ zIndex: 10,
160
+ gap: 10,
161
+ },
162
+ welcomeText: {
163
+ position: 'absolute',
164
+ top: '40%',
165
+ left: 20,
166
+ right: 20,
167
+ textAlign: 'center',
168
+ color: GLOW_WHITE,
169
+ fontSize: 40,
170
+ fontWeight: '800',
171
+ zIndex: 10,
172
+ },
173
+ startButton: {
174
+ backgroundColor: PRIMARY_GREEN,
175
+ paddingVertical: 18,
176
+ paddingHorizontal: 30,
177
+ borderRadius: 12,
178
+ margin: 6,
179
+ alignItems: 'center',
180
+ justifyContent: 'center',
181
+ borderWidth: 0,
182
+ width: SCREEN_WIDTH * 0.9,
183
+ height: 70,
184
+ },
185
+ startButtonText: {
186
+ color: 'white',
187
+ fontSize: 18,
188
+ fontWeight: '600',
189
+ textAlign: 'center',
190
+ },
191
+
192
+ loadingOverlay: {
193
+ flex: 1,
194
+ backgroundColor: 'rgba(0,0,0,0.5)',
195
+ justifyContent: 'center',
196
+ alignItems: 'center',
197
+ position: 'absolute',
198
+ top: 0,
199
+ bottom: 0,
200
+ left: 0,
201
+ right: 0,
202
+ zIndex: 9999,
203
+ },
204
+ loadingGif: {
205
+ width: 120,
206
+ height: 120,
207
+ },
208
+
209
+ fullscreenImageContainer: {
210
+ position: 'absolute',
211
+ top: 0,
212
+ left: 0,
213
+ width: SCREEN_WIDTH,
214
+ height: SCREEN_HEIGHT,
215
+ backgroundColor: 'black',
216
+ justifyContent: 'center',
217
+ alignItems: 'center',
218
+ zIndex: 9999,
219
+ },
220
+ previewContainer: {
221
+ flex: 1,
222
+ backgroundColor: DEEP_BLACK,
223
+ justifyContent: 'center',
224
+ alignItems: 'center',
225
+ width: '100%',
226
+ },
227
+ previewImage: {
228
+ width: SCREEN_WIDTH,
229
+ height: '80%',
230
+ },
231
+ previewButtonContainer: {
232
+ position: 'absolute',
233
+ bottom: 50,
234
+ left: 0,
235
+ right: 0,
236
+ flexDirection: 'row',
237
+ justifyContent: 'space-around',
238
+ paddingHorizontal: 20,
239
+ },
240
+ previewButton: {
241
+ backgroundColor: PRIMARY_GREEN,
242
+ width: 60,
243
+ height: 60,
244
+ borderRadius: 30,
245
+ alignItems: 'center',
246
+ justifyContent: 'center',
247
+ },
248
+ useButton: {
249
+ backgroundColor: GLOW_WHITE,
250
+ },
251
+
252
+
253
+ });
254
+
255
+ export default styles;