vesant-sdk 1.7.1-dev.afc5a32 → 1.7.1-dev.d2f7d80
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/react.js +17 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +17 -2
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -1017,9 +1017,14 @@ function retryTarget(hasHostedJourney) {
|
|
|
1017
1017
|
function modalMaxWidth(hasHostedJourney) {
|
|
1018
1018
|
return hasHostedJourney ? 680 : 448;
|
|
1019
1019
|
}
|
|
1020
|
+
function resultForModalClose(stageKind, result) {
|
|
1021
|
+
const terminal = stageKind === "accepted" || stageKind === "declined" || stageKind === "max_attempts";
|
|
1022
|
+
return terminal && result !== void 0 ? result : null;
|
|
1023
|
+
}
|
|
1020
1024
|
|
|
1021
1025
|
// src/kyc/FaceCaptureModal.tsx
|
|
1022
1026
|
var MOBILE_UA = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
1027
|
+
var ACCEPTED_AUTO_CLOSE_MS = 1200;
|
|
1023
1028
|
var LIVENESS_MESSAGES = [
|
|
1024
1029
|
"Position your face inside the oval",
|
|
1025
1030
|
"Make sure your face is well lit",
|
|
@@ -1316,12 +1321,22 @@ function FaceCaptureModal({
|
|
|
1316
1321
|
}, 3e3);
|
|
1317
1322
|
return () => clearInterval(interval);
|
|
1318
1323
|
}, [captureMode]);
|
|
1319
|
-
const close = (result) => {
|
|
1324
|
+
const close = useCallback((result) => {
|
|
1320
1325
|
cancelledRef.current = true;
|
|
1321
1326
|
if (result === null && onCancel) {
|
|
1322
1327
|
onCancel();
|
|
1323
1328
|
}
|
|
1324
1329
|
onComplete(result);
|
|
1330
|
+
}, [onCancel, onComplete]);
|
|
1331
|
+
useEffect(() => {
|
|
1332
|
+
if (stage.kind !== "accepted") return;
|
|
1333
|
+
const result = stage.result;
|
|
1334
|
+
const timer = setTimeout(() => close(result), ACCEPTED_AUTO_CLOSE_MS);
|
|
1335
|
+
return () => clearTimeout(timer);
|
|
1336
|
+
}, [close, stage]);
|
|
1337
|
+
const handleHeaderClose = () => {
|
|
1338
|
+
const result = "result" in stage ? stage.result : void 0;
|
|
1339
|
+
close(resultForModalClose(stage.kind, result));
|
|
1325
1340
|
};
|
|
1326
1341
|
const renderChoose = () => /* @__PURE__ */ React.createElement("div", { style: contentStyle }, /* @__PURE__ */ React.createElement("div", { style: visualGuideContainerStyle }, /* @__PURE__ */ React.createElement("div", { style: visualGuideStyle }, /* @__PURE__ */ React.createElement("div", { style: circleStyle }, /* @__PURE__ */ React.createElement("img", { src: Camera, alt: "", width: 48, height: 48 })))), /* @__PURE__ */ React.createElement("p", { style: subtitleStyle }, "How would you like to verify?"), /* @__PURE__ */ React.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React.createElement(
|
|
1327
1342
|
"button",
|
|
@@ -1427,7 +1442,7 @@ function FaceCaptureModal({
|
|
|
1427
1442
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, keyframes), /* @__PURE__ */ React.createElement("div", { style: overlayStyle }, /* @__PURE__ */ React.createElement("div", { style: { ...modalStyle, maxWidth: modalMaxWidth(journeyMode) } }, /* @__PURE__ */ React.createElement("div", { style: headerStyle }, /* @__PURE__ */ React.createElement(
|
|
1428
1443
|
"button",
|
|
1429
1444
|
{
|
|
1430
|
-
onClick:
|
|
1445
|
+
onClick: handleHeaderClose,
|
|
1431
1446
|
style: closeButtonStyle,
|
|
1432
1447
|
"aria-label": "Close"
|
|
1433
1448
|
},
|