@codeleap/mobile 2.3.4 → 2.3.6

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 (118) hide show
  1. package/dist/components/Text/index.js +4 -1
  2. package/dist/components/Text/index.js.map +1 -1
  3. package/package.json +3 -2
  4. package/src/components/ActionIcon/index.tsx +0 -32
  5. package/src/components/ActionIcon/styles.ts +0 -97
  6. package/src/components/ActivityIndicator/index.tsx +0 -50
  7. package/src/components/ActivityIndicator/styles.ts +0 -68
  8. package/src/components/Animated.tsx +0 -34
  9. package/src/components/AutoComplete/index.tsx +0 -163
  10. package/src/components/AutoComplete/styles.ts +0 -44
  11. package/src/components/Backdrop/index.tsx +0 -48
  12. package/src/components/Backdrop/styles.ts +0 -33
  13. package/src/components/Button/index.tsx +0 -155
  14. package/src/components/Button/styles.ts +0 -129
  15. package/src/components/Calendar/index.tsx +0 -65
  16. package/src/components/Calendar/style.ts +0 -35
  17. package/src/components/Calendar/types.ts +0 -102
  18. package/src/components/Checkbox/index.tsx +0 -91
  19. package/src/components/Checkbox/styles.ts +0 -81
  20. package/src/components/ContentView/index.tsx +0 -63
  21. package/src/components/ContentView/styles.ts +0 -24
  22. package/src/components/Drawer/index.tsx +0 -33
  23. package/src/components/Drawer/styles.ts +0 -43
  24. package/src/components/EmptyPlaceholder/index.tsx +0 -88
  25. package/src/components/EmptyPlaceholder/styles.ts +0 -58
  26. package/src/components/FileInput/index.tsx +0 -181
  27. package/src/components/FileInput/styles.ts +0 -15
  28. package/src/components/Grid/index.tsx +0 -117
  29. package/src/components/Grid/styles.ts +0 -11
  30. package/src/components/Icon/index.tsx +0 -69
  31. package/src/components/Icon/styles.ts +0 -57
  32. package/src/components/Image/index.tsx +0 -91
  33. package/src/components/Image/styles.ts +0 -20
  34. package/src/components/ImageView/Spotlight.tsx +0 -157
  35. package/src/components/ImageView/component.tsx +0 -38
  36. package/src/components/ImageView/index.ts +0 -2
  37. package/src/components/InputLabel/index.tsx +0 -38
  38. package/src/components/InputLabel/styles.ts +0 -19
  39. package/src/components/List/PaginationIndicator.tsx +0 -71
  40. package/src/components/List/index.tsx +0 -114
  41. package/src/components/List/styles.ts +0 -19
  42. package/src/components/Modal/index.tsx +0 -218
  43. package/src/components/Modal/styles.ts +0 -153
  44. package/src/components/MultiSelect/index.tsx +0 -138
  45. package/src/components/MultiSelect/styles.ts +0 -18
  46. package/src/components/MultiSelect/types.ts +0 -42
  47. package/src/components/Navigation/Navigation.tsx +0 -54
  48. package/src/components/Navigation/constants.ts +0 -8
  49. package/src/components/Navigation/index.tsx +0 -3
  50. package/src/components/Navigation/types.ts +0 -35
  51. package/src/components/Navigation/utils.tsx +0 -57
  52. package/src/components/Pager/index.tsx +0 -121
  53. package/src/components/Pager/styles.ts +0 -81
  54. package/src/components/RadioInput/index.tsx +0 -106
  55. package/src/components/RadioInput/styles.ts +0 -67
  56. package/src/components/Scroll/index.tsx +0 -124
  57. package/src/components/Scroll/styles.ts +0 -18
  58. package/src/components/Sections/index.tsx +0 -91
  59. package/src/components/SegmentedControl/index.tsx +0 -204
  60. package/src/components/SegmentedControl/styles.ts +0 -89
  61. package/src/components/Select/index.tsx +0 -167
  62. package/src/components/Select/styles.ts +0 -62
  63. package/src/components/Select/types.ts +0 -43
  64. package/src/components/Slider/Mark.tsx +0 -46
  65. package/src/components/Slider/Thumb.tsx +0 -29
  66. package/src/components/Slider/index.tsx +0 -130
  67. package/src/components/Slider/styles.ts +0 -76
  68. package/src/components/Slider/types.ts +0 -30
  69. package/src/components/Switch/index.tsx +0 -91
  70. package/src/components/Switch/styles.ts +0 -38
  71. package/src/components/Text/index.tsx +0 -119
  72. package/src/components/Text/styles.ts +0 -50
  73. package/src/components/TextInput/index.tsx +0 -319
  74. package/src/components/TextInput/styles.ts +0 -127
  75. package/src/components/Touchable/index.tsx +0 -174
  76. package/src/components/Touchable/styles.ts +0 -28
  77. package/src/components/View/index.tsx +0 -103
  78. package/src/components/View/styles.ts +0 -24
  79. package/src/components/components.ts +0 -42
  80. package/src/components/defaultStyles.ts +0 -62
  81. package/src/components/legacy/Modal/index.tsx +0 -163
  82. package/src/components/legacy/Modal/styles.ts +0 -125
  83. package/src/components/legacy/Pager/index.tsx +0 -242
  84. package/src/components/legacy/Pager/styles.ts +0 -51
  85. package/src/components/legacy/index.ts +0 -2
  86. package/src/modules/documentPicker.ts +0 -7
  87. package/src/modules/fastImage.ts +0 -2
  88. package/src/modules/imageCropPicker.d.ts +0 -497
  89. package/src/modules/index.d.ts +0 -682
  90. package/src/modules/reactNavigation.ts +0 -15
  91. package/src/modules/textInputMask.ts +0 -11
  92. package/src/modules/types/documentPicker.d.ts +0 -215
  93. package/src/modules/types/fileTypes.ts +0 -138
  94. package/src/modules/types/textInputMask.ts +0 -9
  95. package/src/types/index.ts +0 -1
  96. package/src/types/utility.ts +0 -9
  97. package/src/utils/KeyboardAware/context.tsx +0 -75
  98. package/src/utils/KeyboardAware/index.ts +0 -17
  99. package/src/utils/KeyboardAware/keyboardHooks.ts +0 -124
  100. package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +0 -4
  101. package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +0 -618
  102. package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +0 -13
  103. package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +0 -6
  104. package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +0 -6
  105. package/src/utils/KeyboardAware/types.ts +0 -159
  106. package/src/utils/ModalManager/components.tsx +0 -112
  107. package/src/utils/ModalManager/context.tsx +0 -260
  108. package/src/utils/ModalManager/index.ts +0 -16
  109. package/src/utils/OSAlert.ts +0 -180
  110. package/src/utils/PermissionManager/context.tsx +0 -302
  111. package/src/utils/PermissionManager/index.ts +0 -20
  112. package/src/utils/PermissionManager/types.ts +0 -24
  113. package/src/utils/hooks.ts +0 -163
  114. package/src/utils/index.ts +0 -11
  115. package/src/utils/input.ts +0 -51
  116. package/src/utils/misc.ts +0 -83
  117. package/src/utils/notifications.ts +0 -206
  118. package/src/utils/theme.ts +0 -58
