@idmission/websdk-ui 0.2.0-rc.2 → 0.5.0

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 (212) hide show
  1. package/README.md +168 -56
  2. package/dist/DocumentCaptureView.d.ts +44 -5
  3. package/dist/DocumentCaptureView.d.ts.map +1 -1
  4. package/dist/DocumentCaptureView.js +517 -30
  5. package/dist/FaceLivenessView.d.ts +3 -3
  6. package/dist/FaceLivenessView.d.ts.map +1 -1
  7. package/dist/FaceLivenessView.js +82 -40
  8. package/dist/IdCaptureView.d.ts +33 -20
  9. package/dist/IdCaptureView.d.ts.map +1 -1
  10. package/dist/IdCaptureView.js +196 -33
  11. package/dist/SelfieCaptureView.d.ts +19 -2
  12. package/dist/SelfieCaptureView.d.ts.map +1 -1
  13. package/dist/SelfieCaptureView.js +17 -5
  14. package/dist/SignatureCaptureView.d.ts +23 -2
  15. package/dist/SignatureCaptureView.d.ts.map +1 -1
  16. package/dist/SignatureCaptureView.js +138 -22
  17. package/dist/VideoIdCaptureView.d.ts +15 -3
  18. package/dist/VideoIdCaptureView.d.ts.map +1 -1
  19. package/dist/VideoIdCaptureView.js +35 -8
  20. package/dist/bindings/useDocumentCapture.d.ts.map +1 -1
  21. package/dist/bindings/useDocumentCapture.js +2 -1
  22. package/dist/bindings/useIdCapture.d.ts.map +1 -1
  23. package/dist/bindings/useIdCapture.js +2 -1
  24. package/dist/bindings/useSelfieCapture.d.ts.map +1 -1
  25. package/dist/bindings/useSelfieCapture.js +2 -1
  26. package/dist/bindings/useSignatureCapture.d.ts.map +1 -1
  27. package/dist/bindings/useSignatureCapture.js +2 -1
  28. package/dist/bindings/useVideoIdCapture.d.ts.map +1 -1
  29. package/dist/bindings/useVideoIdCapture.js +2 -1
  30. package/dist/components/CameraFeed.d.ts +11 -3
  31. package/dist/components/CameraFeed.d.ts.map +1 -1
  32. package/dist/components/CameraFeed.js +24 -4
  33. package/dist/components/barcode/BarcodeGuideOverlay.d.ts +7 -1
  34. package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -1
  35. package/dist/components/barcode/BarcodeGuideOverlay.js +2 -2
  36. package/dist/components/common/BrowserEdgeTint.d.ts +63 -0
  37. package/dist/components/common/BrowserEdgeTint.d.ts.map +1 -0
  38. package/dist/components/common/BrowserEdgeTint.js +111 -0
  39. package/dist/components/common/LoaderButton.d.ts +9 -0
  40. package/dist/components/common/LoaderButton.d.ts.map +1 -1
  41. package/dist/components/common/LoaderButton.js +44 -321
  42. package/dist/components/common/ScreenReaderStatus.d.ts +8 -0
  43. package/dist/components/common/ScreenReaderStatus.d.ts.map +1 -0
  44. package/dist/components/common/ScreenReaderStatus.js +18 -0
  45. package/dist/components/common/overlay.d.ts +6 -0
  46. package/dist/components/common/overlay.d.ts.map +1 -1
  47. package/dist/components/common/overlay.js +7 -1
  48. package/dist/components/debug/debug.d.ts +10 -4
  49. package/dist/components/debug/debug.d.ts.map +1 -1
  50. package/dist/components/debug/debug.js +5 -1
  51. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts +29 -0
  52. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -0
  53. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +273 -0
  54. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts +56 -0
  55. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -0
  56. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +128 -0
  57. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +31 -1
  58. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -1
  59. package/dist/components/document/DocumentCaptureGuideOverlay.js +121 -2
  60. package/dist/components/document/DocumentCaptureReviewScreen.d.ts +44 -0
  61. package/dist/components/document/DocumentCaptureReviewScreen.d.ts.map +1 -0
  62. package/dist/components/document/DocumentCaptureReviewScreen.js +40 -0
  63. package/dist/components/document/types.d.ts +25 -0
  64. package/dist/components/document/types.d.ts.map +1 -1
  65. package/dist/components/document/types.js +18 -1
  66. package/dist/components/error/CameraAccessDeniedOverlay.d.ts +8 -1
  67. package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
  68. package/dist/components/error/useCameraAccessDeniedReport.d.ts +12 -0
  69. package/dist/components/error/useCameraAccessDeniedReport.d.ts.map +1 -0
  70. package/dist/components/error/useCameraAccessDeniedReport.js +31 -0
  71. package/dist/components/face_liveness/FaceLivenessFailure.d.ts +4 -1
  72. package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -1
  73. package/dist/components/face_liveness/FaceLivenessFailure.js +4 -2
  74. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +4 -1
  75. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -1
  76. package/dist/components/face_liveness/FaceLivenessSuccess.js +6 -2
  77. package/dist/components/guides/IdCaptureFitGuide.d.ts +2 -0
  78. package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
  79. package/dist/components/guides/IdCaptureFitGuide.js +4 -1
  80. package/dist/components/guides/IdCaptureGuideOverlay.d.ts +2 -0
  81. package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -1
  82. package/dist/components/guides/IdCaptureGuideOverlay.js +3 -1
  83. package/dist/components/guides/IdCaptureGuides.d.ts +14 -0
  84. package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
  85. package/dist/components/guides/IdCaptureGuides.js +23 -9
  86. package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -1
  87. package/dist/components/guides/IdCaptureGuidesCommon.js +12 -7
  88. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +9 -0
  89. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
  90. package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +26 -4
  91. package/dist/components/loading/RingIntroScreen.d.ts.map +1 -1
  92. package/dist/components/loading/RingIntroScreen.js +4 -34
  93. package/dist/components/review/ReviewScreen.d.ts +10 -1
  94. package/dist/components/review/ReviewScreen.d.ts.map +1 -1
  95. package/dist/components/review/ReviewScreen.js +8 -8
  96. package/dist/components/review/SignatureCaptureDiagnostics.d.ts +54 -0
  97. package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -0
  98. package/dist/components/review/SignatureCaptureDiagnostics.js +144 -0
  99. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +9 -2
  100. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -1
  101. package/dist/components/selfie/FaceCaptureGuideOverlay.js +10 -4
  102. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +8 -1
  103. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -1
  104. package/dist/components/selfie/SelfieCaptureAnimatedMask.js +55 -21
  105. package/dist/components/selfie/SelfieCaptureSurface.d.ts +19 -3
  106. package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
  107. package/dist/components/selfie/SelfieCaptureSurface.js +78 -14
  108. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +9 -0
  109. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -1
  110. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +26 -4
  111. package/dist/components/videoId/VideoIdCaptureGuides.d.ts +4 -1
  112. package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -1
  113. package/dist/components/videoId/VideoIdCaptureGuides.js +2 -2
  114. package/dist/flows/AuthStateContext.d.ts.map +1 -1
  115. package/dist/flows/AuthStateContext.js +2 -1
  116. package/dist/flows/CaptureProgress.d.ts +14 -0
  117. package/dist/flows/CaptureProgress.d.ts.map +1 -0
  118. package/dist/flows/CaptureProgress.js +51 -0
  119. package/dist/flows/CompositeWizard.d.ts +5 -0
  120. package/dist/flows/CompositeWizard.d.ts.map +1 -1
  121. package/dist/flows/CompositeWizard.js +6 -1
  122. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +1 -1
  123. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -1
  124. package/dist/flows/CustomerBiometricsEnrollmentFlow.js +6 -3
  125. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +1 -1
  126. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -1
  127. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +5 -2
  128. package/dist/flows/DocumentCaptureFlow.d.ts +2 -2
  129. package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
  130. package/dist/flows/DocumentCaptureFlow.js +6 -6
  131. package/dist/flows/FaceValidationFlow.d.ts +2 -2
  132. package/dist/flows/FaceValidationFlow.d.ts.map +1 -1
  133. package/dist/flows/FaceValidationFlow.js +2 -2
  134. package/dist/flows/FlowChassis.d.ts +3 -1
  135. package/dist/flows/FlowChassis.d.ts.map +1 -1
  136. package/dist/flows/FlowChassis.js +23 -4
  137. package/dist/flows/IdAndFaceValidationFlow.d.ts +1 -1
  138. package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -1
  139. package/dist/flows/IdAndFaceValidationFlow.js +5 -2
  140. package/dist/flows/IdValidationFlow.d.ts +1 -1
  141. package/dist/flows/IdValidationFlow.d.ts.map +1 -1
  142. package/dist/flows/IdValidationFlow.js +18 -4
  143. package/dist/flows/SignatureKYCFlow.d.ts +18 -3
  144. package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
  145. package/dist/flows/SignatureKYCFlow.js +94 -11
  146. package/dist/flows/SubmissionProvider.d.ts.map +1 -1
  147. package/dist/flows/SubmissionProvider.js +10 -5
  148. package/dist/flows/VideoIdValidationFlow.d.ts +1 -1
  149. package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -1
  150. package/dist/flows/VideoIdValidationFlow.js +6 -3
  151. package/dist/flows/additionalDocuments.d.ts.map +1 -1
  152. package/dist/flows/additionalDocuments.js +3 -6
  153. package/dist/flows/approval.d.ts +2 -0
  154. package/dist/flows/approval.d.ts.map +1 -0
  155. package/dist/flows/approval.js +1 -0
  156. package/dist/flows/artifacts.d.ts +1 -1
  157. package/dist/flows/artifacts.d.ts.map +1 -1
  158. package/dist/flows/artifacts.js +29 -9
  159. package/dist/flows/autoCaptureMountGuard.d.ts +22 -0
  160. package/dist/flows/autoCaptureMountGuard.d.ts.map +1 -0
  161. package/dist/flows/autoCaptureMountGuard.js +61 -0
  162. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +1 -1
  163. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -1
  164. package/dist/flows/customerMatch/CustomerMatchFlow.js +5 -6
  165. package/dist/flows/ringScreens.d.ts +1 -3
  166. package/dist/flows/ringScreens.d.ts.map +1 -1
  167. package/dist/flows/ringScreens.js +19 -5
  168. package/dist/flows/types.d.ts +17 -3
  169. package/dist/flows/types.d.ts.map +1 -1
  170. package/dist/guidance/selfieStrings.d.ts +9 -1
  171. package/dist/guidance/selfieStrings.d.ts.map +1 -1
  172. package/dist/guidance/selfieStrings.js +67 -24
  173. package/dist/guidance/strings.d.ts +34 -1
  174. package/dist/guidance/strings.d.ts.map +1 -1
  175. package/dist/guidance/strings.js +39 -0
  176. package/dist/i18n/index.d.ts +28 -1177
  177. package/dist/i18n/index.d.ts.map +1 -1
  178. package/dist/i18n/index.js +58 -22
  179. package/dist/i18n/locales/threeOh.d.ts +4 -0
  180. package/dist/i18n/locales/threeOh.d.ts.map +1 -0
  181. package/dist/i18n/locales/threeOh.js +159 -0
  182. package/dist/index.d.ts +12 -6
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +4 -0
  185. package/dist/testing/autoCaptureFrames.d.ts +23 -0
  186. package/dist/testing/autoCaptureFrames.d.ts.map +1 -0
  187. package/dist/testing/autoCaptureFrames.js +193 -0
  188. package/dist/testing/buildSelfieState.d.ts.map +1 -1
  189. package/dist/testing/buildSelfieState.js +5 -0
  190. package/dist/testing/classNamesLeaves.js +1 -1
  191. package/dist/testing/fakeDocumentController.d.ts +7 -1
  192. package/dist/testing/fakeDocumentController.d.ts.map +1 -1
  193. package/dist/testing/fakeDocumentController.js +10 -2
  194. package/dist/testing/fakeSelfieController.d.ts.map +1 -1
  195. package/dist/testing/fakeSelfieController.js +7 -0
  196. package/dist/testing/index.d.ts +1 -0
  197. package/dist/testing/index.d.ts.map +1 -1
  198. package/dist/testing/index.js +1 -0
  199. package/dist/theme/index.d.ts +10 -0
  200. package/dist/theme/index.d.ts.map +1 -1
  201. package/dist/useDocumentUpload.d.ts +63 -0
  202. package/dist/useDocumentUpload.d.ts.map +1 -0
  203. package/dist/useDocumentUpload.js +45 -0
  204. package/dist/useIdmissionClient.d.ts +29 -0
  205. package/dist/useIdmissionClient.d.ts.map +1 -0
  206. package/dist/useIdmissionClient.js +44 -0
  207. package/dist/utils/canvas.d.ts.map +1 -1
  208. package/dist/utils/canvas.js +41 -0
  209. package/dist/version.d.ts +1 -1
  210. package/dist/version.d.ts.map +1 -1
  211. package/dist/version.js +1 -1
  212. package/package.json +9 -7
