vesant-sdk 1.7.1-dev.beb21ab → 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 +21 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +21 -4
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -1014,9 +1014,17 @@ function releaseOperation(guard) {
|
|
|
1014
1014
|
function retryTarget(hasHostedJourney) {
|
|
1015
1015
|
return hasHostedJourney ? "journey" : "capture";
|
|
1016
1016
|
}
|
|
1017
|
+
function modalMaxWidth(hasHostedJourney) {
|
|
1018
|
+
return hasHostedJourney ? 680 : 448;
|
|
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
|
+
}
|
|
1017
1024
|
|
|
1018
1025
|
// src/kyc/FaceCaptureModal.tsx
|
|
1019
1026
|
var MOBILE_UA = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
1027
|
+
var ACCEPTED_AUTO_CLOSE_MS = 1200;
|
|
1020
1028
|
var LIVENESS_MESSAGES = [
|
|
1021
1029
|
"Position your face inside the oval",
|
|
1022
1030
|
"Make sure your face is well lit",
|
|
@@ -1313,12 +1321,22 @@ function FaceCaptureModal({
|
|
|
1313
1321
|
}, 3e3);
|
|
1314
1322
|
return () => clearInterval(interval);
|
|
1315
1323
|
}, [captureMode]);
|
|
1316
|
-
const close = (result) => {
|
|
1324
|
+
const close = useCallback((result) => {
|
|
1317
1325
|
cancelledRef.current = true;
|
|
1318
1326
|
if (result === null && onCancel) {
|
|
1319
1327
|
onCancel();
|
|
1320
1328
|
}
|
|
1321
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));
|
|
1322
1340
|
};
|
|
1323
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(
|
|
1324
1342
|
"button",
|
|
@@ -1421,10 +1439,10 @@ function FaceCaptureModal({
|
|
|
1421
1439
|
return renderError(stage.message);
|
|
1422
1440
|
}
|
|
1423
1441
|
})();
|
|
1424
|
-
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 }, /* @__PURE__ */ React.createElement("div", { style: headerStyle }, /* @__PURE__ */ React.createElement(
|
|
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(
|
|
1425
1443
|
"button",
|
|
1426
1444
|
{
|
|
1427
|
-
onClick:
|
|
1445
|
+
onClick: handleHeaderClose,
|
|
1428
1446
|
style: closeButtonStyle,
|
|
1429
1447
|
"aria-label": "Close"
|
|
1430
1448
|
},
|
|
@@ -1454,7 +1472,6 @@ var modalStyle = {
|
|
|
1454
1472
|
borderRadius: 16,
|
|
1455
1473
|
boxShadow: "0 25px 50px -12px rgba(0,0,0,.25)",
|
|
1456
1474
|
width: "100%",
|
|
1457
|
-
maxWidth: 448,
|
|
1458
1475
|
maxHeight: "calc(100vh - 32px)",
|
|
1459
1476
|
overflowY: "auto",
|
|
1460
1477
|
animation: "zoomIn .2s ease-out"
|