@codeleap/mobile 1.4.0 → 1.5.0

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.
Files changed (83) hide show
  1. package/dist/components/ActivityIndicator.js +3 -4
  2. package/dist/components/ActivityIndicator.js.map +1 -1
  3. package/dist/components/Button.d.ts +1 -1
  4. package/dist/components/Button.js +1 -1
  5. package/dist/components/Button.js.map +1 -1
  6. package/dist/components/Checkbox/index.js +1 -1
  7. package/dist/components/Checkbox/index.js.map +1 -1
  8. package/dist/components/FileInput.js +2 -2
  9. package/dist/components/FileInput.js.map +1 -1
  10. package/dist/components/Icon.d.ts +2 -1
  11. package/dist/components/Icon.js +9 -3
  12. package/dist/components/Icon.js.map +1 -1
  13. package/dist/components/Image.d.ts +2 -1
  14. package/dist/components/Image.js +9 -3
  15. package/dist/components/Image.js.map +1 -1
  16. package/dist/components/Modal/styles.d.ts +1 -1
  17. package/dist/components/Modal/styles.js +9 -1
  18. package/dist/components/Modal/styles.js.map +1 -1
  19. package/dist/components/Navigation/Navigation.js +11 -3
  20. package/dist/components/Navigation/Navigation.js.map +1 -1
  21. package/dist/components/Navigation/types.js.map +1 -1
  22. package/dist/components/Navigation/utils.js +3 -0
  23. package/dist/components/Navigation/utils.js.map +1 -1
  24. package/dist/components/Overlay.js +1 -1
  25. package/dist/components/Overlay.js.map +1 -1
  26. package/dist/components/Pager/index.js +2 -2
  27. package/dist/components/Pager/index.js.map +1 -1
  28. package/dist/components/RadioInput/index.js +2 -2
  29. package/dist/components/RadioInput/index.js.map +1 -1
  30. package/dist/components/Select/index.js +10 -9
  31. package/dist/components/Select/index.js.map +1 -1
  32. package/dist/components/Switch.js.map +1 -1
  33. package/dist/components/TextInput.d.ts +2 -0
  34. package/dist/components/TextInput.js +3 -3
  35. package/dist/components/TextInput.js.map +1 -1
  36. package/dist/components/Touchable.d.ts +1 -1
  37. package/dist/modules/documentPicker.js.map +1 -1
  38. package/dist/utils/OSAlert.d.ts +3 -3
  39. package/dist/utils/OSAlert.js +63 -10
  40. package/dist/utils/OSAlert.js.map +1 -1
  41. package/package.json +3 -1
  42. package/src/components/ActivityIndicator.tsx +6 -7
  43. package/src/components/Animated.tsx +7 -7
  44. package/src/components/Button.tsx +12 -14
  45. package/src/components/Checkbox/index.tsx +7 -6
  46. package/src/components/Checkbox/styles.ts +2 -2
  47. package/src/components/ContentView.tsx +4 -4
  48. package/src/components/FileInput.tsx +28 -27
  49. package/src/components/Icon.tsx +14 -4
  50. package/src/components/Image.tsx +19 -9
  51. package/src/components/List.tsx +7 -7
  52. package/src/components/Modal/index.tsx +15 -15
  53. package/src/components/Modal/styles.ts +18 -3
  54. package/src/components/Navigation/Navigation.tsx +22 -15
  55. package/src/components/Navigation/index.tsx +2 -2
  56. package/src/components/Navigation/types.ts +3 -5
  57. package/src/components/Navigation/utils.tsx +25 -20
  58. package/src/components/Overlay.tsx +9 -8
  59. package/src/components/Pager/index.tsx +20 -21
  60. package/src/components/Pager/styles.ts +1 -1
  61. package/src/components/RadioInput/index.tsx +17 -16
  62. package/src/components/RadioInput/styles.ts +3 -3
  63. package/src/components/Scroll.tsx +7 -7
  64. package/src/components/Sections.tsx +100 -0
  65. package/src/components/Select/index.tsx +36 -33
  66. package/src/components/Select/styles.ts +7 -7
  67. package/src/components/Select/types.ts +18 -18
  68. package/src/components/Slider/Mark.tsx +7 -7
  69. package/src/components/Slider/Thumb.tsx +1 -1
  70. package/src/components/Slider/index.tsx +14 -14
  71. package/src/components/Slider/types.ts +18 -18
  72. package/src/components/Switch.tsx +6 -7
  73. package/src/components/Text.tsx +3 -3
  74. package/src/components/TextInput.tsx +14 -13
  75. package/src/components/Touchable.tsx +7 -7
  76. package/src/components/View.tsx +3 -3
  77. package/src/modules/documentPicker.ts +3 -4
  78. package/src/modules/index.d.ts +82 -82
  79. package/src/modules/types/documentPicker.d.ts +191 -191
  80. package/src/modules/types/fileTypes.ts +138 -138
  81. package/src/types/utility.ts +1 -1
  82. package/src/utils/OSAlert.ts +83 -27
  83. package/src/utils/misc.ts +2 -2
