idmission-web-sdk 1.0.272 → 1.0.273
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/sdk2.cjs.development.js +62 -43
- 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 +62 -43
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +62 -43
- 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/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
51
51
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
52
52
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
53
53
|
|
|
54
|
-
var webSdkVersion = '1.0.
|
|
54
|
+
var webSdkVersion = '1.0.273';
|
|
55
55
|
|
|
56
56
|
function getPlatform() {
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -13625,34 +13625,34 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13625
13625
|
classNames = _f === void 0 ? {} : _f,
|
|
13626
13626
|
_g = _a.colors,
|
|
13627
13627
|
colors = _g === void 0 ? {} : _g,
|
|
13628
|
-
|
|
13629
|
-
rawVerbiage =
|
|
13630
|
-
|
|
13631
|
-
debugMode =
|
|
13632
|
-
var
|
|
13633
|
-
cameraRef =
|
|
13634
|
-
videoRef =
|
|
13635
|
-
var
|
|
13636
|
-
ref =
|
|
13637
|
-
|
|
13638
|
-
|
|
13628
|
+
_h = _a.verbiage,
|
|
13629
|
+
rawVerbiage = _h === void 0 ? {} : _h,
|
|
13630
|
+
_j = _a.debugMode,
|
|
13631
|
+
debugMode = _j === void 0 ? false : _j;
|
|
13632
|
+
var _k = React.useContext(CameraStateContext),
|
|
13633
|
+
cameraRef = _k.cameraRef,
|
|
13634
|
+
videoRef = _k.videoRef;
|
|
13635
|
+
var _l = useResizeObserver__default['default'](),
|
|
13636
|
+
ref = _l.ref,
|
|
13637
|
+
width = _l.width,
|
|
13638
|
+
height = _l.height;
|
|
13639
13639
|
var signaturePad = React.useRef(null);
|
|
13640
13640
|
var signatureRecorder = React.useRef(null);
|
|
13641
|
-
|
|
13641
|
+
var recordedChunks = React.useRef([]);
|
|
13642
13642
|
var onPredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
|
|
13643
|
-
var
|
|
13644
|
-
isRecording =
|
|
13645
|
-
startRecording =
|
|
13646
|
-
stopRecording =
|
|
13643
|
+
var _m = useVideoRecorder(cameraRef.current),
|
|
13644
|
+
isRecording = _m.isRecording,
|
|
13645
|
+
startRecording = _m.startRecording,
|
|
13646
|
+
stopRecording = _m.stopRecording;
|
|
13647
|
+
var _o = React.useState(null),
|
|
13648
|
+
signatureData = _o[0],
|
|
13649
|
+
setSignatureData = _o[1];
|
|
13647
13650
|
var _p = React.useState(null),
|
|
13648
|
-
|
|
13649
|
-
|
|
13651
|
+
signatureDataUrl = _p[0],
|
|
13652
|
+
setSignatureDataUrl = _p[1];
|
|
13650
13653
|
var _q = React.useState(null),
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
var _r = React.useState(null),
|
|
13654
|
-
signatureVideoData = _r[0];
|
|
13655
|
-
_r[1];
|
|
13654
|
+
signatureVideoData = _q[0],
|
|
13655
|
+
setSignatureVideoData = _q[1];
|
|
13656
13656
|
colors.guidanceMessageBackgroundColor || (colors.guidanceMessageBackgroundColor = '#ccc');
|
|
13657
13657
|
colors.guidanceMessageTextColor || (colors.guidanceMessageTextColor = 'black');
|
|
13658
13658
|
var verbiage = useTranslations(rawVerbiage, {
|
|
@@ -13667,6 +13667,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13667
13667
|
recordingLock.current = true;
|
|
13668
13668
|
(function () {
|
|
13669
13669
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
13670
|
+
var stream;
|
|
13670
13671
|
return tslib.__generator(this, function (_a) {
|
|
13671
13672
|
switch (_a.label) {
|
|
13672
13673
|
case 0:
|
|
@@ -13684,6 +13685,24 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13684
13685
|
_a.label = 2;
|
|
13685
13686
|
case 2:
|
|
13686
13687
|
startRecording();
|
|
13688
|
+
stream = outputCanvas.current.captureStream(24 /* fps */);
|
|
13689
|
+
signatureRecorder.current = new MediaRecorder(stream, {
|
|
13690
|
+
videoBitsPerSecond: 270000
|
|
13691
|
+
});
|
|
13692
|
+
signatureRecorder.current.start();
|
|
13693
|
+
signatureRecorder.current.ondataavailable = function (event) {
|
|
13694
|
+
var _a;
|
|
13695
|
+
recordedChunks.current.push(event.data);
|
|
13696
|
+
if (((_a = signatureRecorder.current) === null || _a === void 0 ? void 0 : _a.state) === 'recording') {
|
|
13697
|
+
signatureRecorder.current.stop();
|
|
13698
|
+
}
|
|
13699
|
+
};
|
|
13700
|
+
signatureRecorder.current.onstop = function () {
|
|
13701
|
+
var blob = new Blob(recordedChunks.current, {
|
|
13702
|
+
type: 'video/mp4'
|
|
13703
|
+
});
|
|
13704
|
+
setSignatureVideoData(blob);
|
|
13705
|
+
};
|
|
13687
13706
|
return [2 /*return*/];
|
|
13688
13707
|
}
|
|
13689
13708
|
});
|
|
@@ -13711,26 +13730,19 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13711
13730
|
if (!ctx) return;
|
|
13712
13731
|
animationFrame.current = requestAnimationFrame(function runFrame() {
|
|
13713
13732
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
13733
|
+
var rect;
|
|
13714
13734
|
return tslib.__generator(this, function (_a) {
|
|
13715
13735
|
if (!signaturePad.current || !videoRef.current || !outputCanvas.current) {
|
|
13716
13736
|
cancelAnimationFrame(animationFrame.current);
|
|
13717
13737
|
return [2 /*return*/];
|
|
13718
13738
|
}
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
// ctx.drawImage(videoRef.current, 0, 0, w, h)
|
|
13727
|
-
//
|
|
13728
|
-
// ctx.beginPath()
|
|
13729
|
-
// ctx.fillStyle = 'rgba(255,255,255,0.5)'
|
|
13730
|
-
// ctx.roundRect(...rect, 16)
|
|
13731
|
-
// ctx.fill()
|
|
13732
|
-
//
|
|
13733
|
-
// ctx.drawImage(signaturePad.current.getCanvas(), ...rect)
|
|
13739
|
+
rect = [w * (isPortrait ? 0.02 : 0.15), h * (isPortrait ? 0.15 : 0.25), w * (isPortrait ? 0.96 : 0.7), h * (isPortrait ? 0.7 : 0.5)];
|
|
13740
|
+
ctx.drawImage(videoRef.current, 0, 0, w, h);
|
|
13741
|
+
ctx.beginPath();
|
|
13742
|
+
ctx.fillStyle = 'rgba(255,255,255,0.5)';
|
|
13743
|
+
ctx.roundRect.apply(ctx, tslib.__spreadArray(tslib.__spreadArray([], rect, false), [16], false));
|
|
13744
|
+
ctx.fill();
|
|
13745
|
+
ctx.drawImage.apply(ctx, tslib.__spreadArray([signaturePad.current.getCanvas()], rect, false));
|
|
13734
13746
|
animationFrame.current = requestAnimationFrame(runFrame);
|
|
13735
13747
|
return [2 /*return*/];
|
|
13736
13748
|
});
|
|
@@ -13740,9 +13752,9 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13740
13752
|
cancelAnimationFrame(animationFrame.current);
|
|
13741
13753
|
};
|
|
13742
13754
|
}, [cameraRef, isRecording, onFaceNotDetected, videoRef]);
|
|
13743
|
-
var
|
|
13744
|
-
numFramesWithoutFaces =
|
|
13745
|
-
setNumFramesWithoutFaces =
|
|
13755
|
+
var _r = React.useState(0),
|
|
13756
|
+
numFramesWithoutFaces = _r[0],
|
|
13757
|
+
setNumFramesWithoutFaces = _r[1];
|
|
13746
13758
|
React.useEffect(function () {
|
|
13747
13759
|
onPredictionMade(function (faces) {
|
|
13748
13760
|
setNumFramesWithoutFaces(function (n) {
|
|
@@ -13778,7 +13790,14 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13778
13790
|
}, /*#__PURE__*/React__default['default'].createElement(SignaturePad, {
|
|
13779
13791
|
ref: ref,
|
|
13780
13792
|
className: classNames.canvasInner
|
|
13781
|
-
}
|
|
13793
|
+
}, /*#__PURE__*/React__default['default'].createElement(SignatureCanvas__default['default'], {
|
|
13794
|
+
ref: signaturePad,
|
|
13795
|
+
canvasProps: {
|
|
13796
|
+
width: width,
|
|
13797
|
+
height: height,
|
|
13798
|
+
className: classNames.canvas
|
|
13799
|
+
}
|
|
13800
|
+
})), /*#__PURE__*/React__default['default'].createElement(SignatureButtonsContainer, {
|
|
13782
13801
|
className: classNames.buttonsRow
|
|
13783
13802
|
}, /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
|
|
13784
13803
|
variant: "secondary",
|