@@ -1,7 +1,48 @@
1
+ /**
2
+ * Ceilings on a guide-overlay backing store.
3
+ *
4
+ * Both are SAFETY RAILS rather than quality settings. Every caller of this
5
+ * helper is a guide overlay — `DocumentCaptureGuideOverlay`,
6
+ * `IdCaptureFitGuide` and `BarcodeGuideOverlay` — which draw a flat scrim and
7
+ * some thin lines. None carries user-drawn content: `SignatureCaptureView`
8
+ * sizes its pad through its own state setter that happens to share this
9
+ * function's name, and pen strokes are exactly the content that would suffer
10
+ * from a lower resolution.
11
+ *
12
+ * `MAX_PIXEL_RATIO` — a scrim and a 3px bracket gain nothing above 2, and a
13
+ * phone at ratio 3 pays 2.25x the memory for it.
14
+ *
15
+ * `MAX_CANVAS_PIXELS` — a backstop for the requested SIZE running away, which
16
+ * is the failure that prompted this. The size comes from a ResizeObserver, and
17
+ * a pinch zoom on iOS can grow the observed element; the backing store then
18
+ * grows with the SQUARE of the zoom:
19
+ *
20
+ * 390x700 overlay at ratio 3 -> 9 MB unzoomed
21
+ * -> 37 MB at 2x
22
+ * -> 84 MB at 3x
23
+ *
24
+ * which is enough for iOS to kill the tab. It surfaces as the whole page hard-
25
+ * reloading the moment the applicant pinches to look at something — reported
26
+ * on document capture, and equally reachable on ID capture and barcode, which
27
+ * mount the same kind of full-surface observed canvas.
28
+ *
29
+ * Neither ceiling engages on a normal layout: a phone overlay wants 1.1 Mpx
30
+ * and a 1920x1080 desktop at ratio 2 wants 8.3 Mpx.
31
+ */
32
+ const MAX_PIXEL_RATIO = 2;
33
+ const MAX_CANVAS_PIXELS = 12_000_000;
1
34
  export function setCanvasDimensions(canvas, width, height) {
2
35
  let devicePixelRatio = 1;
3
36
  if (typeof window !== 'undefined')
4
37
  devicePixelRatio = window.devicePixelRatio;
38
+ devicePixelRatio = Math.min(devicePixelRatio, MAX_PIXEL_RATIO);
39
+ // Give way on RESOLUTION, never on the CSS box: the canvas has to keep
40
+ // covering the element it was measured from, or the mask stops reaching the
41
+ // edges it is masking.
42
+ const requested = width * height * devicePixelRatio * devicePixelRatio;
43
+ if (requested > MAX_CANVAS_PIXELS && width > 0 && height > 0) {
44
+ devicePixelRatio = Math.sqrt(MAX_CANVAS_PIXELS / (width * height));
45
+ }
5
46
  canvas.width = width * devicePixelRatio;
6
47
  canvas.height = height * devicePixelRatio;
7
48
  canvas.style.width = width + 'px';
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const webSdkUiVersion = "0.2.0-rc.2";
1
+ export declare const webSdkUiVersion = "0.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,UAAU,CAAA"}
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Extracted from the barrel so modules inside this package can read the
2
2
  // version without importing index.ts (which would be circular).