@@ -13,7 +13,7 @@ declare module 'react-native-image-crop-picker' {
13
13
  | 'LowQuality'
14
14
  | 'MediumQuality'
15
15
  | 'HighestQuality'
16
- | 'Passthrough';
16
+ | 'Passthrough'
17
17
 
18
18
  /**
19
19
  * iOS smart album types
@@ -46,7 +46,7 @@ declare module 'react-native-image-crop-picker' {
46
46
  | 'LivePhotos'
47
47
  /** >= iOS 11 */
48
48
  | 'Animated'
49
- | 'LongExposure';
49
+ | 'LongExposure'
50
50
 
51
51
  export interface CommonOptions {
52
52
  /**
@@ -54,7 +54,7 @@ declare module 'react-native-image-crop-picker' {
54
54
  *
55
55
  * @default false
56
56
  */
57
- multiple?: boolean;
57
+ multiple?: boolean
58
58
 
59
59
  /**
60
60
  * Min number of files to select when using `multiple` option.
@@ -62,7 +62,7 @@ declare module 'react-native-image-crop-picker' {
62
62
  * @platform iOS only
63
63
  * @default 1
64
64
  */
65
- minFiles?: number;
65
+ minFiles?: number
66
66
 
67
67
  /**
68
68
  * Max number of files to select when using `multiple` option.
@@ -70,7 +70,7 @@ declare module 'react-native-image-crop-picker' {
70
70
  * @platform iOS only
71
71
  * @default 5
72
72
  */
73
- maxFiles?: number;
73
+ maxFiles?: number
74
74
 
75
75
  /**
76
76
  * Promise will resolve/reject once ViewController completion block is called.
@@ -78,7 +78,7 @@ declare module 'react-native-image-crop-picker' {
78
78
  * @platform iOS only
79
79
  * @default true
80
80
  */
81
- waitAnimationEnd?: boolean;
81
+ waitAnimationEnd?: boolean
82
82
 
83
83
  /**
84
84
  * List of smart albums to choose from.
@@ -86,7 +86,7 @@ declare module 'react-native-image-crop-picker' {
86
86
  * @platform iOS only
87
87
  * @default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']
88
88
  */
89
- smartAlbums?: SmartAlbums[];
89
+ smartAlbums?: SmartAlbums[]
90
90
 
91
91
  /**
92
92
  * Whether to default to the front camera when opened. Please note that not all
@@ -95,21 +95,21 @@ declare module 'react-native-image-crop-picker' {
95
95
  *
96
96
  * @default false
97
97
  */
98
- useFrontCamera?: boolean;
98
+ useFrontCamera?: boolean
99
99
 
100
100
  /**
101
101
  * Text displayed while photo is loading in picker.
102
102
  *
103
103
  * @default 'Processing assets...'
104
104
  */
105
- loadingLabelText?: string;
105
+ loadingLabelText?: string
106
106
 
107
107
  /**
108
108
  * Whether to show the number of selected assets.
109
109
  *
110
110
  * @default true
111
111
  */
112
- showsSelectedCount?: boolean;
112
+ showsSelectedCount?: boolean
113
113
 
114
114
  /**
115
115
  * Applies a sort order on the creation date on how media is displayed within the
@@ -118,7 +118,7 @@ declare module 'react-native-image-crop-picker' {
118
118
  * @platform iOS only
119
119
  * @default 'none'
120
120
  */
121
- sortOrder?: 'none' | 'asc' | 'desc';
121
+ sortOrder?: 'none' | 'asc' | 'desc'
122
122
 
123
123
  /**
124
124
  * Whether to display bottom controls.
@@ -126,7 +126,7 @@ declare module 'react-native-image-crop-picker' {
126
126
  * @platform Android only
127
127
  * @default false
128
128
  */
129
- hideBottomControls?: boolean;
129
+ hideBottomControls?: boolean
130
130
 
131
131
  /**
132
132
  * When set to false, does not write temporary files for the selected images. This is useful
@@ -136,21 +136,21 @@ declare module 'react-native-image-crop-picker' {
136
136
  * @platform iOS only
137
137
  * @default true
138
138
  */
139
- writeTempFile?: boolean;
139
+ writeTempFile?: boolean
140
140
  }
141
141
 
142
142
  type ImageOptions = CommonOptions & {
143
- mediaType: 'photo';
143
+ mediaType: 'photo'
144
144
 
145
145
  /**
146
146
  * Width of result image when used with `cropping` option.
147
147
  */
148
- width?: number;
148
+ width?: number
149
149
 
150
150
  /**
151
151
  * Height of result image when used with `cropping` option.
152
152
  */
153
- height?: number;
153
+ height?: number
154
154
 
155
155
  /**
156
156
  * When set to true, the image file content will be available as a base64-encoded string in
@@ -159,35 +159,35 @@ declare module 'react-native-image-crop-picker' {
159
159
  *
160
160
  * @default false
161
161
  */
162
- includeBase64?: boolean;
162
+ includeBase64?: boolean
163
163
 
164
164
  /**
165
165
  * Include image exif data in the response.
166
166
  *
167
167
  * @default false
168
168
  */
169
- includeExif?: boolean;
169
+ includeExif?: boolean
170
170
 
171
171
  /**
172
172
  * Whether to convert photos to JPG. This will also convert any Live Photo into its JPG representation.
173
173
  *
174
174
  * @default false
175
175
  */
176
- forceJpg?: boolean;
176
+ forceJpg?: boolean
177
177
 
178
178
  /**
179
179
  * Enable or disable cropping.
180
180
  *
181
181
  * @default false
182
182
  */
183
- cropping?: boolean;
183
+ cropping?: boolean
184
184
 
185
185
  /**
186
186
  * When set to true, the image will always fill the mask space.
187
187
  *
188
188
  * @default true
189
189
  */
190
- avoidEmptySpaceAroundImage?: boolean;
190
+ avoidEmptySpaceAroundImage?: boolean
191
191
 
192
192
  /**
193
193
  * When cropping image, determines ActiveWidget color.
@@ -195,7 +195,7 @@ declare module 'react-native-image-crop-picker' {
195
195
  * @platform Android only
196
196
  * @default '#424242'
197
197
  */
198
- cropperActiveWidgetColor?: string;
198
+ cropperActiveWidgetColor?: string
199
199
 
200
200
  /**
201
201
  * When cropping image, determines the color of StatusBar.
@@ -203,7 +203,7 @@ declare module 'react-native-image-crop-picker' {
203
203
  * @platform Android only
204
204
  * @default '#424242'
205
205
  */
206
- cropperStatusBarColor?: string;
206
+ cropperStatusBarColor?: string
207
207
 
208
208
  /**
209
209
  * When cropping image, determines the color of Toolbar.
@@ -211,7 +211,7 @@ declare module 'react-native-image-crop-picker' {
211
211
  * @platform Android only
212
212
  * @default '#424242'
213
213
  */
214
- cropperToolbarColor?: string;
214
+ cropperToolbarColor?: string
215
215
 
216
216
  /**
217
217
  * When cropping image, determines the color of Toolbar text and buttons.
@@ -219,14 +219,14 @@ declare module 'react-native-image-crop-picker' {
219
219
  * @platform Android only
220
220
  * @default 'darker orange'
221
221
  */
222
- cropperToolbarWidgetColor?: string;
222
+ cropperToolbarWidgetColor?: string
223
223
 
224
224
  /**
225
225
  * When cropping image, determines the title of Toolbar.
226
226
  *
227
227
  * @default 'Edit Photo'
228
228
  */
229
- cropperToolbarTitle?: string;
229
+ cropperToolbarTitle?: string
230
230
 
231
231
  /**
232
232
  * Enables user to apply custom rectangle area for cropping.
@@ -234,33 +234,33 @@ declare module 'react-native-image-crop-picker' {
234
234
  * @platform iOS only
235
235
  * @default false
236
236
  */
237
- freeStyleCropEnabled?: boolean;
237
+ freeStyleCropEnabled?: boolean
238
238
 
239
239
  /**
240
240
  * cropperTintColor
241
241
  */
242
- cropperTintColor?: string;
242
+ cropperTintColor?: string
243
243
 
244
244
  /**
245
245
  * Enable or disable circular cropping mask.
246
246
  *
247
247
  * @default false
248
248
  */
249
- cropperCircleOverlay?: boolean;
249
+ cropperCircleOverlay?: boolean
250
250
 
251
251
  /**
252
252
  * Cancel button text.
253
253
  *
254
254
  * @default 'Cancel'
255
255
  */
256
- cropperCancelText?: string;
256
+ cropperCancelText?: string
257
257
 
258
258
  /**
259
259
  * Choose button text.
260
260
  *
261
261
  * @default 'Choose'
262
262
  */
263
- cropperChooseText?: string;
263
+ cropperChooseText?: string
264
264
 
265
265
  /**
266
266
  * Enable or disable cropper rotate buttons.
@@ -276,7 +276,7 @@ declare module 'react-native-image-crop-picker' {
276
276
  * @platform Android only
277
277
  * @default true
278
278
  */
279
- showCropGuidelines?: boolean;
279
+ showCropGuidelines?: boolean
280
280
 
281
281
  /**
282
282
  * Whether to show the square crop frame during cropping
@@ -284,7 +284,7 @@ declare module 'react-native-image-crop-picker' {
284
284
  * @platform Android only
285
285
  * @default true
286
286
  */
287
- showCropFrame?: boolean;
287
+ showCropFrame?: boolean
288
288
 
289
289
  /**
290
290
  * Whether to enable rotating the image by hand gesture.
@@ -292,7 +292,7 @@ declare module 'react-native-image-crop-picker' {
292
292
  * @platform Android only
293
293
  * @default false
294
294
  */
295
- enableRotationGesture?: boolean;
295
+ enableRotationGesture?: boolean
296
296
 
297
297
  /**
298
298
  * When cropping image, disables the color setters for cropping library.
@@ -300,21 +300,21 @@ declare module 'react-native-image-crop-picker' {
300
300
  * @platform Android only
301
301
  * @default false
302
302
  */
303
- disableCropperColorSetters?: boolean;
303
+ disableCropperColorSetters?: boolean
304
304
 
305
305
  /**
306
306
  * Compress image with maximum width.
307
307
  *
308
308
  * @default null
309
309
  */
310
- compressImageMaxWidth?: number;
310
+ compressImageMaxWidth?: number
311
311
 
312
312
  /**
313
313
  * Compress image with maximum height.
314
314
  *
315
315
  * @default null
316
316
  */
317
- compressImageMaxHeight?: number;
317
+ compressImageMaxHeight?: number
318
318
 
319
319
  /**
320
320
  * Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger
@@ -323,18 +323,18 @@ declare module 'react-native-image-crop-picker' {
323
323
  *
324
324
  * @default Android: 1, iOS: 0.8
325
325
  */
326
- compressImageQuality?: number;
326
+ compressImageQuality?: number
327
327
  }
328
328
 
329
329
  type CropperOptions = ImageOptions & {
330
330
  /**
331
331
  * Selected image location
332
332
  */
333
- path: string;
333
+ path: string
334
334
  }
335
335
 
336
336
  type VideoOptions = CommonOptions & {
337
- mediaType: 'video';
337
+ mediaType: 'video'
338
338
 
339
339
  /**
340
340
  * Choose which preset will be used for video compression.
@@ -342,106 +342,106 @@ declare module 'react-native-image-crop-picker' {
342
342
  * @platform iOS only
343
343
  * @default 'MediumQuality'
344
344
  */
345
- compressVideoPreset?: CompressVideoPresets;
346
- };
345
+ compressVideoPreset?: CompressVideoPresets
346
+ }
347
347
 
