@idmission/websdk-ui 0.1.0-rc.1 → 0.1.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/IdCaptureView.d.ts +38 -1
  2. package/dist/IdCaptureView.d.ts.map +1 -1
  3. package/dist/IdCaptureView.js +3 -3
  4. package/dist/SignatureCaptureView.d.ts +9 -5
  5. package/dist/SignatureCaptureView.d.ts.map +1 -1
  6. package/dist/SignatureCaptureView.js +51 -28
  7. package/dist/components/GuidanceMessage.d.ts +25 -1
  8. package/dist/components/GuidanceMessage.d.ts.map +1 -1
  9. package/dist/components/GuidanceMessage.js +37 -0
  10. package/dist/components/error/CameraAccessDeniedOverlay.d.ts +12 -1
  11. package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
  12. package/dist/components/error/CameraAccessDeniedOverlay.js +15 -2
  13. package/dist/components/error/ErrorScreen.d.ts.map +1 -1
  14. package/dist/components/error/ErrorScreen.js +72 -57
  15. package/dist/components/guides/IdCaptureFitGuide.d.ts +13 -1
  16. package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
  17. package/dist/components/guides/IdCaptureFitGuide.js +27 -11
  18. package/dist/components/guides/IdCaptureGuides.d.ts +8 -1
  19. package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
  20. package/dist/components/guides/IdCaptureGuides.js +2 -2
  21. package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
  22. package/dist/flows/DocumentCaptureFlow.js +2 -0
  23. package/dist/flows/SignatureKYCFlow.d.ts +19 -1
  24. package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
  25. package/dist/flows/SignatureKYCFlow.js +30 -0
  26. package/dist/flows/documentCapture.d.ts.map +1 -1
  27. package/dist/flows/documentCapture.js +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/layout/GuideLayoutContext.d.ts +11 -0
  31. package/dist/layout/GuideLayoutContext.d.ts.map +1 -1
  32. package/dist/layout/GuideLayoutContext.js +24 -3
  33. package/dist/testing/stubSignatureCanvas.d.ts.map +1 -1
  34. package/dist/testing/stubSignatureCanvas.js +3 -4
  35. package/dist/version.d.ts +1 -1
  36. package/dist/version.js +1 -1
  37. package/package.json +5 -8
  38. package/dist/utils/signaturePadStrokeGuard.d.ts +0 -16
  39. package/dist/utils/signaturePadStrokeGuard.d.ts.map +0 -1
  40. package/dist/utils/signaturePadStrokeGuard.js +0 -70
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.1.0-rc.1';
3
+ export const webSdkUiVersion = '0.1.0-rc.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idmission/websdk-ui",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.2",
4
4
  "description": "React presentation layer for the IDmission Web SDK",
5
5
  "private": false,
6
6
  "repository": {
@@ -38,18 +38,15 @@
38
38
  "i18next-browser-languagedetector": "^7.2.2",
39
39
  "ladda": "^2.0.3",
40
40
  "react-i18next": "^13.5.0",
41
- "react-signature-canvas": "1.0.7",
42
- "signature_pad": "2.3.2",
41
+ "signature_pad": "^5.1.4",
43
42
  "thinking-orbs": "0.1.1",
44
- "@idmission/websdk-core": "0.1.0-rc.1"
43
+ "@idmission/websdk-core": "0.1.0-rc.2"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@testing-library/react": "^16.3.0",
48
47
  "@types/node": "^20.19.39",
49
48
  "@types/react": "^19.2.14",
50
49
  "@types/react-dom": "^18.3.1",
51
- "@types/react-signature-canvas": "^1.0.7",
52
- "@types/signature_pad": "^2.3.0",
53
50
  "global-jsdom": "^26.0.0",
54
51
  "jsdom": "^26.1.0",
55
52
  "react": "18.3.1",
@@ -57,8 +54,8 @@
57
54
  "styled-components": "^6.4.1",
58
55
  "tsx": "^4.20.0",
59
56
  "typescript": "^5.9.3",
60
- "@idmission/typescript-config": "1.0.0",
61
- "@idmission/eslint-config": "1.0.0"
57
+ "@idmission/eslint-config": "1.0.0",
58
+ "@idmission/typescript-config": "1.0.0"
62
59
  },