3
- export const webSdkUiVersion = '0.2.0-rc.2';
3
+ export const webSdkUiVersion = '0.5.0';
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@idmission/websdk-ui",
3
- "version": "0.2.0-rc.2",
3
+ "version": "0.5.0",
4
4
  "description": "React presentation layer for the IDmission Web SDK",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/Idmission-LLC/idmission-web-sdk-2.0.git",
8
+ "url": "https://github.com/idmission/websdk.git",
9
9
  "directory": "packages/websdk-ui"
10
10
  },
11
11
  "publishConfig": {
@@ -34,19 +34,20 @@
34
34
  "styled-components": "^6"
35
35
  },
36
36
  "dependencies": {
37
- "i18next": "^23.16.8",
38
- "i18next-browser-languagedetector": "^7.2.2",
39
- "ladda": "^2.0.3",
40
- "react-i18next": "^13.5.0",
37
+ "i18next": "^26.7.1",
38
+ "i18next-browser-languagedetector": "^8.3.0",
39
+ "react-i18next": "^17.1.11",
41
40
  "signature_pad": "^5.1.4",
42
41
  "thinking-orbs": "0.1.1",
43
- "@idmission/websdk-core": "0.2.0-rc.2"
42
+ "use-sync-external-store": "^1.6.0",
43
+ "@idmission/websdk-core": "0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@testing-library/react": "^16.3.0",
47
47
  "@types/node": "^20.19.39",
48
48
  "@types/react": "^19.2.14",
49
49
  "@types/react-dom": "^18.3.1",
50
+ "@types/use-sync-external-store": "^1.7.0",
50
51
  "global-jsdom": "^26.0.0",
51
52
  "jsdom": "^26.1.0",
52
53
  "react": "18.3.1",
@@ -61,6 +62,7 @@
61
62
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
62
63
  "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
63
64
  "check-readme": "mkdir -p .readme-check/node_modules/@idmission && ln -sfn ../../../.. .readme-check/node_modules/@idmission/websdk-ui && tsc --noEmit -p .readme-check/tsconfig.json",
65
+ "check-migration-guide": "node --test .migration-check/checkGuide.test.mjs && node .migration-check/checkGuide.mjs MIGRATION_FROM_COMPAT.md .migration-check/before .migration-check/after && tsc --noEmit -p .migration-check/tsconfig.json",
64
66
  "check-types": "tsc --noEmit",
65
67
  "lint": "eslint --max-warnings 0",
66
68
  "test": "node --import tsx --import ./test/setup.ts --test 'src/**/*.test.ts' 'src/**/*.test.tsx'"