idmission-web-sdk 2.3.97 → 2.3.98
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/components/video_signature_capture/VideoSignatureContext.d.ts +1 -4
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +67 -86
- 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 -86
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +71 -89
- 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
package/dist/sdk2.esm.js
CHANGED
|
@@ -16,7 +16,6 @@ import { devtools } from 'zustand/middleware';
|
|
|
16
16
|
import { useShallow } from 'zustand/react/shallow';
|
|
17
17
|
import cn from 'clsx';
|
|
18
18
|
import SignatureCanvas from 'react-signature-canvas';
|
|
19
|
-
import { mediaInfoFactory } from 'mediainfo.js';
|
|
20
19
|
import { renderToString } from 'react-dom/server';
|
|
21
20
|
|
|
22
21
|
/******************************************************************************
|
|
@@ -206,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
206
205
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
207
206
|
};
|
|
208
207
|
|
|
209
|
-
var webSdkVersion = '2.3.
|
|
208
|
+
var webSdkVersion = '2.3.98';
|
|
210
209
|
|
|
211
210
|
function getPlatform() {
|
|
212
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -14296,23 +14295,14 @@ function inferBlobType(blobPart) {
|
|
|
14296
14295
|
return t.length > 0 ? t : undefined;
|
|
14297
14296
|
}
|
|
14298
14297
|
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
_a = Uint8Array.bind;
|
|
14308
|
-
return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
|
|
14309
|
-
case 1:
|
|
14310
|
-
return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
|
|
14311
|
-
}
|
|
14312
|
-
});
|
|
14313
|
-
});
|
|
14314
|
-
};
|
|
14315
|
-
}
|
|
14298
|
+
// import { mediaInfoFactory } from 'mediainfo.js'
|
|
14299
|
+
// import type { ReadChunkFunc, MediaInfo, MediaInfoResult } from 'mediainfo.js'
|
|
14300
|
+
// import { DEFAULT_CDN_URL } from '../common/cdn'
|
|
14301
|
+
// import { warn } from '../../lib/utils/logger'
|
|
14302
|
+
// function makeReadChunk(file: File | Blob): ReadChunkFunc {
|
|
14303
|
+
// return async (chunkSize: number, offset: number) =>
|
|
14304
|
+
// new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
|
|
14305
|
+
// }
|
|
14316
14306
|
var signatureRecorder = null;
|
|
14317
14307
|
var signatureChunks = [];
|
|
14318
14308
|
var videoSignatureInitialState = {
|
|
@@ -14394,42 +14384,39 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
14394
14384
|
signatureRecorder.stop();
|
|
14395
14385
|
signatureRecorder.onstop = function () {
|
|
14396
14386
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
14397
|
-
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
});
|
|
14431
|
-
return [2 /*return*/];
|
|
14432
|
-
}
|
|
14387
|
+
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
|
|
14388
|
+
return __generator(this, function (_b) {
|
|
14389
|
+
recordingStoppedAt = performance.now();
|
|
14390
|
+
set({
|
|
14391
|
+
recordingStoppedAt: recordingStoppedAt
|
|
14392
|
+
});
|
|
14393
|
+
inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
|
|
14394
|
+
blob = new Blob(signatureChunks, {
|
|
14395
|
+
type: inferredType
|
|
14396
|
+
});
|
|
14397
|
+
signatureChunks = [];
|
|
14398
|
+
signatureRecorder = null;
|
|
14399
|
+
if (!signatureData) return [2 /*return*/];
|
|
14400
|
+
_a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
|
|
14401
|
+
// const mediaInfo = await get().mediaInfo?.analyzeData(
|
|
14402
|
+
// blob.size,
|
|
14403
|
+
// makeReadChunk(blob),
|
|
14404
|
+
// )
|
|
14405
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
|
|
14406
|
+
// mediaInfo,
|
|
14407
|
+
mimeType: inferredType,
|
|
14408
|
+
timingData: {
|
|
14409
|
+
recordingStartRequestedAt: recordingStartRequestedAt,
|
|
14410
|
+
recordingStartedAt: recordingStartedAt,
|
|
14411
|
+
firstChunkReceivedAt: firstChunkReceivedAt,
|
|
14412
|
+
signatureStartedAt: signatureStartedAt,
|
|
14413
|
+
signatureEndedAt: signatureEndedAt,
|
|
14414
|
+
recordingStopRequestedAt: recordingStopRequestedAt,
|
|
14415
|
+
recordingStoppedAt: recordingStoppedAt,
|
|
14416
|
+
lastChunkReceivedAt: lastChunkReceivedAt
|
|
14417
|
+
}
|
|
14418
|
+
});
|
|
14419
|
+
return [2 /*return*/];
|
|
14433
14420
|
});
|
|
14434
14421
|
});
|
|
14435
14422
|
};
|
|
@@ -14479,9 +14466,7 @@ function waitForOneMoreChunk(timeoutMs) {
|
|
|
14479
14466
|
function VideoSignatureContextProvider(_a) {
|
|
14480
14467
|
var _this = this;
|
|
14481
14468
|
var _b, _c, _d, _e;
|
|
14482
|
-
var children = _a.children
|
|
14483
|
-
_f = _a.captureMediaInfo,
|
|
14484
|
-
captureMediaInfo = _f === void 0 ? false : _f;
|
|
14469
|
+
var children = _a.children;
|
|
14485
14470
|
var videoRef = useCameraStore().videoRef;
|
|
14486
14471
|
var outputCanvas = useRef(null);
|
|
14487
14472
|
useEffect(function () {
|
|
@@ -14491,31 +14476,27 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14491
14476
|
}, []);
|
|
14492
14477
|
var signatureVideoRef = useRef(null);
|
|
14493
14478
|
var frameCheckCanvas = useRef(null);
|
|
14494
|
-
useEffect(
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
});
|
|
14516
|
-
}
|
|
14517
|
-
};
|
|
14518
|
-
}, [captureMediaInfo]);
|
|
14479
|
+
// useEffect(() => {
|
|
14480
|
+
// if (!captureMediaInfo) return
|
|
14481
|
+
// mediaInfoFactory({
|
|
14482
|
+
// format: 'object',
|
|
14483
|
+
// full: true,
|
|
14484
|
+
// locateFile: (filename) => `${DEFAULT_CDN_URL}/${filename}`,
|
|
14485
|
+
// })
|
|
14486
|
+
// .then((mediaInfo) => {
|
|
14487
|
+
// useVideoSignatureStore.setState({ mediaInfo })
|
|
14488
|
+
// })
|
|
14489
|
+
// .catch((e) => {
|
|
14490
|
+
// warn('error loading mediaInfo', e)
|
|
14491
|
+
// })
|
|
14492
|
+
// return () => {
|
|
14493
|
+
// const mediaInfo = useVideoSignatureStore.getState().mediaInfo
|
|
14494
|
+
// if (mediaInfo) {
|
|
14495
|
+
// mediaInfo.close()
|
|
14496
|
+
// useVideoSignatureStore.setState({ mediaInfo: undefined })
|
|
14497
|
+
// }
|
|
14498
|
+
// }
|
|
14499
|
+
// }, [captureMediaInfo])
|
|
14519
14500
|
var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;
|
|
14520
14501
|
var blankCheckPassed = useRef(false);
|
|
14521
14502
|
useEffect(function () {
|
|
@@ -14587,9 +14568,9 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14587
14568
|
video.removeEventListener('play', onPlay);
|
|
14588
14569
|
};
|
|
14589
14570
|
}, [drawOutputFrame, videoRef]);
|
|
14590
|
-
var
|
|
14591
|
-
signaturePad =
|
|
14592
|
-
recordingStartedAt =
|
|
14571
|
+
var _f = useVideoSignatureStore(),
|
|
14572
|
+
signaturePad = _f.signaturePad,
|
|
14573
|
+
recordingStartedAt = _f.recordingStartedAt;
|
|
14593
14574
|
useEffect(function () {
|
|
14594
14575
|
var _a;
|
|
14595
14576
|
if (!signaturePad.current || !recordingStartedAt) return;
|