idmission-web-sdk 1.0.36 → 1.0.38

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.
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import '../../lib/utils/OffscreenCanvasPolyfill';
3
2
  import { DocumentType } from '../../lib/models/DocumentDetection';
4
3
  import { PDF417DetectionResult } from '../../lib/barcode/Native';
5
4
  import { CaptureAttemptMetadata } from '../../contexts/SubmissionContext';
@@ -6,4 +6,3 @@ export declare const useCamera: (resolution?: CameraResolution) => {
6
6
  videoLoaded: boolean;
7
7
  setVideoLoaded: (is: boolean) => void;
8
8
  };
9
- export declare const useWindowFocus: () => boolean;
@@ -50,7 +50,7 @@ var tf__namespace = /*#__PURE__*/_interopNamespace(tf);
50
50
  var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.36';
53
+ var webSdkVersion = '1.0.38';
54
54
 
55
55
  function getPlatform() {
56
56
  return window.platform;
@@ -966,24 +966,6 @@ function bboxToDetectedObjectUnscaled(box, score, label) {
966
966
  };
967
967
  }
968
968
 
969
- if (!window.OffscreenCanvas) {
970
- window.OffscreenCanvas = function () {
971
- function OffscreenCanvas(width, height) {
972
- var _this = this;
973
- this.canvas = document.createElement('canvas');
974
- this.canvas.width = width;
975
- this.canvas.height = height;
976
- this.canvas.convertToBlob = function () {
977
- return new Promise(function (resolve) {
978
- _this.canvas.toBlob(resolve);
979
- });
980
- };
981
- return this.canvas;
982
- }
983
- return OffscreenCanvas;
984
- }();
985
- }
986
-
987
969
  var GuideOrientationContext = /*#__PURE__*/React.createContext({
988
970
  orientation: 'landscape',
989
971
  wrapperWidth: 1,
@@ -1607,7 +1589,6 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
1607
1589
  track.onended = handleStreamEnded;
1608
1590
  });
1609
1591
  cameraRef.current = obtainCameraAccess(stream, videoDevice.label, videoRef.current);
1610
- setCameraReady(true);
1611
1592
  return [2];
1612
1593
  }
1613
1594
  });
@@ -1615,6 +1596,12 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
1615
1596
  })();
1616
1597
  return cleanup;
1617
1598
  }, [iphoneContinuityCameraAllowed, iphoneContinuityCameraAvailable, requestMicrophoneAccess, videoDevice]);
1599
+ React.useEffect(function () {
1600
+ setCameraReady(false);
1601
+ if (videoDevice && videoLoaded) {
1602
+ setCameraReady(true);
1603
+ }
1604
+ }, [videoLoaded, videoDevice]);
1618
1605
  var takePhoto = React.useCallback(function () {
1619
1606
  return tslib.__awaiter(void 0, void 0, void 0, function () {
1620
1607
  var canvas, ctx, photoURL, data;