@@ -1,215 +0,0 @@
1
- import { ModalPropsIOS } from 'react-native'
2
- import type { PlatformTypes, SupportedPlatforms } from './fileTypes'
3
-
4
- export declare type DocumentPickerResponse = {
5
- uri: string
6
- name: string
7
- copyError?: string
8
- fileCopyUri: string | null
9
- type: string | null
10
- size: number | null
11
- }
12
- export declare const types: Readonly<{
13
- readonly allFiles: '*/*'
14
- readonly audio: 'audio/*'
15
- readonly csv: 'text/csv'
16
- readonly doc: 'application/msword'
17
- readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
18
- readonly images: 'image/*'
19
- readonly pdf: 'application/pdf'
20
- readonly plainText: 'text/plain'
21
- readonly ppt: 'application/vnd.ms-powerpoint'
22
- readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
23
- readonly video: 'video/*'
24
- readonly xls: 'application/vnd.ms-excel'
25
- readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
26
- readonly zip: 'application/zip'
27
- }> | Readonly<{
28
- readonly allFiles: 'public.item'
29
- readonly audio: 'public.audio'
30
- readonly csv: 'public.comma-separated-values-text'
31
- readonly doc: 'com.microsoft.word.doc'
32
- readonly docx: 'org.openxmlformats.wordprocessingml.document'
33
- readonly images: 'public.image'
34
- readonly pdf: 'com.adobe.pdf'
35
- readonly plainText: 'public.plain-text'
36
- readonly ppt: 'com.microsoft.powerpoint.ppt'
37
- readonly pptx: 'org.openxmlformats.presentationml.presentation'
38
- readonly video: 'public.movie'
39
- readonly xls: 'com.microsoft.excel.xls'
40
- readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet'
41
- readonly zip: 'public.zip-archive'
42
- }> | Readonly<{
43
- readonly allFiles: '*'
44
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
45
- readonly csv: '.csv'
46
- readonly doc: '.doc'
47
- readonly docx: '.docx'
48
- readonly images: '.jpeg .jpg .png'
49
- readonly pdf: '.pdf'
50
- readonly plainText: '.txt'
51
- readonly ppt: '.ppt'
52
- readonly pptx: '.pptx'
53
- readonly video: '.mp4'
54
- readonly xls: '.xls'
55
- readonly xlsx: '.xlsx'
56
- readonly zip: '.zip .gz'
57
- }>
58
- export declare type DirectoryPickerResponse = {
59
- uri: string
60
- }
61
- export declare type DocumentPickerOptions<OS extends SupportedPlatforms> = {
62
- type?: string | PlatformTypes[OS][keyof PlatformTypes[OS]] | Array<PlatformTypes[OS][keyof PlatformTypes[OS]] | string>
63
- mode?: 'import' | 'open'
64
- copyTo?: 'cachesDirectory' | 'documentDirectory'
65
- allowMultiSelection?: boolean
66
- } & Pick<ModalPropsIOS, 'presentationStyle'>
67
- export declare function pickDirectory<
68
- OS extends SupportedPlatforms>(params?: Pick<DocumentPickerOptions<OS>, 'presentationStyle'>): Promise<DirectoryPickerResponse | null>
69
- export declare function pickMultiple<OS extends SupportedPlatforms>(opts?: DocumentPickerOptions<OS>): Promise<DocumentPickerResponse[]>
70
- export declare function pickSingle<OS extends SupportedPlatforms>(opts?: DocumentPickerOptions<OS>): Promise<DocumentPickerResponse>
71
- export declare function pick<OS extends SupportedPlatforms>(opts?: DocumentPickerOptions<OS>): Promise<DocumentPickerResponse[]>
72
- export declare function releaseSecureAccess(uris: Array<string>): Promise<void>
73
- export declare type NativeModuleErrorShape = Error & {
74
- code?: string
75
- }
76
- export declare function isCancel(err: unknown): boolean
77
- export declare function isInProgress(err: unknown): boolean
78
-
79
- export type DocumentPicker = {
80
- isCancel: typeof isCancel
81
- releaseSecureAccess: typeof releaseSecureAccess
82
- pickDirectory: typeof pickDirectory
83
- pick: typeof pick
84
- pickMultiple: typeof pickMultiple
85
- pickSingle: typeof pickSingle
86
- types: Readonly<{
87
- readonly allFiles: '*/*'
88
- readonly audio: 'audio/*'
89
- readonly csv: 'text/csv'
90
- readonly doc: 'application/msword'
91
- readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
92
- readonly images: 'image/*'
93
- readonly pdf: 'application/pdf'
94
- readonly plainText: 'text/plain'
95
- readonly ppt: 'application/vnd.ms-powerpoint'
96
- readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
97
- readonly video: 'video/*'
98
- readonly xls: 'application/vnd.ms-excel'
99
- readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
100
- readonly zip: 'application/zip'
101
- }> | Readonly<{
102
- readonly allFiles: 'public.item'
103
- readonly audio: 'public.audio'
104
- readonly csv: 'public.comma-separated-values-text'
105
- readonly doc: 'com.microsoft.word.doc'
106
- readonly docx: 'org.openxmlformats.wordprocessingml.document'
107
- readonly images: 'public.image'
108
- readonly pdf: 'com.adobe.pdf'
109
- readonly plainText: 'public.plain-text'
110
- readonly ppt: 'com.microsoft.powerpoint.ppt'
111
- readonly pptx: 'org.openxmlformats.presentationml.presentation'
112
- readonly video: 'public.movie'
113
- readonly xls: 'com.microsoft.excel.xls'
114
- readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet'
115
- readonly zip: 'public.zip-archive'
116
- }> | Readonly<{
117
- readonly allFiles: '*'
118
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
119
- readonly csv: '.csv'
120
- readonly doc: '.doc'
121
- readonly docx: '.docx'
122
- readonly images: '.jpeg .jpg .png'
123
- readonly pdf: '.pdf'
124
- readonly plainText: '.txt'
125
- readonly ppt: '.ppt'
126
- readonly pptx: '.pptx'
127
- readonly video: '.mp4'
128
- readonly xls: '.xls'
129
- readonly xlsx: '.xlsx'
130
- readonly zip: '.zip .gz'
131
- }>
132
- perPlatformTypes: {
133
- android: Readonly<{
134
- readonly allFiles: '*/*'
135
- readonly audio: 'audio/*'
136
- readonly csv: 'text/csv'
137
- readonly doc: 'application/msword'
138
- readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
139
- readonly images: 'image/*'
140
- readonly pdf: 'application/pdf'
141
- readonly plainText: 'text/plain'
142
- readonly ppt: 'application/vnd.ms-powerpoint'
143
- readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
144
- readonly video: 'video/*'
145
- readonly xls: 'application/vnd.ms-excel'
146
- readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
147
- readonly zip: 'application/zip'
148
- }>
149
- ios: Readonly<{
150
- readonly allFiles: 'public.item'
151
- readonly audio: 'public.audio'
152
- readonly csv: 'public.comma-separated-values-text'
153
- readonly doc: 'com.microsoft.word.doc'
154
- readonly docx: 'org.openxmlformats.wordprocessingml.document'
155
- readonly images: 'public.image'
156
- readonly pdf: 'com.adobe.pdf'
157
- readonly plainText: 'public.plain-text'
158
- readonly ppt: 'com.microsoft.powerpoint.ppt'
159
- readonly pptx: 'org.openxmlformats.presentationml.presentation'
160
- readonly video: 'public.movie'
161
- readonly xls: 'com.microsoft.excel.xls'
162
- readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet'
163
- readonly zip: 'public.zip-archive'
164
- }>
165
- windows: Readonly<{
166
- readonly allFiles: '*'
167
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
168
- readonly csv: '.csv'
169
- readonly doc: '.doc'
170
- readonly docx: '.docx'
171
- readonly images: '.jpeg .jpg .png'
172
- readonly pdf: '.pdf'
173
- readonly plainText: '.txt'
174
- readonly ppt: '.ppt'
175
- readonly pptx: '.pptx'
176
- readonly video: '.mp4'
177
- readonly xls: '.xls'
178
- readonly xlsx: '.xlsx'
179
- readonly zip: '.zip .gz'
180
- }>
181
- macos: Readonly<{
182
- readonly allFiles: '*'
183
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
184
- readonly csv: '.csv'
185
- readonly doc: '.doc'
186
- readonly docx: '.docx'
187
- readonly images: '.jpeg .jpg .png'
188
- readonly pdf: '.pdf'
189
- readonly plainText: '.txt'
190
- readonly ppt: '.ppt'
191
- readonly pptx: '.pptx'
192
- readonly video: '.mp4'
193
- readonly xls: '.xls'
194
- readonly xlsx: '.xlsx'
195
- readonly zip: '.zip .gz'
196
- }>
197
- web: Readonly<{
198
- readonly allFiles: '*'
199
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
200
- readonly csv: '.csv'
201
- readonly doc: '.doc'
202
- readonly docx: '.docx'
203
- readonly images: '.jpeg .jpg .png'
204
- readonly pdf: '.pdf'
205
- readonly plainText: '.txt'
206
- readonly ppt: '.ppt'
207
- readonly pptx: '.pptx'
208
- readonly video: '.mp4'
209
- readonly xls: '.xls'
210
- readonly xlsx: '.xlsx'
211
- readonly zip: '.zip .gz'
212
- }>
213
- }
214
- }
215
-
@@ -1,138 +0,0 @@
1
- declare const mimeTypes: Readonly<{
2
- readonly allFiles: '*/*'
3
- readonly audio: 'audio/*'
4
- readonly csv: 'text/csv'
5
- readonly doc: 'application/msword'
6
- readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
7
- readonly images: 'image/*'
8
- readonly pdf: 'application/pdf'
9
- readonly plainText: 'text/plain'
10
- readonly ppt: 'application/vnd.ms-powerpoint'
11
- readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
12
- readonly video: 'video/*'
13
- readonly xls: 'application/vnd.ms-excel'
14
- readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
15
- readonly zip: 'application/zip'
16
- }>
17
- declare const utis: Readonly<{
18
- readonly allFiles: 'public.item'
19
- readonly audio: 'public.audio'
20
- readonly csv: 'public.comma-separated-values-text'
21
- readonly doc: 'com.microsoft.word.doc'
22
- readonly docx: 'org.openxmlformats.wordprocessingml.document'
23
- readonly images: 'public.image'
24
- readonly pdf: 'com.adobe.pdf'
25
- readonly plainText: 'public.plain-text'
26
- readonly ppt: 'com.microsoft.powerpoint.ppt'
27
- readonly pptx: 'org.openxmlformats.presentationml.presentation'
28
- readonly video: 'public.movie'
29
- readonly xls: 'com.microsoft.excel.xls'
30
- readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet'
31
- readonly zip: 'public.zip-archive'
32
- }>
33
- declare const extensions: Readonly<{
34
- readonly allFiles: '*'
35
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
36
- readonly csv: '.csv'
37
- readonly doc: '.doc'
38
- readonly docx: '.docx'
39
- readonly images: '.jpeg .jpg .png'
40
- readonly pdf: '.pdf'
41
- readonly plainText: '.txt'
42
- readonly ppt: '.ppt'
43
- readonly pptx: '.pptx'
44
- readonly video: '.mp4'
45
- readonly xls: '.xls'
46
- readonly xlsx: '.xlsx'
47
- readonly zip: '.zip .gz'
48
- }>
49
- export declare type PlatformTypes = {
50
- android: typeof mimeTypes
51
- ios: typeof utis
52
- windows: typeof extensions
53
- }
54
- export declare type SupportedPlatforms = 'ios' | 'android' | 'windows'
55
- export declare const perPlatformTypes: {
56
- android: Readonly<{
57
- readonly allFiles: '*/*'
58
- readonly audio: 'audio/*'
59
- readonly csv: 'text/csv'
60
- readonly doc: 'application/msword'
61
- readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
62
- readonly images: 'image/*'
63
- readonly pdf: 'application/pdf'
64
- readonly plainText: 'text/plain'
65
- readonly ppt: 'application/vnd.ms-powerpoint'
66
- readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
67
- readonly video: 'video/*'
68
- readonly xls: 'application/vnd.ms-excel'
69
- readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
70
- readonly zip: 'application/zip'
71
- }>
72
- ios: Readonly<{
73
- readonly allFiles: 'public.item'
74
- readonly audio: 'public.audio'
75
- readonly csv: 'public.comma-separated-values-text'
76
- readonly doc: 'com.microsoft.word.doc'
77
- readonly docx: 'org.openxmlformats.wordprocessingml.document'
78
- readonly images: 'public.image'
79
- readonly pdf: 'com.adobe.pdf'
80
- readonly plainText: 'public.plain-text'
81
- readonly ppt: 'com.microsoft.powerpoint.ppt'
82
- readonly pptx: 'org.openxmlformats.presentationml.presentation'
83
- readonly video: 'public.movie'
84
- readonly xls: 'com.microsoft.excel.xls'
85
- readonly xlsx: 'org.openxmlformats.spreadsheetml.sheet'
86
- readonly zip: 'public.zip-archive'
87
- }>
88
- windows: Readonly<{
89
- readonly allFiles: '*'
90
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
91
- readonly csv: '.csv'
92
- readonly doc: '.doc'
93
- readonly docx: '.docx'
94
- readonly images: '.jpeg .jpg .png'
95
- readonly pdf: '.pdf'
96
- readonly plainText: '.txt'
97
- readonly ppt: '.ppt'
98
- readonly pptx: '.pptx'
99
- readonly video: '.mp4'
100
- readonly xls: '.xls'
101
- readonly xlsx: '.xlsx'
102
- readonly zip: '.zip .gz'
103
- }>
104
- macos: Readonly<{
105
- readonly allFiles: '*'
106
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
107
- readonly csv: '.csv'
108
- readonly doc: '.doc'
109
- readonly docx: '.docx'
110
- readonly images: '.jpeg .jpg .png'
111
- readonly pdf: '.pdf'
112
- readonly plainText: '.txt'
113
- readonly ppt: '.ppt'
114
- readonly pptx: '.pptx'
115
- readonly video: '.mp4'
116
- readonly xls: '.xls'
117
- readonly xlsx: '.xlsx'
118
- readonly zip: '.zip .gz'
119
- }>
120
- web: Readonly<{
121
- readonly allFiles: '*'
122
- readonly audio: '.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma'
123
- readonly csv: '.csv'
124
- readonly doc: '.doc'
125
- readonly docx: '.docx'
126
- readonly images: '.jpeg .jpg .png'
127
- readonly pdf: '.pdf'
128
- readonly plainText: '.txt'
129
- readonly ppt: '.ppt'
130
- readonly pptx: '.pptx'
131
- readonly video: '.mp4'
132
- readonly xls: '.xls'
133
- readonly xlsx: '.xlsx'
134
- readonly zip: '.zip .gz'
135
- }>
136
- }
137
- export declare const typesAreEqual: true
138
- export {}
@@ -1,9 +0,0 @@
1
- import { FormTypes } from '@codeleap/common'
2
- import { TextInputProps } from 'react-native'
3
-
4
- import { TextInputMaskProps as RNTextInputMaskProps } from 'react-native-masked-text'
5
-
6
- export type TextInputMaskProps =Omit<RNTextInputMaskProps, keyof TextInputProps > & {
7
- masking: FormTypes.TextField['masking']
8
- onChangeText: RNTextInputMaskProps['onChangeText']
9
- }
@@ -1 +0,0 @@
1
- export * from './utility'
@@ -1,9 +0,0 @@
1
- import { StyleProp } from 'react-native'
2
- import { EasingFunction } from 'react-native-animatable'
3
-
4
- export type StylesOf<C extends string> = Partial<Record<C, StyleProp<any>>>
5
- export type TransitionConfig = {
6
- easing?: EasingFunction
7
- type?: 'timing' | 'spring'
8
- duration?: number
9
- }
@@ -1,75 +0,0 @@
1
- import React from 'react'
2
- import { useCodeleapContext, useEffect, useState, useContext } from '@codeleap/common'
3
- import {
4
- Keyboard,
5
- Platform,
6
- KeyboardEvent,
7
- KeyboardEventName,
8
- } from 'react-native'
9
-
10
- type KeyboardVisibilityEvents = {
11
- show: KeyboardEventName
12
- hide: KeyboardEventName
13
- }
14
- type TKeyboardCtx = {
15
- event: KeyboardEvent
16
- isVisible: boolean
17
- height: number
18
- }
19
- export const KeyboardCtx = React.createContext({} as TKeyboardCtx)
20
-
21
- export const KeyboardProvider = ({ children }) => {
22
- const [keyboardEvent, setKeyboardEvent] = useState<KeyboardEvent>(null)
23
- const [keyboardVisible, setKeyboardVisible] = useState(false)
24
- const { Theme } = useCodeleapContext()
25
- useEffect(() => {
26
- const eventNames = Platform.select<KeyboardVisibilityEvents>({
27
- ios: {
28
- show: 'keyboardWillShow',
29
- hide: 'keyboardWillHide',
30
- },
31
- android: {
32
- show: 'keyboardDidShow',
33
- hide: 'keyboardDidHide',
34
- },
35
- })
36
- const events = [
37
- Keyboard.addListener(eventNames.show, (e) => {
38
-
39
- setKeyboardEvent(e)
40
- setKeyboardVisible(true)
41
- }),
42
- Keyboard.addListener(eventNames.hide, (e) => {
43
-
44
- setKeyboardEvent(e)
45
- setKeyboardVisible(false)
46
- }),
47
- ]
48
- return () => {
49
- events.forEach(e => e.remove())
50
- }
51
- }, [])
52
-
53
- let adjustKeyboard = 0
54
-
55
- if (Platform.OS === 'android') {
56
- adjustKeyboard = Theme.values.safeAreaTop
57
- }
58
- const height = keyboardEvent?.endCoordinates?.height ?? 0
59
-
60
- const _return = {
61
- event: keyboardEvent,
62
- isVisible: keyboardVisible,
63
- height: (!!height && keyboardVisible) ? height + adjustKeyboard : 0,
64
- ...Keyboard,
65
- }
66
-
67
- return <KeyboardCtx.Provider value={_return}>
68
- {children}
69
- </KeyboardCtx.Provider >
70
-
71
- }
72
-
73
- export const useKeyboard = () => {
74
- return useContext(KeyboardCtx)
75
- }
@@ -1,17 +0,0 @@
1
- /* @flow */
2
-
3
- import listenToKeyboardEvents from './lib/KeyboardAwareHOC'
4
- import KeyboardAwareScrollView from './lib/KeyboardAwareScrollView'
5
- import KeyboardAwareFlatList from './lib/KeyboardAwareFlatList'
6
- import KeyboardAwareSectionList from './lib/KeyboardAwareSectionList'
7
- export * from './keyboardHooks'
8
- export * from './context'
9
-
10
- export {
11
- listenToKeyboardEvents,
12
- KeyboardAwareFlatList,
13
- KeyboardAwareSectionList,
14
- KeyboardAwareScrollView,
15
- }
16
-
17
- export * from './types'
@@ -1,124 +0,0 @@
1
- import { PropsOf, useCodeleapContext, TypeGuards } from '@codeleap/common'
2
- import { ScrollView, Platform, StyleSheet, Dimensions, EasingFunction, Easing } from 'react-native'
3
- import { TransitionConfig } from '../../types'
4
- import { useKeyboard } from './context'
5
- type ScrollViewProps = Partial<
6
- Pick<
7
- PropsOf<typeof ScrollView>,
8
- 'horizontal' | 'contentContainerStyle' | 'style'
9
- >
10
- > & {
11
- transition?: TransitionConfig
12
- }
13
-
14
- export type GetKeyboardAwarePropsOptions = {
15
- baseStyleProp?: 'style' | 'contentContainerStyle'
16
- adapt?: 'height' | 'maxHeight' | 'paddingBottom' | 'marginBottom' | 'bottom'
17
- enabled?: boolean
18
- animated?: boolean
19
- transition?: TransitionConfig
20
- enableOnAndroid?: boolean
21
- }
22
- type UseKeyboardAwareViewParams = {
23
- debugName?: string
24
- }
25
- export const useKeyboardAwareView = (params?: UseKeyboardAwareViewParams) => {
26
- const keyboard = useKeyboard()
27
- const { logger } = useCodeleapContext()
28
- function getKeyboardAwareProps<T extends ScrollViewProps>(
29
- props?:T,
30
- options?: GetKeyboardAwarePropsOptions,
31
- ): T {
32
-
33
- const _options:GetKeyboardAwarePropsOptions = {
34
- adapt: 'maxHeight',
35
- baseStyleProp: 'style',
36
- enabled: true,
37
- enableOnAndroid: false,
38
- animated: false,
39
- ...options,
40
- transition: {
41
- easing: Easing.linear,
42
- duration: 200,
43
- type: 'timing',
44
- },
45
- }
46
-
47
- if (!_options.enabled || props?.horizontal || (Platform.OS === 'android' && !_options.enableOnAndroid)) return props
48
-
49
- if (!props) {
50
- props = {} as T
51
- }
52
- const baseStyle = StyleSheet.flatten(props[_options.baseStyleProp] || {})
53
-
54
- const baseValue = baseStyle[_options.adapt] as number
55
- let valid = true
56
- const warnOnNotNumber = () => {
57
- if (!TypeGuards.isNil(baseValue) && !TypeGuards.isNumber(baseValue)) {
58
- valid = false
59
- const debugStr = params?.debugName ? 'at ' + params?.debugName + ' ' : ''
60
- logger.warn(
61
- `${_options.baseStyleProp}.${_options.adapt} must be a number or not be set at all`,
62
- { props, options: _options },
63
- 'useKeyboardAwareView' + debugStr,
64
- )
65
- }
66
- }
67
-
68
- const newStyleProp = _options.animated ? {
69
-
70
- } : {
71
- ...baseStyle,
72
- }
73
-
74
- switch (_options.adapt) {
75
- case 'height':
76
- warnOnNotNumber()
77
- const baseHeight = baseValue || 0
78
- newStyleProp.height = baseHeight - keyboard.height
79
- break
80
- case 'maxHeight':
81
- if (keyboard.isVisible) {
82
- warnOnNotNumber()
83
- const baseMaxHeight = baseValue || Dimensions.get('window').height
84
- newStyleProp.maxHeight = baseMaxHeight - keyboard.height
85
- // break
86
- }
87
- break
88
- case 'paddingBottom':
89
- warnOnNotNumber()
90
- const basePaddingBottom = baseValue || 0
91
- newStyleProp.paddingBottom = basePaddingBottom + keyboard.height
92
- break
93
- case 'marginBottom':
94
- warnOnNotNumber()
95
- const baseMarginBottom = baseValue || 0
96
- newStyleProp.marginBottom = baseMarginBottom + keyboard.height
97
- break
98
- case 'bottom':
99
- warnOnNotNumber()
100
- const baseBottom = baseValue || 0
101
- newStyleProp.bottom = baseBottom + keyboard.height
102
- break
103
- }
104
-
105
- if (!valid) return props
106
-
107
- const _return = {
108
- ...props,
109
- [_options?.animated ? 'animate' : _options.baseStyleProp]: newStyleProp,
110
- }
111
-
112
- if (_options.animated && !!_options?.transition) {
113
- _return.transition = JSON.parse(JSON.stringify({
114
- [_options.adapt]: _options.transition,
115
- }))
116
- }
117
-
118
- return _return
119
- }
120
- return {
121
- keyboard,
122
- getKeyboardAwareProps,
123
- }
124
- }
@@ -1,4 +0,0 @@
1
- import { FlatList } from 'react-native'
2
- import listenToKeyboardEvents from './KeyboardAwareHOC'
3
-
4
- export default listenToKeyboardEvents(FlatList)