@transfergratis/react-native-sdk 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/build/api/axios.d.ts +30 -0
  2. package/build/api/axios.d.ts.map +1 -0
  3. package/build/api/axios.js +92 -0
  4. package/build/api/axios.js.map +1 -0
  5. package/build/components/EnhancedCameraView.d.ts +1 -41
  6. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  7. package/build/components/EnhancedCameraView.js +75 -34
  8. package/build/components/EnhancedCameraView.js.map +1 -1
  9. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  10. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  11. package/build/components/EnhancedCameraView.web.js +28 -4
  12. package/build/components/EnhancedCameraView.web.js.map +1 -1
  13. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  14. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  15. package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
  16. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  17. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  18. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  19. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  20. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  21. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  22. package/build/components/KYCElements/IDCardCapture.js +253 -104
  23. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  24. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  25. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  26. package/build/components/KYCElements/InitializationStep.js +41 -0
  27. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  28. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  29. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  30. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  31. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  32. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  33. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  34. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  35. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  36. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  37. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  38. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  39. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  40. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  41. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  42. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  43. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  44. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  45. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  46. package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
  47. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  48. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  49. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  50. package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
  51. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  52. package/build/components/OverLay/IdCard.d.ts +1 -1
  53. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  54. package/build/components/OverLay/IdCard.js +10 -6
  55. package/build/components/OverLay/IdCard.js.map +1 -1
  56. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  57. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  58. package/build/components/OverLay/SelfieOverlay.js +5 -4
  59. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  60. package/build/components/OverLay/type.d.ts +71 -1
  61. package/build/components/OverLay/type.d.ts.map +1 -1
  62. package/build/components/OverLay/type.js.map +1 -1
  63. package/build/components/TemplateKYCExample.d.ts +4 -1
  64. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  65. package/build/components/TemplateKYCExample.js +74 -199
  66. package/build/components/TemplateKYCExample.js.map +1 -1
  67. package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
  68. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  69. package/build/components/TemplateKYCFlowRefactored.js +64 -40
  70. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  71. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  72. package/build/components/example/OrientationVideoExample.js +1 -5
  73. package/build/components/example/OrientationVideoExample.js.map +1 -1
  74. package/build/config/countriesData.d.ts +3 -0
  75. package/build/config/countriesData.d.ts.map +1 -0
  76. package/build/config/countriesData.js +79 -0
  77. package/build/config/countriesData.js.map +1 -0
  78. package/build/config/region_mapping.d.ts +3 -0
  79. package/build/config/region_mapping.d.ts.map +1 -0
  80. package/build/config/region_mapping.js +687 -0
  81. package/build/config/region_mapping.js.map +1 -0
  82. package/build/hooks/useI18n.d.ts +11 -0
  83. package/build/hooks/useI18n.d.ts.map +1 -0
  84. package/build/hooks/useI18n.js +37 -0
  85. package/build/hooks/useI18n.js.map +1 -0
  86. package/build/hooks/useOrientationVideo.d.ts +1 -2
  87. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  88. package/build/hooks/useOrientationVideo.js +2 -1
  89. package/build/hooks/useOrientationVideo.js.map +1 -1
  90. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  91. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  92. package/build/hooks/useRealtimeVerifier.js +91 -0
  93. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  94. package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
  95. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  96. package/build/hooks/useTemplateKYCFlow.js +356 -42
  97. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  98. package/build/i18n/en/index.d.ts +168 -0
  99. package/build/i18n/en/index.d.ts.map +1 -0
  100. package/build/i18n/en/index.js +195 -0
  101. package/build/i18n/en/index.js.map +1 -0
  102. package/build/i18n/fr/index.d.ts +168 -0
  103. package/build/i18n/fr/index.d.ts.map +1 -0
  104. package/build/i18n/fr/index.js +194 -0
  105. package/build/i18n/fr/index.js.map +1 -0
  106. package/build/i18n/index.d.ts +10 -0
  107. package/build/i18n/index.d.ts.map +1 -0
  108. package/build/i18n/index.js +56 -0
  109. package/build/i18n/index.js.map +1 -0
  110. package/build/i18n/types.d.ts +153 -0
  111. package/build/i18n/types.d.ts.map +1 -0
  112. package/build/i18n/types.js +3 -0
  113. package/build/i18n/types.js.map +1 -0
  114. package/build/i18n/usage-example.d.ts +4 -0
  115. package/build/i18n/usage-example.d.ts.map +1 -0
  116. package/build/i18n/usage-example.js +189 -0
  117. package/build/i18n/usage-example.js.map +1 -0
  118. package/build/index.d.ts +1 -0
  119. package/build/index.d.ts.map +1 -1
  120. package/build/index.js +2 -0
  121. package/build/index.js.map +1 -1
  122. package/build/modules/api/CardAuthentification.d.ts +22 -0
  123. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  124. package/build/modules/api/CardAuthentification.js +107 -0
  125. package/build/modules/api/CardAuthentification.js.map +1 -0
  126. package/build/modules/api/KYCService.d.ts +58 -1
  127. package/build/modules/api/KYCService.d.ts.map +1 -1
  128. package/build/modules/api/KYCService.js +304 -27
  129. package/build/modules/api/KYCService.js.map +1 -1
  130. package/build/modules/api/SelfieVerification.d.ts +3 -0
  131. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  132. package/build/modules/api/SelfieVerification.js +9 -0
  133. package/build/modules/api/SelfieVerification.js.map +1 -0
  134. package/build/modules/api/backendApi.d.ts +2 -0
  135. package/build/modules/api/backendApi.d.ts.map +1 -0
  136. package/build/modules/api/backendApi.js +6 -0
  137. package/build/modules/api/backendApi.js.map +1 -0
  138. package/build/modules/api/types.d.ts +45 -0
  139. package/build/modules/api/types.d.ts.map +1 -0
  140. package/build/modules/api/types.js +2 -0
  141. package/build/modules/api/types.js.map +1 -0
  142. package/build/types/KYC.types.d.ts +56 -7
  143. package/build/types/KYC.types.d.ts.map +1 -1
  144. package/build/types/KYC.types.js +9 -1
  145. package/build/types/KYC.types.js.map +1 -1
  146. package/build/utils/cropByObb.d.ts +11 -0
  147. package/build/utils/cropByObb.d.ts.map +1 -0
  148. package/build/utils/cropByObb.js +78 -0
  149. package/build/utils/cropByObb.js.map +1 -0
  150. package/build/utils/get-document-type-info.d.ts +13 -0
  151. package/build/utils/get-document-type-info.d.ts.map +1 -0
  152. package/build/utils/get-document-type-info.js +59 -0
  153. package/build/utils/get-document-type-info.js.map +1 -0
  154. package/build/utils/pathToBase64.d.ts +3 -0
  155. package/build/utils/pathToBase64.d.ts.map +1 -0
  156. package/build/utils/pathToBase64.js +47 -0
  157. package/build/utils/pathToBase64.js.map +1 -0
  158. package/build/utils/remove-duplicate.d.ts +2 -0
  159. package/build/utils/remove-duplicate.d.ts.map +1 -0
  160. package/build/utils/remove-duplicate.js +4 -0
  161. package/build/utils/remove-duplicate.js.map +1 -0
  162. package/build/web/WebKYCEntry.d.ts +9 -0
  163. package/build/web/WebKYCEntry.d.ts.map +1 -0
  164. package/build/web/WebKYCEntry.js +156 -0
  165. package/build/web/WebKYCEntry.js.map +1 -0
  166. package/build/web/index.d.ts +2 -0
  167. package/build/web/index.d.ts.map +1 -0
  168. package/build/web/index.js +2 -0
  169. package/build/web/index.js.map +1 -0
  170. package/package.json +3 -1
  171. package/src/api/axios.ts +144 -0
  172. package/src/components/EnhancedCameraView.tsx +96 -78
  173. package/src/components/EnhancedCameraView.web.tsx +41 -40
  174. package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
  175. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  176. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  177. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  178. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  179. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  180. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  181. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  182. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  183. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
  184. package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
  185. package/src/components/OverLay/IdCard.tsx +17 -9
  186. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  187. package/src/components/OverLay/type.ts +64 -2
  188. package/src/components/TemplateKYCExample.tsx +80 -200
  189. package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
  190. package/src/components/example/OrientationVideoExample.tsx +3 -7
  191. package/src/config/countriesData.ts +84 -0
  192. package/src/config/region_mapping.ts +688 -0
  193. package/src/hooks/useI18n.ts +53 -0
  194. package/src/hooks/useOrientationVideo.ts +2 -2
  195. package/src/hooks/useRealtimeVerifier.ts +128 -0
  196. package/src/hooks/useTemplateKYCFlow.tsx +407 -57
  197. package/src/i18n/README.md +288 -0
  198. package/src/i18n/en/index.ts +206 -0
  199. package/src/i18n/fr/index.ts +205 -0
  200. package/src/i18n/index.ts +65 -0
  201. package/src/i18n/types.ts +172 -0
  202. package/src/i18n/usage-example.tsx +202 -0
  203. package/src/index.ts +3 -0
  204. package/src/modules/api/CardAuthentification.ts +114 -0
  205. package/src/modules/api/KYCService.ts +350 -30
  206. package/src/modules/api/SelfieVerification.ts +11 -0
  207. package/src/modules/api/backendApi.ts +8 -0
  208. package/src/modules/api/types.ts +51 -0
  209. package/src/types/KYC.types.ts +82 -14
  210. package/src/utils/cropByObb.ts +99 -0
  211. package/src/utils/get-document-type-info.ts +62 -0
  212. package/src/utils/pathToBase64.ts +47 -0
  213. package/src/utils/remove-duplicate.ts +3 -0
  214. package/src/web/WebKYCEntry.tsx +215 -0
  215. package/src/web/index.ts +1 -0
  216. package/src/types/nativewind.d.ts +0 -2
