@axelor/aos-mobile-core 0.0.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 (361) hide show
  1. package/README.md +310 -0
  2. package/lib/api/attached-files-api.d.ts +8 -0
  3. package/lib/api/attached-files-api.js +51 -0
  4. package/lib/api/attached-files-api.js.map +1 -0
  5. package/lib/api/login-api.d.ts +5 -0
  6. package/lib/api/login-api.js +41 -0
  7. package/lib/api/login-api.js.map +1 -0
  8. package/lib/api/mail-message-api.d.ts +43 -0
  9. package/lib/api/mail-message-api.js +114 -0
  10. package/lib/api/mail-message-api.js.map +1 -0
  11. package/lib/api/menu-config-api.d.ts +5 -0
  12. package/lib/api/menu-config-api.js +68 -0
  13. package/lib/api/menu-config-api.js.map +1 -0
  14. package/lib/api/metafile-api.d.ts +6 -0
  15. package/lib/api/metafile-api.js +50 -0
  16. package/lib/api/metafile-api.js.map +1 -0
  17. package/lib/api/mobile-config-api.d.ts +1 -0
  18. package/lib/api/mobile-config-api.js +31 -0
  19. package/lib/api/mobile-config-api.js.map +1 -0
  20. package/lib/api/net-info-utils.d.ts +5 -0
  21. package/lib/api/net-info-utils.js +29 -0
  22. package/lib/api/net-info-utils.js.map +1 -0
  23. package/lib/api/traceback-api.d.ts +7 -0
  24. package/lib/api/traceback-api.js +35 -0
  25. package/lib/api/traceback-api.js.map +1 -0
  26. package/lib/api/utils.d.ts +25 -0
  27. package/lib/api/utils.js +92 -0
  28. package/lib/api/utils.js.map +1 -0
  29. package/lib/app/Application.d.ts +15 -0
  30. package/lib/app/Application.js +29 -0
  31. package/lib/app/Application.js.map +1 -0
  32. package/lib/app/ContextedApplication.d.ts +9 -0
  33. package/lib/app/ContextedApplication.js +80 -0
  34. package/lib/app/ContextedApplication.js.map +1 -0
  35. package/lib/app/ContextsProvider.d.ts +14 -0
  36. package/lib/app/ContextsProvider.js +63 -0
  37. package/lib/app/ContextsProvider.js.map +1 -0
  38. package/lib/app/Module.d.ts +26 -0
  39. package/lib/app/Module.js +19 -0
  40. package/lib/app/Module.js.map +1 -0
  41. package/lib/app/RootNavigator.d.ts +7 -0
  42. package/lib/app/RootNavigator.js +69 -0
  43. package/lib/app/RootNavigator.js.map +1 -0
  44. package/lib/app/index.d.ts +5 -0
  45. package/lib/app/index.js +22 -0
  46. package/lib/app/index.js.map +1 -0
  47. package/lib/assets/Logo_Axelor.png +0 -0
  48. package/lib/auth/api/company-api.d.ts +1 -0
  49. package/lib/auth/api/company-api.js +31 -0
  50. package/lib/auth/api/company-api.js.map +1 -0
  51. package/lib/auth/api/config-api.d.ts +2 -0
  52. package/lib/auth/api/config-api.js +45 -0
  53. package/lib/auth/api/config-api.js.map +1 -0
  54. package/lib/auth/api/index.d.ts +4 -0
  55. package/lib/auth/api/index.js +22 -0
  56. package/lib/auth/api/index.js.map +1 -0
  57. package/lib/auth/api/language-api.d.ts +1 -0
  58. package/lib/auth/api/language-api.js +24 -0
  59. package/lib/auth/api/language-api.js.map +1 -0
  60. package/lib/auth/api/user-api.d.ts +2 -0
  61. package/lib/auth/api/user-api.js +30 -0
  62. package/lib/auth/api/user-api.js.map +1 -0
  63. package/lib/auth/features/asyncFunctionsIndex.d.ts +4 -0
  64. package/lib/auth/features/asyncFunctionsIndex.js +22 -0
  65. package/lib/auth/features/asyncFunctionsIndex.js.map +1 -0
  66. package/lib/auth/features/companySlice.d.ts +14 -0
  67. package/lib/auth/features/companySlice.js +48 -0
  68. package/lib/auth/features/companySlice.js.map +1 -0
  69. package/lib/auth/features/configSlice.d.ts +37 -0
  70. package/lib/auth/features/configSlice.js +82 -0
  71. package/lib/auth/features/configSlice.js.map +1 -0
  72. package/lib/auth/features/index.d.ts +4 -0
  73. package/lib/auth/features/index.js +22 -0
  74. package/lib/auth/features/index.js.map +1 -0
  75. package/lib/auth/features/languageSlice.d.ts +14 -0
  76. package/lib/auth/features/languageSlice.js +48 -0
  77. package/lib/auth/features/languageSlice.js.map +1 -0
  78. package/lib/auth/features/userSlice.d.ts +27 -0
  79. package/lib/auth/features/userSlice.js +83 -0
  80. package/lib/auth/features/userSlice.js.map +1 -0
  81. package/lib/auth/i18n/en.json +23 -0
  82. package/lib/auth/i18n/fr.json +23 -0
  83. package/lib/auth/index.d.ts +5 -0
  84. package/lib/auth/index.js +55 -0
  85. package/lib/auth/index.js.map +1 -0
  86. package/lib/auth/screens/SettingsScreen.d.ts +4 -0
  87. package/lib/auth/screens/SettingsScreen.js +79 -0
  88. package/lib/auth/screens/SettingsScreen.js.map +1 -0
  89. package/lib/auth/screens/UserScreen.d.ts +5 -0
  90. package/lib/auth/screens/UserScreen.js +116 -0
  91. package/lib/auth/screens/UserScreen.js.map +1 -0
  92. package/lib/auth/screens/index.d.ts +2 -0
  93. package/lib/auth/screens/index.js +20 -0
  94. package/lib/auth/screens/index.js.map +1 -0
  95. package/lib/axios/AxiosApi.d.ts +12 -0
  96. package/lib/axios/AxiosApi.js +32 -0
  97. package/lib/axios/AxiosApi.js.map +1 -0
  98. package/lib/components/external/Camera/Camera.d.ts +2 -0
  99. package/lib/components/external/Camera/Camera.js +148 -0
  100. package/lib/components/external/Camera/Camera.js.map +1 -0
  101. package/lib/components/external/Camera/CaptureButton.d.ts +10 -0
  102. package/lib/components/external/Camera/CaptureButton.js +118 -0
  103. package/lib/components/external/Camera/CaptureButton.js.map +1 -0
  104. package/lib/components/external/CameraScanner/CameraScanner.d.ts +10 -0
  105. package/lib/components/external/CameraScanner/CameraScanner.js +87 -0
  106. package/lib/components/external/CameraScanner/CameraScanner.js.map +1 -0
  107. package/lib/components/external/PlanningView/PlanningView.d.ts +11 -0
  108. package/lib/components/external/PlanningView/PlanningView.js +123 -0
  109. package/lib/components/external/PlanningView/PlanningView.js.map +1 -0
  110. package/lib/components/external/PlanningView/agenda.helpers.d.ts +10 -0
  111. package/lib/components/external/PlanningView/agenda.helpers.js +90 -0
  112. package/lib/components/external/PlanningView/agenda.helpers.js.map +1 -0
  113. package/lib/components/external/Scanner/Scanner.d.ts +2 -0
  114. package/lib/components/external/Scanner/Scanner.js +67 -0
  115. package/lib/components/external/Scanner/Scanner.js.map +1 -0
  116. package/lib/components/external/Stopwatch/Stopwatch.d.ts +18 -0
  117. package/lib/components/external/Stopwatch/Stopwatch.js +114 -0
  118. package/lib/components/external/Stopwatch/Stopwatch.js.map +1 -0
  119. package/lib/components/external/Timer/Timer.d.ts +9 -0
  120. package/lib/components/external/Timer/Timer.js +60 -0
  121. package/lib/components/external/Timer/Timer.js.map +1 -0
  122. package/lib/components/external/index.d.ts +6 -0
  123. package/lib/components/external/index.js +24 -0
  124. package/lib/components/external/index.js.map +1 -0
  125. package/lib/components/index.d.ts +4 -0
  126. package/lib/components/index.js +22 -0
  127. package/lib/components/index.js.map +1 -0
  128. package/lib/components/molecules/ErrorText/ErrorText.d.ts +4 -0
  129. package/lib/components/molecules/ErrorText/ErrorText.js +31 -0
  130. package/lib/components/molecules/ErrorText/ErrorText.js.map +1 -0
  131. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.d.ts +9 -0
  132. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js +56 -0
  133. package/lib/components/molecules/HeaderOptionsMenuItem/HeaderOptionMenuItem.js.map +1 -0
  134. package/lib/components/molecules/IconSettings/IconSettings.d.ts +4 -0
  135. package/lib/components/molecules/IconSettings/IconSettings.js +31 -0
  136. package/lib/components/molecules/IconSettings/IconSettings.js.map +1 -0
  137. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.d.ts +7 -0
  138. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js +84 -0
  139. package/lib/components/molecules/InputBarCodeCard/InputBarCodeCard.js.map +1 -0
  140. package/lib/components/molecules/LoginButton/LoginButton.d.ts +4 -0
  141. package/lib/components/molecules/LoginButton/LoginButton.js +40 -0
  142. package/lib/components/molecules/LoginButton/LoginButton.js.map +1 -0
  143. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.d.ts +7 -0
  144. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js +55 -0
  145. package/lib/components/molecules/MailMessageReadIcon/MailMessageReadIcon.js.map +1 -0
  146. package/lib/components/molecules/TrackItem/TrackItem.d.ts +9 -0
  147. package/lib/components/molecules/TrackItem/TrackItem.js +65 -0
  148. package/lib/components/molecules/TrackItem/TrackItem.js.map +1 -0
  149. package/lib/components/molecules/index.d.ts +7 -0
  150. package/lib/components/molecules/index.js +25 -0
  151. package/lib/components/molecules/index.js.map +1 -0
  152. package/lib/components/organisms/AOSImage/AOSImage.d.ts +15 -0
  153. package/lib/components/organisms/AOSImage/AOSImage.js +37 -0
  154. package/lib/components/organisms/AOSImage/AOSImage.js.map +1 -0
  155. package/lib/components/organisms/AOSImageBubble/AOSImageBubble.d.ts +9 -0
  156. package/lib/components/organisms/AOSImageBubble/AOSImageBubble.js +30 -0
  157. package/lib/components/organisms/AOSImageBubble/AOSImageBubble.js.map +1 -0
  158. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +9 -0
  159. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +68 -0
  160. package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -0
  161. package/lib/components/organisms/LogoImage/LogoImage.d.ts +4 -0
  162. package/lib/components/organisms/LogoImage/LogoImage.js +52 -0
  163. package/lib/components/organisms/LogoImage/LogoImage.js.map +1 -0
  164. package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +17 -0
  165. package/lib/components/organisms/MailMessageCard/MailMessageCard.js +79 -0
  166. package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -0
  167. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.d.ts +12 -0
  168. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +139 -0
  169. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +1 -0
  170. package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.d.ts +15 -0
  171. package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js +79 -0
  172. package/lib/components/organisms/MailMessageNotificationCard/MailMessageNotificationCard.js.map +1 -0
  173. package/lib/components/organisms/PasswordInput/PasswordInput.d.ts +7 -0
  174. package/lib/components/organisms/PasswordInput/PasswordInput.js +36 -0
  175. package/lib/components/organisms/PasswordInput/PasswordInput.js.map +1 -0
  176. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.d.ts +17 -0
  177. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js +68 -0
  178. package/lib/components/organisms/ScannerAutocompleteSearch/ScannerAutocompleteSearch.js.map +1 -0
  179. package/lib/components/organisms/UrlInput/UrlInput.d.ts +10 -0
  180. package/lib/components/organisms/UrlInput/UrlInput.js +38 -0
  181. package/lib/components/organisms/UrlInput/UrlInput.js.map +1 -0
  182. package/lib/components/organisms/UsernameInput/UsernameInput.d.ts +6 -0
  183. package/lib/components/organisms/UsernameInput/UsernameInput.js +33 -0
  184. package/lib/components/organisms/UsernameInput/UsernameInput.js.map +1 -0
  185. package/lib/components/organisms/index.d.ts +11 -0
  186. package/lib/components/organisms/index.js +29 -0
  187. package/lib/components/organisms/index.js.map +1 -0
  188. package/lib/components/templates/AttachedFilesView/AttachedFilesView.d.ts +10 -0
  189. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +87 -0
  190. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -0
  191. package/lib/components/templates/MailMessageView/MailMessageView.d.ts +6 -0
  192. package/lib/components/templates/MailMessageView/MailMessageView.js +140 -0
  193. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -0
  194. package/lib/components/templates/index.d.ts +2 -0
  195. package/lib/components/templates/index.js +20 -0
  196. package/lib/components/templates/index.js.map +1 -0
  197. package/lib/features/attachedFilesSlice.d.ts +35 -0
  198. package/lib/features/attachedFilesSlice.js +82 -0
  199. package/lib/features/attachedFilesSlice.js.map +1 -0
  200. package/lib/features/authSlice.d.ts +44 -0
  201. package/lib/features/authSlice.js +67 -0
  202. package/lib/features/authSlice.js.map +1 -0
  203. package/lib/features/cameraSlice.d.ts +14 -0
  204. package/lib/features/cameraSlice.js +52 -0
  205. package/lib/features/cameraSlice.js.map +1 -0
  206. package/lib/features/index.d.ts +8 -0
  207. package/lib/features/index.js +26 -0
  208. package/lib/features/index.js.map +1 -0
  209. package/lib/features/mailMessageSlice.d.ts +97 -0
  210. package/lib/features/mailMessageSlice.js +219 -0
  211. package/lib/features/mailMessageSlice.js.map +1 -0
  212. package/lib/features/menuConfigSlice.d.ts +14 -0
  213. package/lib/features/menuConfigSlice.js +48 -0
  214. package/lib/features/menuConfigSlice.js.map +1 -0
  215. package/lib/features/metafileSlice.d.ts +14 -0
  216. package/lib/features/metafileSlice.js +48 -0
  217. package/lib/features/metafileSlice.js.map +1 -0
  218. package/lib/features/mobileConfigSlice.d.ts +14 -0
  219. package/lib/features/mobileConfigSlice.js +52 -0
  220. package/lib/features/mobileConfigSlice.js.map +1 -0
  221. package/lib/features/scannerSlice.d.ts +14 -0
  222. package/lib/features/scannerSlice.js +52 -0
  223. package/lib/features/scannerSlice.js.map +1 -0
  224. package/lib/hooks/use-effect-debugger.d.ts +1 -0
  225. package/lib/hooks/use-effect-debugger.js +47 -0
  226. package/lib/hooks/use-effect-debugger.js.map +1 -0
  227. package/lib/i18n/api/translation.d.ts +2 -0
  228. package/lib/i18n/api/translation.js +38 -0
  229. package/lib/i18n/api/translation.js.map +1 -0
  230. package/lib/i18n/component/Translator.d.ts +6 -0
  231. package/lib/i18n/component/Translator.js +74 -0
  232. package/lib/i18n/component/Translator.js.map +1 -0
  233. package/lib/i18n/helpers/langages.d.ts +3 -0
  234. package/lib/i18n/helpers/langages.js +34 -0
  235. package/lib/i18n/helpers/langages.js.map +1 -0
  236. package/lib/i18n/helpers/translations.d.ts +1 -0
  237. package/lib/i18n/helpers/translations.js +24 -0
  238. package/lib/i18n/helpers/translations.js.map +1 -0
  239. package/lib/i18n/hooks/use-translator.d.ts +5 -0
  240. package/lib/i18n/hooks/use-translator.js +24 -0
  241. package/lib/i18n/hooks/use-translator.js.map +1 -0
  242. package/lib/i18n/i18n.d.ts +20 -0
  243. package/lib/i18n/i18n.js +53 -0
  244. package/lib/i18n/i18n.js.map +1 -0
  245. package/lib/i18n/index.d.ts +4 -0
  246. package/lib/i18n/index.js +22 -0
  247. package/lib/i18n/index.js.map +1 -0
  248. package/lib/i18n/translations/en.json +52 -0
  249. package/lib/i18n/translations/fr.json +52 -0
  250. package/lib/index.d.ts +18 -0
  251. package/lib/index.js +36 -0
  252. package/lib/index.js.map +1 -0
  253. package/lib/navigator/Navigator.d.ts +12 -0
  254. package/lib/navigator/Navigator.js +118 -0
  255. package/lib/navigator/Navigator.js.map +1 -0
  256. package/lib/navigator/drawer/AuthMenuIconButton.d.ts +6 -0
  257. package/lib/navigator/drawer/AuthMenuIconButton.js +29 -0
  258. package/lib/navigator/drawer/AuthMenuIconButton.js.map +1 -0
  259. package/lib/navigator/drawer/BackIcon.d.ts +4 -0
  260. package/lib/navigator/drawer/BackIcon.js +32 -0
  261. package/lib/navigator/drawer/BackIcon.js.map +1 -0
  262. package/lib/navigator/drawer/DrawerContent.d.ts +8 -0
  263. package/lib/navigator/drawer/DrawerContent.js +177 -0
  264. package/lib/navigator/drawer/DrawerContent.js.map +1 -0
  265. package/lib/navigator/drawer/DrawerToggleButton.d.ts +4 -0
  266. package/lib/navigator/drawer/DrawerToggleButton.js +32 -0
  267. package/lib/navigator/drawer/DrawerToggleButton.js.map +1 -0
  268. package/lib/navigator/drawer/Menu.d.ts +8 -0
  269. package/lib/navigator/drawer/Menu.js +91 -0
  270. package/lib/navigator/drawer/Menu.js.map +1 -0
  271. package/lib/navigator/drawer/MenuIconButton.d.ts +10 -0
  272. package/lib/navigator/drawer/MenuIconButton.js +64 -0
  273. package/lib/navigator/drawer/MenuIconButton.js.map +1 -0
  274. package/lib/navigator/drawer/MenuItem.d.ts +8 -0
  275. package/lib/navigator/drawer/MenuItem.js +71 -0
  276. package/lib/navigator/drawer/MenuItem.js.map +1 -0
  277. package/lib/navigator/menu.helper.d.ts +8 -0
  278. package/lib/navigator/menu.helper.js +50 -0
  279. package/lib/navigator/menu.helper.js.map +1 -0
  280. package/lib/navigator/module.helper.d.ts +7 -0
  281. package/lib/navigator/module.helper.js +95 -0
  282. package/lib/navigator/module.helper.js.map +1 -0
  283. package/lib/navigator/roles.helper.d.ts +4 -0
  284. package/lib/navigator/roles.helper.js +33 -0
  285. package/lib/navigator/roles.helper.js.map +1 -0
  286. package/lib/redux/hooks.d.ts +5 -0
  287. package/lib/redux/hooks.js +25 -0
  288. package/lib/redux/hooks.js.map +1 -0
  289. package/lib/redux/store.d.ts +1 -0
  290. package/lib/redux/store.js +28 -0
  291. package/lib/redux/store.js.map +1 -0
  292. package/lib/screens/AttachedFilesScreen.d.ts +5 -0
  293. package/lib/screens/AttachedFilesScreen.js +26 -0
  294. package/lib/screens/AttachedFilesScreen.js.map +1 -0
  295. package/lib/screens/ErrorScreen.d.ts +5 -0
  296. package/lib/screens/ErrorScreen.js +46 -0
  297. package/lib/screens/ErrorScreen.js.map +1 -0
  298. package/lib/screens/LoginScreen.d.ts +4 -0
  299. package/lib/screens/LoginScreen.js +115 -0
  300. package/lib/screens/LoginScreen.js.map +1 -0
  301. package/lib/screens/MailMessageScreen.d.ts +5 -0
  302. package/lib/screens/MailMessageScreen.js +25 -0
  303. package/lib/screens/MailMessageScreen.js.map +1 -0
  304. package/lib/storage/Storage.d.ts +17 -0
  305. package/lib/storage/Storage.js +53 -0
  306. package/lib/storage/Storage.js.map +1 -0
  307. package/lib/tools/ClipboardProvider.d.ts +7 -0
  308. package/lib/tools/ClipboardProvider.js +59 -0
  309. package/lib/tools/ClipboardProvider.js.map +1 -0
  310. package/lib/tools/FileViewer.d.ts +13 -0
  311. package/lib/tools/FileViewer.js +48 -0
  312. package/lib/tools/FileViewer.js.map +1 -0
  313. package/lib/tools/LinkingProvider.d.ts +17 -0
  314. package/lib/tools/LinkingProvider.js +94 -0
  315. package/lib/tools/LinkingProvider.js.map +1 -0
  316. package/lib/tools/index.d.ts +3 -0
  317. package/lib/tools/index.js +21 -0
  318. package/lib/tools/index.js.map +1 -0
  319. package/lib/tools/linking.helper.d.ts +25 -0
  320. package/lib/tools/linking.helper.js +70 -0
  321. package/lib/tools/linking.helper.js.map +1 -0
  322. package/lib/types/index.d.ts +2 -0
  323. package/lib/types/index.js +20 -0
  324. package/lib/types/index.js.map +1 -0
  325. package/lib/types/mail-message-notification-type.d.ts +12 -0
  326. package/lib/types/mail-message-notification-type.js +48 -0
  327. package/lib/types/mail-message-notification-type.js.map +1 -0
  328. package/lib/types/stopwatch-type.d.ts +14 -0
  329. package/lib/types/stopwatch-type.js +64 -0
  330. package/lib/types/stopwatch-type.js.map +1 -0
  331. package/lib/utils/agenda.d.ts +1 -0
  332. package/lib/utils/agenda.js +28 -0
  333. package/lib/utils/agenda.js.map +1 -0
  334. package/lib/utils/date.d.ts +4 -0
  335. package/lib/utils/date.js +41 -0
  336. package/lib/utils/date.js.map +1 -0
  337. package/lib/utils/displayers.d.ts +1 -0
  338. package/lib/utils/displayers.js +19 -0
  339. package/lib/utils/displayers.js.map +1 -0
  340. package/lib/utils/formatters.d.ts +5 -0
  341. package/lib/utils/formatters.js +74 -0
  342. package/lib/utils/formatters.js.map +1 -0
  343. package/lib/utils/index.d.ts +9 -0
  344. package/lib/utils/index.js +27 -0
  345. package/lib/utils/index.js.map +1 -0
  346. package/lib/utils/list.d.ts +3 -0
  347. package/lib/utils/list.js +101 -0
  348. package/lib/utils/list.js.map +1 -0
  349. package/lib/utils/object.d.ts +2 -0
  350. package/lib/utils/object.js +36 -0
  351. package/lib/utils/object.js.map +1 -0
  352. package/lib/utils/show-toast-message.d.ts +2 -0
  353. package/lib/utils/show-toast-message.js +22 -0
  354. package/lib/utils/show-toast-message.js.map +1 -0
  355. package/lib/utils/string.d.ts +4 -0
  356. package/lib/utils/string.js +54 -0
  357. package/lib/utils/string.js.map +1 -0
  358. package/lib/utils/time.d.ts +4 -0
  359. package/lib/utils/time.js +78 -0
  360. package/lib/utils/time.js.map +1 -0
  361. package/package.json +95 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-effect-debugger.js","sourceRoot":"","sources":["../../src/hooks/use-effect-debugger.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;IAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACjC,SAAS,CAAC,GAAG,EAAE;QACb,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,UAAU,EACV,YAAY,EACZ,eAAe,GAAG,EAAE,EACpB,EAAE;IACF,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;QACnE,IAAI,UAAU,KAAK,YAAY,CAAC,KAAK,CAAC,EAAE;YACtC,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;YAChD,OAAO;gBACL,GAAG,KAAK;gBACR,CAAC,OAAO,CAAC,EAAE;oBACT,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;oBAC3B,KAAK,EAAE,UAAU;iBAClB;aACF,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE;QACnC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAAC;KACpD;IAED,uDAAuD;IACvD,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export function fetchTranslation(language: any): Promise<any>;
