idmission-web-sdk 2.3.96 → 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 -87
- 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 +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.
|
|
5
|
-
})(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('react-dom/server')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'react-dom/server'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.server));
|
|
5
|
+
})(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, server) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
var n = Object.create(null);
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.3.
|
|
214
|
+
var webSdkVersion = '2.3.98';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -24200,23 +24200,14 @@
|
|
|
24200
24200
|
return t.length > 0 ? t : undefined;
|
|
24201
24201
|
}
|
|
24202
24202
|
|
|
24203
|
-
|
|
24204
|
-
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
|
|
24208
|
-
|
|
24209
|
-
|
|
24210
|
-
|
|
24211
|
-
_a = Uint8Array.bind;
|
|
24212
|
-
return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
|
|
24213
|
-
case 1:
|
|
24214
|
-
return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
|
|
24215
|
-
}
|
|
24216
|
-
});
|
|
24217
|
-
});
|
|
24218
|
-
};
|
|
24219
|
-
}
|
|
24203
|
+
// import { mediaInfoFactory } from 'mediainfo.js'
|
|
24204
|
+
// import type { ReadChunkFunc, MediaInfo, MediaInfoResult } from 'mediainfo.js'
|
|
24205
|
+
// import { DEFAULT_CDN_URL } from '../common/cdn'
|
|
24206
|
+
// import { warn } from '../../lib/utils/logger'
|
|
24207
|
+
// function makeReadChunk(file: File | Blob): ReadChunkFunc {
|
|
24208
|
+
// return async (chunkSize: number, offset: number) =>
|
|
24209
|
+
// new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
|
|
24210
|
+
// }
|
|
24220
24211
|
var signatureRecorder = null;
|
|
24221
24212
|
var signatureChunks = [];
|
|
24222
24213
|
var videoSignatureInitialState = {
|
|
@@ -24298,42 +24289,39 @@
|
|
|
24298
24289
|
signatureRecorder.stop();
|
|
24299
24290
|
signatureRecorder.onstop = function () {
|
|
24300
24291
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
24301
|
-
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt
|
|
24302
|
-
|
|
24303
|
-
|
|
24304
|
-
|
|
24305
|
-
|
|
24306
|
-
|
|
24307
|
-
|
|
24308
|
-
|
|
24309
|
-
|
|
24310
|
-
|
|
24311
|
-
|
|
24312
|
-
|
|
24313
|
-
|
|
24314
|
-
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
|
|
24326
|
-
|
|
24327
|
-
|
|
24328
|
-
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
});
|
|
24335
|
-
return [2 /*return*/];
|
|
24336
|
-
}
|
|
24292
|
+
var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
|
|
24293
|
+
return __generator(this, function (_b) {
|
|
24294
|
+
recordingStoppedAt = performance.now();
|
|
24295
|
+
set({
|
|
24296
|
+
recordingStoppedAt: recordingStoppedAt
|
|
24297
|
+
});
|
|
24298
|
+
inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
|
|
24299
|
+
blob = new Blob(signatureChunks, {
|
|
24300
|
+
type: inferredType
|
|
24301
|
+
});
|
|
24302
|
+
signatureChunks = [];
|
|
24303
|
+
signatureRecorder = null;
|
|
24304
|
+
if (!signatureData) return [2 /*return*/];
|
|
24305
|
+
_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;
|
|
24306
|
+
// const mediaInfo = await get().mediaInfo?.analyzeData(
|
|
24307
|
+
// blob.size,
|
|
24308
|
+
// makeReadChunk(blob),
|
|
24309
|
+
// )
|
|
24310
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
|
|
24311
|
+
// mediaInfo,
|
|
24312
|
+
mimeType: inferredType,
|
|
24313
|
+
timingData: {
|
|
24314
|
+
recordingStartRequestedAt: recordingStartRequestedAt,
|
|
24315
|
+
recordingStartedAt: recordingStartedAt,
|
|
24316
|
+
firstChunkReceivedAt: firstChunkReceivedAt,
|
|
24317
|
+
signatureStartedAt: signatureStartedAt,
|
|
24318
|
+
signatureEndedAt: signatureEndedAt,
|
|
24319
|
+
recordingStopRequestedAt: recordingStopRequestedAt,
|
|
24320
|
+
recordingStoppedAt: recordingStoppedAt,
|
|
24321
|
+
lastChunkReceivedAt: lastChunkReceivedAt
|
|
24322
|
+
}
|
|
24323
|
+
});
|
|
24324
|
+
return [2 /*return*/];
|
|
24337
24325
|
});
|
|
24338
24326
|
});
|
|
24339
24327
|
};
|
|
@@ -24383,9 +24371,7 @@
|
|
|
24383
24371
|
function VideoSignatureContextProvider(_a) {
|
|
24384
24372
|
var _this = this;
|
|
24385
24373
|
var _b, _c, _d, _e;
|
|
24386
|
-
var children = _a.children
|
|
24387
|
-
_f = _a.captureMediaInfo,
|
|
24388
|
-
captureMediaInfo = _f === void 0 ? false : _f;
|
|
24374
|
+
var children = _a.children;
|
|
24389
24375
|
var videoRef = useCameraStore().videoRef;
|
|
24390
24376
|
var outputCanvas = React.useRef(null);
|
|
24391
24377
|
React.useEffect(function () {
|
|
@@ -24395,31 +24381,27 @@
|
|
|
24395
24381
|
}, []);
|
|
24396
24382
|
var signatureVideoRef = React.useRef(null);
|
|
24397
24383
|
var frameCheckCanvas = React.useRef(null);
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
});
|
|
24420
|
-
}
|
|
24421
|
-
};
|
|
24422
|
-
}, [captureMediaInfo]);
|
|
24384
|
+
// useEffect(() => {
|
|
24385
|
+
// if (!captureMediaInfo) return
|
|
24386
|
+
// mediaInfoFactory({
|
|
24387
|
+
// format: 'object',
|
|
24388
|
+
// full: true,
|
|
24389
|
+
// locateFile: (filename) => `${DEFAULT_CDN_URL}/${filename}`,
|
|
24390
|
+
// })
|
|
24391
|
+
// .then((mediaInfo) => {
|
|
24392
|
+
// useVideoSignatureStore.setState({ mediaInfo })
|
|
24393
|
+
// })
|
|
24394
|
+
// .catch((e) => {
|
|
24395
|
+
// warn('error loading mediaInfo', e)
|
|
24396
|
+
// })
|
|
24397
|
+
// return () => {
|
|
24398
|
+
// const mediaInfo = useVideoSignatureStore.getState().mediaInfo
|
|
24399
|
+
// if (mediaInfo) {
|
|
24400
|
+
// mediaInfo.close()
|
|
24401
|
+
// useVideoSignatureStore.setState({ mediaInfo: undefined })
|
|
24402
|
+
// }
|
|
24403
|
+
// }
|
|
24404
|
+
// }, [captureMediaInfo])
|
|
24423
24405
|
var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;
|
|
24424
24406
|
var blankCheckPassed = React.useRef(false);
|
|
24425
24407
|
React.useEffect(function () {
|
|
@@ -24491,9 +24473,9 @@
|
|
|
24491
24473
|
video.removeEventListener('play', onPlay);
|
|
24492
24474
|
};
|
|
24493
24475
|
}, [drawOutputFrame, videoRef]);
|
|
24494
|
-
var
|
|
24495
|
-
signaturePad =
|
|
24496
|
-
recordingStartedAt =
|
|
24476
|
+
var _f = useVideoSignatureStore(),
|
|
24477
|
+
signaturePad = _f.signaturePad,
|
|
24478
|
+
recordingStartedAt = _f.recordingStartedAt;
|
|
24497
24479
|
React.useEffect(function () {
|
|
24498
24480
|
var _a;
|
|
24499
24481
|
if (!signaturePad.current || !recordingStartedAt) return;
|