63
60
  "scripts": {
64
61
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
@@ -1,16 +0,0 @@
1
- /**
2
- * Guards the pad behind a mounted react-signature-canvas.
3
- *
4
- * The module-load patch above covers every pad on its own. This only re-checks
5
- * the live instance, because a bundler is free to hand react-signature-canvas a
6
- * different copy of signature_pad than the one imported here — its CommonJS
7
- * build against this ES module — in which case the two prototypes are different
8
- * objects and the patch above missed.
9
- */
10
- export declare function guardSignaturePadStrokes(canvas: SignatureCanvasLike): void;
11
- /** Structural stand-in for a react-signature-canvas instance. */
12
- type SignatureCanvasLike = {
13
- getSignaturePad(): unknown;
14
- } | null;
15
- export {};
16
- //# sourceMappingURL=signaturePadStrokeGuard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signaturePadStrokeGuard.d.ts","sourceRoot":"","sources":["../../src/utils/signaturePadStrokeGuard.ts"],"names":[],"mappings":"AA4CA;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAK1E;AAED,iEAAiE;AACjE,KAAK,mBAAmB,GAAG;IAAE,eAAe,IAAI,OAAO,CAAA;CAAE,GAAG,IAAI,CAAA"}
@@ -1,70 +0,0 @@
1
- import SignaturePad from 'signature_pad';
2
- /**
3
- * Backports the signature_pad v4 "open a stroke on demand" guard onto the v2
4
- * pad that react-signature-canvas builds for us.
5
- *
6
- * signature_pad@2.3.2 — pinned by the unmaintained react-signature-canvas@1.0.7
7
- * — only opens a stroke when a gesture starts as a single touch on the canvas,
8
- * but moves and lifts run unconditionally:
9
- *
10
- * _handleTouchStart: if (event.targetTouches.length === 1) self._strokeBegin(touch)
11
- * _handleTouchMove: self._strokeMoveUpdate(event.targetTouches[0])
12
- * _handleTouchEnd: self._strokeEnd(event)
13
- *
14
- * `_strokeBegin` is the only thing that pushes a stroke onto `_data`, so any
15
- * gesture that does not start that way — a second finger or a palm landing with
16
- * the first, a pinch, or Clear being tapped while a finger is still down —
17
- * leaves `_data` empty, and every following move throws:
18
- *
19
- * TypeError: undefined is not an object
20
- * (evaluating 'this._data[this._data.length-1].push')
21
- *
22
- * The throw lands *after* `_drawCurve`, which is what makes it more than noise:
23
- * the ink is painted but never recorded. `onBegin` never fires, `toData()` stays
24
- * empty, and the user is left looking at a signature the pad will not accept.
25
- * `_strokeEnd` then throws on the same empty `_data` when they lift, because the
26
- * points the failed moves accumulated are still there.
27
- *
28
- * v4 fixed this at the source (`if (this._data.length === 0) { this._strokeBegin(event); return }`),
29
- * so this applies the same rule: a move with no open stroke opens one. That also
30
- * settles the lift, which can only reach an empty `_data` by way of a move that
31
- * did not open a stroke.
32
- */
33
- const guarded = Symbol.for('idmission.websdk.signaturePadStrokeGuard');
34
- // Patched at module load, which is the whole trick: a pad snapshots
35
- // `SignaturePad.prototype._strokeUpdate` into its throttle closure when it is
36
- // constructed, so guarding after the fact leaves that pad's throttled moves
37
- // running the original. That gap is reachable — tap Clear mid-stroke and the
38
- // trailing call the throttle already queued lands on an emptied `_data`. This
39
- // module is imported by the view, so it runs long before any pad is built.
40
- guardStrokeUpdate(SignaturePad.prototype);
41
- /**
42
- * Guards the pad behind a mounted react-signature-canvas.
43
- *
44
- * The module-load patch above covers every pad on its own. This only re-checks
45
- * the live instance, because a bundler is free to hand react-signature-canvas a
46
- * different copy of signature_pad than the one imported here — its CommonJS
47
- * build against this ES module — in which case the two prototypes are different
48
- * objects and the patch above missed.
49
- */
50
- export function guardSignaturePadStrokes(canvas) {
51
- if (!canvas)
52
- return;
53
- const pad = canvas.getSignaturePad();
54
- guardStrokeUpdate(Object.getPrototypeOf(pad));
55
- }
56
- function guardStrokeUpdate(prototype) {
57
- if (prototype[guarded])
58
- return;
59
- const strokeUpdate = prototype._strokeUpdate;
60
- prototype._strokeUpdate = function (event) {
61
- if (this._data.length === 0) {
62
- // `_strokeBegin` pushes the stroke and then calls back into this method,
63
- // which takes the normal path because `_data` is no longer empty.
64
- this._strokeBegin(event);
65
- return;
66
- }
67
- strokeUpdate.call(this, event);
68
- };
69
- Object.defineProperty(prototype, guarded, { value: true });
70
- }