@ha_tecno/live-id-sdk 1.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. package/android/build.gradle +4 -0
  2. package/lib/commonjs/components/{WaitingForResult → CameraConfigInfo}/index.js +9 -11
  3. package/lib/commonjs/components/CameraConfigInfo/index.js.map +1 -0
  4. package/lib/commonjs/components/CameraConfigInfo/styles.js +20 -0
  5. package/lib/commonjs/components/CameraConfigInfo/styles.js.map +1 -0
  6. package/lib/commonjs/components/CaptureButton/index.js +88 -0
  7. package/lib/commonjs/components/CaptureButton/index.js.map +1 -0
  8. package/lib/commonjs/components/CaptureButton/styles.js +22 -0
  9. package/lib/commonjs/components/CaptureButton/styles.js.map +1 -0
  10. package/lib/commonjs/components/Gabarito/index.js +2 -2
  11. package/lib/commonjs/components/Gabarito/index.js.map +1 -1
  12. package/lib/commonjs/components/Gabarito/styles.js +10 -11
  13. package/lib/commonjs/components/Gabarito/styles.js.map +1 -1
  14. package/lib/commonjs/components/HelpRegister/index.js +51 -0
  15. package/lib/commonjs/components/HelpRegister/index.js.map +1 -0
  16. package/lib/commonjs/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.js +17 -20
  17. package/lib/commonjs/components/HelpRegister/styles.js.map +1 -0
  18. package/lib/commonjs/components/Toast/Toast.js +12 -12
  19. package/lib/commonjs/components/Toast/Toast.js.map +1 -1
  20. package/lib/commonjs/components/deviceNotFound/deviceNotFound.js +27 -0
  21. package/lib/commonjs/components/deviceNotFound/deviceNotFound.js.map +1 -0
  22. package/lib/commonjs/components/deviceNotFound/styles.js +36 -0
  23. package/lib/commonjs/components/deviceNotFound/styles.js.map +1 -0
  24. package/lib/commonjs/components/icon/icon.js +22 -0
  25. package/lib/commonjs/components/icon/icon.js.map +1 -0
  26. package/lib/commonjs/components/index.js +56 -0
  27. package/lib/commonjs/components/index.js.map +1 -0
  28. package/lib/commonjs/components/modalMessage/modalMessage.js +63 -0
  29. package/lib/commonjs/components/modalMessage/modalMessage.js.map +1 -0
  30. package/lib/commonjs/components/modalMessage/styles.js +51 -0
  31. package/lib/commonjs/components/modalMessage/styles.js.map +1 -0
  32. package/lib/commonjs/components/recordButton/recordButton.js +83 -0
  33. package/lib/commonjs/components/recordButton/recordButton.js.map +1 -0
  34. package/lib/commonjs/components/recordButton/styles.js +21 -0
  35. package/lib/commonjs/components/recordButton/styles.js.map +1 -0
  36. package/lib/commonjs/index.js +9 -11
  37. package/lib/commonjs/index.js.map +1 -1
  38. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +29 -29
  39. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +1 -1
  40. package/lib/commonjs/screens/FingerAuth/FingerAuth.js +128 -0
  41. package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -0
  42. package/lib/commonjs/screens/FingerAuth/styles.js +35 -0
  43. package/lib/commonjs/screens/FingerAuth/styles.js.map +1 -0
  44. package/lib/commonjs/screens/FingerRegister/index.js +136 -0
  45. package/lib/commonjs/screens/FingerRegister/index.js.map +1 -0
  46. package/lib/commonjs/screens/FingerRegister/styles.js +35 -0
  47. package/lib/commonjs/screens/FingerRegister/styles.js.map +1 -0
  48. package/lib/commonjs/screens/LifeCertificate/index.js +145 -0
  49. package/lib/commonjs/screens/LifeCertificate/index.js.map +1 -0
  50. package/lib/commonjs/screens/LifeCertificate/styles.js +27 -0
  51. package/lib/commonjs/screens/LifeCertificate/styles.js.map +1 -0
  52. package/lib/commonjs/screens/index.js +28 -0
  53. package/lib/commonjs/screens/index.js.map +1 -0
  54. package/lib/commonjs/services/index.js +35 -101
  55. package/lib/commonjs/services/index.js.map +1 -1
  56. package/lib/commonjs/services/services.js +134 -0
  57. package/lib/commonjs/services/services.js.map +1 -0
  58. package/lib/commonjs/services/types.js +2 -0
  59. package/lib/commonjs/{types/screen.js.map → services/types.js.map} +1 -1
  60. package/lib/commonjs/store/createSelectors.js +16 -0
  61. package/lib/commonjs/store/createSelectors.js.map +1 -0
  62. package/lib/commonjs/store/modules/fingerAuth/index.js +19 -0
  63. package/lib/commonjs/store/modules/fingerAuth/index.js.map +1 -0
  64. package/lib/commonjs/store/modules/fingerAuth/selectors.js +13 -0
  65. package/lib/commonjs/store/modules/fingerAuth/selectors.js.map +1 -0
  66. package/lib/commonjs/store/modules/fingerAuth/slice.js +92 -0
  67. package/lib/commonjs/store/modules/fingerAuth/slice.js.map +1 -0
  68. package/lib/commonjs/store/modules/fingerAuth/type.js +2 -0
  69. package/lib/commonjs/store/modules/fingerAuth/type.js.map +1 -0
  70. package/lib/commonjs/store/modules/fingerRegister/index.js +19 -0
  71. package/lib/commonjs/store/modules/fingerRegister/index.js.map +1 -0
  72. package/lib/commonjs/store/modules/fingerRegister/selectors.js +13 -0
  73. package/lib/commonjs/store/modules/fingerRegister/selectors.js.map +1 -0
  74. package/lib/commonjs/store/modules/fingerRegister/slice.js +101 -0
  75. package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -0
  76. package/lib/commonjs/store/modules/fingerRegister/types.js +2 -0
  77. package/lib/commonjs/store/modules/fingerRegister/types.js.map +1 -0
  78. package/lib/commonjs/store/modules/lifeCertificate/index.js +19 -0
  79. package/lib/commonjs/store/modules/lifeCertificate/index.js.map +1 -0
  80. package/lib/commonjs/store/modules/lifeCertificate/selectors.js +13 -0
  81. package/lib/commonjs/store/modules/lifeCertificate/selectors.js.map +1 -0
  82. package/lib/commonjs/store/modules/lifeCertificate/slice.js +101 -0
  83. package/lib/commonjs/store/modules/lifeCertificate/slice.js.map +1 -0
  84. package/lib/commonjs/store/modules/lifeCertificate/types.js +6 -0
  85. package/lib/commonjs/store/modules/lifeCertificate/types.js.map +1 -0
  86. package/lib/commonjs/utils/file.js +2 -2
  87. package/lib/commonjs/utils/getConfigCamera.js +1 -1
  88. package/lib/commonjs/utils/getConfigCamera.js.map +1 -1
  89. package/lib/module/components/CameraConfigInfo/index.js +15 -0
  90. package/lib/module/components/CameraConfigInfo/index.js.map +1 -0
  91. package/lib/module/components/CameraConfigInfo/styles.js +14 -0
  92. package/lib/module/components/CameraConfigInfo/styles.js.map +1 -0
  93. package/lib/module/components/CaptureButton/index.js +79 -0
  94. package/lib/module/components/CaptureButton/index.js.map +1 -0
  95. package/lib/module/components/CaptureButton/styles.js +16 -0
  96. package/lib/module/components/CaptureButton/styles.js.map +1 -0
  97. package/lib/module/components/Gabarito/index.js +5 -4
  98. package/lib/module/components/Gabarito/index.js.map +1 -1
  99. package/lib/module/components/Gabarito/styles.js +11 -12
  100. package/lib/module/components/Gabarito/styles.js.map +1 -1
  101. package/lib/module/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/index.js +17 -15
  102. package/lib/module/components/HelpRegister/index.js.map +1 -0
  103. package/lib/module/components/HelpRegister/styles.js +53 -0
  104. package/lib/module/components/HelpRegister/styles.js.map +1 -0
  105. package/lib/module/components/Toast/Toast.js +14 -14
  106. package/lib/module/components/Toast/Toast.js.map +1 -1
  107. package/lib/module/components/deviceNotFound/deviceNotFound.js +20 -0
  108. package/lib/module/components/deviceNotFound/deviceNotFound.js.map +1 -0
  109. package/lib/module/components/deviceNotFound/styles.js +30 -0
  110. package/lib/module/components/deviceNotFound/styles.js.map +1 -0
  111. package/lib/module/components/icon/icon.js +15 -0
  112. package/lib/module/components/icon/icon.js.map +1 -0
  113. package/lib/module/components/index.js +9 -0
  114. package/lib/module/components/index.js.map +1 -0
  115. package/lib/module/components/modalMessage/modalMessage.js +54 -0
  116. package/lib/module/components/modalMessage/modalMessage.js.map +1 -0
  117. package/lib/module/components/modalMessage/styles.js +45 -0
  118. package/lib/module/components/modalMessage/styles.js.map +1 -0
  119. package/lib/module/components/recordButton/recordButton.js +74 -0
  120. package/lib/module/components/recordButton/recordButton.js.map +1 -0
  121. package/lib/module/components/recordButton/styles.js +15 -0
  122. package/lib/module/components/recordButton/styles.js.map +1 -0
  123. package/lib/module/index.js +4 -4
  124. package/lib/module/index.js.map +1 -1
  125. package/lib/module/screens/CadastroScreen/CadastroScreen.js +33 -33
  126. package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +1 -1
  127. package/lib/module/screens/FingerAuth/FingerAuth.js +119 -0
  128. package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -0
  129. package/lib/module/screens/FingerAuth/styles.js +29 -0
  130. package/lib/module/screens/FingerAuth/styles.js.map +1 -0
  131. package/lib/module/screens/FingerRegister/index.js +127 -0
  132. package/lib/module/screens/FingerRegister/index.js.map +1 -0
  133. package/lib/module/screens/FingerRegister/styles.js +29 -0
  134. package/lib/module/screens/FingerRegister/styles.js.map +1 -0
  135. package/lib/module/screens/LifeCertificate/index.js +136 -0
  136. package/lib/module/screens/LifeCertificate/index.js.map +1 -0
  137. package/lib/module/screens/LifeCertificate/styles.js +21 -0
  138. package/lib/module/screens/LifeCertificate/styles.js.map +1 -0
  139. package/lib/module/screens/index.js +5 -0
  140. package/lib/module/screens/index.js.map +1 -0
  141. package/lib/module/services/index.js +9 -95
  142. package/lib/module/services/index.js.map +1 -1
  143. package/lib/module/services/services.js +123 -0
  144. package/lib/module/services/services.js.map +1 -0
  145. package/lib/module/services/types.js +2 -0
  146. package/lib/module/{types/screen.js.map → services/types.js.map} +1 -1
  147. package/lib/module/store/createSelectors.js +10 -0
  148. package/lib/module/store/createSelectors.js.map +1 -0
  149. package/lib/module/store/modules/fingerAuth/index.js +3 -0
  150. package/lib/module/store/modules/fingerAuth/index.js.map +1 -0
  151. package/lib/module/store/modules/fingerAuth/selectors.js +6 -0
  152. package/lib/module/store/modules/fingerAuth/selectors.js.map +1 -0
  153. package/lib/module/store/modules/fingerAuth/slice.js +86 -0
  154. package/lib/module/store/modules/fingerAuth/slice.js.map +1 -0
  155. package/lib/module/store/modules/fingerAuth/type.js +2 -0
  156. package/lib/module/store/modules/fingerAuth/type.js.map +1 -0
  157. package/lib/module/store/modules/fingerRegister/index.js +3 -0
  158. package/lib/module/store/modules/fingerRegister/index.js.map +1 -0
  159. package/lib/module/store/modules/fingerRegister/selectors.js +6 -0
  160. package/lib/module/store/modules/fingerRegister/selectors.js.map +1 -0
  161. package/lib/module/store/modules/fingerRegister/slice.js +95 -0
  162. package/lib/module/store/modules/fingerRegister/slice.js.map +1 -0
  163. package/lib/module/store/modules/fingerRegister/types.js +2 -0
  164. package/lib/module/store/modules/fingerRegister/types.js.map +1 -0
  165. package/lib/module/store/modules/lifeCertificate/index.js +3 -0
  166. package/lib/module/store/modules/lifeCertificate/index.js.map +1 -0
  167. package/lib/module/store/modules/lifeCertificate/selectors.js +6 -0
  168. package/lib/module/store/modules/lifeCertificate/selectors.js.map +1 -0
  169. package/lib/module/store/modules/lifeCertificate/slice.js +95 -0
  170. package/lib/module/store/modules/lifeCertificate/slice.js.map +1 -0
  171. package/lib/module/store/modules/lifeCertificate/types.js +2 -0
  172. package/lib/module/store/modules/lifeCertificate/types.js.map +1 -0
  173. package/lib/module/utils/file.js +3 -3
  174. package/lib/module/utils/getConfigCamera.js +4 -4
  175. package/lib/module/utils/getConfigCamera.js.map +1 -1
  176. package/lib/module/utils/index.js +1 -1
  177. package/lib/typescript/src/components/CameraConfigInfo/index.d.ts +8 -0
  178. package/lib/typescript/src/components/CameraConfigInfo/index.d.ts.map +1 -0
  179. package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts +13 -0
  180. package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts.map +1 -0
  181. package/lib/typescript/src/components/CaptureButton/index.d.ts +10 -0
  182. package/lib/typescript/src/components/CaptureButton/index.d.ts.map +1 -0
  183. package/lib/typescript/src/components/CaptureButton/styles.d.ts +15 -0
  184. package/lib/typescript/src/components/CaptureButton/styles.d.ts.map +1 -0
  185. package/lib/typescript/src/components/Gabarito/index.d.ts +2 -1
  186. package/lib/typescript/src/components/Gabarito/index.d.ts.map +1 -1
  187. package/lib/typescript/src/components/Gabarito/styles.d.ts +1 -2
  188. package/lib/typescript/src/components/Gabarito/styles.d.ts.map +1 -1
  189. package/lib/typescript/src/components/HelpRegister/index.d.ts +4 -0
  190. package/lib/typescript/src/components/HelpRegister/index.d.ts.map +1 -0
  191. package/lib/typescript/src/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.d.ts +2 -5
  192. package/lib/typescript/src/components/HelpRegister/styles.d.ts.map +1 -0
  193. package/lib/typescript/src/components/Toast/Toast.d.ts +1 -1
  194. package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
  195. package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts +8 -0
  196. package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts.map +1 -0
  197. package/lib/typescript/src/components/deviceNotFound/styles.d.ts +29 -0
  198. package/lib/typescript/src/components/deviceNotFound/styles.d.ts.map +1 -0
  199. package/lib/typescript/src/components/icon/icon.d.ts +9 -0
  200. package/lib/typescript/src/components/icon/icon.d.ts.map +1 -0
  201. package/lib/typescript/src/components/index.d.ts +9 -0
  202. package/lib/typescript/src/components/index.d.ts.map +1 -0
  203. package/lib/typescript/src/components/modalMessage/modalMessage.d.ts +11 -0
  204. package/lib/typescript/src/components/modalMessage/modalMessage.d.ts.map +1 -0
  205. package/lib/typescript/src/components/modalMessage/styles.d.ts +44 -0
  206. package/lib/typescript/src/components/modalMessage/styles.d.ts.map +1 -0
  207. package/lib/typescript/src/components/recordButton/recordButton.d.ts +10 -0
  208. package/lib/typescript/src/components/recordButton/recordButton.d.ts.map +1 -0
  209. package/lib/typescript/src/components/recordButton/styles.d.ts +14 -0
  210. package/lib/typescript/src/components/recordButton/styles.d.ts.map +1 -0
  211. package/lib/typescript/src/index.d.ts +3 -4
  212. package/lib/typescript/src/index.d.ts.map +1 -1
  213. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +2 -4
  214. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +1 -1
  215. package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts +9 -0
  216. package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -0
  217. package/lib/typescript/src/screens/FingerAuth/styles.d.ts +25 -0
  218. package/lib/typescript/src/screens/FingerAuth/styles.d.ts.map +1 -0
  219. package/lib/typescript/src/screens/FingerRegister/index.d.ts +8 -0
  220. package/lib/typescript/src/screens/FingerRegister/index.d.ts.map +1 -0
  221. package/lib/typescript/src/screens/FingerRegister/styles.d.ts +25 -0
  222. package/lib/typescript/src/screens/FingerRegister/styles.d.ts.map +1 -0
  223. package/lib/typescript/src/screens/LifeCertificate/index.d.ts +7 -0
  224. package/lib/typescript/src/screens/LifeCertificate/index.d.ts.map +1 -0
  225. package/lib/typescript/src/{components/WaitingForResult → screens/LifeCertificate}/styles.d.ts +7 -11
  226. package/lib/typescript/src/screens/LifeCertificate/styles.d.ts.map +1 -0
  227. package/lib/typescript/src/screens/index.d.ts +5 -0
  228. package/lib/typescript/src/screens/index.d.ts.map +1 -0
  229. package/lib/typescript/src/services/index.d.ts +2 -17
  230. package/lib/typescript/src/services/index.d.ts.map +1 -1
  231. package/lib/typescript/src/services/services.d.ts +6 -0
  232. package/lib/typescript/src/services/services.d.ts.map +1 -0
  233. package/lib/typescript/src/services/types.d.ts +37 -0
  234. package/lib/typescript/src/services/types.d.ts.map +1 -0
  235. package/lib/typescript/src/store/createSelectors.d.ts +11 -0
  236. package/lib/typescript/src/store/createSelectors.d.ts.map +1 -0
  237. package/lib/typescript/src/store/modules/fingerAuth/index.d.ts +3 -0
  238. package/lib/typescript/src/store/modules/fingerAuth/index.d.ts.map +1 -0
  239. package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts +20 -0
  240. package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts.map +1 -0
  241. package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts +4 -0
  242. package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts.map +1 -0
  243. package/lib/typescript/src/store/modules/fingerAuth/type.d.ts +28 -0
  244. package/lib/typescript/src/store/modules/fingerAuth/type.d.ts.map +1 -0
  245. package/lib/typescript/src/store/modules/fingerRegister/index.d.ts +3 -0
  246. package/lib/typescript/src/store/modules/fingerRegister/index.d.ts.map +1 -0
  247. package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +22 -0
  248. package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts.map +1 -0
  249. package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts +4 -0
  250. package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -0
  251. package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +30 -0
  252. package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -0
  253. package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts +3 -0
  254. package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts.map +1 -0
  255. package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts +23 -0
  256. package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts.map +1 -0
  257. package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts +4 -0
  258. package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts.map +1 -0
  259. package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts +37 -0
  260. package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts.map +1 -0
  261. package/lib/typescript/src/utils/getConfigCamera.d.ts +1 -1
  262. package/lib/typescript/src/utils/getConfigCamera.d.ts.map +1 -1
  263. package/lib/typescript/src/utils/index.d.ts +1 -1
  264. package/package.json +24 -42
  265. package/src/components/CameraConfigInfo/index.tsx +20 -0
  266. package/src/components/CameraConfigInfo/styles.ts +14 -0
  267. package/src/components/CaptureButton/index.tsx +74 -0
  268. package/src/components/CaptureButton/styles.ts +16 -0
  269. package/src/components/Gabarito/index.tsx +6 -4
  270. package/src/components/Gabarito/styles.ts +13 -14
  271. package/src/components/HelpRegister/index.tsx +40 -0
  272. package/src/components/HelpRegister/styles.ts +54 -0
  273. package/src/components/Toast/Toast.tsx +18 -22
  274. package/src/components/deviceNotFound/deviceNotFound.tsx +23 -0
  275. package/src/components/deviceNotFound/styles.ts +30 -0
  276. package/src/components/icon/icon.tsx +14 -0
  277. package/src/components/index.ts +9 -0
  278. package/src/components/modalMessage/modalMessage.tsx +73 -0
  279. package/src/components/modalMessage/styles.ts +45 -0
  280. package/src/components/recordButton/recordButton.tsx +75 -0
  281. package/src/components/recordButton/styles.ts +15 -0
  282. package/src/index.tsx +5 -4
  283. package/src/screens/CadastroScreen/CadastroScreen.tsx +35 -52
  284. package/src/screens/FingerAuth/FingerAuth.tsx +121 -0
  285. package/src/screens/FingerAuth/styles.ts +28 -0
  286. package/src/screens/FingerRegister/index.tsx +139 -0
  287. package/src/screens/FingerRegister/styles.ts +28 -0
  288. package/src/screens/LifeCertificate/index.tsx +152 -0
  289. package/src/screens/LifeCertificate/styles.ts +21 -0
  290. package/src/screens/index.ts +5 -0
  291. package/src/services/index.ts +12 -113
  292. package/src/services/services.ts +129 -0
  293. package/src/services/types.ts +42 -0
  294. package/src/store/createSelectors.ts +15 -0
  295. package/src/store/modules/fingerAuth/index.ts +3 -0
  296. package/src/store/modules/fingerAuth/selectors.ts +7 -0
  297. package/src/store/modules/fingerAuth/slice.ts +91 -0
  298. package/src/store/modules/fingerAuth/type.ts +29 -0
  299. package/src/store/modules/fingerRegister/index.ts +3 -0
  300. package/src/store/modules/fingerRegister/selectors.ts +7 -0
  301. package/src/store/modules/fingerRegister/slice.ts +101 -0
  302. package/src/store/modules/fingerRegister/types.ts +30 -0
  303. package/src/store/modules/lifeCertificate/index.ts +3 -0
  304. package/src/store/modules/lifeCertificate/selectors.ts +7 -0
  305. package/src/store/modules/lifeCertificate/slice.ts +100 -0
  306. package/src/store/modules/lifeCertificate/types.ts +40 -0
  307. package/src/utils/file.ts +3 -3
  308. package/src/utils/getConfigCamera.ts +7 -12
  309. package/src/utils/index.ts +1 -1
  310. package/lib/commonjs/components/CameraConfigInfos/index.js +0 -21
  311. package/lib/commonjs/components/CameraConfigInfos/index.js.map +0 -1
  312. package/lib/commonjs/components/CameraConfigInfos/styles.js +0 -19
  313. package/lib/commonjs/components/CameraConfigInfos/styles.js.map +0 -1
  314. package/lib/commonjs/components/DeviceNullDisplay/index.js +0 -59
  315. package/lib/commonjs/components/DeviceNullDisplay/index.js.map +0 -1
  316. package/lib/commonjs/components/ErrorDisplay/index.js +0 -59
  317. package/lib/commonjs/components/ErrorDisplay/index.js.map +0 -1
  318. package/lib/commonjs/components/WaitingForResult/index.js.map +0 -1
  319. package/lib/commonjs/components/WaitingForResult/styles.js +0 -32
  320. package/lib/commonjs/components/WaitingForResult/styles.js.map +0 -1
  321. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js +0 -49
  322. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
  323. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
  324. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js +0 -298
  325. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
  326. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -54
  327. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
  328. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -44
  329. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
  330. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -65
  331. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
  332. package/lib/commonjs/screens/CadastroFinger/index.js +0 -50
  333. package/lib/commonjs/screens/CadastroFinger/index.js.map +0 -1
  334. package/lib/commonjs/screens/ProvaVidas/index.js +0 -246
  335. package/lib/commonjs/screens/ProvaVidas/index.js.map +0 -1
  336. package/lib/commonjs/screens/ProvaVidas/styles.js +0 -93
  337. package/lib/commonjs/screens/ProvaVidas/styles.js.map +0 -1
  338. package/lib/commonjs/screens/ValidadeFinger/index.js +0 -216
  339. package/lib/commonjs/screens/ValidadeFinger/index.js.map +0 -1
  340. package/lib/commonjs/screens/ValidadeFinger/styles.js +0 -54
  341. package/lib/commonjs/screens/ValidadeFinger/styles.js.map +0 -1
  342. package/lib/commonjs/types/screen.js +0 -2
  343. package/lib/module/components/CameraConfigInfos/index.js +0 -13
  344. package/lib/module/components/CameraConfigInfos/index.js.map +0 -1
  345. package/lib/module/components/CameraConfigInfos/styles.js +0 -13
  346. package/lib/module/components/CameraConfigInfos/styles.js.map +0 -1
  347. package/lib/module/components/DeviceNullDisplay/index.js +0 -51
  348. package/lib/module/components/DeviceNullDisplay/index.js.map +0 -1
  349. package/lib/module/components/ErrorDisplay/index.js +0 -51
  350. package/lib/module/components/ErrorDisplay/index.js.map +0 -1
  351. package/lib/module/components/WaitingForResult/index.js +0 -17
  352. package/lib/module/components/WaitingForResult/index.js.map +0 -1
  353. package/lib/module/components/WaitingForResult/styles.js +0 -26
  354. package/lib/module/components/WaitingForResult/styles.js.map +0 -1
  355. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
  356. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js +0 -56
  357. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
  358. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js +0 -288
  359. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
  360. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -48
  361. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
  362. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -36
  363. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
  364. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -59
  365. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
  366. package/lib/module/screens/CadastroFinger/index.js +0 -42
  367. package/lib/module/screens/CadastroFinger/index.js.map +0 -1
  368. package/lib/module/screens/ProvaVidas/index.js +0 -239
  369. package/lib/module/screens/ProvaVidas/index.js.map +0 -1
  370. package/lib/module/screens/ProvaVidas/styles.js +0 -87
  371. package/lib/module/screens/ProvaVidas/styles.js.map +0 -1
  372. package/lib/module/screens/ValidadeFinger/index.js +0 -206
  373. package/lib/module/screens/ValidadeFinger/index.js.map +0 -1
  374. package/lib/module/screens/ValidadeFinger/styles.js +0 -48
  375. package/lib/module/screens/ValidadeFinger/styles.js.map +0 -1
  376. package/lib/module/types/screen.js +0 -2
  377. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts +0 -9
  378. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts.map +0 -1
  379. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts +0 -11
  380. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts.map +0 -1
  381. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts +0 -11
  382. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts.map +0 -1
  383. package/lib/typescript/src/components/ErrorDisplay/index.d.ts +0 -11
  384. package/lib/typescript/src/components/ErrorDisplay/index.d.ts.map +0 -1
  385. package/lib/typescript/src/components/WaitingForResult/index.d.ts +0 -7
  386. package/lib/typescript/src/components/WaitingForResult/index.d.ts.map +0 -1
  387. package/lib/typescript/src/components/WaitingForResult/styles.d.ts.map +0 -1
  388. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts +0 -7
  389. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts.map +0 -1
  390. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts.map +0 -1
  391. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts +0 -16
  392. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts.map +0 -1
  393. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts +0 -44
  394. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts.map +0 -1
  395. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts +0 -12
  396. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts.map +0 -1
  397. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts +0 -54
  398. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts.map +0 -1
  399. package/lib/typescript/src/screens/CadastroFinger/index.d.ts +0 -16
  400. package/lib/typescript/src/screens/CadastroFinger/index.d.ts.map +0 -1
  401. package/lib/typescript/src/screens/ProvaVidas/index.d.ts +0 -14
  402. package/lib/typescript/src/screens/ProvaVidas/index.d.ts.map +0 -1
  403. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts +0 -85
  404. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts.map +0 -1
  405. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts +0 -14
  406. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts.map +0 -1
  407. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts +0 -44
  408. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts.map +0 -1
  409. package/lib/typescript/src/types/screen.d.ts +0 -6
  410. package/lib/typescript/src/types/screen.d.ts.map +0 -1
  411. package/live-id-sdk.podspec +0 -41
  412. package/src/components/CameraConfigInfos/index.tsx +0 -25
  413. package/src/components/CameraConfigInfos/styles.ts +0 -13
  414. package/src/components/DeviceNullDisplay/index.tsx +0 -59
  415. package/src/components/ErrorDisplay/index.tsx +0 -60
  416. package/src/components/WaitingForResult/index.tsx +0 -22
  417. package/src/components/WaitingForResult/styles.ts +0 -27
  418. package/src/screens/CadastroFinger/components/AjudaCadastro/index.tsx +0 -49
  419. package/src/screens/CadastroFinger/components/AjudaCadastro/styles.ts +0 -56
  420. package/src/screens/CadastroFinger/components/CameraCadastro/index.tsx +0 -356
  421. package/src/screens/CadastroFinger/components/CameraCadastro/styles.ts +0 -47
  422. package/src/screens/CadastroFinger/components/ImageDisplayScreen/index.tsx +0 -45
  423. package/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.ts +0 -55
  424. package/src/screens/CadastroFinger/index.tsx +0 -56
  425. package/src/screens/ProvaVidas/index.tsx +0 -308
  426. package/src/screens/ProvaVidas/styles.ts +0 -99
  427. package/src/screens/ValidadeFinger/index.tsx +0 -263
  428. package/src/screens/ValidadeFinger/styles.ts +0 -47
  429. package/src/types/screen.ts +0 -5