2
+ export function postTranslations(language: any, translations: any): Promise<any>;
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import axios from 'axios';
19
+ export async function fetchTranslation(language) {
20
+ return axios
21
+ .get(`/ws/aos/translation/${language}`)
22
+ .catch(error => {
23
+ console.warn('ERROR : Failed to fetch translations from webapp');
24
+ if (error) {
25
+ console.log({ error });
26
+ }
27
+ return;
28
+ })
29
+ .then(res => res?.data?.translation);
30
+ }
31
+ export async function postTranslations(language, translations) {
32
+ return axios
33
+ .post(`/ws/aos/translation/${language}`, translations)
34
+ .then(res => {
35
+ return res?.data?.messageStatus;
36
+ });
37
+ }
38
+ //# sourceMappingURL=translation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../src/i18n/api/translation.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAQ;IAC7C,OAAO,KAAK;SACT,GAAG,CAAC,uBAAuB,QAAQ,EAAE,CAAC;SACtC,KAAK,CAAC,KAAK,CAAC,EAAE;QACb,OAAO,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QACjE,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC;SACtB;QACD,OAAO;IACT,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAQ,EAAE,YAAY;IAC3D,OAAO,KAAK;SACT,IAAI,CAAC,uBAAuB,QAAQ,EAAE,EAAE,YAAY,CAAC;SACrD,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,OAAO,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,6 @@
1
+ export function getTranslations(language: any): any;
2
+ export const selectLanguage: ((state: any) => any) & import("reselect").OutputSelectorFields<(args_0: any) => any> & {
3
+ clearCache: () => void;
4
+ };
5
+ export default Translator;
6
+ declare function Translator(): any;
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { useEffect, useCallback } from 'react';
19
+ import { createSelector } from '@reduxjs/toolkit';
20
+ import { fetchTranslation } from '../api/translation';
21
+ import { reduceTranslationsToI18nResources } from '../helpers/translations';
22
+ import { storage } from '../../storage/Storage';
23
+ import { i18nProvider } from '../i18n';
24
+ import { useSelector } from 'react-redux';
25
+ export const selectLanguage = createSelector(state => state?.user, userState => userState?.user?.language);
26
+ const DEFAULT_NAMESPACE = 'translation';
27
+ const useLanguageEffect = callback => {
28
+ const language = useSelector(selectLanguage);
29
+ useEffect(() => {
30
+ if (language) {
31
+ callback(language);
32
+ }
33
+ }, [language, callback]);
34
+ };
35
+ const Translator = () => {
36
+ useEffect(() => {
37
+ i18nProvider.i18n.on('initialized', function () {
38
+ loadTranslationsFromStorage(i18nProvider.i18n.language);
39
+ });
40
+ }, []);
41
+ useLanguageEffect(useCallback(language => {
42
+ loadTranslationsFromStorage(language);
43
+ }, []));
44
+ useLanguageEffect(useCallback(language => {
45
+ fetchTranslation(language).then(translations => {
46
+ if (translations) {
47
+ addTranslationsToI18n(language, translations);
48
+ saveTranslationResourcesToStorage(language);
49
+ }
50
+ });
51
+ }, []));
52
+ useLanguageEffect(useCallback(language => {
53
+ i18nProvider.i18n.changeLanguage(language);
54
+ }, []));
55
+ return null;
56
+ };
57
+ export function getTranslations(language) {
58
+ return i18nProvider.i18n.getResourceBundle(language, DEFAULT_NAMESPACE);
59
+ }
60
+ function loadTranslationsFromStorage(language) {
61
+ const translations = storage.getItem(`language.${language}`);
62
+ if (translations != null) {
63
+ i18nProvider.i18n.addResourceBundle(language, DEFAULT_NAMESPACE, translations);
64
+ }
65
+ }
66
+ function addTranslationsToI18n(language, translations) {
67
+ i18nProvider.i18n.addResources(language, DEFAULT_NAMESPACE, reduceTranslationsToI18nResources(translations));
68
+ }
69
+ function saveTranslationResourcesToStorage(language) {
70
+ const translationResources = i18nProvider.i18n.getResourceBundle(language, DEFAULT_NAMESPACE);
71
+ storage.setItem(`language.${language}`, translationResources);
72
+ }
73
+ export default Translator;
74
+ //# sourceMappingURL=Translator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Translator.js","sourceRoot":"","sources":["../../../src/i18n/component/Translator.js"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { langagesResources } from '../i18n';
2
+ export declare const getSupportedLangages: ({ resources }: langagesResources) => string[];
3
+ export declare const formatResources: ({ resources }: langagesResources) => {};
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export const getSupportedLangages = ({ resources }) => {
19
+ if (resources == null || resources.length === 0) {
20
+ return [];
21
+ }
22
+ return resources.map(langageBundle => langageBundle.lng);
23
+ };
24
+ export const formatResources = ({ resources }) => {
25
+ if (resources == null || resources.length === 0) {
26
+ return {};
27
+ }
28
+ const linkedLangages = {};
29
+ resources.forEach(langageBundle => (linkedLangages[langageBundle.lng] = {
30
+ translation: langageBundle.translationsObject,
31
+ }));
32
+ return linkedLangages;
33
+ };
34
+ //# sourceMappingURL=langages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langages.js","sourceRoot":"","sources":["../../../src/i18n/helpers/langages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAC,SAAS,EAAoB,EAAE,EAAE;IACrE,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/C,OAAO,EAAE,CAAC;KACX;IACD,OAAO,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,SAAS,EAAoB,EAAE,EAAE;IAChE,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/C,OAAO,EAAE,CAAC;KACX;IAED,MAAM,cAAc,GAAG,EAAE,CAAC;IAC1B,SAAS,CAAC,OAAO,CACf,aAAa,CAAC,EAAE,CACd,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;QACnC,WAAW,EAAE,aAAa,CAAC,kBAAkB;KAC9C,CAAC,CACL,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function reduceTranslationsToI18nResources(translations: any): any;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export function reduceTranslationsToI18nResources(translations) {
19
+ return translations.reduce((resources, translation) => {
20
+ resources[translation.key] = translation.value;
21
+ return resources;
22
+ }, {});
23
+ }
24
+ //# sourceMappingURL=translations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.js","sourceRoot":"","sources":["../../../src/i18n/helpers/translations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,UAAU,iCAAiC,CAAC,YAAY;IAC5D,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE;QACpD,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface TranslatorProps {
2
+ t: (key: string) => string;
3
+ }
4
+ declare function useTranslator(): TranslatorProps;
5
+ export default useTranslator;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { useMemo } from 'react';
19
+ import { i18nProvider } from '../i18n';
20
+ function useTranslator() {
21
+ return useMemo(() => ({ t: i18nProvider?.i18n ? i18nProvider.i18n.t : value => value }), []);
22
+ }
23
+ export default useTranslator;
24
+ //# sourceMappingURL=use-translator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-translator.js","sourceRoot":"","sources":["../../../src/i18n/hooks/use-translator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAMrC,SAAS,aAAa;IACpB,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAC,CAAC,EACtE,EAAE,CACH,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { i18n } from 'i18next';
2
+ export interface resourcesBinding {
3
+ lng: string;
4
+ translationsObject: any;
5
+ }
6
+ export interface langagesResources {
7
+ resources: resourcesBinding[];
8
+ }
9
+ declare class I18nProvider {
10
+ private supportedLng;
11
+ private resources;
12
+ private i18next;
13
+ constructor();
14
+ get i18n(): i18n;
15
+ configI18n({ resources }: langagesResources): void;
16
+ initI18n: () => void;
17
+ }
18
+ export declare const i18nProvider: I18nProvider;
19
+ export declare const configI18n: ({ resources }: langagesResources) => void;
20
+ export {};
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import i18next from 'i18next';
19
+ import { initReactI18next } from 'react-i18next';
20
+ import { formatResources, getSupportedLangages } from './helpers/langages';
21
+ class I18nProvider {
22
+ supportedLng;
23
+ resources;
24
+ i18next;
25
+ constructor() {
26
+ this.supportedLng = [];
27
+ this.resources = [];
28
+ this.i18next = i18next;
29
+ }
30
+ get i18n() {
31
+ return this.i18next;
32
+ }
33
+ configI18n({ resources }) {
34
+ this.supportedLng = getSupportedLangages({ resources });
35
+ this.resources = formatResources({ resources });
36
+ this.initI18n();
37
+ }
38
+ initI18n = () => {
39
+ this.i18next.use(initReactI18next).init({
40
+ compatibilityJSON: 'v3',
41
+ lng: 'en',
42
+ fallbackLng: 'en',
43
+ supportedLngs: this.supportedLng,
44
+ resources: this.resources,
45
+ react: {
46
+ bindI18nStore: 'added',
47
+ },
48
+ });
49
+ };
50
+ }
51
+ export const i18nProvider = new I18nProvider();
52
+ export const configI18n = ({ resources }) => i18nProvider.configI18n({ resources });
53
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,OAAe,MAAM,SAAS,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAWzE,MAAM,YAAY;IACR,YAAY,CAAW;IACvB,SAAS,CAAM;IACf,OAAO,CAAO;IAEtB;QACE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,UAAU,CAAC,EAAC,SAAS,EAAoB;QACvC,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,EAAC,SAAS,EAAC,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,EAAC,SAAS,EAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,GAAG,GAAG,EAAE;QACd,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;YACtC,iBAAiB,EAAE,IAAI;YACvB,GAAG,EAAE,IAAI;YACT,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,IAAI,CAAC,YAAY;YAChC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE;gBACL,aAAa,EAAE,OAAO;aACvB;SACF,CAAC,CAAC;IACL,CAAC,CAAC;CACH;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAC,SAAS,EAAoB,EAAE,EAAE,CAC3D,YAAY,CAAC,UAAU,CAAC,EAAC,SAAS,EAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { postTranslations } from "./api/translation";
2
+ export { default as Translator, selectLanguage, getTranslations } from "./component/Translator";
3
+ export { default as useTranslator, TranslatorProps } from "./hooks/use-translator";
4
+ export { i18nProvider, configI18n } from "./i18n";
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { postTranslations } from './api/translation';
19
+ export { default as Translator, selectLanguage, getTranslations, } from './component/Translator';
20
+ export { default as useTranslator, } from './hooks/use-translator';
21
+ export { i18nProvider, configI18n } from './i18n';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,cAAc,EACd,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,OAAO,IAAI,aAAa,GAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,52 @@
1
+ {
2
+ "Base_AddedOn": "Added on",
3
+ "Base_OK": "Ok",
4
+ "Base_NoMoreItems": "No more items.",
5
+ "Base_NoData": "No data.",
6
+ "Base_Description": "Description",
7
+ "Base_AllFilters": "All filters",
8
+ "Base_DateFormat": "MM/DD/YYYY",
9
+ "Base_DateTimeFormat": "MM/DD/YYYY HH:mm",
10
+ "Base_DecimalSpacer": ",",
11
+ "Base_ThousandSpacer": ".",
12
+ "Base_CreatedOn": "Created on",
13
+ "Base_ValidatedOn": "Validated on",
14
+ "Base_PlannedFor": "Planned for",
15
+ "Base_RealizedOn": "Realize on",
16
+ "Base_StartedOn": "Started on",
17
+ "Base_CompletedOn": "Completed on",
18
+ "Base_Save": "Save",
19
+ "Base_Validate": "Validated",
20
+ "Base_Realize": "Realize",
21
+ "Base_RealizeContinue": "Realize and continue",
22
+ "Base_Search": "Search",
23
+ "Base_Add": "Add",
24
+ "Base_Check": "Check",
25
+ "Base_Start": "Start",
26
+ "Base_Complete": "Complete",
27
+ "Base_Confirm": "Confirm",
28
+ "Base_Cancel": "Cancel",
29
+ "Base_Content": "Content",
30
+ "Base_ViewAll": "View all",
31
+ "Base_NoAppConfigured": "No module configured on your application, please contact an administrator.",
32
+ "Base_Unknown": "Unknown",
33
+ "Base_Next": "Next",
34
+ "Base_Estimated": "Estimated",
35
+ "Base_Real": "Real",
36
+ "Base_Large": "Large",
37
+ "Base_Small": "Small",
38
+ "Base_MailMessages": "Mail Messages",
39
+ "Base_Comment": "Comment",
40
+ "Base_MailMessages_CommentInput_Placeholder": "Enter a comment",
41
+ "Base_AttachedFiles": "Attached Files",
42
+ "Base_Question": "Question",
43
+ "Base_Unfollow_Confirmation": "Are you sure to unfollow this document?",
44
+ "Base_NoConnection": "No internet connection",
45
+ "Base_Connected": "Connection is established",
46
+ "Stopwatch_Status_Ready": "Ready",
47
+ "Stopwatch_Status_InProgress": "InProgress",
48
+ "Stopwatch_Status_Paused": "Paused",
49
+ "Stopwatch_Status_Finished": "Finished",
50
+ "Stopwatch_Status_Canceled": "Canceled",
51
+ "Stopwatch_TimerFormat": "mm:ss"
52
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "Base_AddedOn": "Ajouté le",
3
+ "Base_OK": "Ok",
4
+ "Base_NoMoreItems": "Fin de la liste.",
5
+ "Base_NoData": "Aucune donnée.",
6
+ "Base_Description": "Description",
7
+ "Base_AllFilters": "Tous les filtres",
8
+ "Base_DateFormat": "DD/MM/YYYY",
9
+ "Base_DateTimeFormat": "DD/MM/YYYY HH:mm",
10
+ "Base_DecimalSpacer": ".",
11
+ "Base_ThousandSpacer": " ",
12
+ "Base_CreatedOn": "Créé le",
13
+ "Base_ValidatedOn": "Validé le",
14
+ "Base_PlannedFor": "Planifé pour le",
15
+ "Base_RealizedOn": "Réalisé le",
16
+ "Base_StartedOn": "Commencé le",
17
+ "Base_CompletedOn": "Complété le",
18
+ "Base_Save": "Enregister",
19
+ "Base_Validate": "Valider",
20
+ "Base_Realize": "Réaliser",
21
+ "Base_RealizeContinue": "Réaliser et continuer",
22
+ "Base_Search": "Rechercher",
23
+ "Base_Add": "Ajouter",
24
+ "Base_Check": "Vérifier",
25
+ "Base_Start": "Commencer",
26
+ "Base_Complete": "Terminer",
27
+ "Base_Confirm": "Confirmer",
28
+ "Base_Cancel": "Annuler",
29
+ "Base_Content": "Contenu",
30
+ "Base_ViewAll": "Tout voir",
31
+ "Base_NoAppConfigured": "Votre application n'est pas configurée, merci de contacter un administrateur.",
32
+ "Base_Unknown": "Inconnue",
33
+ "Base_Next": "Suivant",
34
+ "Base_Estimated": "Estimée",
35
+ "Base_Real": "Réelle",
36
+ "Base_Large": "Large",
37
+ "Base_Small": " Petit",
38
+ "Base_MailMessages": "Suivi des notifications",
39
+ "Base_Comment": "Commentaire",
40
+ "Base_MailMessages_CommentInput_Placeholder": "Entrez votre commentaire",
41
+ "Base_AttachedFiles": "Fichiers attachés",
42
+ "Base_Question": "Question",
43
+ "Base_Unfollow_Confirmation": "Êtes-vous sûr de vouloir vous désabonner de ce document?",
44
+ "Base_NoConnection": "Pas de connexion Internet",
45
+ "Base_Connected": "Connexion est établie",
46
+ "Stopwatch_Status_Ready": "Prêt",
47
+ "Stopwatch_Status_InProgress": "En cours",
48
+ "Stopwatch_Status_Paused": "En pause",
49
+ "Stopwatch_Status_Finished": "Terminé",
50
+ "Stopwatch_Status_Canceled": "Annulé",
51
+ "Stopwatch_TimerFormat": "mm:ss"
52
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ export * from './app';
2
+ export { default as Navigator } from './navigator/Navigator';
3
+ export { configGlobalStore } from './redux/store';
4
+ export { storage, useStorage } from './storage/Storage';
5
+ export { traceError } from './api/traceback-api';
6
+ export { useEffectDebugger } from './hooks/use-effect-debugger';
7
+ export { logout } from './features/authSlice';
8
+ export { axiosApiProvider } from './axios/AxiosApi';
9
+ export { getApiResponseData, getFirstData, handlerApiCall, handlerError, } from './api/utils';
10
+ export { useScannedValueByKey, useScannerSelector, enableScan, scanValue, disableScan, default as scannerReducer, } from './features/scannerSlice';
11
+ export { useCameraSelector, useCameraValueByKey, enableCamera, takePhoto, disableCamera, default as cameraReducer, } from './features/cameraSlice';
12
+ export { useDispatch, useSelector } from './redux/hooks';
13
+ export * from './components';
14
+ export * from './tools';
15
+ export * from './utils';
16
+ export * from './types';
17
+ export * from './auth';
18
+ export * from './i18n';
package/lib/index.js ADDED
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export * from './app';
19
+ export { default as Navigator } from './navigator/Navigator';
20
+ export { configGlobalStore } from './redux/store';
21
+ export { storage, useStorage } from './storage/Storage';
22
+ export { traceError } from './api/traceback-api';
23
+ export { useEffectDebugger } from './hooks/use-effect-debugger';
24
+ export { logout } from './features/authSlice';
25
+ export { axiosApiProvider } from './axios/AxiosApi';
26
+ export { getApiResponseData, getFirstData, handlerApiCall, handlerError, } from './api/utils';
27
+ export { useScannedValueByKey, useScannerSelector, enableScan, scanValue, disableScan, default as scannerReducer, } from './features/scannerSlice';
28
+ export { useCameraSelector, useCameraValueByKey, enableCamera, takePhoto, disableCamera, default as cameraReducer, } from './features/cameraSlice';
29
+ export { useDispatch, useSelector } from './redux/hooks';
30
+ export * from './components';
31
+ export * from './tools';
32
+ export * from './utils';
33
+ export * from './types';
34
+ export * from './auth';
35
+ export * from './i18n';
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,OAAO,CAAC;AACtB,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,IAAI,cAAc,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,OAAO,IAAI,aAAa,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACvD,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export const ModuleNavigatorContext: React.Context<{
2
+ activeModule: any;
3
+ modulesMenus: {};
4
+ modulesScreens: {};
5
+ }>;
6
+ export default Navigator;
7
+ import React from "react";
8
+ declare function Navigator({ modules, mainMenu, showModulesSubtitle }: {
9
+ modules: any;
10
+ mainMenu: any;
11
+ showModulesSubtitle?: boolean;
12
+ }): JSX.Element;