@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,682 +0,0 @@
1
- declare module 'react-native-image-crop-picker' {
2
- /**
3
- * AVAssetExportPreset presets.
4
- *
5
- * @see https://developer.apple.com/documentation/avfoundation/avassetexportsession/export_preset_names_for_quicktime_files_of_a_given_size
6
- */
7
- type CompressVideoPresets =
8
- | '640x480'
9
- | '960x540'
10
- | '1280x720'
11
- | '1920x1080'
12
- | 'HEVC3840x2160'
13
- | 'LowQuality'
14
- | 'MediumQuality'
15
- | 'HighestQuality'
16
- | 'Passthrough'
17
-
18
- /**
19
- * iOS smart album types
20
- *
21
- * @see https://developer.apple.com/documentation/photokit/phassetcollectionsubtype
22
- */
23
- type SmartAlbums =
24
- | 'Regular'
25
- | 'SyncedEvent'
26
- | 'SyncedFaces'
27
- | 'SyncedAlbum'
28
- | 'Imported'
29
- | 'PhotoStream'
30
- | 'CloudShared'
31
- | 'Generic'
32
- | 'Panoramas'
33
- | 'Videos'
34
- | 'Favorites'
35
- | 'Timelapses'
36
- | 'AllHidden'
37
- | 'RecentlyAdded'
38
- | 'Bursts'
39
- | 'SlomoVideos'
40
- | 'UserLibrary'
41
- | 'Screenshots'
42
- | 'SelfPortraits'
43
- /** >= iOS 10.2 */
44
- | 'DepthEffect'
45
- /** >= iOS 10.3 */
46
- | 'LivePhotos'
47
- /** >= iOS 11 */
48
- | 'Animated'
49
- | 'LongExposure'
50
-
51
- export interface CommonOptions {
52
- /**
53
- * Enable or disable multiple image selection.
54
- *
55
- * @default false
56
- */
57
- multiple?: boolean
58
-
59
- /**
60
- * Min number of files to select when using `multiple` option.
61
- *
62
- * @platform iOS only
63
- * @default 1
64
- */
65
- minFiles?: number
66
-
67
- /**
68
- * Max number of files to select when using `multiple` option.
69
- *
70
- * @platform iOS only
71
- * @default 5
72
- */
73
- maxFiles?: number
74
-
75
- /**
76
- * Promise will resolve/reject once ViewController completion block is called.
77
- *
78
- * @platform iOS only
79
- * @default true
80
- */
81
- waitAnimationEnd?: boolean
82
-
83
- /**
84
- * List of smart albums to choose from.
85
- *
86
- * @platform iOS only
87
- * @default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']
88
- */
89
- smartAlbums?: SmartAlbums[]
90
-
91
- /**
92
- * Whether to default to the front camera when opened. Please note that not all
93
- * Android devices handle this parameter, see
94
- * [issue #1058](https://github.com/ivpusic/react-native-image-crop-picker/issues/1058).
95
- *
96
- * @default false
97
- */
98
- useFrontCamera?: boolean
99
-
100
- /**
101
- * Text displayed while photo is loading in picker.
102
- *
103
- * @default 'Processing assets...'
104
- */
105
- loadingLabelText?: string
106
-
107
- /**
108
- * Whether to show the number of selected assets.
109
- *
110
- * @default true
111
- */
112
- showsSelectedCount?: boolean
113
-
114
- /**
115
- * Applies a sort order on the creation date on how media is displayed within the
116
- * albums/detail photo views when opening the image picker.
117
- *
118
- * @platform iOS only
119
- * @default 'none'
120
- */
121
- sortOrder?: 'none' | 'asc' | 'desc'
122
-
123
- /**
124
- * Whether to display bottom controls.
125
- *
126
- * @platform Android only
127
- * @default false
128
- */
129
- hideBottomControls?: boolean
130
-
131
- /**
132
- * When set to false, does not write temporary files for the selected images. This is useful
133
- * to improve performance when you are retrieving file contents with the includeBase64 option
134
- * and don't need to read files from disk.
135
- *
136
- * @platform iOS only
137
- * @default true
138
- */
139
- writeTempFile?: boolean
140
- }
141
-
142
- type ImageOptions = CommonOptions & {
143
- mediaType: 'photo'
144
-
145
- /**
146
- * Width of result image when used with `cropping` option.
147
- */
148
- width?: number
149
-
150
- /**
151
- * Height of result image when used with `cropping` option.
152
- */
153
- height?: number
154
-
155
- /**
156
- * When set to true, the image file content will be available as a base64-encoded string in
157
- * the data property. Hint: To use this string as an image source, use it like:
158
- * <Image source={{uri: `data:${image.mime};base64,${image.data}`}} />
159
- *
160
- * @default false
161
- */
162
- includeBase64?: boolean
163
-
164
- /**
165
- * Include image exif data in the response.
166
- *
167
- * @default false
168
- */
169
- includeExif?: boolean
170
-
171
- /**
172
- * Whether to convert photos to JPG. This will also convert any Live Photo into its JPG representation.
173
- *
174
- * @default false
175
- */
176
- forceJpg?: boolean
177
-
178
- /**
179
- * Enable or disable cropping.
180
- *
181
- * @default false
182
- */
183
- cropping?: boolean
184
-
185
- /**
186
- * When set to true, the image will always fill the mask space.
187
- *
188
- * @default true
189
- */
190
- avoidEmptySpaceAroundImage?: boolean
191
-
192
- /**
193
- * When cropping image, determines ActiveWidget color.
194
- *
195
- * @platform Android only
196
- * @default '#424242'
197
- */
198
- cropperActiveWidgetColor?: string
199
-
200
- /**
201
- * When cropping image, determines the color of StatusBar.
202
- *
203
- * @platform Android only
204
- * @default '#424242'
205
- */
206
- cropperStatusBarColor?: string
207
-
208
- /**
209
- * When cropping image, determines the color of Toolbar.
210
- *
211
- * @platform Android only
212
- * @default '#424242'
213
- */
214
- cropperToolbarColor?: string
215
-
216
- /**
217
- * When cropping image, determines the color of Toolbar text and buttons.
218
- *
219
- * @platform Android only
220
- * @default 'darker orange'
221
- */
222
- cropperToolbarWidgetColor?: string
223
-
224
- /**
225
- * When cropping image, determines the title of Toolbar.
226
- *
227
- * @default 'Edit Photo'
228
- */
229
- cropperToolbarTitle?: string
230
-
231
- /**
232
- * Enables user to apply custom rectangle area for cropping.
233
- *
234
- * @platform iOS only
235
- * @default false
236
- */
237
- freeStyleCropEnabled?: boolean
238
-
239
- /**
240
- * cropperTintColor
241
- */
242
- cropperTintColor?: string
243
-
244
- /**
245
- * Enable or disable circular cropping mask.
246
- *
247
- * @default false
248
- */
249
- cropperCircleOverlay?: boolean
250
-
251
- /**
252
- * Cancel button text.
253
- *
254
- * @default 'Cancel'
255
- */
256
- cropperCancelText?: string
257
-
258
- /**
259
- * Choose button text.
260
- *
261
- * @default 'Choose'
262
- */
263
- cropperChooseText?: string
264
-
265
- /**
266
- * Enable or disable cropper rotate buttons.
267
- *
268
- * @platform iOS only
269
- * @default false
270
- */
271
- cropperRotateButtonsHidden?: boolean
272
-
273
- /**
274
- * Whether to show the 3x3 grid on top of the image during cropping.
275
- *
276
- * @platform Android only
277
- * @default true
278
- */
279
- showCropGuidelines?: boolean
280
-
281
- /**
282
- * Whether to show the square crop frame during cropping
283
- *
284
- * @platform Android only
285
- * @default true
286
- */
287
- showCropFrame?: boolean
288
-
289
- /**
290
- * Whether to enable rotating the image by hand gesture.
291
- *
292
- * @platform Android only
293
- * @default false
294
- */
295
- enableRotationGesture?: boolean
296
-
297
- /**
298
- * When cropping image, disables the color setters for cropping library.
299
- *
300
- * @platform Android only
301
- * @default false
302
- */
303
- disableCropperColorSetters?: boolean
304
-
305
- /**
306
- * Compress image with maximum width.
307
- *
308
- * @default null
309
- */
310
- compressImageMaxWidth?: number
311
-
312
- /**
313
- * Compress image with maximum height.
314
- *
315
- * @default null
316
- */
317
- compressImageMaxHeight?: number
318
-
319
- /**
320
- * Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger
321
- * than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8
322
- * will reduce the file size by about half or less compared to a value of 1.
323
- *
324
- * @default Android: 1, iOS: 0.8
325
- */
326
- compressImageQuality?: number
327
- }
328
-
329
- type CropperOptions = ImageOptions & {
330
- /**
331
- * Selected image location
332
- */
333
- path: string
334
- }
335
-
336
- type VideoOptions = CommonOptions & {
337
- mediaType: 'video'
338
-
339
- /**
340
- * Choose which preset will be used for video compression.
341
- *
342
- * @platform iOS only
343
- * @default 'MediumQuality'
344
- */
345
- compressVideoPreset?: CompressVideoPresets
346
- }
347
-
348
- type AnyOptions = Omit<ImageOptions, 'mediaType'> & Omit<VideoOptions, 'mediaType'> & {
349
- mediaType?: 'any'
350
- }
351
-
352
- export type Options = AnyOptions | VideoOptions | ImageOptions
353
-
354
- interface ImageVideoCommon {
355
- /**
356
- * Selected image location. This is null when the `writeTempFile` option is set to `false`.
357
- */
358
- path: string
359
-
360
- /**
361
- * Selected image size in bytes.
362
- */
363
- size: number
364
-
365
- /**
366
- * Selected image/video width.
367
- */
368
- width: number
369
-
370
- /**
371
- * Selected image/video height.
372
- */
373
- height: number
374
-
375
- /**
376
- * Selected image MIME type (image/jpeg, image/png, etc).
377
- */
378
- mime: string
379
-
380
- /**
381
- * Extracted exif data from image. Response format is platform specific.
382
- */
383
- exif?: null | object
384
-
385
- /**
386
- * Selected image's localidentifier, used for PHAsset searching.
387
- *
388
- * @platform iOS only
389
- */
390
- localIdentifier?: string
391
-
392
- /**
393
- * Selected image's source path, do not have write access.
394
- *
395
- * @platform iOS only
396
- */
397
- sourceURL?: string
398
-
399
- /**
400
- * Selected image/video's filename.
401
- *
402
- * @platform iOS only
403
- */
404
- filename?: string
405
-
406
- /**
407
- * UNIX timestamp when image was created.
408
- *
409
- * @platform iOS only
410
- */
411
- creationDate?: string
412
-
413
- /**
414
- * UNIX timestamp when image was last modified.
415
- */
416
- modificationDate?: string
417
- }
418
-
419
- export interface Image extends ImageVideoCommon {
420
- /**
421
- * Optional base64 selected file representation.
422
- */
423
- data?: string | null
424
-
425
- /**
426
- * Cropped image rectangle (width, height, x, y).
427
- */
428
- cropRect?: CropRect | null
429
- }
430
-
431
- export interface Video extends ImageVideoCommon {
432
- /**
433
- * Video duration in milliseconds
434
- */
435
- duration: number | null
436
- }
437
-
438
- export type ImageOrVideo = Image | Video
439
-
440
- export interface CropRect {
441
- x: number
442
- y: number
443
- width: number
444
- height: number
445
- }
446
-
447
- type PickerErrorCodeCommon =
448
- | 'E_PICKER_CANCELLED'
449
- | 'E_NO_IMAGE_DATA_FOUND'
450
- | 'E_NO_LIBRARY_PERMISSION'
451
- | 'E_NO_CAMERA_PERMISSION'
452
- | 'E_ERROR_WHILE_CLEANING_FILES'
453
-
454
- type PickerErrorCodeIOS =
455
- | 'E_PICKER_CANNOT_RUN_CAMERA_ON_SIMULATOR'
456
- | 'E_CROPPER_IMAGE_NOT_FOUND'
457
- | 'E_CANNOT_SAVE_IMAGE'
458
- | 'E_CANNOT_PROCESS_VIDEO'
459
-
460
- type PickerErrorCodeAndroid =
461
- | 'E_ACTIVITY_DOES_NOT_EXIST'
462
- | 'E_CALLBACK_ERROR'
463
- | 'E_FAILED_TO_SHOW_PICKER'
464
- | 'E_FAILED_TO_OPEN_CAMERA'
465
- | 'E_CAMERA_IS_NOT_AVAILABLE'
466
- | 'E_CANNOT_LAUNCH_CAMERA'
467
-
468
- export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid
469
-
470
- /** Change return type based on `multiple` property. */
471
- export type PossibleArray<O, T> = O extends { multiple: true } ? T[] : T
472
-
473
- /** Isolate return type based on `mediaType` property. */
474
- type MediaType<O> =
475
- O extends { mediaType: 'photo' } ? Image :
476
- O extends { mediaType: 'video' } ? Video :
477
- ImageOrVideo
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>
484
-
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>
491
- }
492
-
493
- const ImageCropPicker: ImageCropPicker
494
-
495
- export default ImageCropPicker
496
- }
497
-
498
- import * as React from 'react'
499
- import {
500
- ScrollViewProps,
501
- FlatListProps,
502
- SectionListProps,
503
- } from 'react-native'
504
- export namespace KeyboardAwareScrollViewTypes {
505
- interface KeyboardAwareProps {
506
- /**
507
- * Catches the reference of the component.
508
- *
509
- *
510
- * @type {function}
511
- * @memberof KeyboardAwareProps
512
- */
513
- innerRef?: (ref: JSX.Element) => void
514
- /**
515
- * Adds an extra offset that represents the TabBarIOS height.
516
- *
517
- * Default is false
518
- * @type {boolean}
519
- * @memberof KeyboardAwareProps
520
- */
521
- viewIsInsideTabBar?: boolean
522
-
523
- /**
524
- * Coordinates that will be used to reset the scroll when the keyboard hides.
525
- *
526
- * @type {{
527
- * x: number,
528
- * y: number
529
- * }}
530
- * @memberof KeyboardAwareProps
531
- */
532
- resetScrollToCoords?: {
533
- x: number
534
- y: number
535
- }
536
-
537
- /**
538
- * Lets the user enable or disable automatic resetScrollToCoords
539
- *
540
- * @type {boolean}
541
- * @memberof KeyboardAwareProps
542
- */
543
- enableResetScrollToCoords?: boolean
544
-
545
- /**
546
- * When focus in TextInput will scroll the position
547
- *
548
- * Default is true
549
- *
550
- * @type {boolean}
551
- * @memberof KeyboardAwareProps
552
- */
553
-
554
- enableAutomaticScroll?: boolean
555
- /**
556
- * Enables keyboard aware settings for Android
557
- *
558
- * Default is false
559
- *
560
- * @type {boolean}
561
- * @memberof KeyboardAwareProps
562
- */
563
- enableOnAndroid?: boolean
564
-
565
- /**
566
- * Adds an extra offset when focusing the TextInputs.
567
- *
568
- * Default is 75
569
- * @type {number}
570
- * @memberof KeyboardAwareProps
571
- */
572
- extraHeight?: number
573
-
574
- /**
575
- * Adds an extra offset to the keyboard.
576
- * Useful if you want to stick elements above the keyboard.
577
- *
578
- * Default is 0
579
- *
580
- * @type {number}
581
- * @memberof KeyboardAwareProps
582
- */
583
- extraScrollHeight?: number
584
-
585
- /**
586
- * Sets the delay time before scrolling to new position
587
- *
588
- * Default is 250
589
- *
590
- * @type {number}
591
- * @memberof KeyboardAwareProps
592
- */
593
- keyboardOpeningTime?: number
594
-
595
- /**
596
- * Callback when the keyboard will show.
597
- *
598
- * @param frames Information about the keyboard frame and animation.
599
- */
600
- onKeyboardWillShow?: (frames: Object) => void
601
-
602
- /**
603
- * Callback when the keyboard did show.
604
- *
605
- * @param frames Information about the keyboard frame and animation.
606
- */
607
- onKeyboardDidShow?: (frames: Object) => void
608
-
609
- /**
610
- * Callback when the keyboard will hide.
611
- *
612
- * @param frames Information about the keyboard frame and animation.
613
- */
614
- onKeyboardWillHide?: (frames: Object) => void
615
-
616
- /**
617
- * Callback when the keyboard did hide.
618
- *
619
- * @param frames Information about the keyboard frame and animation.
620
- */
621
- onKeyboardDidHide?: (frames: Object) => void
622
-
623
- /**
624
- * Callback when the keyboard frame will change.
625
- *
626
- * @param frames Information about the keyboard frame and animation.
627
- */
628
- onKeyboardWillChangeFrame?: (frames: Object) => void
629
-
630
- /**
631
- * Callback when the keyboard frame did change.
632
- *
633
- * @param frames Information about the keyboard frame and animation.
634
- */
635
- onKeyboardDidChangeFrame?: (frames: Object) => void
636
- }
637
-
638
- interface KeyboardAwareScrollViewProps
639
- extends KeyboardAwareProps,
640
- ScrollViewProps {}
641
- interface KeyboardAwareFlatListProps<ItemT>
642
- extends KeyboardAwareProps,
643
- FlatListProps<ItemT> {}
644
- interface KeyboardAwareSectionListProps<ItemT>
645
- extends KeyboardAwareProps,
646
- SectionListProps<ItemT> {}
647
-
648
- interface KeyboardAwareState {
649
- keyboardSpace: number
650
- }
651
-
652
- declare class ScrollableComponent<P, S> extends React.Component<P, S> {
653
- getScrollResponder: () => void
654
-
655
- scrollToPosition: (x: number, y: number, animated?: boolean) => void
656
-
657
- scrollToEnd: (animated?: boolean) => void
658
-
659
- scrollForExtraHeightOnAndroid: (extraHeight: number) => void
660
-
661
- scrollToFocusedInput: (
662
- reactNode: Object,
663
- extraHeight?: number,
664
- keyboardOpeningTime?: number
665
- ) => void
666
- }
667
-
668
- export class KeyboardAwareMixin {}
669
- export class KeyboardAwareScrollView extends ScrollableComponent<
670
- KeyboardAwareScrollViewProps,
671
- KeyboardAwareState
672
- > {}
673
- export class KeyboardAwareFlatList extends ScrollableComponent<
674
- KeyboardAwareFlatListProps<any>,
675
- KeyboardAwareState
676
- > {}
677
- export class KeyboardAwareSectionList extends ScrollableComponent<
678
- KeyboardAwareSectionListProps<any>,
679
- KeyboardAwareState
680
- > {}
681
-
682
- }
@@ -1,6 +0,0 @@
1
- // @ts-ignore
2
- import DeviceInfo from 'react-native-device-info'
3
-
4
- export {
5
- DeviceInfo
6
- }