@codeleap/mobile 3.1.1 → 3.2.1

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