@@ -0,0 +1,75 @@
1
+ import React, { useEffect } from "react";
2
+ import { Pressable } from "react-native";
3
+ import Animated, {
4
+ interpolateColor,
5
+ useAnimatedStyle,
6
+ useSharedValue,
7
+ withSpring,
8
+ withTiming
9
+ } from "react-native-reanimated";
10
+ import Icon from "../icon/icon";
11
+ import { styles } from "./styles";
12
+
13
+ type Props = {
14
+ onPress: () => void;
15
+ disabled: boolean;
16
+ isRecording: boolean;
17
+ timer: number;
18
+ };
19
+
20
+ const RecordButton = ({ onPress, disabled, timer, isRecording }: Props) => {
21
+ const progress = useSharedValue(0);
22
+ const width = useSharedValue(100);
23
+ const translateX = useSharedValue(0);
24
+ const opacity = useSharedValue(0);
25
+
26
+ const animatedView = useAnimatedStyle(() => ({
27
+ width: width.value,
28
+ backgroundColor: interpolateColor(progress.value, [0, 1], ["#1F75FF", "#DE3737"])
29
+ }));
30
+
31
+ const animatedIcon = useAnimatedStyle(() => ({
32
+ transform: [{ translateX: -translateX.value }]
33
+ }));
34
+
35
+ const animatedText = useAnimatedStyle(() => ({
36
+ opacity: opacity.value,
37
+ transform: [{ translateX: translateX.value }]
38
+ }));
39
+
40
+ useEffect(() => {
41
+ if (timer === 0) {
42
+ setTimeout(() => {
43
+ width.value = withSpring(100);
44
+ translateX.value = withSpring(0);
45
+ opacity.value = withTiming(0, { duration: 250 });
46
+ }, 500);
47
+ setTimeout(() => {
48
+ progress.value = withSpring(0, { duration: 1000 });
49
+ }, 5);
50
+ }
51
+ }, [width, opacity, timer, progress, translateX]);
52
+
53
+ const handlePress = () => {
54
+ onPress();
55
+ width.value = withSpring(175);
56
+ translateX.value = withSpring(25);
57
+ opacity.value = withTiming(1, { duration: 250 });
58
+ progress.value = withSpring(1, { duration: 1000 });
59
+ };
60
+
61
+ return (
62
+ <Pressable onPress={handlePress} disabled={disabled}>
63
+ <Animated.View style={[styles.container, animatedView]}>
64
+ <Animated.View style={animatedIcon}>
65
+ <Icon name="videocam-outline" size={40} color="white" />
66
+ </Animated.View>
67
+ {isRecording && timer >= 0 ? (
68
+ <Animated.Text style={[styles.text, animatedText]}>{timer}</Animated.Text>
69
+ ) : undefined}
70
+ </Animated.View>
71
+ </Pressable>
72
+ );
73
+ };
74
+
75
+ export default RecordButton;
@@ -0,0 +1,15 @@
1
+ import { StyleSheet } from "react-native";
2
+
3
+ export const styles = StyleSheet.create({
4
+ container: {
5
+ flexDirection: "row",
6
+ height: 50,
7
+ justifyContent: "center",
8
+ alignItems: "center",
9
+ borderRadius: 50,
10
+ },
11
+ text: {
12
+ position: "absolute",
13
+ color: "#fff",
14
+ },
15
+ });
package/src/index.tsx CHANGED
@@ -1,6 +1,7 @@
1
- export { ValidaFinger } from './screens/ValidadeFinger';
1
+ import { LifeCertificate, FingerRegister, FingerAuth } from "./screens";
2
2
 