348
348
  type AnyOptions = Omit<ImageOptions, 'mediaType'> & Omit<VideoOptions, 'mediaType'> & {
349
- mediaType?: 'any';
350
- };
349
+ mediaType?: 'any'
350
+ }
351
351
 
352
- export type Options = AnyOptions | VideoOptions | ImageOptions;
352
+ export type Options = AnyOptions | VideoOptions | ImageOptions
353
353
 
354
354
  interface ImageVideoCommon {
355
355
  /**
356
356
  * Selected image location. This is null when the `writeTempFile` option is set to `false`.
357
357
  */
358
- path: string;
358
+ path: string
359
359
 
360
360
  /**
361
361
  * Selected image size in bytes.
362
362
  */
363
- size: number;
363
+ size: number
364
364
 
365
365
  /**
366
366
  * Selected image/video width.
367
367
  */
368
- width: number;
368
+ width: number
369
369
 
370
370
  /**
371
371
  * Selected image/video height.
372
372
  */
373
- height: number;
373
+ height: number
374
374
 
375
375
  /**
376
376
  * Selected image MIME type (image/jpeg, image/png, etc).
377
377
  */
378
- mime: string;
378
+ mime: string
379
379
 
380
380
  /**
381
381
  * Extracted exif data from image. Response format is platform specific.
382
382
  */
383
- exif?: null | object;
383
+ exif?: null | object
384
384
 
385
385
  /**
386
386
  * Selected image's localidentifier, used for PHAsset searching.
387
387
  *
388
388
  * @platform iOS only
389
389
  */
390
- localIdentifier?: string;
390
+ localIdentifier?: string
391
391
 
392
392
  /**
393
393
  * Selected image's source path, do not have write access.
394
394
  *
395
395
  * @platform iOS only
396
396
  */
397
- sourceURL?: string;
397
+ sourceURL?: string
398
398
 
399
399
  /**
400
400
  * Selected image/video's filename.
401
401
  *
402
402
  * @platform iOS only
403
403
  */
404
- filename?: string;
404
+ filename?: string
405
405
 
406
406
  /**
407
407
  * UNIX timestamp when image was created.
408
408
  *
409
409
  * @platform iOS only
410
410
  */
411
- creationDate?: string;
411
+ creationDate?: string
412
412
 
413
413
  /**
414
414
  * UNIX timestamp when image was last modified.
415
415
  */
416
- modificationDate?: string;
416
+ modificationDate?: string
417
417
  }