@@ -0,0 +1,30 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export type ApiConfiguration = {
3
+ baseURL: string;
4
+ apiKey?: string;
5
+ authToken?: string;
6
+ timeoutMs?: number;
7
+ };
8
+ export type ApiErrorData = {
9
+ message?: string;
10
+ code?: string | number;
11
+ details?: unknown;
12
+ };
13
+ export declare class HttpClient {
14
+ private instance;
15
+ private apiKey?;
16
+ private authToken?;
17
+ constructor(configuration: ApiConfiguration);
18
+ setAuthToken(token?: string): void;
19
+ setApiKey(key?: string): void;
20
+ setBaseURL(url: string): void;
21
+ get<T = unknown>(url: string, requestConfig?: AxiosRequestConfig): Promise<T>;
22
+ post<T = unknown, B = unknown>(url: string, body?: B, requestConfig?: AxiosRequestConfig): Promise<T>;
23
+ put<T = unknown, B = unknown>(url: string, body?: B, requestConfig?: AxiosRequestConfig): Promise<T>;
24
+ patch<T = unknown, B = unknown>(url: string, body?: B, requestConfig?: AxiosRequestConfig): Promise<T>;
25
+ delete<T = unknown>(url: string, requestConfig?: AxiosRequestConfig): Promise<T>;
26
+ }
27
+ export default HttpClient;
28
+ export declare const mlService: HttpClient;
29
+ export declare const backendService: HttpClient;
30
+ //# sourceMappingURL=axios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../src/api/axios.ts"],"names":[],"mappings":"AAAA,OAAc,EAEV,kBAAkB,EAGrB,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,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AkB,GAAG,OAAO,CAAC,CAAC,CAAC;CAIzF;AAED,eAAe,UAAU,CAAC;AAI1B,eAAO,MAAM,SAAS,YAGpB,CAAC;AAEH,eAAO,MAAM,cAAc,YAGzB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import axios from 'axios';
2
+ export class HttpClient {
3
+ instance;
4
+ apiKey;
5
+ authToken;
6
+ constructor(configuration) {
7
+ this.apiKey = configuration.apiKey;
8
+ this.authToken = configuration.authToken;
9
+ this.instance = axios.create({
10
+ baseURL: configuration.baseURL,
11
+ timeout: configuration.timeoutMs ?? 15000,
12
+ headers: {
13
+ Accept: 'application/json',
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ });
17
+ this.instance.interceptors.request.use((request) => {
18
+ const headers = request.headers ?? {};
19
+ if (this.apiKey && !headers['x-api-key']) {
20
+ headers['x-api-key'] = this.apiKey;
21
+ }
22
+ if (this.authToken && !headers.Authorization) {
23
+ headers.Authorization = `Bearer ${this.authToken}`;
24
+ }
25
+ request.headers = headers;
26
+ return request;
27
+ }, (error) => Promise.reject(error));
28
+ this.instance.interceptors.response.use((response) => response, (error) => {
29
+ if (!error.response) {
30
+ return Promise.reject({
31
+ message: 'Network error. Please check your connection.',
32
+ code: 'network_error',
33
+ details: error?.message,
34
+ });
35
+ }
36
+ const { status, data } = error.response;
37
+ if (status === 401) {
38
+ return Promise.reject({
39
+ message: data?.message || 'Unauthorized',
40
+ code: 401,
41
+ details: data,
42
+ });
43
+ }
44
+ return Promise.reject({
45
+ message: data?.message || 'Request failed',
46
+ code: status,
47
+ details: data,
48
+ });
49
+ });
50
+ }
51
+ setAuthToken(token) {
52
+ this.authToken = token;
53
+ }
54
+ setApiKey(key) {
55
+ this.apiKey = key;
56
+ }
57
+ setBaseURL(url) {
58
+ this.instance.defaults.baseURL = url;
59
+ }
60
+ async get(url, requestConfig) {
61
+ const res = await this.instance.get(url, requestConfig);
62
+ return res.data;
63
+ }
64
+ async post(url, body, requestConfig) {
65
+ const res = await this.instance.post(url, body, requestConfig);
66
+ return res.data;
67
+ }
68
+ async put(url, body, requestConfig) {
69
+ const res = await this.instance.put(url, body, requestConfig);
70
+ return res.data;
71
+ }
72
+ async patch(url, body, requestConfig) {
73
+ const res = await this.instance.patch(url, body, requestConfig);
74
+ return res.data;
75
+ }
76
+ async delete(url, requestConfig) {
77
+ const res = await this.instance.delete(url, requestConfig);
78
+ return res.data;
79
+ }
80
+ }
81
+ export default HttpClient;
82
+ // ml service api
83
+ export const mlService = new HttpClient({
84
+ baseURL: 'https://api.ml.transfergratis.com',
85
+ apiKey: 'your-api-key',
86
+ });
87
+ // backedn service api
88
+ export const backendService = new HttpClient({
89
+ baseURL: 'https://api.backend.transfergratis.com',
90
+ apiKey: 'your-api-key',
91
+ });
92
+ //# sourceMappingURL=axios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/api/axios.ts"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAef,MAAM,OAAO,UAAU;IACX,QAAQ,CAAgB;IACxB,MAAM,CAAU;IAChB,SAAS,CAAU;IAE3B,YAAY,aAA+B;QACvC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,OAAO,EAAE,aAAa,CAAC,SAAS,IAAI,KAAK;YACzC,OAAO,EAAE;gBACL,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACrC;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAClC,CAAC,OAAmC,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;YACtC,IAAI,IAA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,MAAM,CAAI,GAAG,EAAE,aAAa,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,IAAS,CAAC;IACzB,CAAC;CACJ;AAED,eAAe,UAAU,CAAC;AAG1B,iBAAiB;AACjB,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC;IACpC,OAAO,EAAE,mCAAmC;IAC5C,MAAM,EAAE,cAAc;CACzB,CAAC,CAAC;AACH,sBAAsB;AACtB,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC;IACzC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,cAAc;CACzB,CAAC,CAAC","sourcesContent":["import axios, {\n AxiosInstance,\n AxiosRequestConfig,\n InternalAxiosRequestConfig,\n AxiosResponse,\n} from 'axios';\n\nexport type ApiConfiguration = {\n baseURL: string;\n apiKey?: string;\n authToken?: string;\n timeoutMs?: number;\n};\n\nexport type ApiErrorData = {\n message?: string;\n code?: string | number;\n details?: unknown;\n};\n\nexport class HttpClient {\n private instance: AxiosInstance;\n private apiKey?: string;\n private authToken?: string;\n\n constructor(configuration: ApiConfiguration) {\n this.apiKey = configuration.apiKey;\n this.authToken = configuration.authToken;\n this.instance = axios.create({\n baseURL: configuration.baseURL,\n timeout: configuration.timeoutMs ?? 15000,\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n });\n\n this.instance.interceptors.request.use(\n (request: InternalAxiosRequestConfig) => {\n const headers = request.headers ?? {};\n if (this.apiKey && !headers['x-api-key']) {\n headers['x-api-key'] = this.apiKey;\n }\n if (this.authToken && !headers.Authorization) {\n headers.Authorization = `Bearer ${this.authToken}`;\n }\n request.headers = headers;\n return request;\n },\n (error) => Promise.reject(error)\n );\n\n this.instance.interceptors.response.use(\n (response: AxiosResponse) => response,\n (error) => {\n if (!error.response) {\n return Promise.reject({\n message: 'Network error. Please check your connection.',\n code: 'network_error',\n details: error?.message,\n } as ApiErrorData);\n }\n const { status, data } = error.response as AxiosResponse<ApiErrorData>;\n if (status === 401) {\n return Promise.reject({\n message: data?.message || 'Unauthorized',\n code: 401,\n details: data,\n } as ApiErrorData);\n }\n return Promise.reject({\n message: data?.message || 'Request failed',\n code: status,\n details: data,\n } as ApiErrorData);\n }\n );\n }\n\n setAuthToken(token?: string): void {\n this.authToken = token;\n }\n\n setApiKey(key?: string): void {\n this.apiKey = key;\n }\n\n setBaseURL(url: string): void {\n this.instance.defaults.baseURL = url;\n }\n\n async get<T = unknown>(url: string, requestConfig?: AxiosRequestConfig): Promise<T> {\n const res = await this.instance.get<T>(url, requestConfig);\n return res.data as T;\n }\n\n async post<T = unknown, B = unknown>(\n url: string,\n body?: B,\n requestConfig?: AxiosRequestConfig\n ): Promise<T> {\n const res = await this.instance.post<T>(url, body, requestConfig);\n return res.data as T;\n }\n\n async put<T = unknown, B = unknown>(\n url: string,\n body?: B,\n requestConfig?: AxiosRequestConfig\n ): Promise<T> {\n const res = await this.instance.put<T>(url, body, requestConfig);\n return res.data as T;\n }\n\n async patch<T = unknown, B = unknown>(\n url: string,\n body?: B,\n requestConfig?: AxiosRequestConfig\n ): Promise<T> {\n const res = await this.instance.patch<T>(url, body, requestConfig);\n return res.data as T;\n }\n\n async delete<T = unknown>(url: string, requestConfig?: AxiosRequestConfig): Promise<T> {\n const res = await this.instance.delete<T>(url, requestConfig);\n return res.data as T;\n }\n}\n\nexport default HttpClient;\n\n\n// ml service api\nexport const mlService = new HttpClient({\n baseURL: 'https://api.ml.transfergratis.com',\n apiKey: 'your-api-key',\n});\n// backedn service api\nexport const backendService = new HttpClient({\n baseURL: 'https://api.backend.transfergratis.com',\n apiKey: 'your-api-key',\n});\n\n\n"]}
@@ -1,44 +1,4 @@
1
1
  import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- export interface EnhancedCameraViewProps {
4
- instructions?: string;
5
- showCamera: boolean;
6
- cameraType?: 'front' | 'back';
7
- style?: ViewStyle;
8
- onCapture?: (result: {
9
- success: boolean;
10
- path?: string;
11
- error?: string;
12
- }) => void;
13
- onError?: (event: {
14
- message: string;
15
- }) => void;
16
- onClose?: () => void;
17
- enableFlash?: boolean;
18
- enableHdr?: boolean;
19
- quality?: 'low' | 'medium' | 'high';
20
- showCaptureButton?: boolean;
21
- showSwitchCamera?: boolean;
22
- overlayComponent?: React.ReactNode;
23
- bbox?: {
24
- xMin: number;
25
- yMin: number;
26
- xMax: number;
27
- yMax: number;
28
- borderColor?: string;
29
- borderWidth?: number;
30
- cornerRadius?: number;
31
- };
32
- canFlip?: boolean;
33
- enableVideo?: boolean;
34
- isRecording?: boolean;
35
- onVideoRecordingStart?: () => void;
36
- onVideoRecordingStop?: (result: {
37
- success: boolean;
38
- path?: string;
39
- error?: string;
40
- }) => void;
41
- videoDuration?: number;
42
- }
2
+ import { EnhancedCameraViewProps } from './OverLay/type';
43
3
  export declare const EnhancedCameraView: React.FC<EnhancedCameraViewProps>;
44
4
  //# sourceMappingURL=EnhancedCameraView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedCameraView.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAA4C,SAAS,EAAE,MAAM,cAAc,CAAC;AAInF,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/C,OAA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,CAAC,uBAAuB,CA2ThE,CAAC"}
@@ -2,13 +2,16 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
3
3
  import { Camera, useCameraDevice } from 'react-native-vision-camera';
4
4
  import VisionCameraModule from '../modules/camera/VisionCameraModule';
5
- export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, }) => {
5
+ import { useI18n } from '../hooks/useI18n';
6
+ export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, onSilentCapture, silentCaptureResult, }) => {
7
+ const { t } = useI18n();
6
8
  const camera = useRef(null);
7
9
  const [cameraType, setCameraType] = useState(initialCameraType);
8
10
  const [hasPermission, setHasPermission] = useState(false);
9
11
  const [isInitialized, setIsInitialized] = useState(false);
10
12
  const [flash, setFlash] = useState('off');
11
13
  const device = useCameraDevice(cameraType);
14
+ console.log({ setCameraType, setFlash });
12
15
  // Check permissions on component mount
13
16
  useEffect(() => {
14
17
  if (showCamera) {
@@ -21,7 +24,7 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
21
24
  if (!hasAllPermissions) {
22
25
  const granted = await VisionCameraModule.requestAllPermissions();
23
26
  if (!granted) {
24
- onError?.({ message: 'Camera permissions not granted' });
27
+ onError?.({ message: t('camera.permissionRequired') });
25
28
  return;
26
29
  }
27
30
  }
@@ -29,7 +32,7 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
29
32
  }
30
33
  catch (error) {
31
34
  console.error('Error checking permissions:', error);
32
- onError?.({ message: 'Error checking camera permissions' });
35
+ onError?.({ message: t('camera.errorOccurred') });
33
36
  }
34
37
  };
35
38
  const onInitialized = useCallback(() => {
@@ -38,12 +41,42 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
38
41
  }, []);
39
42
  const onCameraError = useCallback((error) => {
40
43
  console.error('Camera error:', error);
41
- onError?.({ message: error.message || 'Camera error occurred' });
42
- }, [onError]);
44
+ onError?.({ message: error.message || t('camera.errorOccurred') });
45
+ }, [onError, t]);
46
+ const captureSilentPhoto = useCallback(async () => {
47
+ if (!camera.current || !isInitialized) {
48
+ onError?.({ message: t('camera.notReady') });
49
+ return;
50
+ }
51
+ console.log('silentCaptureResult', silentCaptureResult);
52
+ if (silentCaptureResult?.isAnalyzing || silentCaptureResult?.success) {
53
+ return;
54
+ }
55
+ try {
56
+ const photo = await camera.current.takePhoto({
57
+ enableShutterSound: true,
58
+ flash: enableFlash ? flash : 'off',
59
+ });
60
+ const result = await VisionCameraModule.processPhotoResult(photo);
61
+ onSilentCapture?.(result);
62
+ }
63
+ catch (error) {
64
+ }
65
+ }, [isInitialized, onError, onSilentCapture]);
66
+ // Automatically take a silent photo every 5 seconds when ready
67
+ useEffect(() => {
68
+ if (!showCamera || !isInitialized) {
69
+ return;
70
+ }
71
+ const intervalId = setInterval(() => {
72
+ captureSilentPhoto();
73
+ }, 5000);
74
+ return () => clearInterval(intervalId);
75
+ }, [showCamera, isInitialized, captureSilentPhoto]);
43
76
  const capturePhoto = useCallback(async () => {
44
77
  try {
45
78
  if (!camera.current || !isInitialized) {
46
- onError?.({ message: 'Camera not ready' });
79
+ onError?.({ message: t('camera.notReady') });
47
80
  return;
48
81
  }
49
82
  const photo = await camera.current.takePhoto({
@@ -57,14 +90,14 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
57
90
  console.error('Error taking photo:', error);
58
91
  onCapture?.({
59
92
  success: false,
60
- error: error instanceof Error ? error.message : 'Failed to capture photo',
93
+ error: error instanceof Error ? error.message : t('camera.failedToCapture'),
61
94
  });
62
95
  }
63
96
  }, [isInitialized, quality, flash, enableFlash, onCapture, onError]);
64
97
  const startVideoRecording = useCallback(async () => {
65
98
  try {
66
99
  if (!camera.current || !isInitialized) {
67
- onError?.({ message: 'Camera not ready' });
100
+ onError?.({ message: t('camera.notReady') });
68
101
  return;
69
102
  }
70
103
  await camera.current.startRecording({
@@ -78,7 +111,7 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
78
111
  console.error('Recording error:', error);
79
112
  onVideoRecordingStop?.({
80
113
  success: false,
81
- error: error.message || 'Failed to record video',
114
+ error: error.message || t('camera.failedToStartRecording'),
82
115
  });
83
116
  },
84
117
  });
@@ -88,47 +121,47 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
88
121
  console.error('Error starting video recording:', error);
89
122
  onVideoRecordingStop?.({
90
123
  success: false,
91
- error: error instanceof Error ? error.message : 'Failed to start video recording',
124
+ error: error instanceof Error ? error.message : t('camera.failedToStartRecording'),
92
125
  });
93
126
  }
94
127
  }, [isInitialized, onVideoRecordingStart, onVideoRecordingStop, onError]);
95
128
  const stopVideoRecording = useCallback(async () => {
96
129
  try {
97
130
  if (!camera.current) {
98
- onError?.({ message: 'Camera not ready' });
131
+ onError?.({ message: t('camera.notReady') });
99
132
  return;
100
133
  }
101
134
  await camera.current.stopRecording();
102
135
  }
103
136
  catch (error) {
104
137
  console.error('Error stopping video recording:', error);
105
- onError?.({ message: 'Failed to stop video recording' });
138
+ onError?.({ message: t('camera.failedToStopRecording') });
106
139
  }
107
140
  }, [onError]);
108
- const switchCamera = useCallback(() => {
109
- setCameraType(current => current === 'front' ? 'back' : 'front');
110
- }, []);
111
- const toggleFlash = useCallback(() => {
112
- setFlash(current => {
113
- switch (current) {
114
- case 'off': return 'on';
115
- case 'on': return 'auto';
116
- case 'auto': return 'off';
117
- default: return 'off';
118
- }
119
- });
120
- }, []);
141
+ // const switchCamera = useCallback(() => {
142
+ // setCameraType(current => current === 'front' ? 'back' : 'front');
143
+ // }, []);
144
+ // const toggleFlash = useCallback(() => {
145
+ // setFlash(current => {
146
+ // switch (current) {
147
+ // case 'off': return 'on';
148
+ // case 'on': return 'auto';
149
+ // case 'auto': return 'off';
150
+ // default: return 'off';
151
+ // }
152
+ // });
153
+ // }, []);
121
154
  if (!hasPermission) {
122
155
  return (<View style={[styles.container, style]}>
123
156
  <Text style={styles.permissionMessage}>
124
- Camera permission required. Please grant permission to continue.
157
+ {t('camera.permissionRequired')}
125
158
  </Text>
126
159
  </View>);
127
160
  }
128
161
  if (!device) {
129
162
  return (<View style={[styles.container, style]}>
130
163
  <Text style={styles.errorMessage}>
131
- Camera device not available
164
+ {t('camera.deviceNotAvailable')}
132
165
  </Text>
133
166
  </View>);
134
167
  }
@@ -150,7 +183,7 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
150
183
 
151
184
  {/* Bounding box overlay */}
152
185
  {bbox && (<View style={styles.bboxOverlay}>
153
- <View style={[
186
+ <View style={[
154
187
  styles.bbox,
155
188
  {
156
189
  left: `${bbox.xMin}%`,
@@ -168,14 +201,16 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
168
201
  {/* Camera controls */}
169
202
  <View style={styles.controlsContainer}>
170
203
  {/* Flash button */}
171
- {enableFlash && (<TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>
204
+ {/* {enableFlash && (
205
+ <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>
172
206
  <Text style={styles.controlButtonText}>
173
207
  {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}
174
208
  </Text>
175
- </TouchableOpacity>)}
209
+ </TouchableOpacity>
210
+ )} */}
176
211
 
177
212
  {/* Capture button */}
178
- {showCaptureButton && !enableVideo && (<TouchableOpacity style={styles.captureButton} onPress={capturePhoto} disabled={!isInitialized}>
213
+ {showCaptureButton && !enableVideo && silentCaptureResult?.success && (<TouchableOpacity style={styles.captureButton} onPress={capturePhoto} disabled={!isInitialized}>
179
214
  <View style={[
180
215
  styles.captureButtonInner,
181
216
  !isInitialized && styles.captureButtonDisabled
@@ -183,7 +218,7 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
183
218
  </TouchableOpacity>)}
184
219
 
185
220
  {/* Video recording button */}
186
- {showCaptureButton && enableVideo && (<TouchableOpacity style={[
221
+ {showCaptureButton && enableVideo && silentCaptureResult?.success && (<TouchableOpacity style={[
187
222
  styles.captureButton,
188
223
  isRecording && styles.recordingButton
189
224
  ]} onPress={isRecording ? stopVideoRecording : startVideoRecording} disabled={!isInitialized}>
@@ -195,9 +230,15 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
195
230
  </TouchableOpacity>)}
196
231
 
197
232
  {/* Switch camera button */}
198
- {showSwitchCamera && canFlip && (<TouchableOpacity style={styles.controlButton} onPress={switchCamera}>
233
+ {/* {showSwitchCamera && canFlip && (
234
+ <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>
199
235
  <Text style={styles.controlButtonText}>🔄</Text>
200
- </TouchableOpacity>)}
236
+ </TouchableOpacity>
237
+ )} */}
238
+
239
+ {silentCaptureResult?.isAnalyzing && (<View style={{ backgroundColor: 'rgba(0, 0, 0, 0.7)', padding: 10, borderRadius: 10 }}>
240
+ <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{t('camera.analyzing')}</Text>
241
+ </View>)}
201
242
  </View>
202
243
  </View>);
203
244
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedCameraView.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EA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Y,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text, ViewStyle } from 'react-native';\nimport { Camera, useCameraDevice } from 'react-native-vision-camera';\nimport VisionCameraModule from '../modules/camera/VisionCameraModule';\n\nexport interface EnhancedCameraViewProps {\n instructions?: string;\n showCamera: boolean;\n cameraType?: 'front' | 'back';\n style?: ViewStyle;\n onCapture?: (result: { success: boolean; path?: string; error?: string }) => void;\n onError?: (event: { message: string }) => void;\n onClose?: () => void;\n enableFlash?: boolean;\n enableHdr?: boolean;\n quality?: 'low' | 'medium' | 'high';\n showCaptureButton?: boolean;\n showSwitchCamera?: boolean;\n overlayComponent?: React.ReactNode;\n bbox?: {\n xMin: number;\n yMin: number;\n xMax: number;\n yMax: number;\n borderColor?: string;\n borderWidth?: number;\n cornerRadius?: number;\n };\n canFlip?: boolean;\n // Video recording props\n enableVideo?: boolean;\n isRecording?: boolean;\n onVideoRecordingStart?: () => void;\n onVideoRecordingStop?: (result: { success: boolean; path?: string; error?: string }) => void;\n videoDuration?: number;\n}\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({\n instructions = 'Position yourself in the frame and tap the capture button',\n showCamera,\n cameraType: initialCameraType = 'front',\n style,\n onCapture,\n onError,\n onClose,\n enableFlash = false,\n enableHdr = false,\n quality = 'high',\n showCaptureButton = true,\n showSwitchCamera = true,\n overlayComponent,\n bbox,\n canFlip = true,\n enableVideo = false,\n isRecording = false,\n onVideoRecordingStart,\n onVideoRecordingStop,\n videoDuration = 10,\n}) => {\n const camera = useRef<Camera>(null);\n const [cameraType, setCameraType] = useState<'front' | 'back'>(initialCameraType);\n const [hasPermission, setHasPermission] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [flash, setFlash] = useState<'off' | 'on' | 'auto'>('off');\n\n const device = useCameraDevice(cameraType);\n\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera]);\n\n const checkPermissions = async () => {\n try {\n const hasAllPermissions = await VisionCameraModule.hasAllPermissions();\n if (!hasAllPermissions) {\n const granted = await VisionCameraModule.requestAllPermissions();\n if (!granted) {\n onError?.({ message: 'Camera permissions not granted' });\n return;\n }\n }\n setHasPermission(true);\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: 'Error checking camera permissions' });\n }\n };\n\n const onInitialized = useCallback(() => {\n console.log('Camera initialized!');\n setIsInitialized(true);\n }, []);\n\n const onCameraError = useCallback((error: any) => {\n console.error('Camera error:', error);\n onError?.({ message: error.message || 'Camera error occurred' });\n }, [onError]);\n\n const capturePhoto = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onCapture?.(result);\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, quality, flash, enableFlash, onCapture, onError]);\n\n const startVideoRecording = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n await camera.current.startRecording({\n onRecordingFinished: (video: any) => {\n onVideoRecordingStop?.({\n success: true,\n path: video.path,\n });\n },\n onRecordingError: (error: any) => {\n console.error('Recording error:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error.message || 'Failed to record video',\n });\n },\n });\n\n onVideoRecordingStart?.();\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to start video recording',\n });\n }\n }, [isInitialized, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (!camera.current) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n await camera.current.stopRecording();\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: 'Failed to stop video recording' });\n }\n }, [onError]);\n\n const switchCamera = useCallback(() => {\n setCameraType(current => current === 'front' ? 'back' : 'front');\n }, []);\n\n const toggleFlash = useCallback(() => {\n setFlash(current => {\n switch (current) {\n case 'off': return 'on';\n case 'on': return 'auto';\n case 'auto': return 'off';\n default: return 'off';\n }\n });\n }, []);\n\n if (!hasPermission) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.permissionMessage}>\n Camera permission required. Please grant permission to continue.\n </Text>\n </View>\n );\n }\n\n if (!device) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.errorMessage}>\n Camera device not available\n </Text>\n </View>\n );\n }\n\n if (!showCamera) {\n return <View style={[styles.container, style]} />;\n }\n\n return (\n <View style={[styles.container, style]}>\n <Camera\n ref={camera}\n style={StyleSheet.absoluteFill}\n device={device}\n isActive={showCamera}\n photo={true}\n video={enableVideo}\n audio={enableVideo}\n onInitialized={onInitialized}\n onError={onCameraError}\n />\n\n {/* Instructions */}\n {/* {instructions && (\n <View style={styles.instructionsOverlay}>\n <Text style={styles.instructions}>{instructions}</Text>\n </View>\n )} */}\n\n {/* Custom overlay component */}\n {overlayComponent}\n\n {/* Bounding box overlay */}\n {bbox && (\n <View style={styles.bboxOverlay}>\n <View\n style={[\n styles.bbox,\n {\n left: `${bbox.xMin}%`,\n top: `${bbox.yMin}%`,\n width: `${bbox.xMax - bbox.xMin}%`,\n height: `${bbox.yMax - bbox.yMin}%`,\n borderColor: bbox.borderColor || '#2DBD60',\n borderWidth: bbox.borderWidth || 3,\n borderRadius: bbox.cornerRadius || 8,\n }\n ]}\n />\n </View>\n )}\n\n\n {/* Camera controls */}\n <View style={styles.controlsContainer}>\n {/* Flash button */}\n {enableFlash && (\n <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>\n <Text style={styles.controlButtonText}>\n {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}\n </Text>\n </TouchableOpacity>\n )}\n\n {/* Capture button */}\n {showCaptureButton && !enableVideo && (\n <TouchableOpacity\n style={styles.captureButton}\n onPress={capturePhoto}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Video recording button */}\n {showCaptureButton && enableVideo && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecording && styles.recordingButton\n ]}\n onPress={isRecording ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecording && styles.recordingButtonInner\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Switch camera button */}\n {showSwitchCamera && canFlip && (\n <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>\n <Text style={styles.controlButtonText}>🔄</Text>\n </TouchableOpacity>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n },\n instructionsOverlay: {\n position: 'absolute',\n top: 60,\n left: 20,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 15,\n // borderRadius: 10,\n zIndex: 1,\n },\n instructions: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n fontWeight: '500',\n },\n closeButton: {\n position: 'absolute',\n top: 50,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 40,\n height: 40,\n borderRadius: 20,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n closeButtonText: {\n color: 'white',\n fontSize: 20,\n fontWeight: 'bold',\n },\n controlsContainer: {\n position: 'absolute',\n bottom: 40,\n left: 0,\n right: 0,\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 40,\n zIndex: 1,\n },\n controlButton: {\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 50,\n height: 50,\n borderRadius: 25,\n justifyContent: 'center',\n alignItems: 'center',\n },\n controlButtonText: {\n fontSize: 24,\n },\n captureButton: {\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n width: 80,\n height: 80,\n borderRadius: 40,\n justifyContent: 'center',\n alignItems: 'center',\n borderWidth: 3,\n borderColor: 'white',\n },\n captureButtonInner: {\n backgroundColor: 'white',\n width: 60,\n height: 60,\n borderRadius: 30,\n },\n captureButtonDisabled: {\n backgroundColor: 'rgba(255, 255, 255, 0.5)',\n },\n recordingButton: {\n backgroundColor: 'rgba(255, 59, 48, 0.3)',\n borderColor: '#FF3B30',\n },\n recordingButtonInner: {\n backgroundColor: '#FF3B30',\n },\n permissionMessage: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n errorMessage: {\n color: 'red',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n bboxOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n },\n bbox: {\n position: 'absolute',\n borderStyle: 'solid',\n backgroundColor: 'transparent',\n },\n});"]}
1
+ {"version":3,"file":"EnhancedCameraView.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAA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,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text } from 'react-native';\nimport { Camera, useCameraDevice } from 'react-native-vision-camera';\nimport VisionCameraModule from '../modules/camera/VisionCameraModule';\nimport { useI18n } from '../hooks/useI18n';\nimport { EnhancedCameraViewProps } from './OverLay/type';\n\n\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({\n instructions = 'Position yourself in the frame and tap the capture button',\n showCamera,\n cameraType: initialCameraType = 'front',\n style,\n onCapture,\n onError,\n onClose,\n enableFlash = false,\n enableHdr = false,\n quality = 'high',\n showCaptureButton = true,\n showSwitchCamera = true,\n overlayComponent,\n bbox,\n canFlip = true,\n enableVideo = false,\n isRecording = false,\n onVideoRecordingStart,\n onVideoRecordingStop,\n videoDuration = 10,\n onSilentCapture,\n silentCaptureResult,\n}) => {\n const { t } = useI18n();\n const camera = useRef<Camera>(null);\n const [cameraType, setCameraType] = useState<'front' | 'back'>(initialCameraType);\n const [hasPermission, setHasPermission] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [flash, setFlash] = useState<'off' | 'on' | 'auto'>('off');\n\n const device = useCameraDevice(cameraType);\n console.log({ setCameraType, setFlash });\n\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera]);\n\n const checkPermissions = async () => {\n try {\n const hasAllPermissions = await VisionCameraModule.hasAllPermissions();\n if (!hasAllPermissions) {\n const granted = await VisionCameraModule.requestAllPermissions();\n if (!granted) {\n onError?.({ message: t('camera.permissionRequired') });\n return;\n }\n }\n setHasPermission(true);\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: t('camera.errorOccurred') });\n }\n };\n\n const onInitialized = useCallback(() => {\n console.log('Camera initialized!');\n setIsInitialized(true);\n }, []);\n\n const onCameraError = useCallback((error: any) => {\n console.error('Camera error:', error);\n onError?.({ message: error.message || t('camera.errorOccurred') });\n }, [onError, t]);\n\n const captureSilentPhoto = useCallback(async () => {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n console.log('silentCaptureResult', silentCaptureResult);\n if (silentCaptureResult?.isAnalyzing || silentCaptureResult?.success) {\n return;\n }\n try {\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onSilentCapture?.(result);\n } catch (error) {\n\n }\n }, [isInitialized, onError, onSilentCapture]);\n\n // Automatically take a silent photo every 5 seconds when ready\n useEffect(() => {\n if (!showCamera || !isInitialized) {\n return;\n }\n\n const intervalId = setInterval(() => {\n captureSilentPhoto();\n }, 5000);\n\n return () => clearInterval(intervalId);\n }, [showCamera, isInitialized, captureSilentPhoto]);\n\n const capturePhoto = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onCapture?.(result);\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToCapture'),\n });\n }\n }, [isInitialized, quality, flash, enableFlash, onCapture, onError]);\n\n const startVideoRecording = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.startRecording({\n onRecordingFinished: (video: any) => {\n onVideoRecordingStop?.({\n success: true,\n path: video.path,\n });\n },\n onRecordingError: (error: any) => {\n console.error('Recording error:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error.message || t('camera.failedToStartRecording'),\n });\n },\n });\n\n onVideoRecordingStart?.();\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToStartRecording'),\n });\n }\n }, [isInitialized, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (!camera.current) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.stopRecording();\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: t('camera.failedToStopRecording') });\n }\n }, [onError]);\n\n // const switchCamera = useCallback(() => {\n // setCameraType(current => current === 'front' ? 'back' : 'front');\n // }, []);\n\n // const toggleFlash = useCallback(() => {\n // setFlash(current => {\n // switch (current) {\n // case 'off': return 'on';\n // case 'on': return 'auto';\n // case 'auto': return 'off';\n // default: return 'off';\n // }\n // });\n // }, []);\n\n if (!hasPermission) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.permissionMessage}>\n {t('camera.permissionRequired')}\n </Text>\n </View>\n );\n }\n\n if (!device) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.errorMessage}>\n {t('camera.deviceNotAvailable')}\n </Text>\n </View>\n );\n }\n\n if (!showCamera) {\n return <View style={[styles.container, style]} />;\n }\n\n return (\n <View style={[styles.container, style]}>\n <Camera\n ref={camera}\n style={StyleSheet.absoluteFill}\n device={device}\n isActive={showCamera}\n photo={true}\n video={enableVideo}\n audio={enableVideo}\n onInitialized={onInitialized}\n onError={onCameraError}\n />\n\n {/* Instructions */}\n {/* {instructions && (\n <View style={styles.instructionsOverlay}>\n <Text style={styles.instructions}>{instructions}</Text>\n </View>\n )} */}\n\n {/* Custom overlay component */}\n {overlayComponent}\n\n {/* Bounding box overlay */}\n {bbox && (\n <View style={styles.bboxOverlay}>\n <View\n style={[\n styles.bbox,\n {\n left: `${bbox.xMin}%`,\n top: `${bbox.yMin}%`,\n width: `${bbox.xMax - bbox.xMin}%`,\n height: `${bbox.yMax - bbox.yMin}%`,\n borderColor: bbox.borderColor || '#2DBD60',\n borderWidth: bbox.borderWidth || 3,\n borderRadius: bbox.cornerRadius || 8,\n }\n ]}\n />\n </View>\n )}\n\n\n {/* Camera controls */}\n <View style={styles.controlsContainer}>\n {/* Flash button */}\n {/* {enableFlash && (\n <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>\n <Text style={styles.controlButtonText}>\n {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}\n </Text>\n </TouchableOpacity>\n )} */}\n\n {/* Capture button */}\n {showCaptureButton && !enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={styles.captureButton}\n onPress={capturePhoto}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Video recording button */}\n {showCaptureButton && enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecording && styles.recordingButton\n ]}\n onPress={isRecording ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecording && styles.recordingButtonInner\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Switch camera button */}\n {/* {showSwitchCamera && canFlip && (\n <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>\n <Text style={styles.controlButtonText}>🔄</Text>\n </TouchableOpacity>\n )} */}\n\n {silentCaptureResult?.isAnalyzing && (\n <View style={{ backgroundColor: 'rgba(0, 0, 0, 0.7)', padding: 10, borderRadius: 10 }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{t('camera.analyzing')}</Text>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n },\n instructionsOverlay: {\n position: 'absolute',\n top: 60,\n left: 20,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 15,\n // borderRadius: 10,\n zIndex: 1,\n },\n instructions: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n fontWeight: '500',\n },\n closeButton: {\n position: 'absolute',\n top: 50,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 40,\n height: 40,\n borderRadius: 20,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n closeButtonText: {\n color: 'white',\n fontSize: 20,\n fontWeight: 'bold',\n },\n controlsContainer: {\n position: 'absolute',\n bottom: 40,\n left: 0,\n right: 0,\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 40,\n zIndex: 1,\n },\n controlButton: {\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 50,\n height: 50,\n borderRadius: 25,\n justifyContent: 'center',\n alignItems: 'center',\n },\n controlButtonText: {\n fontSize: 24,\n },\n captureButton: {\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n width: 80,\n height: 80,\n borderRadius: 40,\n justifyContent: 'center',\n alignItems: 'center',\n borderWidth: 3,\n borderColor: 'white',\n },\n captureButtonInner: {\n backgroundColor: 'white',\n width: 60,\n height: 60,\n borderRadius: 30,\n },\n captureButtonDisabled: {\n backgroundColor: 'rgba(255, 255, 255, 0.5)',\n },\n recordingButton: {\n backgroundColor: 'rgba(255, 59, 48, 0.3)',\n borderColor: '#FF3B30',\n },\n recordingButtonInner: {\n backgroundColor: '#FF3B30',\n },\n permissionMessage: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n errorMessage: {\n color: 'red',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n bboxOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n },\n bbox: {\n position: 'absolute',\n borderStyle: 'solid',\n backgroundColor: 'transparent',\n },\n});"]}
@@ -1,44 +1,4 @@
1
1
  import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- export interface EnhancedCameraViewProps {
4
- instructions?: string;
5
- showCamera: boolean;
6
- cameraType?: 'front' | 'back';
7
- style?: ViewStyle;
8
- onCapture?: (result: {
9
- success: boolean;
10
- path?: string;
11
- error?: string;
12
- }) => void;
13
- onError?: (event: {
14
- message: string;
15
- }) => void;
16
- onClose?: () => void;
17
- enableFlash?: boolean;
18
- enableHdr?: boolean;
19
- quality?: 'low' | 'medium' | 'high';
20
- showCaptureButton?: boolean;
21
- showSwitchCamera?: boolean;
22
- overlayComponent?: React.ReactNode;
23
- bbox?: {
24
- xMin: number;
25
- yMin: number;
26
- xMax: number;
27
- yMax: number;
28
- borderColor?: string;
29
- borderWidth?: number;
30
- cornerRadius?: number;
31
- };
32
- canFlip?: boolean;
33
- enableVideo?: boolean;
34
- isRecording?: boolean;
35
- onVideoRecordingStart?: () => void;
36
- onVideoRecordingStop?: (result: {
37
- success: boolean;
38
- path?: string;
39
- error?: string;
40
- }) => void;
41
- videoDuration?: number;
42
- }
2
+ import { EnhancedCameraViewProps } from './OverLay/type';
43
3
  export declare const EnhancedCameraView: React.FC<EnhancedCameraViewProps>;
44
4
  //# sourceMappingURL=EnhancedCameraView.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedCameraView.web.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAA4C,SAAS,EAAY,MAAM,cAAc,CAAC;AAE7F,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE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