idmission-web-sdk 2.6.1-changeset-release-develop-a09dd14 → 2.6.1-changeset-release-develop-3d44875
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 +19 -4
- package/dist/props.json +21 -21
- package/dist/sdk2.cjs.development.js +67 -58
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +67 -58
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +67 -58
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/package.json +1 -1
|
@@ -20364,7 +20364,7 @@
|
|
|
20364
20364
|
});
|
|
20365
20365
|
case 8:
|
|
20366
20366
|
if (stream) {
|
|
20367
|
-
_context.next =
|
|
20367
|
+
_context.next = 13;
|
|
20368
20368
|
break;
|
|
20369
20369
|
}
|
|
20370
20370
|
_context.prev = 9;
|
|
@@ -20378,21 +20378,26 @@
|
|
|
20378
20378
|
debug$1(LOG_TAG + " opened fallback stream", {
|
|
20379
20379
|
maxVideoResolution: maxVideoResolution
|
|
20380
20380
|
});
|
|
20381
|
-
_context.next =
|
|
20381
|
+
_context.next = 13;
|
|
20382
20382
|
break;
|
|
20383
20383
|
case 11:
|
|
20384
20384
|
_context.prev = 11;
|
|
20385
20385
|
_t2 = _context["catch"](9);
|
|
20386
|
-
|
|
20387
|
-
|
|
20386
|
+
if (!(_t2.name === 'NotAllowedError')) {
|
|
20387
|
+
_context.next = 12;
|
|
20388
|
+
break;
|
|
20389
|
+
}
|
|
20390
|
+
throw _t2;
|
|
20388
20391
|
case 12:
|
|
20392
|
+
debug$1(LOG_TAG + " cannot open stream at all", _t2);
|
|
20393
|
+
case 13:
|
|
20389
20394
|
if (stream) {
|
|
20390
|
-
_context.next =
|
|
20395
|
+
_context.next = 14;
|
|
20391
20396
|
break;
|
|
20392
20397
|
}
|
|
20393
20398
|
error$1(LOG_TAG + " failed to open camera");
|
|
20394
20399
|
throw new Error('failed to open camera: ');
|
|
20395
|
-
case
|
|
20400
|
+
case 14:
|
|
20396
20401
|
debug$1(LOG_TAG + " camera access requested with constraints", constraints);
|
|
20397
20402
|
handleStreamEnded = function handleStreamEnded() {
|
|
20398
20403
|
// cameraStore.tsx:303-326 — sdk2 branches on whether a continuity
|
|
@@ -20415,7 +20420,7 @@
|
|
|
20415
20420
|
handleStreamEnded();
|
|
20416
20421
|
};
|
|
20417
20422
|
camera = obtainCameraAccess(stream, selectedCamera.label, videoEl);
|
|
20418
|
-
_context.next =
|
|
20423
|
+
_context.next = 15;
|
|
20419
20424
|
return new Promise(function (resolve) {
|
|
20420
20425
|
scheduleTimeout(function () {
|
|
20421
20426
|
// iOS 17 has a strange behavior where the video track flickers
|
|
@@ -20431,7 +20436,7 @@
|
|
|
20431
20436
|
resolve();
|
|
20432
20437
|
}, 500);
|
|
20433
20438
|
});
|
|
20434
|
-
case
|
|
20439
|
+
case 15:
|
|
20435
20440
|
isRearFacing = (_camera$isRearFacing = camera == null ? void 0 : camera.isRearFacing) != null ? _camera$isRearFacing : false;
|
|
20436
20441
|
return _context.abrupt("return", {
|
|
20437
20442
|
camera: camera,
|
|
@@ -20441,18 +20446,18 @@
|
|
|
20441
20446
|
return camera.release();
|
|
20442
20447
|
}
|
|
20443
20448
|
});
|
|
20444
|
-
case
|
|
20445
|
-
_context.prev =
|
|
20449
|
+
case 16:
|
|
20450
|
+
_context.prev = 16;
|
|
20446
20451
|
_t3 = _context["catch"](2);
|
|
20447
20452
|
if (!(_t3 instanceof CaptureAttachError)) {
|
|
20448
|
-
_context.next =
|
|
20453
|
+
_context.next = 17;
|
|
20449
20454
|
break;
|
|
20450
20455
|
}
|
|
20451
20456
|
throw _t3;
|
|
20452
|
-
case
|
|
20457
|
+
case 17:
|
|
20453
20458
|
err = _t3;
|
|
20454
20459
|
if (!(err.name === 'NotAllowedError')) {
|
|
20455
|
-
_context.next =
|
|
20460
|
+
_context.next = 18;
|
|
20456
20461
|
break;
|
|
20457
20462
|
}
|
|
20458
20463
|
// cameraStore.tsx:374-381 — outer catch's "blocked by the user" path.
|
|
@@ -20463,9 +20468,9 @@
|
|
|
20463
20468
|
code: 'CAMERA_PERMISSION_DENIED',
|
|
20464
20469
|
recoverable: true
|
|
20465
20470
|
});
|
|
20466
|
-
case
|
|
20471
|
+
case 18:
|
|
20467
20472
|
if (!((_err$message = err.message) != null && _err$message.includes('failed to open camera') || (_err$message2 = err.message) != null && _err$message2.includes('Could not start video source'))) {
|
|
20468
|
-
_context.next =
|
|
20473
|
+
_context.next = 19;
|
|
20469
20474
|
break;
|
|
20470
20475
|
}
|
|
20471
20476
|
error$1(LOG_TAG + " camera access encountered some other error", _t3);
|
|
@@ -20474,16 +20479,16 @@
|
|
|
20474
20479
|
recoverable: true,
|
|
20475
20480
|
cause: _t3
|
|
20476
20481
|
});
|
|
20477
|
-
case
|
|
20482
|
+
case 19:
|
|
20478
20483
|
// cameraStore.tsx:382-385 — genuinely unexpected error; sdk2 rethrows it
|
|
20479
20484
|
// as-is (no CaptureError bucket exists for it), so we do too.
|
|
20480
20485
|
error$1(LOG_TAG + " camera access encountered some other error", _t3);
|
|
20481
20486
|
throw _t3;
|
|
20482
|
-
case
|
|
20487
|
+
case 20:
|
|
20483
20488
|
case "end":
|
|
20484
20489
|
return _context.stop();
|
|
20485
20490
|
}
|
|
20486
|
-
}, _callee, null, [[2,
|
|
20491
|
+
}, _callee, null, [[2, 16], [5, 7], [9, 11]]);
|
|
20487
20492
|
}));
|
|
20488
20493
|
return _acquireCamera.apply(this, arguments);
|
|
20489
20494
|
}
|
|
@@ -24915,6 +24920,34 @@
|
|
|
24915
24920
|
var Heading$8 = styled.h1(_templateObject2$w || (_templateObject2$w = _taggedTemplateLiteralLoose(["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1rem;\n"])));
|
|
24916
24921
|
var Description$2 = styled.p(_templateObject3$n || (_templateObject3$n = _taggedTemplateLiteralLoose(["\n line-height: 1.5;\n margin-bottom: 1.5rem;\n"])));
|
|
24917
24922
|
|
|
24923
|
+
function reasonFor(code) {
|
|
24924
|
+
if (code === 'CAMERA_PERMISSION_DENIED') return 'permissionDenied';
|
|
24925
|
+
if (code === 'CAMERA_UNAVAILABLE') return 'unavailable';
|
|
24926
|
+
return undefined;
|
|
24927
|
+
}
|
|
24928
|
+
/**
|
|
24929
|
+
* Calls `onCameraAccessDenied` once per camera failure a controller reports:
|
|
24930
|
+
* when its error code becomes one, changes to the other, or a different
|
|
24931
|
+
* controller reports one. Not per render, and not again when StrictMode
|
|
24932
|
+
* replays effects, since the latch only moves when what it saw changes. A
|
|
24933
|
+
* failure seen with no handler bound is not latched, so a handler bound later
|
|
24934
|
+
* still hears about it; one already reported stays latched while the handler
|
|
24935
|
+
* is briefly unbound.
|
|
24936
|
+
*/
|
|
24937
|
+
function useCameraAccessDeniedReport(controller, errorCode, onCameraAccessDenied) {
|
|
24938
|
+
var reason = reasonFor(errorCode);
|
|
24939
|
+
var reportedRef = React.useRef(undefined);
|
|
24940
|
+
React.useEffect(function () {
|
|
24941
|
+
var reported = reportedRef.current;
|
|
24942
|
+
var alreadyReported = (reported == null ? void 0 : reported.controller) === controller && reported.reason === reason;
|
|
24943
|
+
reportedRef.current = {
|
|
24944
|
+
controller: controller,
|
|
24945
|
+
reason: onCameraAccessDenied || alreadyReported ? reason : undefined
|
|
24946
|
+
};
|
|
24947
|
+
if (reason && onCameraAccessDenied && !alreadyReported) onCameraAccessDenied(reason);
|
|
24948
|
+
}, [controller, reason, onCameraAccessDenied]);
|
|
24949
|
+
}
|
|
24950
|
+
|
|
24918
24951
|
// The one file-read both fallback screens use.
|
|
24919
24952
|
//
|
|
24920
24953
|
// Shared rather than duplicated: they read the same kind of file for the same
|
|
@@ -25743,7 +25776,6 @@
|
|
|
25743
25776
|
var pendingPrecapturedRef = React.useRef(new Set());
|
|
25744
25777
|
var seenPrecapturedRef = React.useRef(new Set());
|
|
25745
25778
|
var tamperReportedRef = React.useRef(false);
|
|
25746
|
-
var cameraDeniedReportedRef = React.useRef(false);
|
|
25747
25779
|
var reportedModelErrorRef = React.useRef(null);
|
|
25748
25780
|
// A new controller is a new session, so every notification latch below has
|
|
25749
25781
|
// to start over — the same reasoning as the attach and overlay-dismissal
|
|
@@ -25761,7 +25793,6 @@
|
|
|
25761
25793
|
pendingPrecapturedRef.current = new Set();
|
|
25762
25794
|
seenPrecapturedRef.current = new Set();
|
|
25763
25795
|
tamperReportedRef.current = false;
|
|
25764
|
-
cameraDeniedReportedRef.current = false;
|
|
25765
25796
|
reportedModelErrorRef.current = null;
|
|
25766
25797
|
}, [controller]);
|
|
25767
25798
|
React.useEffect(function () {
|
|
@@ -25813,16 +25844,7 @@
|
|
|
25813
25844
|
// controller's typed error, which is where core lands a denied camera and a
|
|
25814
25845
|
// failed model load alike (dual-truth contract: the same failure is already
|
|
25815
25846
|
// on screen, so these are notifications, not the error UI).
|
|
25816
|
-
|
|
25817
|
-
React.useEffect(function () {
|
|
25818
|
-
if (!cameraDenied) {
|
|
25819
|
-
cameraDeniedReportedRef.current = false;
|
|
25820
|
-
return;
|
|
25821
|
-
}
|
|
25822
|
-
if (cameraDeniedReportedRef.current) return;
|
|
25823
|
-
cameraDeniedReportedRef.current = true;
|
|
25824
|
-
onCameraAccessDenied == null || onCameraAccessDenied();
|
|
25825
|
-
}, [controller, cameraDenied, onCameraAccessDenied]);
|
|
25847
|
+
useCameraAccessDeniedReport(controller, (_state$error2 = state.error) == null ? void 0 : _state$error2.code, onCameraAccessDenied);
|
|
25826
25848
|
// Keyed on the ERROR OBJECT's identity, not on its cause: a MODEL_LOAD_FAILED
|
|
25827
25849
|
// with no cause attached is still a model failure the host asked to hear
|
|
25828
25850
|
// about, and keying on the cause skipped those entirely. A second, different
|
|
@@ -31444,7 +31466,7 @@
|
|
|
31444
31466
|
|
|
31445
31467
|
var _templateObject$q, _templateObject2$n;
|
|
31446
31468
|
function SelfieCaptureSurface(_ref) {
|
|
31447
|
-
var _state$error, _state$error2, _state$captureRecover, _state$error5, _state$captureRecover2, _state$prediction, _state$prediction$sam, _state$prediction2, _state$prediction3, _state$prediction4, _state$prediction5, _state$prediction6, _state$prediction7, _state$prediction8, _state$prediction9, _state$prediction0, _state$prediction1, _state$prediction$bri, _state$prediction10, _state$prediction$ran, _state$prediction11, _state$prediction$var, _state$prediction12, _assets$loadingOverla, _classNames$loadingOv, _colors$loadingOverla, _verbiage$loadingOver;
|
|
31469
|
+
var _state$error, _state$error2, _state$captureRecover, _state$error4, _state$error5, _state$captureRecover2, _state$prediction, _state$prediction$sam, _state$prediction2, _state$prediction3, _state$prediction4, _state$prediction5, _state$prediction6, _state$prediction7, _state$prediction8, _state$prediction9, _state$prediction0, _state$prediction1, _state$prediction$bri, _state$prediction10, _state$prediction$ran, _state$prediction11, _state$prediction$var, _state$prediction12, _assets$loadingOverla, _classNames$loadingOv, _colors$loadingOverla, _verbiage$loadingOver;
|
|
31448
31470
|
var controller = _ref.controller,
|
|
31449
31471
|
state = _ref.state,
|
|
31450
31472
|
loadingOverlayMode = _ref.loadingOverlayMode,
|
|
@@ -31626,10 +31648,9 @@
|
|
|
31626
31648
|
kind: 'no-prompt'
|
|
31627
31649
|
});
|
|
31628
31650
|
var reportedModelErrorRef = React.useRef(null);
|
|
31629
|
-
var cameraDeniedReportedRef = React.useRef(false);
|
|
31630
31651
|
var tamperReportedRef = React.useRef(false);
|
|
31631
31652
|
React.useEffect(function () {
|
|
31632
|
-
var _state$error3
|
|
31653
|
+
var _state$error3;
|
|
31633
31654
|
var modelError = state.models.error;
|
|
31634
31655
|
if (modelError && modelError !== reportedModelErrorRef.current) {
|
|
31635
31656
|
reportedModelErrorRef.current = modelError;
|
|
@@ -31637,21 +31658,16 @@
|
|
|
31637
31658
|
onModelError == null || onModelError(modelError);
|
|
31638
31659
|
}
|
|
31639
31660
|
if (!modelError) reportedModelErrorRef.current = null;
|
|
31640
|
-
var cameraDenied = ((_state$error3 = state.error) == null ? void 0 : _state$error3.code) === 'CAMERA_PERMISSION_DENIED';
|
|
31641
|
-
if (cameraDenied && !cameraDeniedReportedRef.current) {
|
|
31642
|
-
cameraDeniedReportedRef.current = true;
|
|
31643
|
-
onCameraAccessDenied == null || onCameraAccessDenied();
|
|
31644
|
-
}
|
|
31645
|
-
if (!cameraDenied) cameraDeniedReportedRef.current = false;
|
|
31646
31661
|
// Same one-shot latch as IdCaptureView's: the host counts detections, not
|
|
31647
31662
|
// renders, and a cleared-then-re-detected tamper is a second detection.
|
|
31648
|
-
var tampered = ((_state$
|
|
31663
|
+
var tampered = ((_state$error3 = state.error) == null ? void 0 : _state$error3.code) === 'CAMERA_TAMPERING_SUSPECTED';
|
|
31649
31664
|
if (tampered && !tamperReportedRef.current) {
|
|
31650
31665
|
tamperReportedRef.current = true;
|
|
31651
31666
|
onCameraTamperingDetected == null || onCameraTamperingDetected();
|
|
31652
31667
|
}
|
|
31653
31668
|
if (!tampered) tamperReportedRef.current = false;
|
|
31654
|
-
}, [
|
|
31669
|
+
}, [onCameraTamperingDetected, onLoadingFailed, onModelError, (_state$error4 = state.error) == null ? void 0 : _state$error4.code, state.models.error]);
|
|
31670
|
+
useCameraAccessDeniedReport(controller, (_state$error5 = state.error) == null ? void 0 : _state$error5.code, onCameraAccessDenied);
|
|
31655
31671
|
var handleLoadingContinue = React.useCallback(function () {
|
|
31656
31672
|
void controller.actions.start();
|
|
31657
31673
|
onLoadingOverlayDismissed == null || onLoadingOverlayDismissed();
|
|
@@ -41201,7 +41217,7 @@
|
|
|
41201
41217
|
});
|
|
41202
41218
|
}
|
|
41203
41219
|
function DocumentCaptureSurface(_ref) {
|
|
41204
|
-
var _entry$contentUrl, _entry$uploadState, _uiDocument$cameraFee, _entry$item$aspectRat, _uiDocument$instructi, _entry$item$title, _theme$documentCaptur, _theme$documentCaptur2, _state$autoCaptureShu, _state$autoCaptureShu2, _state$autoCaptureShu3, _state$autoCapture, _theme$documentCaptur3, _theme$documentCaptur4, _theme$colors$positiv, _theme$colors, _entry$item$title2, _entry$captureMetadat, _entry$captureMetadat2, _opaqueColor, _state$error, _state$error2, _guideRect$x, _guideRect$y, _guideRect$width, _guideRect$height, _state$autoCapture$gu, _state$autoCapture2;
|
|
41220
|
+
var _entry$contentUrl, _entry$uploadState, _uiDocument$cameraFee, _entry$item$aspectRat, _uiDocument$instructi, _entry$item$title, _theme$documentCaptur, _theme$documentCaptur2, _state$autoCaptureShu, _state$autoCaptureShu2, _state$autoCaptureShu3, _state$autoCapture, _theme$documentCaptur3, _theme$documentCaptur4, _theme$colors$positiv, _theme$colors, _entry$item$title2, _entry$captureMetadat, _entry$captureMetadat2, _opaqueColor, _state$error, _state$error2, _state$error3, _state$error4, _guideRect$x, _guideRect$y, _guideRect$width, _guideRect$height, _state$autoCapture$gu, _state$autoCapture2;
|
|
41205
41221
|
var controller = _ref.controller,
|
|
41206
41222
|
_ref$lang = _ref.lang,
|
|
41207
41223
|
lang = _ref$lang === void 0 ? 'auto' : _ref$lang,
|
|
@@ -41430,20 +41446,13 @@
|
|
|
41430
41446
|
completedRef.current = true;
|
|
41431
41447
|
onCompleted == null || onCompleted();
|
|
41432
41448
|
}, [everyUploaded, onCompleted]);
|
|
41433
|
-
|
|
41434
|
-
|
|
41435
|
-
|
|
41436
|
-
|
|
41437
|
-
|
|
41438
|
-
|
|
41439
|
-
|
|
41440
|
-
deniedReportedRef.current = false;
|
|
41441
|
-
return;
|
|
41442
|
-
}
|
|
41443
|
-
if (deniedReportedRef.current) return;
|
|
41444
|
-
deniedReportedRef.current = true;
|
|
41445
|
-
onCameraAccessDenied == null || onCameraAccessDenied();
|
|
41446
|
-
}, [cameraAccessDenied, onCameraAccessDenied]);
|
|
41449
|
+
// Either camera failure leaves the capture button stuck on "Loading", so
|
|
41450
|
+
// both get the retry button.
|
|
41451
|
+
var cameraFailed = ((_state$error = state.error) == null ? void 0 : _state$error.code) === 'CAMERA_PERMISSION_DENIED' || ((_state$error2 = state.error) == null ? void 0 : _state$error2.code) === 'CAMERA_UNAVAILABLE';
|
|
41452
|
+
var cameraTampered = ((_state$error3 = state.error) == null ? void 0 : _state$error3.code) === 'CAMERA_TAMPERING_SUSPECTED';
|
|
41453
|
+
// Latched like the completion effect above: a notification per camera
|
|
41454
|
+
// failure or detection, not per render.
|
|
41455
|
+
useCameraAccessDeniedReport(controller, (_state$error4 = state.error) == null ? void 0 : _state$error4.code, onCameraAccessDenied);
|
|
41447
41456
|
var tamperReportedRef = React.useRef(false);
|
|
41448
41457
|
React.useEffect(function () {
|
|
41449
41458
|
if (!cameraTampered) {
|
|
@@ -41589,7 +41598,7 @@
|
|
|
41589
41598
|
finished: true,
|
|
41590
41599
|
onClick: onExitAfterTamperSealPopped,
|
|
41591
41600
|
children: verbiage.exitBtnText
|
|
41592
|
-
}) : null :
|
|
41601
|
+
}) : null : cameraFailed ? jsx(LoaderButton, {
|
|
41593
41602
|
className: classNames.retryCameraAccessBtn,
|
|
41594
41603
|
variant: "negative",
|
|
41595
41604
|
finished: true,
|
|
@@ -54137,7 +54146,7 @@
|
|
|
54137
54146
|
});
|
|
54138
54147
|
}
|
|
54139
54148
|
|
|
54140
|
-
var webSdkVersion = '2.6.1-changeset-release-develop-
|
|
54149
|
+
var webSdkVersion = '2.6.1-changeset-release-develop-3d44875';
|
|
54141
54150
|
|
|
54142
54151
|
// GENERATED by scripts/styleBagTypes.mjs from
|
|
54143
54152
|
// src/__fixtures__/sdk2StyleBags.json and the mapper sweep — do not
|