3
3
  // deprecated
4
- export { CameraProvaVidas } from './screens/ProvaVidas';
5
- export { CadastroFinger } from './screens/CadastroFinger';
6
- export { CadastroScreen } from './screens/CadastroScreen/CadastroScreen';
4
+
5
+ export { CadastroScreen } from "./screens/CadastroScreen/CadastroScreen";
6
+
7
+ export { LifeCertificate, FingerRegister, FingerAuth };
@@ -1,18 +1,8 @@
1
1
  /* eslint-disable react-native/no-inline-styles */
2
- import React, { useEffect, useState } from 'react';
3
- import {
4
- View,
5
- Text,
6
- TextInput,
7
- TouchableOpacity,
8
- StyleSheet,
9
- Alert,
10
- Image,
11
- } from 'react-native';
12
- import { cadastro } from '../../services';
13
- import Modal, { type ModalProps } from 'react-native-modal';
14
-
15
- import type { ScreenProps } from '../../types/screen';
2
+ import React, { useEffect, useState } from "react";
3
+ import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, Image } from "react-native";
4
+ import { cadastro } from "../../services";
5
+ import Modal, { type ModalProps } from "react-native-modal";
16
6
 
17
7
  interface CadastroScreenProps {
18
8
  isVisible: boolean;
@@ -20,7 +10,6 @@ interface CadastroScreenProps {
20
10
  onError?: (response?: any) => void;
21
11
  onSuccess?: (response?: any) => void;
22
12
  ModalParams?: ModalProps;
23
- screenProps?: ScreenProps;
24
13
  }
25
14
 
26
15
  export const CadastroScreen: React.FC<CadastroScreenProps> = ({
@@ -28,15 +17,15 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
28
17
  onCloseModal,
29
18
  onError,
30
19
  onSuccess,
31
- ModalParams,
20
+ ModalParams
32
21
  }) => {
33
- const [cpf, setCpf] = useState('');
34
- const [nome, setNome] = useState('');
35
- const [senha, setSenha] = useState('');
36
- const [confirmarSenha, setConfirmarSenha] = useState('');
22
+ const [cpf, setCpf] = useState("");
23
+ const [nome, setNome] = useState("");
24
+ const [senha, setSenha] = useState("");
25
+ const [confirmarSenha, setConfirmarSenha] = useState("");
37
26
 
38
27
  const generateRandomElevenDigits = () => {
39
- let cpf = '';
28
+ let cpf = "";
40
29
  for (let i = 0; i < 11; i++) {
41
30
  cpf += Math.floor(Math.random() * 9);
42
31
  }
@@ -45,7 +34,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
45
34
 
46
35
  const generateRandomName = () => {
47
36
  // uma strin aleatória de 10 caracteres a 14 caracteres
48
- let name = '';
37
+ let name = "";
49
38
  const length = Math.floor(Math.random() * 5) + 10;
50
39
  for (let i = 0; i < length; i++) {
51
40
  name += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
@@ -60,8 +49,8 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
60
49
  const generateRnadomUser = () => {
61
50
  setCpf(generateRandomElevenDigits());
62
51
  setNome(generateRandomName());
63
- setSenha('123');
64
- setConfirmarSenha('123');
52
+ setSenha("123");
53
+ setConfirmarSenha("123");
65
54
  };
66
55
 
67
56
  const handleCadastro = async () => {
@@ -74,7 +63,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
74
63
  onSuccess && onSuccess(response);
75
64
 
76
65
  onCloseModalHandler();
77
- if (jsonString.includes('person_id')) {
66
+ if (jsonString.includes("person_id")) {
78
67
  if (response.finger === false) {
79
68
  // openModal({
80
69
  // type: 'ajuda',
@@ -87,24 +76,18 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
87
76
  // type: 'login',
88
77
  // });
89
78
  }
90
- } else if (jsonString.includes('User exists')) {
91
- Alert.alert('Usuário já cadastrado!');
79
+ } else if (jsonString.includes("User exists")) {
80
+ Alert.alert("Usuário já cadastrado!");
92
81
  // openModal({
93
82
  // type: 'login',
94
83
  // });
95
- } else if (jsonString.includes('erro')) {
96
- Alert.alert('Usuário não cadastrado', 'Por favor, cadastre-se!');
84
+ } else if (jsonString.includes("erro")) {
85
+ Alert.alert("Usuário não cadastrado", "Por favor, cadastre-se!");
97
86
  } else {
98
- Alert.alert(
99
- 'Erro',
100
- 'Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.'
101
- );
87
+ Alert.alert("Erro", "Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.");
102
88
  }
103
89
  } else {
104
- Alert.alert(
105
- 'Erro',
106
- 'As senhas não coincidem. Por favor, tente novamente.'
107
- );
90
+ Alert.alert("Erro", "As senhas não coincidem. Por favor, tente novamente.");
108
91
  return;
109
92
  }
110
93
  } catch (error) {
@@ -128,7 +111,7 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
128
111
  {...ModalParams}
129
112
  >
130
113
  <View style={styles.container}>
131
- <Image source={require('../../assets/logo.png')} style={styles.logo} />
114
+ <Image source={require("../../assets/logo.png")} style={styles.logo} />
132
115
  <Text style={styles.title}>Cadastro de usuário</Text>
133
116
  <TextInput
134
117
  style={styles.input}
@@ -172,41 +155,41 @@ export const CadastroScreen: React.FC<CadastroScreenProps> = ({
172
155
  const styles = StyleSheet.create({
173
156
  container: {
174
157
  flex: 1,
175
- alignItems: 'center',
176
- justifyContent: 'center',
177
- backgroundColor: '#fff',
158
+ alignItems: "center",
159
+ justifyContent: "center",
160
+ backgroundColor: "#fff"
178
161
  },
179
162
  title: {
180
163
  fontSize: 24,
181
164
  marginBottom: 16,
182
- color: '#00bfff',
165
+ color: "#00bfff"
183
166
  },
184
167
  input: {
185
- width: '80%',
168
+ width: "80%",
186
169
  height: 50,
187
170
  padding: 10,
188
171
  borderWidth: 1,
189
- borderColor: '#ccc',
172
+ borderColor: "#ccc",
190
173
  borderRadius: 4,
191
174
  marginBottom: 16,
192
175
  fontSize: 16,
193
- color: '#000',
176
+ color: "#000"
194
177
  },
195
178
  button: {
196
- width: '80%',
179
+ width: "80%",
197
180
  height: 50,
198
- backgroundColor: '#00bfff',
181
+ backgroundColor: "#00bfff",
199
182
  borderRadius: 4,
200
- alignItems: 'center',
201
- justifyContent: 'center',
183
+ alignItems: "center",
184
+ justifyContent: "center"
202
185
  },
203
186
  buttonText: {
204
187
  fontSize: 16,
205
- color: '#fff',
188
+ color: "#fff"
206
189
  },
207
190
  logo: {
208
191
  width: 500,
209
192
  height: 250,
210
- resizeMode: 'contain',
211
- },
193
+ resizeMode: "contain"
194
+ }
212
195
  });
@@ -0,0 +1,121 @@
1
+ import React, { useCallback, useEffect, useMemo, useRef } from "react";
2
+ import { View } from "react-native";
3
+ import { Camera, useCameraFormat, Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
4
+ import Orientation from "react-native-orientation-locker";
5
+ import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
6
+ import { runOnJS } from "react-native-reanimated";
7
+
8
+ import { styles } from "./styles";
9
+ import { DeviceNotFound, Gabarito, CameraConfigInfo, ModalMessage, CaptureButton } from "../../components";
10
+ import { useDispatch, useSelector } from "../../store/modules/fingerAuth";
11
+
12
+ type Props = {
13
+ UID: string;
14
+ qualityPrioritization?: "speed" | "quality" | "balanced";
15
+ onSuccess: (code: number) => void;
16
+ };
17
+
18
+ const FingerAuth = ({ UID, qualityPrioritization, onSuccess }: Props) => {
19
+ const cameraRef = useRef<Camera>(null);
20
+ const { hasPermission, requestPermission } = useCameraPermission();
21
+ const device = useCameraDevice("back");
22
+ const dispatch = useDispatch();
23
+ const state = useSelector();
24
+
25
+ useEffect(() => {
26
+ Orientation.lockToPortrait();
27
+ return () => {
28
+ Orientation.unlockAllOrientations();
29
+ };
30
+ }, []);
31
+
32
+ const cameraPermission = useCallback(async () => {
33
+ if (!hasPermission) {
34
+ await requestPermission();
35
+ }
36
+ }, [hasPermission, requestPermission]);
37
+
38
+ useEffect(() => {
39
+ cameraPermission();
40
+ dispatch.getConfig("finger");
41
+ }, [cameraPermission]);
42
+
43
+ const containerCaptureStyled = useMemo(
44
+ () => [styles.containerCapture, { bottom: state.showButtonInfo ? 75 : 20 }],
45
+ [state.showButtonInfo]
46
+ );
47
+
48
+ const cameraFormat = useCameraFormat(device, [
49
+ {
50
+ photoResolution: {
51
+ height: 1280,
52
+ width: 720
53
+ }
54
+ }
55
+ ]);
56
+
57
+ useEffect(() => {
58
+ if (state.code === 0) {
59
+ dispatch.setModal("Sucesso!", "Usuário Identificado!");
60
+ onSuccess && onSuccess?.(state.code);
61
+ dispatch.handleLoading();
62
+ }
63
+ if (state.code !== 0 && state.code !== null) {
64
+ dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
65
+ dispatch.handleLoading();
66
+ }
67
+ dispatch.resetState();
68
+ }, [state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal]);
69
+
70
+ const takePhoto = async () => {
71
+ const photo = await cameraRef.current?.takePhoto({
72
+ qualityPrioritization: qualityPrioritization,
73
+ flash: "on"
74
+ });
75
+ if (photo != null) dispatch.sendImage(photo.path, UID);
76
+ };
77
+
78
+ const focus = useCallback((point: Point) => {
79
+ const camera = cameraRef.current;
80
+ if (camera != null) {
81
+ camera.focus(point);
82
+ }
83
+ }, []);
84
+
85
+ const gesture = Gesture.Tap().onBegin(({ x, y }) => {
86
+ runOnJS(focus)({ x, y });
87
+ });
88
+
89
+ if (device == null || hasPermission === false)
90
+ return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
91
+
92
+ return (
93
+ <GestureHandlerRootView style={styles.root}>
94
+ <GestureDetector gesture={gesture}>
95
+ <View style={styles.cameraContainer}>
96
+ <Camera
97
+ ref={cameraRef}
98
+ style={styles.camera}
99
+ isActive={true}
100
+ device={device}
101
+ format={cameraFormat}
102
+ torch={"on"}
103
+ focusable={true}
104
+ exposure={state.exposure}
105
+ zoom={2}
106
+ photo={true}
107
+ enableHighQualityPhotos={true}
108
+ />
109
+ <Gabarito />
110
+ </View>
111
+ </GestureDetector>
112
+ <View style={containerCaptureStyled}>
113
+ <CaptureButton authFinger onPress={takePhoto} loading={state.loading} />
114
+ </View>
115
+ {state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.exposure} />}
116
+ <ModalMessage isLoading={state.loading} modal={state.modal} />
117
+ </GestureHandlerRootView>
118
+ );
119
+ };
120
+
121
+ export default FingerAuth;
@@ -0,0 +1,28 @@
1
+ import { StyleSheet, Dimensions } from "react-native";
2
+
3
+ const { height } = Dimensions.get("window");
4
+
5
+ export const styles = StyleSheet.create({
6
+ container: {
7
+ flex: 1
8
+ },
9
+ root: {
10
+ flex: 1
11
+ },
12
+ cameraContainer: {
13
+ flex: 1,
14
+ justifyContent: "center"
15
+ },
16
+ camera: {
17
+ flex: 1,
18
+ paddingBottom: height * 0.2
19
+ },
20
+ containerCapture: {
21
+ position: "absolute",
22
+ width: "100%",
23
+ alignItems: "center"
24
+ },
25
+ cameraConfigs: {
26
+ alignItems: "center"
27
+ }
28
+ });
@@ -0,0 +1,139 @@
1
+ import React, { useCallback, useEffect, useMemo, useRef } from "react";
2
+ import { View } from "react-native";
3
+ import { Camera, useCameraFormat, type Point, useCameraDevice, useCameraPermission } from "react-native-vision-camera";
4
+ import Orientation from "react-native-orientation-locker";
5
+ import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
6
+ import { runOnJS } from "react-native-reanimated";
7
+
8
+ import { styles } from "./styles";
9
+ import { useSelector, useDispatch } from "../../store/modules/fingerRegister";
10
+ import {
11
+ CaptureButton,
12
+ DeviceNotFound,
13
+ HelpRegister,
14
+ ModalMessage,
15
+ CameraConfigInfo,
16
+ Gabarito
17
+ } from "../../components";
18
+
19
+ type Props = {
20
+ UID: string;
21
+ qualityPrioritization: "speed" | "quality" | "balanced";
22
+ };
23
+
24
+ const FingerRegister = ({ UID, qualityPrioritization }: Props) => {
25
+ const cameraRef = useRef<Camera>(null);
26
+ const { hasPermission, requestPermission } = useCameraPermission();
27
+ const state = useSelector();
28
+ const dispatch = useDispatch();
29
+ const device = useCameraDevice("back");
30
+ const base64ImagesCount = state.base64Images.length;
31
+
32
+ useEffect(() => {
33
+ Orientation.lockToPortrait();
34
+ return () => {
35
+ Orientation.unlockAllOrientations();
36
+ };
37
+ }, []);
38
+
39
+ useEffect(() => {
40
+ if (state.base64Images !== undefined && base64ImagesCount === 3) {
41
+ if (!UID) {
42
+ dispatch.setModal("Ocorreu um erro!", "Erro: UID não encontrado!");
43
+ }
44
+ dispatch.handleLoading();
45
+ dispatch.sendImages(state.base64Images, UID);
46
+ }
47
+ }, [dispatch.sendImages, dispatch.handleLoading, state.base64Images, base64ImagesCount]);
48
+
49
+ useEffect(() => {
50
+ if (state.code === 0) {
51
+ dispatch.setModal("Sucesso!", "Cadastro de digital realizado com sucesso!");
52
+ dispatch.handleLoading();
53
+ }
54
+ if (state.code !== 0 && state.code !== null) {
55
+ dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
56
+ dispatch.handleLoading();
57
+ }
58
+ dispatch.resetState();
59
+ }, [state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal]);
60
+
61
+ const cameraPermission = useCallback(async () => {
62
+ if (!hasPermission) {
63
+ await requestPermission();
64
+ }
65
+ }, [hasPermission, requestPermission]);
66
+
67
+ useEffect(() => {
68
+ cameraPermission();
69
+ dispatch.getConfig("finger");
70
+ }, [cameraPermission]);
71
+
72
+ const containerCaptureStyled = useMemo(
73
+ () => [styles.containerCapture, { bottom: state.showButtonInfo ? 75 : 20 }],
74
+ [state.showButtonInfo]
75
+ );
76
+
77
+ const cameraFormat = useCameraFormat(device, [
78
+ {
79
+ photoResolution: {
80
+ width: 1920,
81
+ height: 1080
82
+ },
83
+ pixelFormat: "native"
84
+ }
85
+ ]);
86
+
87
+ const takePhoto = async () => {
88
+ const photo = await cameraRef.current?.takePhoto({
89
+ qualityPrioritization: qualityPrioritization,
90
+ flash: "on"
91
+ });
92
+ if (photo != null) dispatch.setImagePath(photo.path);
93
+ };
94
+
95
+ const focus = useCallback((point: Point) => {
96
+ const camera = cameraRef.current;
97
+ if (camera != null) {
98
+ camera.focus(point);
99
+ }
100
+ }, []);
101
+
102
+ const gesture = Gesture.Tap().onBegin(({ x, y }) => {
103
+ runOnJS(focus)({ x, y });
104
+ });
105
+
106
+ if (device == null || hasPermission === false)
107
+ return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
108
+
109
+ return (
110
+ <GestureHandlerRootView style={styles.root}>
111
+ <HelpRegister />
112
+ <GestureDetector gesture={gesture}>
113
+ <View style={styles.cameraContainer}>
114
+ <Camera
115
+ ref={cameraRef}
116
+ style={styles.camera}
117
+ isActive={true}
118
+ device={device}
119
+ format={cameraFormat}
120
+ torch={"on"}
121
+ focusable={true}
122
+ exposure={state.exposure}
123
+ zoom={state.exposure}
124
+ photo={true}
125
+ enableHighQualityPhotos={true}
126
+ />
127
+ <Gabarito />
128
+ </View>
129
+ </GestureDetector>
130
+ <View style={containerCaptureStyled}>
131
+ <CaptureButton onPress={takePhoto} imagesCount={base64ImagesCount} />
132
+ </View>
133
+ {state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.zoom} />}
134
+ <ModalMessage isLoading={state.loading} modal={state.modal} />
135
+ </GestureHandlerRootView>
136
+ );
137
+ };
138
+
139
+ export default FingerRegister;
@@ -0,0 +1,28 @@
1
+ import { StyleSheet, Dimensions } from "react-native";
2
+
3
+ const { height } = Dimensions.get("window");
4
+
5
+ export const styles = StyleSheet.create({
6
+ container: {
7
+ flex: 1
8
+ },
9
+ root: {
10
+ flex: 1
11
+ },
12
+ cameraContainer: {
13
+ flex: 1,
14
+ justifyContent: "center"
15
+ },
16
+ camera: {
17
+ flex: 1,
18
+ paddingBottom: height * 0.2
19
+ },
20
+ containerCapture: {
21
+ position: "absolute",
22
+ width: "100%",
23
+ alignItems: "center"
24
+ },
25
+ cameraConfigs: {
26
+ alignItems: "center"
27
+ }
28
+ });