@codeleap/mobile 1.9.33 → 2.0.2

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 (434) hide show
  1. package/dist/components/ActionIcon/index.d.ts +13 -0
  2. package/dist/components/ActionIcon/index.js +54 -0
  3. package/dist/components/ActionIcon/index.js.map +1 -0
  4. package/dist/components/ActionIcon/styles.d.ts +64 -0
  5. package/dist/components/ActionIcon/styles.js +57 -0
  6. package/dist/components/ActionIcon/styles.js.map +1 -0
  7. package/dist/components/{ActivityIndicator.d.ts → ActivityIndicator/index.d.ts} +4 -2
  8. package/dist/components/{ActivityIndicator.js → ActivityIndicator/index.js} +5 -1
  9. package/dist/components/ActivityIndicator/index.js.map +1 -0
  10. package/dist/components/ActivityIndicator/styles.d.ts +59 -0
  11. package/dist/components/ActivityIndicator/styles.js +52 -0
  12. package/dist/components/ActivityIndicator/styles.js.map +1 -0
  13. package/dist/components/AutoComplete/index.d.ts +33 -0
  14. package/dist/components/AutoComplete/index.js +129 -0
  15. package/dist/components/AutoComplete/index.js.map +1 -0
  16. package/dist/components/AutoComplete/styles.d.ts +57 -0
  17. package/dist/components/AutoComplete/styles.js +28 -0
  18. package/dist/components/AutoComplete/styles.js.map +1 -0
  19. package/dist/components/Backdrop/index.d.ts +14 -0
  20. package/dist/components/{Backdrop.js → Backdrop/index.js} +21 -30
  21. package/dist/components/Backdrop/index.js.map +1 -0
  22. package/dist/components/{Backdrop.d.ts → Backdrop/styles.d.ts} +7 -20
  23. package/dist/components/Backdrop/styles.js +28 -0
  24. package/dist/components/Backdrop/styles.js.map +1 -0
  25. package/dist/components/Button/index.d.ts +247 -0
  26. package/dist/components/{Button.js → Button/index.js} +45 -13
  27. package/dist/components/Button/index.js.map +1 -0
  28. package/dist/components/Button/styles.d.ts +65 -0
  29. package/dist/components/Button/styles.js +61 -0
  30. package/dist/components/Button/styles.js.map +1 -0
  31. package/dist/components/Calendar/index.d.ts +15 -0
  32. package/dist/components/Calendar/index.js +80 -0
  33. package/dist/components/Calendar/index.js.map +1 -0
  34. package/dist/components/Calendar/style.d.ts +4 -0
  35. package/dist/components/Calendar/style.js +36 -0
  36. package/dist/components/Calendar/style.js.map +1 -0
  37. package/dist/components/Calendar/types.d.ts +95 -0
  38. package/dist/components/Calendar/types.js +3 -0
  39. package/dist/components/Calendar/types.js.map +1 -0
  40. package/dist/components/Checkbox/index.d.ts +2 -2
  41. package/dist/components/Checkbox/index.js +5 -3
  42. package/dist/components/Checkbox/index.js.map +1 -1
  43. package/dist/components/Checkbox/styles.d.ts +53 -53
  44. package/dist/components/Checkbox/styles.js +6 -2
  45. package/dist/components/Checkbox/styles.js.map +1 -1
  46. package/dist/components/{ContentView.d.ts → ContentView/index.d.ts} +5 -3
  47. package/dist/components/{ContentView.js → ContentView/index.js} +19 -4
  48. package/dist/components/ContentView/index.js.map +1 -0
  49. package/dist/components/ContentView/styles.d.ts +53 -0
  50. package/dist/components/ContentView/styles.js +26 -0
  51. package/dist/components/ContentView/styles.js.map +1 -0
  52. package/dist/components/Drawer/index.d.ts +7 -0
  53. package/dist/components/{View.js → Drawer/index.js} +18 -15
  54. package/dist/components/Drawer/index.js.map +1 -0
  55. package/dist/components/{NewModal → Drawer}/styles.d.ts +55 -56
  56. package/dist/components/Drawer/styles.js +37 -0
  57. package/dist/components/Drawer/styles.js.map +1 -0
  58. package/dist/components/{EmptyPlaceholder.d.ts → EmptyPlaceholder/index.d.ts} +4 -2
  59. package/dist/components/{EmptyPlaceholder.js → EmptyPlaceholder/index.js} +9 -5
  60. package/dist/components/EmptyPlaceholder/index.js.map +1 -0
  61. package/dist/components/EmptyPlaceholder/styles.d.ts +55 -0
  62. package/dist/components/EmptyPlaceholder/styles.js +32 -0
  63. package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
  64. package/dist/components/{FileInput.d.ts → FileInput/index.d.ts} +8 -6
  65. package/dist/components/{FileInput.js → FileInput/index.js} +13 -30
  66. package/dist/components/FileInput/index.js.map +1 -0
  67. package/dist/components/FileInput/styles.d.ts +53 -0
  68. package/dist/components/FileInput/styles.js +19 -0
  69. package/dist/components/FileInput/styles.js.map +1 -0
  70. package/dist/components/Grid/index.d.ts +30 -0
  71. package/dist/components/Grid/index.js +69 -0
  72. package/dist/components/Grid/index.js.map +1 -0
  73. package/dist/components/Grid/styles.d.ts +5 -0
  74. package/dist/components/Grid/styles.js +19 -0
  75. package/dist/components/Grid/styles.js.map +1 -0
  76. package/dist/components/{Icon.d.ts → Icon/index.d.ts} +3 -1
  77. package/dist/components/{Icon.js → Icon/index.js} +6 -2
  78. package/dist/components/Icon/index.js.map +1 -0
  79. package/dist/components/{NewPager → Icon}/styles.d.ts +59 -86
  80. package/dist/components/Icon/styles.js +45 -0
  81. package/dist/components/Icon/styles.js.map +1 -0
  82. package/dist/components/{Image.d.ts → Image/index.d.ts} +6 -4
  83. package/dist/components/{Image.js → Image/index.js} +38 -7
  84. package/dist/components/Image/index.js.map +1 -0
  85. package/dist/components/Image/styles.d.ts +54 -0
  86. package/dist/components/Image/styles.js +25 -0
  87. package/dist/components/Image/styles.js.map +1 -0
  88. package/dist/components/ImageView/Spotlight.d.ts +25 -0
  89. package/dist/components/ImageView/Spotlight.js +155 -0
  90. package/dist/components/ImageView/Spotlight.js.map +1 -0
  91. package/dist/components/ImageView/component.d.ts +5 -0
  92. package/dist/components/ImageView/component.js +54 -0
  93. package/dist/components/ImageView/component.js.map +1 -0
  94. package/dist/components/ImageView/index.d.ts +2 -0
  95. package/dist/components/ImageView/index.js +19 -0
  96. package/dist/components/ImageView/index.js.map +1 -0
  97. package/dist/components/List/PaginationIndicator.d.ts +67 -0
  98. package/dist/components/List/PaginationIndicator.js +51 -0
  99. package/dist/components/List/PaginationIndicator.js.map +1 -0
  100. package/dist/components/{List.d.ts → List/index.d.ts} +12 -15
  101. package/dist/components/List/index.js +68 -0
  102. package/dist/components/List/index.js.map +1 -0
  103. package/dist/components/List/styles.d.ts +5 -0
  104. package/dist/components/List/styles.js +24 -0
  105. package/dist/components/List/styles.js.map +1 -0
  106. package/dist/components/Modal/index.d.ts +13 -3
  107. package/dist/components/Modal/index.js +23 -8
  108. package/dist/components/Modal/index.js.map +1 -1
  109. package/dist/components/Modal/styles.d.ts +55 -55
  110. package/dist/components/Modal/styles.js +4 -3
  111. package/dist/components/Modal/styles.js.map +1 -1
  112. package/dist/components/MultiSelect/index.d.ts +6 -0
  113. package/dist/components/MultiSelect/index.js +106 -0
  114. package/dist/components/MultiSelect/index.js.map +1 -0
  115. package/dist/components/MultiSelect/styles.d.ts +58 -0
  116. package/dist/components/MultiSelect/styles.js +22 -0
  117. package/dist/components/MultiSelect/styles.js.map +1 -0
  118. package/dist/components/MultiSelect/types.d.ts +32 -0
  119. package/dist/components/MultiSelect/types.js +3 -0
  120. package/dist/components/MultiSelect/types.js.map +1 -0
  121. package/dist/components/Navigation/Navigation.js +1 -5
  122. package/dist/components/Navigation/Navigation.js.map +1 -1
  123. package/dist/components/Navigation/utils.js +0 -1
  124. package/dist/components/Navigation/utils.js.map +1 -1
  125. package/dist/components/Pager/index.d.ts +18 -12
  126. package/dist/components/Pager/index.js +54 -134
  127. package/dist/components/Pager/index.js.map +1 -1
  128. package/dist/components/Pager/styles.d.ts +42 -9
  129. package/dist/components/Pager/styles.js +53 -25
  130. package/dist/components/Pager/styles.js.map +1 -1
  131. package/dist/components/RadioInput/index.d.ts +4 -4
  132. package/dist/components/RadioInput/index.js +3 -1
  133. package/dist/components/RadioInput/index.js.map +1 -1
  134. package/dist/components/RadioInput/styles.d.ts +54 -54
  135. package/dist/components/RadioInput/styles.js +12 -7
  136. package/dist/components/RadioInput/styles.js.map +1 -1
  137. package/dist/components/Scroll/index.d.ts +18 -0
  138. package/dist/components/{Scroll.js → Scroll/index.js} +14 -11
  139. package/dist/components/Scroll/index.js.map +1 -0
  140. package/dist/components/Scroll/styles.d.ts +4 -0
  141. package/dist/components/Scroll/styles.js +27 -0
  142. package/dist/components/Scroll/styles.js.map +1 -0
  143. package/dist/components/Sections/index.d.ts +11 -0
  144. package/dist/components/{Sections.js → Sections/index.js} +4 -5
  145. package/dist/components/Sections/index.js.map +1 -0
  146. package/dist/components/SegmentedControl/index.d.ts +10 -1
  147. package/dist/components/SegmentedControl/index.js +27 -27
  148. package/dist/components/SegmentedControl/index.js.map +1 -1
  149. package/dist/components/SegmentedControl/styles.d.ts +56 -51
  150. package/dist/components/SegmentedControl/styles.js +10 -3
  151. package/dist/components/SegmentedControl/styles.js.map +1 -1
  152. package/dist/components/Select/index.d.ts +8 -0
  153. package/dist/components/Select/index.js +37 -80
  154. package/dist/components/Select/index.js.map +1 -1
  155. package/dist/components/Select/styles.d.ts +57 -7
  156. package/dist/components/Select/styles.js +17 -41
  157. package/dist/components/Select/styles.js.map +1 -1
  158. package/dist/components/Select/types.d.ts +16 -25
  159. package/dist/components/Slider/index.d.ts +1 -0
  160. package/dist/components/Slider/index.js +4 -0
  161. package/dist/components/Slider/index.js.map +1 -1
  162. package/dist/components/Slider/styles.d.ts +53 -0
  163. package/dist/components/Slider/styles.js +61 -0
  164. package/dist/components/Slider/styles.js.map +1 -0
  165. package/dist/components/Slider/types.d.ts +3 -2
  166. package/dist/components/{Switch.d.ts → Switch/index.d.ts} +3 -2
  167. package/dist/components/{Switch.js → Switch/index.js} +9 -5
  168. package/dist/components/Switch/index.js.map +1 -0
  169. package/dist/components/Switch/styles.d.ts +54 -0
  170. package/dist/components/Switch/styles.js +34 -0
  171. package/dist/components/Switch/styles.js.map +1 -0
  172. package/dist/components/{Text.d.ts → Text/index.d.ts} +7 -3
  173. package/dist/components/{Text.js → Text/index.js} +53 -5
  174. package/dist/components/Text/index.js.map +1 -0
  175. package/dist/components/Text/styles.d.ts +70 -0
  176. package/dist/components/Text/styles.js +31 -0
  177. package/dist/components/Text/styles.js.map +1 -0
  178. package/dist/components/TextInput/Label.d.ts +9 -0
  179. package/dist/components/TextInput/Label.js +34 -0
  180. package/dist/components/TextInput/Label.js.map +1 -0
  181. package/dist/components/{TextInput.d.ts → TextInput/index.d.ts} +42 -45
  182. package/dist/components/TextInput/index.js +204 -0
  183. package/dist/components/TextInput/index.js.map +1 -0
  184. package/dist/components/TextInput/styles.d.ts +62 -0
  185. package/dist/components/TextInput/styles.js +68 -0
  186. package/dist/components/TextInput/styles.js.map +1 -0
  187. package/dist/components/Touchable/index.d.ts +20 -0
  188. package/dist/components/Touchable/index.js +165 -0
  189. package/dist/components/Touchable/index.js.map +1 -0
  190. package/dist/components/Touchable/styles.d.ts +58 -0
  191. package/dist/components/Touchable/styles.js +24 -0
  192. package/dist/components/Touchable/styles.js.map +1 -0
  193. package/dist/components/{View.d.ts → View/index.d.ts} +6 -0
  194. package/dist/components/View/index.js +99 -0
  195. package/dist/components/View/index.js.map +1 -0
  196. package/dist/components/View/styles.d.ts +54 -0
  197. package/dist/components/View/styles.js +29 -0
  198. package/dist/components/View/styles.js.map +1 -0
  199. package/dist/components/components.d.ts +10 -3
  200. package/dist/components/components.js +23 -3
  201. package/dist/components/components.js.map +1 -1
  202. package/dist/components/defaultStyles.d.ts +1364 -0
  203. package/dist/components/defaultStyles.js +63 -0
  204. package/dist/components/defaultStyles.js.map +1 -0
  205. package/dist/components/{_Modal → legacy/Modal}/index.d.ts +3 -3
  206. package/dist/components/{_Modal → legacy/Modal}/index.js +6 -6
  207. package/dist/components/legacy/Modal/index.js.map +1 -0
  208. package/dist/components/{_Modal → legacy/Modal}/styles.d.ts +6 -6
  209. package/dist/components/{_Modal → legacy/Modal}/styles.js +0 -0
  210. package/dist/components/legacy/Modal/styles.js.map +1 -0
  211. package/dist/components/legacy/Pager/index.d.ts +20 -0
  212. package/dist/components/legacy/Pager/index.js +168 -0
  213. package/dist/components/legacy/Pager/index.js.map +1 -0
  214. package/dist/components/legacy/Pager/styles.d.ts +54 -0
  215. package/dist/components/legacy/Pager/styles.js +44 -0
  216. package/dist/components/legacy/Pager/styles.js.map +1 -0
  217. package/dist/components/legacy/index.d.ts +2 -0
  218. package/dist/components/legacy/index.js +19 -0
  219. package/dist/components/legacy/index.js.map +1 -0
  220. package/dist/index.d.ts +4 -6
  221. package/dist/index.js +6 -9
  222. package/dist/index.js.map +1 -1
  223. package/dist/modules/reactNavigation.d.ts +2 -0
  224. package/dist/modules/reactNavigation.js +16 -1
  225. package/dist/modules/reactNavigation.js.map +1 -1
  226. package/dist/modules/textInputMask.d.ts +1 -0
  227. package/dist/modules/textInputMask.js +15 -0
  228. package/dist/modules/textInputMask.js.map +1 -1
  229. package/dist/types/index.d.ts +1 -0
  230. package/dist/types/index.js +18 -0
  231. package/dist/types/index.js.map +1 -0
  232. package/dist/utils/KeyboardAware/index.d.ts +6 -0
  233. package/dist/utils/KeyboardAware/index.js +31 -0
  234. package/dist/utils/KeyboardAware/index.js.map +1 -0
  235. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.d.ts +3 -0
  236. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js +9 -0
  237. package/dist/utils/KeyboardAware/lib/KeyboardAwareFlatList.js.map +1 -0
  238. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +67 -0
  239. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +451 -0
  240. package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -0
  241. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.d.ts +7 -0
  242. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js +4 -0
  243. package/dist/utils/KeyboardAware/lib/KeyboardAwareInterface.js.map +1 -0
  244. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.d.ts +3 -0
  245. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js +10 -0
  246. package/dist/utils/KeyboardAware/lib/KeyboardAwareScrollView.js.map +1 -0
  247. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.d.ts +3 -0
  248. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js +10 -0
  249. package/dist/utils/KeyboardAware/lib/KeyboardAwareSectionList.js.map +1 -0
  250. package/dist/utils/KeyboardAware/types.d.ts +1 -0
  251. package/dist/utils/KeyboardAware/types.js +7 -0
  252. package/dist/utils/KeyboardAware/types.js.map +1 -0
  253. package/dist/utils/ModalManager/components.d.ts +10 -2
  254. package/dist/utils/ModalManager/components.js +39 -7
  255. package/dist/utils/ModalManager/components.js.map +1 -1
  256. package/dist/utils/ModalManager/context.d.ts +1 -0
  257. package/dist/utils/ModalManager/context.js +6 -0
  258. package/dist/utils/ModalManager/context.js.map +1 -1
  259. package/dist/utils/ModalManager/index.d.ts +3 -2
  260. package/dist/utils/ModalManager/index.js +1 -0
  261. package/dist/utils/ModalManager/index.js.map +1 -1
  262. package/dist/utils/OSAlert.d.ts +6 -5
  263. package/dist/utils/OSAlert.js +7 -6
  264. package/dist/utils/OSAlert.js.map +1 -1
  265. package/dist/utils/PermissionManager/context.js +0 -7
  266. package/dist/utils/PermissionManager/context.js.map +1 -1
  267. package/dist/utils/hooks.d.ts +34 -1
  268. package/dist/utils/hooks.js +54 -1
  269. package/dist/utils/hooks.js.map +1 -1
  270. package/dist/utils/index.d.ts +8 -0
  271. package/dist/utils/index.js +38 -0
  272. package/dist/utils/index.js.map +1 -0
  273. package/dist/utils/misc.d.ts +5 -1
  274. package/dist/utils/misc.js +62 -1
  275. package/dist/utils/misc.js.map +1 -1
  276. package/dist/utils/notifications.d.ts +34 -0
  277. package/dist/utils/notifications.js +268 -0
  278. package/dist/utils/notifications.js.map +1 -0
  279. package/package.json +13 -4
  280. package/src/components/ActionIcon/index.tsx +31 -0
  281. package/src/components/ActionIcon/styles.ts +92 -0
  282. package/src/components/{ActivityIndicator.tsx → ActivityIndicator/index.tsx} +7 -3
  283. package/src/components/ActivityIndicator/styles.ts +68 -0
  284. package/src/components/AutoComplete/index.tsx +158 -0
  285. package/src/components/AutoComplete/styles.ts +49 -0
  286. package/src/components/{Backdrop.tsx → Backdrop/index.tsx} +9 -42
  287. package/src/components/Backdrop/styles.ts +33 -0
  288. package/src/components/{Button.tsx → Button/index.tsx} +62 -13
  289. package/src/components/Button/styles.ts +129 -0
  290. package/src/components/Calendar/index.tsx +65 -0
  291. package/src/components/Calendar/style.ts +35 -0
  292. package/src/components/Calendar/types.ts +102 -0
  293. package/src/components/Checkbox/index.tsx +10 -5
  294. package/src/components/Checkbox/styles.ts +8 -3
  295. package/src/components/{ContentView.tsx → ContentView/index.tsx} +11 -6
  296. package/src/components/ContentView/styles.ts +25 -0
  297. package/src/components/Drawer/index.tsx +24 -0
  298. package/src/components/Drawer/styles.ts +38 -0
  299. package/src/components/{EmptyPlaceholder.tsx → EmptyPlaceholder/index.tsx} +14 -7
  300. package/src/components/EmptyPlaceholder/styles.ts +58 -0
  301. package/src/components/{FileInput.tsx → FileInput/index.tsx} +19 -28
  302. package/src/components/FileInput/styles.ts +15 -0
  303. package/src/components/Grid/index.tsx +107 -0
  304. package/src/components/Grid/styles.ts +11 -0
  305. package/src/components/{Icon.tsx → Icon/index.tsx} +8 -3
  306. package/src/components/Icon/styles.ts +52 -0
  307. package/src/components/Image/index.tsx +91 -0
  308. package/src/components/Image/styles.ts +20 -0
  309. package/src/components/ImageView/Spotlight.tsx +158 -0
  310. package/src/components/ImageView/component.tsx +38 -0
  311. package/src/components/ImageView/index.ts +2 -0
  312. package/src/components/List/PaginationIndicator.tsx +71 -0
  313. package/src/components/List/index.tsx +108 -0
  314. package/src/components/List/styles.ts +15 -0
  315. package/src/components/Modal/index.tsx +75 -39
  316. package/src/components/Modal/styles.ts +7 -5
  317. package/src/components/MultiSelect/index.tsx +120 -0
  318. package/src/components/MultiSelect/styles.ts +18 -0
  319. package/src/components/MultiSelect/types.ts +39 -0
  320. package/src/components/Navigation/Navigation.tsx +1 -5
  321. package/src/components/Navigation/utils.tsx +0 -2
  322. package/src/components/Pager/index.tsx +81 -202
  323. package/src/components/Pager/styles.ts +57 -27
  324. package/src/components/RadioInput/index.tsx +8 -7
  325. package/src/components/RadioInput/styles.ts +10 -11
  326. package/src/components/{Scroll.tsx → Scroll/index.tsx} +22 -24
  327. package/src/components/Scroll/styles.ts +18 -0
  328. package/src/components/{Sections.tsx → Sections/index.tsx} +5 -15
  329. package/src/components/SegmentedControl/index.tsx +30 -17
  330. package/src/components/SegmentedControl/styles.ts +29 -7
  331. package/src/components/Select/index.tsx +78 -142
  332. package/src/components/Select/styles.ts +52 -74
  333. package/src/components/Select/types.ts +16 -23
  334. package/src/components/Slider/index.tsx +2 -0
  335. package/src/components/Slider/styles.ts +75 -0
  336. package/src/components/Slider/types.ts +7 -2
  337. package/src/components/{Switch.tsx → Switch/index.tsx} +10 -5
  338. package/src/components/Switch/styles.ts +37 -0
  339. package/src/components/Text/index.tsx +102 -0
  340. package/src/components/Text/styles.ts +50 -0
  341. package/src/components/TextInput/Label.tsx +26 -0
  342. package/src/components/{TextInput.tsx → TextInput/index.tsx} +124 -75
  343. package/src/components/TextInput/styles.ts +130 -0
  344. package/src/components/Touchable/index.tsx +182 -0
  345. package/src/components/Touchable/styles.ts +28 -0
  346. package/src/components/View/index.tsx +89 -0
  347. package/src/components/View/styles.ts +24 -0
  348. package/src/components/components.ts +14 -4
  349. package/src/components/defaultStyles.ts +60 -0
  350. package/src/components/{_Modal → legacy/Modal}/index.tsx +7 -7
  351. package/src/components/{_Modal → legacy/Modal}/styles.ts +0 -0
  352. package/src/components/legacy/Pager/index.tsx +242 -0
  353. package/src/components/legacy/Pager/styles.ts +51 -0
  354. package/src/components/legacy/index.ts +2 -0
  355. package/src/index.ts +4 -9
  356. package/src/modules/reactNavigation.ts +11 -0
  357. package/src/modules/textInputMask.ts +2 -0
  358. package/src/types/index.ts +1 -0
  359. package/src/utils/KeyboardAware/index.ts +15 -0
  360. package/src/utils/KeyboardAware/lib/KeyboardAwareFlatList.ts +4 -0
  361. package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +618 -0
  362. package/src/utils/KeyboardAware/lib/KeyboardAwareInterface.ts +13 -0
  363. package/src/utils/KeyboardAware/lib/KeyboardAwareScrollView.ts +6 -0
  364. package/src/utils/KeyboardAware/lib/KeyboardAwareSectionList.ts +6 -0
  365. package/src/utils/KeyboardAware/types.ts +159 -0
  366. package/src/utils/ModalManager/components.tsx +57 -14
  367. package/src/utils/ModalManager/context.tsx +10 -0
  368. package/src/utils/ModalManager/index.ts +4 -1
  369. package/src/utils/OSAlert.ts +10 -10
  370. package/src/utils/PermissionManager/context.tsx +1 -7
  371. package/src/utils/hooks.ts +82 -2
  372. package/src/utils/index.ts +9 -0
  373. package/src/utils/misc.ts +61 -2
  374. package/src/utils/notifications.ts +206 -0
  375. package/dist/components/ActivityIndicator.js.map +0 -1
  376. package/dist/components/Backdrop.js.map +0 -1
  377. package/dist/components/Button.d.ts +0 -132
  378. package/dist/components/Button.js.map +0 -1
  379. package/dist/components/ContentView.js.map +0 -1
  380. package/dist/components/EmptyPlaceholder.js.map +0 -1
  381. package/dist/components/FileInput.js.map +0 -1
  382. package/dist/components/Gap.d.ts +0 -8
  383. package/dist/components/Gap.js +0 -60
  384. package/dist/components/Gap.js.map +0 -1
  385. package/dist/components/Icon.js.map +0 -1
  386. package/dist/components/Image.js.map +0 -1
  387. package/dist/components/List.js +0 -101
  388. package/dist/components/List.js.map +0 -1
  389. package/dist/components/NewModal/index.d.ts +0 -27
  390. package/dist/components/NewModal/index.js +0 -99
  391. package/dist/components/NewModal/index.js.map +0 -1
  392. package/dist/components/NewModal/styles.js +0 -58
  393. package/dist/components/NewModal/styles.js.map +0 -1
  394. package/dist/components/NewPager/index.d.ts +0 -26
  395. package/dist/components/NewPager/index.js +0 -88
  396. package/dist/components/NewPager/index.js.map +0 -1
  397. package/dist/components/NewPager/styles.js +0 -70
  398. package/dist/components/NewPager/styles.js.map +0 -1
  399. package/dist/components/Overlay.d.ts +0 -16
  400. package/dist/components/Overlay.js +0 -74
  401. package/dist/components/Overlay.js.map +0 -1
  402. package/dist/components/Scroll.d.ts +0 -15
  403. package/dist/components/Scroll.js.map +0 -1
  404. package/dist/components/Sections.d.ts +0 -11
  405. package/dist/components/Sections.js.map +0 -1
  406. package/dist/components/SegmentedControl.d.ts +0 -5
  407. package/dist/components/SegmentedControl.js +0 -32
  408. package/dist/components/SegmentedControl.js.map +0 -1
  409. package/dist/components/Switch.js.map +0 -1
  410. package/dist/components/Text.js.map +0 -1
  411. package/dist/components/TextInput.js +0 -181
  412. package/dist/components/TextInput.js.map +0 -1
  413. package/dist/components/Touchable.d.ts +0 -16
  414. package/dist/components/Touchable.js +0 -83
  415. package/dist/components/Touchable.js.map +0 -1
  416. package/dist/components/View.js.map +0 -1
  417. package/dist/components/_Modal/index.js.map +0 -1
  418. package/dist/components/_Modal/styles.js.map +0 -1
  419. package/dist/utils/PermissionManager/components.d.ts +0 -18
  420. package/dist/utils/PermissionManager/components.js +0 -52
  421. package/dist/utils/PermissionManager/components.js.map +0 -1
  422. package/dist/utils/styles.d.ts +0 -1
  423. package/dist/utils/styles.js +0 -13
  424. package/dist/utils/styles.js.map +0 -1
  425. package/src/components/Gap.tsx +0 -40
  426. package/src/components/Image.tsx +0 -62
  427. package/src/components/List.tsx +0 -155
  428. package/src/components/NewPager/index.tsx +0 -121
  429. package/src/components/NewPager/styles.ts +0 -76
  430. package/src/components/Overlay.tsx +0 -86
  431. package/src/components/Text.tsx +0 -43
  432. package/src/components/Touchable.tsx +0 -89
  433. package/src/components/View.tsx +0 -48
  434. package/src/utils/styles.ts +0 -14
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Permissions = void 0;
30
+ __exportStar(require("./OSAlert"), exports);
31
+ __exportStar(require("./hooks"), exports);
32
+ __exportStar(require("./misc"), exports);
33
+ __exportStar(require("./notifications"), exports);
34
+ __exportStar(require("./ModalManager"), exports);
35
+ var Permissions = __importStar(require("./PermissionManager"));
36
+ exports.Permissions = Permissions;
37
+ __exportStar(require("./KeyboardAware"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,kDAA+B;AAC/B,iDAA8B;AAC9B,+DAAkD;AAEzC,kCAAW;AACpB,kDAA+B"}
@@ -1,2 +1,6 @@
1
- import { MobileInputFile } from '@codeleap/common';
1
+ /// <reference types="react-native" />
2
+ import { MobileFile, MobileInputFile } from '@codeleap/common';
2
3
  export declare const stringToFile: (str: string) => MobileInputFile;
4
+ export declare function toMultipartFile(file: MobileInputFile): MobileFile;
5
+ export declare function isFile(param: any): param is MobileInputFile;
6
+ export declare function toMultipart(body: any): FormData;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringToFile = void 0;
3
+ exports.toMultipart = exports.isFile = exports.toMultipartFile = exports.stringToFile = void 0;
4
4
  var common_1 = require("@codeleap/common");
5
5
  var stringToFile = function (str) {
6
6
  if (!str) {
@@ -23,4 +23,65 @@ var stringToFile = function (str) {
23
23
  };
24
24
  };
25
25
  exports.stringToFile = stringToFile;
26
+ function toMultipartFile(file) {
27
+ // const inputFile = file as MobileInputFile
28
+ var withPreview = file;
29
+ if (!!(withPreview === null || withPreview === void 0 ? void 0 : withPreview.file)) {
30
+ return withPreview.file;
31
+ }
32
+ return file;
33
+ // const fileData:MobileFile = ? inputFile.file : (file as RNFile)
34
+ // // const extension = parseFilePathData(fileData.uri).extension
35
+ // // const isImage =DocumentPicker..includes(extension)
36
+ // return fileData as unknown as Blob
37
+ // // if (isImage) {
38
+ // // return {
39
+ // // uri: fileData.uri,
40
+ // // name: `image_${fileData.uri}`,
41
+ // // type: `image/${extension}`,
42
+ // // } as unknown as Blob
43
+ // // } else {
44
+ // // return fileData as unknown as Blob
45
+ // // }
46
+ }
47
+ exports.toMultipartFile = toMultipartFile;
48
+ function isFile(param) {
49
+ var file = param;
50
+ try {
51
+ if (typeof (param === null || param === void 0 ? void 0 : param.preview) !== 'undefined' && typeof (param === null || param === void 0 ? void 0 : param.file) !== 'undefined') {
52
+ file = param.file;
53
+ }
54
+ var keys_1 = Object.keys(file);
55
+ return ['uri', 'name', 'type'].every(function (key) { return keys_1.includes(key); });
56
+ }
57
+ catch (e) {
58
+ return false;
59
+ }
60
+ }
61
+ exports.isFile = isFile;
62
+ function toMultipart(body) {
63
+ var form = new FormData();
64
+ var _loop_1 = function (key, value) {
65
+ var formValue = null;
66
+ if (Array.isArray(value) && value.every(isFile)) {
67
+ formValue = value.map(function (file) { return form.append(key, toMultipartFile(file)); });
68
+ }
69
+ else if (isFile(value)) {
70
+ formValue = toMultipartFile(value);
71
+ }
72
+ else if (typeof value === 'object') {
73
+ formValue = JSON.stringify(value);
74
+ }
75
+ else {
76
+ formValue = String(value);
77
+ }
78
+ form.append(key, formValue);
79
+ };
80
+ for (var _i = 0, _a = Object.entries(body); _i < _a.length; _i++) {
81
+ var _b = _a[_i], key = _b[0], value = _b[1];
82
+ _loop_1(key, value);
83
+ }
84
+ return form;
85
+ }
86
+ exports.toMultipart = toMultipart;
26
87
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/utils/misc.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AAE9D,IAAM,YAAY,GAAG,UAAC,GAAW;IACtC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAA;KACF;IACD,IAAM,QAAQ,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;IAEvC,IAAM,IAAI,GAA4B;QACpC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC,SAAS;QACnC,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,GAAG;QACR,WAAW,EAAE,GAAG;KACjB,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KAClB,CAAA;AACH,CAAC,CAAA;AArBY,QAAA,YAAY,gBAqBxB"}
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/utils/misc.ts"],"names":[],"mappings":";;;AAAA,2CAAkG;AAE3F,IAAM,YAAY,GAAG,UAAC,GAAW;IACtC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAA;KACF;IACD,IAAM,QAAQ,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;IAEvC,IAAM,IAAI,GAAe;QACvB,IAAI,EAAE,QAAQ,CAAC,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AA;KAEhE;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AAdD,wBAcC;AAED,SAAgB,WAAW,CAAC,IAAI;IAC9B,IAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAA;4BAEf,GAAG,EAAE,KAAK;QACpB,IAAI,SAAS,GAAG,IAAI,CAAA;QACpB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;YAC/C,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,EAAvC,CAAuC,CAAC,CAAA;SACzE;aAAM,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;YACxB,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;SACnC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;SAClC;aAAM;YACL,SAAS,GAAG,MAAM,CAAC,KAAK,CAAW,CAAA;SACpC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;;IAX7B,KAA2B,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB;QAApC,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBAAV,GAAG,EAAE,KAAK;KAYrB;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAlBD,kCAkBC"}
@@ -0,0 +1,34 @@
1
+ import { FunctionType } from '@codeleap/common';
2
+ import { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
3
+ export declare type Message = FirebaseMessagingTypes.RemoteMessage;
4
+ export declare type MessageType = 'foreground' | 'background' | 'press' | 'initial';
5
+ export declare type NotificationHandler = FunctionType<[message: Message, type: MessageType], any>;
6
+ export declare type HandleNotificationParam = {
7
+ data: Message;
8
+ type: MessageType;
9
+ };
10
+ export declare type NotificationStateChangeListener = FunctionType<[isInitialized: boolean, token?: string], any>;
11
+ export declare class NotificationManager {
12
+ private logger;
13
+ autoHandleInitialNotification: boolean;
14
+ stateChangeListeners: NotificationStateChangeListener[];
15
+ messageListeners: NotificationHandler[];
16
+ _initialized: boolean;
17
+ unsubscribeFromMessage: any;
18
+ unsubscribeFromBackgroundMessage: any;
19
+ unsubscribeFromPress: any;
20
+ _currentToken: any;
21
+ _initialNoficationHandled: boolean;
22
+ constructor(logger?: import("@codeleap/common").Logger, autoHandleInitialNotification?: boolean);
23
+ init(): Promise<void>;
24
+ deinit(): Promise<void>;
25
+ private handleNotification;
26
+ get currentToken(): string;
27
+ set currentToken(token: string);
28
+ get initialized(): boolean;
29
+ set initialized(to: boolean);
30
+ onNotification(handler: NotificationHandler): () => void;
31
+ private triggerStateChange;
32
+ onStateChange(handler: NotificationStateChangeListener): () => void;
33
+ getInitialNotification(): Promise<HandleNotificationParam>;
34
+ }
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.NotificationManager = void 0;
40
+ var common_1 = require("@codeleap/common");
41
+ // @ts-ignore
42
+ var messaging_1 = require("@react-native-firebase/messaging");
43
+ var messaging = messaging_1.firebase.messaging;
44
+ var MODULE = 'Notifications';
45
+ var NotificationManager = /** @class */ (function () {
46
+ function NotificationManager(logger, autoHandleInitialNotification) {
47
+ if (logger === void 0) { logger = common_1.silentLogger; }
48
+ if (autoHandleInitialNotification === void 0) { autoHandleInitialNotification = true; }
49
+ this.logger = logger;
50
+ this.autoHandleInitialNotification = autoHandleInitialNotification;
51
+ this.stateChangeListeners = [];
52
+ this.messageListeners = [];
53
+ this._initialized = false;
54
+ this.unsubscribeFromMessage = null;
55
+ this.unsubscribeFromBackgroundMessage = null;
56
+ this.unsubscribeFromPress = null;
57
+ this._currentToken = null;
58
+ this._initialNoficationHandled = false;
59
+ }
60
+ NotificationManager.prototype.init = function () {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var token_1, e_1;
63
+ var _this = this;
64
+ return __generator(this, function (_a) {
65
+ switch (_a.label) {
66
+ case 0:
67
+ // return
68
+ if (this.initialized)
69
+ return [2 /*return*/];
70
+ _a.label = 1;
71
+ case 1:
72
+ _a.trys.push([1, 4, , 5]);
73
+ return [4 /*yield*/, messaging().registerDeviceForRemoteMessages()
74
+ // logger.log('firebase registeted', '', MODULE)
75
+ ];
76
+ case 2:
77
+ _a.sent();
78
+ return [4 /*yield*/, messaging().getToken()
79
+ // logger.log('init token', { token }, MODULE)
80
+ ];
81
+ case 3:
82
+ token_1 = _a.sent();
83
+ // logger.log('init token', { token }, MODULE)
84
+ if (token_1) {
85
+ this.currentToken = token_1;
86
+ this.initialized = true;
87
+ }
88
+ else {
89
+ this.currentToken = null;
90
+ this.initialized = false;
91
+ }
92
+ messaging().onTokenRefresh(function (newToken) {
93
+ // logger.log('onTokenRefresh', { newToken }, MODULE)
94
+ if (token_1) {
95
+ _this.currentToken = newToken;
96
+ _this.initialized = true;
97
+ }
98
+ else {
99
+ _this.currentToken = null;
100
+ _this.initialized = false;
101
+ }
102
+ });
103
+ return [3 /*break*/, 5];
104
+ case 4:
105
+ e_1 = _a.sent();
106
+ this.logger.error('Failed to initialize notification services', e_1, MODULE);
107
+ return [3 /*break*/, 5];
108
+ case 5: return [2 /*return*/];
109
+ }
110
+ });
111
+ });
112
+ };
113
+ NotificationManager.prototype.deinit = function () {
114
+ return __awaiter(this, void 0, void 0, function () {
115
+ return __generator(this, function (_a) {
116
+ [
117
+ this.unsubscribeFromMessage,
118
+ this.unsubscribeFromBackgroundMessage,
119
+ this.unsubscribeFromPress,
120
+ ].forEach(function (unsubscribe) {
121
+ if (unsubscribe) {
122
+ unsubscribe();
123
+ }
124
+ });
125
+ this.initialized = false;
126
+ return [2 /*return*/];
127
+ });
128
+ });
129
+ };
130
+ NotificationManager.prototype.handleNotification = function (args) {
131
+ return __awaiter(this, void 0, void 0, function () {
132
+ var _i, _a, listener;
133
+ return __generator(this, function (_b) {
134
+ switch (_b.label) {
135
+ case 0:
136
+ _i = 0, _a = this.messageListeners;
137
+ _b.label = 1;
138
+ case 1:
139
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
140
+ listener = _a[_i];
141
+ return [4 /*yield*/, listener(args.data, args.type)];
142
+ case 2:
143
+ _b.sent();
144
+ _b.label = 3;
145
+ case 3:
146
+ _i++;
147
+ return [3 /*break*/, 1];
148
+ case 4: return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
153
+ Object.defineProperty(NotificationManager.prototype, "currentToken", {
154
+ get: function () {
155
+ return this._currentToken;
156
+ },
157
+ set: function (token) {
158
+ this._currentToken = token;
159
+ this.triggerStateChange();
160
+ },
161
+ enumerable: false,
162
+ configurable: true
163
+ });
164
+ Object.defineProperty(NotificationManager.prototype, "initialized", {
165
+ get: function () {
166
+ return this._initialized;
167
+ },
168
+ set: function (to) {
169
+ var _this = this;
170
+ if (to) {
171
+ this.logger.info('Initialized', '', MODULE);
172
+ this.unsubscribeFromMessage = messaging().onMessage(function (msg) {
173
+ _this.handleNotification({
174
+ data: msg,
175
+ type: 'foreground',
176
+ });
177
+ });
178
+ this.unsubscribeFromBackgroundMessage = messaging().setBackgroundMessageHandler(function (msg) { return __awaiter(_this, void 0, void 0, function () {
179
+ return __generator(this, function (_a) {
180
+ this.handleNotification({
181
+ data: msg,
182
+ type: 'background',
183
+ });
184
+ return [2 /*return*/];
185
+ });
186
+ }); });
187
+ this.unsubscribeFromPress = messaging().onNotificationOpenedApp(function (msg) {
188
+ _this.logger.info('Notification press', msg, MODULE);
189
+ _this.handleNotification({
190
+ data: msg,
191
+ type: 'press',
192
+ });
193
+ });
194
+ if (!this._initialNoficationHandled && this.autoHandleInitialNotification) {
195
+ this.getInitialNotification().then(function (msg) {
196
+ if (!msg.data)
197
+ return;
198
+ _this.logger.info('Notification initial', msg, MODULE);
199
+ _this.handleNotification(msg).then(function () {
200
+ _this._initialNoficationHandled = true;
201
+ }).catch(function (e) {
202
+ _this._initialNoficationHandled = true;
203
+ _this.logger.error('Error handling initial notification', e, MODULE);
204
+ });
205
+ });
206
+ }
207
+ }
208
+ else {
209
+ this.unsubscribeFromMessage = null;
210
+ this.unsubscribeFromBackgroundMessage = null;
211
+ this.unsubscribeFromPress = null;
212
+ this.logger.info('Deinitialized', '', MODULE);
213
+ }
214
+ this._initialized = to;
215
+ this.triggerStateChange();
216
+ },
217
+ enumerable: false,
218
+ configurable: true
219
+ });
220
+ NotificationManager.prototype.onNotification = function (handler) {
221
+ var _this = this;
222
+ var newLen = this.messageListeners.push(handler);
223
+ return function () {
224
+ _this.messageListeners.splice(newLen - 1);
225
+ };
226
+ };
227
+ NotificationManager.prototype.triggerStateChange = function () {
228
+ var _this = this;
229
+ this.stateChangeListeners.forEach(function (l) {
230
+ l(_this._initialized, _this.currentToken);
231
+ });
232
+ };
233
+ NotificationManager.prototype.onStateChange = function (handler) {
234
+ var _this = this;
235
+ var newLen = this.stateChangeListeners.push(handler);
236
+ return function () {
237
+ _this.stateChangeListeners.splice(newLen - 1);
238
+ };
239
+ };
240
+ NotificationManager.prototype.getInitialNotification = function () {
241
+ return __awaiter(this, void 0, void 0, function () {
242
+ var msg, e_2;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0:
246
+ _a.trys.push([0, 2, , 3]);
247
+ return [4 /*yield*/, messaging().getInitialNotification()];
248
+ case 1:
249
+ msg = _a.sent();
250
+ return [2 /*return*/, {
251
+ data: msg,
252
+ type: 'initial',
253
+ }];
254
+ case 2:
255
+ e_2 = _a.sent();
256
+ return [2 /*return*/, {
257
+ data: null,
258
+ type: 'initial',
259
+ }];
260
+ case 3: return [2 /*return*/];
261
+ }
262
+ });
263
+ });
264
+ };
265
+ return NotificationManager;
266
+ }());
267
+ exports.NotificationManager = NotificationManager;
268
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/utils/notifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,aAAa;AACb,8DAAmF;AAEnF,IAAM,SAAS,GAAG,oBAAQ,CAAC,SAAS,CAAA;AAEpC,IAAM,MAAM,GAAG,eAAe,CAAA;AAa9B;IAkBI,6BAAoB,MAAqB,EAAS,6BAAoC;QAAlE,uBAAA,EAAA,SAAS,qBAAY;QAAS,8CAAA,EAAA,oCAAoC;QAAlE,WAAM,GAAN,MAAM,CAAe;QAAS,kCAA6B,GAA7B,6BAA6B,CAAO;QAhBtF,yBAAoB,GAAqC,EAAE,CAAA;QAE3D,qBAAgB,GAAyB,EAAE,CAAA;QAE3C,iBAAY,GAAG,KAAK,CAAA;QAEpB,2BAAsB,GAAG,IAAI,CAAA;QAE7B,qCAAgC,GAAG,IAAI,CAAA;QAEvC,yBAAoB,GAAG,IAAI,CAAA;QAE3B,kBAAa,GAAG,IAAI,CAAA;QAEpB,8BAAyB,GAAG,KAAK,CAAA;IAGjC,CAAC;IAEK,kCAAI,GAAV;;;;;;;wBACE,SAAS;wBACT,IAAI,IAAI,CAAC,WAAW;4BAAE,sBAAM;;;;wBAI1B,qBAAM,SAAS,EAAE,CAAC,+BAA+B,EAAE;4BACnD,gDAAgD;0BADG;;wBAAnD,SAAmD,CAAA;wBAGrC,qBAAM,SAAS,EAAE,CAAC,QAAQ,EAAE;4BAC1C,8CAA8C;0BADJ;;wBAApC,UAAQ,SAA4B;wBAC1C,8CAA8C;wBAE9C,IAAI,OAAK,EAAE;4BACT,IAAI,CAAC,YAA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AOC;QANC,IAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAEtD,OAAO;YACL,KAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAC9C,CAAC,CAAA;IAEH,CAAC;IAEK,oDAAsB,GAA5B;;;;;;;wBAGgB,qBAAM,SAAS,EAAE,CAAC,sBAAsB,EAAE,EAAA;;wBAAhD,GAAG,GAAG,SAA0C;wBACtD,sBAAO;gCACL,IAAI,EAAE,GAAc;gCACpB,IAAI,EAAE,SAAS;6BAChB,EAAA;;;wBAGD,sBAAO;gCACL,IAAI,EAAE,IAAI;gCACV,IAAI,EAAE,SAAS;6BAChB,EAAA;;;;;KAEJ;IACL,0BAAC;AAAD,CAAC,AAzLD,IAyLC;AAzLY,kDAAmB"}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@codeleap/mobile",
3
- "version": "1.9.33",
3
+ "version": "2.0.2",
4
4
  "main": "src/index.ts",
5
- "author": "Paulo Henrique De Souza <paulosouza300272@gmail.com>",
6
5
  "license": "UNLICENSED",
7
- "repository": "PRIVATE",
6
+ "repository": {
7
+ "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
8
+ "type": "git",
9
+ "directory": "packages/mobile"
10
+ },
8
11
  "devDependencies": {
9
12
  "@codeleap/config": "*",
10
13
  "@types/react-native": "^0.66.15",
@@ -18,6 +21,7 @@
18
21
  },
19
22
  "peerDependencies": {
20
23
  "@codeleap/common": "*",
24
+ "@react-native-firebase/messaging": "14.4.0",
21
25
  "@react-navigation/bottom-tabs": "^6.0.9",
22
26
  "@react-navigation/drawer": "^6.1.8",
23
27
  "@react-navigation/native": "^6.0.6",
@@ -27,17 +31,22 @@
27
31
  "react": "*",
28
32
  "react-native": "*",
29
33
  "react-native-animatable": "^1.3.3",
34
+ "react-native-calendars": "*",
30
35
  "react-native-fast-image": "^8.5.11",
31
36
  "react-native-gesture-handler": "^2.2.0",
32
37
  "react-native-image-crop-picker": "*",
38
+ "react-native-image-viewing": "^0.2.2",
33
39
  "react-native-keyboard-aware-scroll-view": "^0.9.5",
34
40
  "react-native-text-input-mask": "3.1.4"
35
41
  },
36
42
  "dependencies": {
37
43
  "@gorhom/portal": "^1.0.13",
38
44
  "@miblanchard/react-native-slider": "^2.1.0",
45
+ "date-fns": "^2.28.0",
39
46
  "react-native-animatable": "^1.3.3",
40
47
  "react-native-masked-text": "^1.13.0",
41
- "react-native-pose": "^0.9.1"
48
+ "react-native-pose": "^0.9.1",
49
+ "react-native-super-grid": "^4.4.2",
50
+ "react-native-uuid": "^2.0.1"
42
51
  }
43
52
  }
@@ -0,0 +1,31 @@
1
+ import { ComponentVariants, getNestedStylesByKey, useDefaultComponentStyle } from '@codeleap/common'
2
+ import React from 'react'
3
+ import { StyleSheet } from 'react-native'
4
+ import { StylesOf } from '../../types'
5
+ import { Icon, IconProps } from '../Icon'
6
+ import { Touchable, TouchableProps } from '../Touchable'
7
+ import { ActionIconComposition, ActionIconStyles } from './styles'
8
+
9
+ export type ActionIconProps= {
10
+ iconProps?: Partial<IconProps>
11
+ icon?: IconProps['name']
12
+ styles?: StylesOf<ActionIconComposition>
13
+ } & Omit<TouchableProps, 'styles' | 'variants'> & ComponentVariants<typeof ActionIconStyles>
14
+
15
+ export const ActionIcon:React.FC<ActionIconProps> = (props) => {
16
+ const { icon, iconProps, variants, styles, ...touchableProps } = props
17
+ const variantStyles = useDefaultComponentStyle<'u:ActionIcon', typeof ActionIconStyles>('u:ActionIcon', {
18
+ variants, styles, transform: StyleSheet.flatten,
19
+ })
20
+ const touchableStyles = getNestedStylesByKey('touchable', variantStyles)
21
+
22
+ return <Touchable styles={touchableStyles} {...touchableProps}>
23
+ <Icon name={icon} style={
24
+ [
25
+ variantStyles.icon,
26
+ touchableProps?.disabled && variantStyles['icon:disabled'],
27
+ ]} {...iconProps}/>
28
+ </Touchable>
29
+ }
30
+
31
+ export * from './styles'
@@ -0,0 +1,92 @@
1
+ import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
2
+ import { TouchableComposition } from '../Touchable'
3
+
4
+ export type ActionIconParts = 'icon' | `touchable${Capitalize<TouchableComposition>}`
5
+ export type ActionIconStates = ':disabled' | ''
6
+ export type ActionIconComposition = `${ActionIconParts}${ActionIconStates}`
7
+ const createActionIconStyle = createDefaultVariantFactory<ActionIconComposition>()
8
+
9
+ const presets = includePresets((style) => createActionIconStyle(() => ({ touchableWrapper: style })))
10
+
11
+ export const ActionIconStyles = {
12
+ ...presets,
13
+ default: createActionIconStyle((theme) => {
14
+
15
+ return {
16
+ icon: {
17
+ color: theme.colors.icon,
18
+ ...theme.sized(5 * 0.6),
19
+
20
+ },
21
+ touchableWrapper: {
22
+ ...theme.sized(5),
23
+ borderRadius: theme.borderRadius.round,
24
+ ...theme.presets.center,
25
+ },
26
+ 'icon:disabled': {
27
+ color: theme.colors.disabled,
28
+ },
29
+
30
+ }
31
+ }),
32
+ small: createActionIconStyle((theme) => ({
33
+ touchableWrapper: {
34
+ ...theme.sized(3.5),
35
+
36
+ },
37
+ icon: {
38
+ ...theme.sized(3.5 * 0.6),
39
+
40
+ },
41
+ })),
42
+ large: createActionIconStyle((theme) => ({
43
+ touchableWrapper: {
44
+ ...theme.sized(6.5),
45
+
46
+ },
47
+ icon: {
48
+ ...theme.sized(6.5 * 0.6),
49
+
50
+ },
51
+ })),
52
+ primary: createActionIconStyle((theme) => ({
53
+ icon: {
54
+ color: theme.colors.primary,
55
+
56
+ },
57
+
58
+ })),
59
+ negative: createActionIconStyle((theme) => ({
60
+ icon: {
61
+ color: theme.colors.negative,
62
+
63
+ },
64
+
65
+ })),
66
+ positive: createActionIconStyle((theme) => ({
67
+ icon: {
68
+ color: theme.colors.positive,
69
+
70
+ },
71
+
72
+ })),
73
+ black: createActionIconStyle((theme) => ({
74
+ icon: {
75
+ color: theme.colors.black,
76
+
77
+ },
78
+
79
+ })),
80
+ white: createActionIconStyle((theme) => ({
81
+ icon: {
82
+ color: theme.colors.white,
83
+
84
+ },
85
+
86
+ })),
87
+ neutral: createActionIconStyle((theme) => ({
88
+ icon: {
89
+ color: theme.colors.neutral,
90
+ },
91
+ })),
92
+ }
@@ -2,14 +2,18 @@ import * as React from 'react'
2
2
  import { ComponentPropsWithoutRef, forwardRef } from 'react'
3
3
  import { ActivityIndicator as Indicator, StyleSheet } from 'react-native'
4
4
  import {
5
- ActivityIndicatorComposition,
6
- ActivityIndicatorStyles,
5
+
7
6
  useDefaultComponentStyle,
8
7
  ComponentVariants,
9
8
  useCodeleapContext,
10
9
  } from '@codeleap/common'
11
- import { StylesOf } from '../types/utility'
10
+ import { StylesOf } from '../../types'
11
+ import {
12
+ ActivityIndicatorComposition,
13
+ ActivityIndicatorStyles,
14
+ } from './styles'
12
15
 
16
+ export * from './styles'
13
17
  export type ActivityIndicatorProps = ComponentPropsWithoutRef<
14
18
  typeof Indicator
15
19
  > & {