idmission-web-sdk 2.5.64 → 2.5.65

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.
package/dist/index.d.ts CHANGED
@@ -4520,7 +4520,7 @@ declare global {
4520
4520
  var IDmissionSDK: IDmissionSDK;
4521
4521
  }
4522
4522
 
4523
- declare const webSdkVersion = "2.5.64";
4523
+ declare const webSdkVersion = "2.5.65";
4524
4524
 
4525
4525
  /**
4526
4526
  * sdk2's imperative handle on the video-signature capture screen
package/dist/props.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "GENERATED by scripts/propsManifest.mjs at build time. Each customer flow's props, read off dist/index.d.ts.",
3
3
  "schemaVersion": 1,
4
- "version": "2.5.64",
4
+ "version": "2.5.65",
5
5
  "components": {
6
6
  "IdValidation": {
7
7
  "description": "Render a fullscreen ID capture component that instructs the user to\nphotograph both sides of their ID card, or the full page of their passport.",
@@ -23197,6 +23197,19 @@ function reduceSelfieCapture(state, event) {
23197
23197
  error: null
23198
23198
  });
23199
23199
  }
23200
+ // The exit button: abandon the attempt and put the instructions back up.
23201
+ // 'captureStarted' accepts 'loading', so the overlay's continue starts a
23202
+ // fresh attempt from here.
23203
+ case 'exitRequested':
23204
+ {
23205
+ if (state.phase === 'initializing' || state.phase === 'loading') return state;
23206
+ return _extends({}, state, {
23207
+ phase: 'loading'
23208
+ }, clearedSelfieVerdict(), {
23209
+ capturedSelfie: null,
23210
+ error: null
23211
+ });
23212
+ }
23200
23213
  }
23201
23214
  }
23202
23215
  // The ladder's code, except that HOLD_STILL reads HAND_OVER_FACE while the
@@ -25506,6 +25519,37 @@ function createSelfieCaptureController(config) {
25506
25519
  return _doAttach.apply(this, arguments);
25507
25520
  }
25508
25521
  var cameraReacquisition = null;
25522
+ // sdk2's retry and exit both remount FaceLivenessCapture with a new `key`
25523
+ // (FaceLivenessWizard.tsx:394-409), which throws away that component's
25524
+ // whole reducer -- INCLUDING timesLivenessCheckFailed -- so the user gets a
25525
+ // fresh set of liveness attempts. Rebuilding the machine here is that
25526
+ // remount's equivalent; without it a retry from the lockout screen
25527
+ // re-entered capture with the failure budget still spent, and the next
25528
+ // failed check re-locked immediately.
25529
+ function resetLivenessAttempt() {
25530
+ clearTimer('liveness:reset');
25531
+ clearTimer('liveness:kickout');
25532
+ clearTimer('liveness:kickoutGrace');
25533
+ // The challenge runner and its tick are NOT reducer state, so the
25534
+ // setState below cannot reach them -- runLivenessEffects runs only from
25535
+ // dispatchLiveness. Leaving CHALLENGE otherwise left the discarded runner
25536
+ // ticking, still able to fire onChallengeComplete for an attempt the user
25537
+ // had abandoned.
25538
+ clearTimer('challenge:tick');
25539
+ challengeRunner = null;
25540
+ challengeResultConsumed = false;
25541
+ // Orphan any check still in flight: its verdict would otherwise land in
25542
+ // the machine built below (the reducer's livenessChecked case is
25543
+ // unguarded), and its single-flight latch would block the fresh attempt
25544
+ // from checking at all until it settled.
25545
+ livenessGeneration += 1;
25546
+ livenessCheckInFlight = false;
25547
+ internal.setState({
25548
+ liveness: createInitialLivenessMachineState(),
25549
+ challenge: null,
25550
+ livenessTimedOut: false
25551
+ });
25552
+ }
25509
25553
  // retry()'s capture re-entry, run straight away or once a released camera
25510
25554
  // is back.
25511
25555
  function resumeCapture() {
@@ -25839,37 +25883,7 @@ function createSelfieCaptureController(config) {
25839
25883
  },
25840
25884
  retry: function retry() {
25841
25885
  if (!active) return;
25842
- // sdk2's retry remounts FaceLivenessCapture with a new `key`
25843
- // (FaceLivenessWizard.tsx:402-409), which throws away that
25844
- // component's whole reducer -- INCLUDING timesLivenessCheckFailed --
25845
- // so the user gets a fresh set of liveness attempts. Rebuilding the
25846
- // machine here is that remount's equivalent; without it a retry from
25847
- // the lockout screen re-entered capture with the failure budget still
25848
- // spent, and the next failed check re-locked immediately.
25849
- if (config.liveness) {
25850
- clearTimer('liveness:reset');
25851
- clearTimer('liveness:kickout');
25852
- clearTimer('liveness:kickoutGrace');
25853
- // The challenge runner and its tick are NOT reducer state, so the
25854
- // setState below cannot reach them -- runLivenessEffects runs only
25855
- // from dispatchLiveness. Retrying out of CHALLENGE otherwise left
25856
- // the discarded runner ticking, still able to fire
25857
- // onChallengeComplete for an attempt the user had abandoned.
25858
- clearTimer('challenge:tick');
25859
- challengeRunner = null;
25860
- challengeResultConsumed = false;
25861
- // Orphan any check still in flight: its verdict would otherwise land
25862
- // in the machine built below (the reducer's livenessChecked case is
25863
- // unguarded), and its single-flight latch would block the fresh
25864
- // attempt from checking at all until it settled.
25865
- livenessGeneration += 1;
25866
- livenessCheckInFlight = false;
25867
- internal.setState({
25868
- liveness: createInitialLivenessMachineState(),
25869
- challenge: null,
25870
- livenessTimedOut: false
25871
- });
25872
- }
25886
+ if (config.liveness) resetLivenessAttempt();
25873
25887
  progress.retry('capture-error');
25874
25888
  dispatch({
25875
25889
  type: 'retryRequested'
@@ -25886,12 +25900,43 @@ function createSelfieCaptureController(config) {
25886
25900
  if (cameraReacquisition) return;
25887
25901
  var generation = attachGeneration;
25888
25902
  var reacquisition = requestCamera().then(function () {
25889
- if (active && generation === attachGeneration) resumeCapture();
25903
+ // exitCapture() may have sent the user back to the instructions
25904
+ // while the camera was coming back.
25905
+ if (active && generation === attachGeneration && internal.getState().phase === 'capturing') resumeCapture();
25890
25906
  })["catch"](function () {})["finally"](function () {
25891
25907
  // detach() may have dropped this one and a newer one started.
25892
25908
  if (cameraReacquisition === reacquisition) cameraReacquisition = null;
25893
25909
  });
25894
25910
  cameraReacquisition = reacquisition;
25911
+ },
25912
+ exitCapture: function exitCapture() {
25913
+ var _frameLoop9;
25914
+ if (!active) return;
25915
+ var _internal$getState = internal.getState(),
25916
+ phase = _internal$getState.phase;
25917
+ if (phase === 'initializing' || phase === 'loading') return;
25918
+ // Every armed timer belongs to the abandoned attempt.
25919
+ clearAllTimers();
25920
+ (_frameLoop9 = frameLoop) == null || _frameLoop9.stop();
25921
+ frameLoop = null;
25922
+ trackingOnly = false;
25923
+ initialDelayOver = false;
25924
+ busy = false;
25925
+ pendingFire = null;
25926
+ if (config.liveness) resetLivenessAttempt();
25927
+ progress.retry('user-requested');
25928
+ internal.setState({
25929
+ capturedAttempt: null,
25930
+ capturedImageUrl: null,
25931
+ captureRecovery: null
25932
+ });
25933
+ dispatch({
25934
+ type: 'exitRequested'
25935
+ });
25936
+ // The overlay waits on `camera.ready`, so a camera handed back by a
25937
+ // terminal screen has to come back for its continue to enable. A
25938
+ // failure lands in `error` (requestCamera's own write).
25939
+ if (cameraReleased && !cameraReacquisition) void requestCamera()["catch"](function () {});
25895
25940
  }
25896
25941
  }
25897
25942
  }, progressBinding);
@@ -27638,6 +27683,13 @@ function SelfieCaptureSurface(_ref) {
27638
27683
  void controller.actions.start();
27639
27684
  onLoadingOverlayDismissed == null || onLoadingOverlayDismissed();
27640
27685
  }, [controller, onLoadingOverlayDismissed]);
27686
+ // Back to the instructions BEFORE telling the host, as sdk2 did
27687
+ // (FaceLivenessWizard.tsx:394): handing `onExit` to the button raw left the
27688
+ // capture running behind a host that expected the loading screen.
27689
+ var handleExit = React.useCallback(function () {
27690
+ controller.actions.exitCapture();
27691
+ onExit == null || onExit();
27692
+ }, [controller, onExit]);
27641
27693
  // plan-3 ruling: camera-acquisition errors recover via requestCamera()
27642
27694
  // (retry() explicitly excludes them, controller.ts), everything else via
27643
27695
  // retry(). Applies unconditionally across every loadingOverlayMode.
@@ -27736,7 +27788,7 @@ function SelfieCaptureSurface(_ref) {
27736
27788
  children: [jsxRuntime.jsx("br", {}), state.handOverFace.lastCheck ? state.handOverFace.lastCheck.handOverFace ? '❌' : '✅' : '➖', ' ', "Hand Off Face (", state.handOverFace.status, state.handOverFace.lastCheck && ", last check " + state.handOverFace.lastCheck.coverage.toFixed(2) + " covered in " + Math.round(state.handOverFace.lastCheck.inferenceMs) + " ms", ")"]
27737
27789
  })]
27738
27790
  }), onExit != null && jsxRuntime.jsx(ExitCaptureButton, {
27739
- onClick: onExit,
27791
+ onClick: handleExit,
27740
27792
  className: classNames.exitBtn
27741
27793
  }), showLoadingOverlay && jsxRuntime.jsx(SelfieCaptureLoadingOverlay, {
27742
27794
  state: loadingOverlayState,
@@ -48046,7 +48098,7 @@ function mapCustomerIdAndBiometricsEnrollmentProps(props, ctx) {
48046
48098
  });
48047
48099
  }
48048
48100
 
48049
- var webSdkVersion = '2.5.64';
48101
+ var webSdkVersion = '2.5.65';
48050
48102
 
48051
48103
  var MAPPED = 'mapped';
48052
48104
  var NOOP = 'dropped-noop';