418
418
 
419
419
  export interface Image extends ImageVideoCommon {
420
420
  /**
421
421
  * Optional base64 selected file representation.
422
422
  */
423
- data?: string | null;
423
+ data?: string | null
424
424
 
425
425
  /**
426
426
  * Cropped image rectangle (width, height, x, y).
427
427
  */
428
- cropRect?: CropRect | null;
428
+ cropRect?: CropRect | null
429
429
  }
430
430
 
431
431
  export interface Video extends ImageVideoCommon {
432
432
  /**
433
433
  * Video duration in milliseconds
434
434
  */
435
- duration: number | null;
435
+ duration: number | null
436
436
  }
437
437
 
438
- export type ImageOrVideo = Image | Video;
438
+ export type ImageOrVideo = Image | Video
439
439
 
440
440
  export interface CropRect {
441
- x: number;
442
- y: number;
443
- width: number;
444
- height: number;
441
+ x: number
442
+ y: number
443
+ width: number
444
+ height: number
445
445
  }
446
446
 
447
447
  type PickerErrorCodeCommon =
@@ -449,13 +449,13 @@ declare module 'react-native-image-crop-picker' {
449
449
  | 'E_NO_IMAGE_DATA_FOUND'
450
450
  | 'E_NO_LIBRARY_PERMISSION'
451
451
  | 'E_NO_CAMERA_PERMISSION'
452
- | 'E_ERROR_WHILE_CLEANING_FILES';
452
+ | 'E_ERROR_WHILE_CLEANING_FILES'
453
453
 
454
454
  type PickerErrorCodeIOS =
455
455
  | 'E_PICKER_CANNOT_RUN_CAMERA_ON_SIMULATOR'
456
456
  | 'E_CROPPER_IMAGE_NOT_FOUND'
457
457
  | 'E_CANNOT_SAVE_IMAGE'
458
- | 'E_CANNOT_PROCESS_VIDEO';
458
+ | 'E_CANNOT_PROCESS_VIDEO'
459
459
 
460
460
  type PickerErrorCodeAndroid =
461
461
  | 'E_ACTIVITY_DOES_NOT_EXIST'
@@ -463,31 +463,31 @@ declare module 'react-native-image-crop-picker' {
463
463
  | 'E_FAILED_TO_SHOW_PICKER'
464
464
  | 'E_FAILED_TO_OPEN_CAMERA'
465
465
  | 'E_CAMERA_IS_NOT_AVAILABLE'
466
- | 'E_CANNOT_LAUNCH_CAMERA';
466
+ | 'E_CANNOT_LAUNCH_CAMERA'
467
467
 
468
- export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid;
468
+ export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid
469
469
 
470
470
  /** Change return type based on `multiple` property. */
471
- export type PossibleArray<O, T> = O extends { multiple: true; } ? T[] : T;
471
+ export type PossibleArray<O, T> = O extends { multiple: true } ? T[] : T
472
472
 
473
473
  /** Isolate return type based on `mediaType` property. */
474
474
  type MediaType<O> =
475
- O extends { mediaType: 'photo'; } ? Image :
476
- O extends { mediaType: 'video'; } ? Video :
477
- ImageOrVideo;
475
+ O extends { mediaType: 'photo' } ? Image :
476
+ O extends { mediaType: 'video' } ? Video :
477
+ ImageOrVideo
478
478
 
479
- export function openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>;
480
- export function openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>;
481
- export function openCropper(options: CropperOptions): Promise<Image>;
482
- export function clean(): Promise<void>;
483
- export function cleanSingle(path: string): Promise<void>;
479
+ export function openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
480
+ export function openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
481
+ export function openCropper(options: CropperOptions): Promise<Image>
482
+ export function clean(): Promise<void>
483
+ export function cleanSingle(path: string): Promise<void>
484
484
 
485
485
  export interface ImageCropPicker {
486
- openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>;
487
- openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>;
488
- openCropper(options: CropperOptions): Promise<Image>;
489
- clean(): Promise<void>;
490
- cleanSingle(path: string): Promise<void>;
486
+ openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
487
+ openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
488
+ openCropper(options: CropperOptions): Promise<Image>
489
+ clean(): Promise<void>
490
+ cleanSingle(path: string): Promise<void>
491
491
  }
492
492
 
493
493
  const ImageCropPicker: ImageCropPicker