veryfi-lens-wasm 3.0.0 → 3.0.2

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.
@@ -83,8 +83,8 @@ export const handleAnydocPageCapture = () => {
83
83
  }
84
84
  );
85
85
 
86
- if (state.exitButton && typeof state.exitButton.hide === 'function') {
87
- state.exitButton.hide();
86
+ if (state.exitButtonRef && typeof state.exitButtonRef.hide === 'function') {
87
+ state.exitButtonRef.hide();
88
88
  }
89
89
 
90
90
  state.blurStatus = false;
package/core/constants.js CHANGED
@@ -12,7 +12,7 @@ export const API_URLS = {
12
12
  };
13
13
 
14
14
  export const DEFAULTS = {
15
- SDK_VERSION: '3.0.0',
15
+ SDK_VERSION: '3.0.2',
16
16
  BLUR_THRESHOLD: 0.7,
17
17
  LCD_THRESHOLD: 0.5,
18
18
  BOX_COLOR: 'rgba(84, 192, 139, 0.6)',
@@ -11,10 +11,10 @@ export const hideVideoOverlay = () => {
11
11
  state.captureButton.button.style.display = 'none';
12
12
  }
13
13
 
14
- if (typeof state.torchButton?.hide === 'function') {
15
- state.torchButton.hide();
16
- } else if (state.torchButton?.button) {
17
- state.torchButton.button.style.display = 'none';
14
+ if (typeof state.torchButtonRef?.hide === 'function') {
15
+ state.torchButtonRef.hide();
16
+ } else if (state.torchButtonRef?.button) {
17
+ state.torchButtonRef.button.style.display = 'none';
18
18
  }
19
19
 
20
20
  if (state.submitButton) {
@@ -39,14 +39,14 @@ export const showVideoOverlay = () => {
39
39
  state.captureButton.button.style.display = 'block';
40
40
  }
41
41
 
42
- if (typeof state.torchButton?.show === 'function') {
43
- state.torchButton.show();
44
- } else if (state.torchButton?.button) {
45
- state.torchButton.button.style.display = 'block';
42
+ if (typeof state.torchButtonRef?.show === 'function') {
43
+ state.torchButtonRef.show();
44
+ } else if (state.torchButtonRef?.button) {
45
+ state.torchButtonRef.button.style.display = 'block';
46
46
  }
47
47
 
48
- if (typeof state.exitButton?.show === 'function') {
49
- state.exitButton.show();
48
+ if (typeof state.exitButtonRef?.show === 'function') {
49
+ state.exitButtonRef.show();
50
50
  }
51
51
 
52
52
  if (state.isManualCheckCapture && state.checkOverlay) {
package/core/state.js CHANGED
@@ -145,14 +145,14 @@ export const state = {
145
145
  blurModal: null,
146
146
  documentModal: null,
147
147
  lcdModal: null,
148
- torchButton: null,
148
+ torchButtonRef: null,
149
149
  uploadContainer: null,
150
150
  fileUpload: null,
151
151
  croppedImage: null,
152
152
  submitButton: null,
153
153
  videoOverlay: null,
154
154
  captureButton: null,
155
- exitButton: null,
155
+ exitButtonRef: null,
156
156
  longPreview: null,
157
157
  cardOverlay: null,
158
158
  stitchingButton: null,
@@ -279,10 +279,10 @@ export const resetState = () => {
279
279
  state.cropImgRef = null;
280
280
  state.videoRef = null;
281
281
  state.boxRef = null;
282
- state.torchButton = null;
282
+ state.torchButtonRef = null;
283
283
  state.captureButton = null;
284
284
  state.submitButton = null;
285
- state.exitButton = null;
285
+ state.exitButtonRef = null;
286
286
  state.longPreview = null;
287
287
  state.stitchingButton = null;
288
288
  state.checkImagesComponent = null;
@@ -33,7 +33,7 @@ const setupVideoOverlayControls = (captureAction) => {
33
33
  }
34
34
 
35
35
  if (state.exitButton) {
36
- state.exitButton = createExitButton(state.videoOverlay.overlay, {
36
+ state.exitButtonRef = createExitButton(state.videoOverlay.overlay, {
37
37
  setter: state.onClose,
38
38
  redirectUrl: state.onCloseRedirectUrl,
39
39
  lensFlavor: state.lensFlavor,
@@ -43,7 +43,7 @@ const setupVideoOverlayControls = (captureAction) => {
43
43
  state.captureButton = createCaptureButton(state.videoOverlay.overlay, captureAction);
44
44
 
45
45
  if (state.torchButton) {
46
- state.torchButton = createTorchButton(state.videoOverlay.overlay, () => {
46
+ state.torchButtonRef = createTorchButton(state.videoOverlay.overlay, () => {
47
47
  toggleTorchLight();
48
48
  }, state.lensFlavor);
49
49
  }
@@ -103,7 +103,7 @@ export const renderVideoOverlayIfNeeded = () => {
103
103
  }
104
104
 
105
105
  if (state.exitButton) {
106
- state.exitButton = createExitButton(state.videoOverlay.overlay, {
106
+ state.exitButtonRef = createExitButton(state.videoOverlay.overlay, {
107
107
  setter: state.onClose,
108
108
  redirectUrl: state.onCloseRedirectUrl,
109
109
  lensFlavor: state.lensFlavor,
@@ -121,7 +121,7 @@ export const renderVideoOverlayIfNeeded = () => {
121
121
  }
122
122
 
123
123
  if (state.torchButton) {
124
- state.torchButton = createTorchButton(state.videoOverlay.overlay, () => {
124
+ state.torchButtonRef = createTorchButton(state.videoOverlay.overlay, () => {
125
125
  toggleTorchLight();
126
126
  }, state.lensFlavor);
127
127
  }
@@ -146,7 +146,7 @@ export const renderCreditCardIfNeeded = () => {
146
146
  }, () => actions.removeOverlay());
147
147
  }
148
148
  if (state.torchButton) {
149
- state.torchButton = createTorchButton(state.cardOverlay.element, () => {
149
+ state.torchButtonRef = createTorchButton(state.cardOverlay.element, () => {
150
150
  toggleTorchLight();
151
151
  }, state.lensFlavor);
152
152
  }
@@ -315,12 +315,6 @@ export const sendCardWasm = async () => {
315
315
  };
316
316
 
317
317
  export const getLongImage = async () => {
318
- if (!state.hasCoordinates) {
319
- actions.checkIfDocumentOnCapture?.();
320
- stopWasm();
321
- return false;
322
- }
323
-
324
318
  const wasmOutput = await refs.wasmWrapper.getStitchedImage();
325
319
  const { data, blurLevel, outputHeight, outputWidth } = wasmOutput;
326
320
  const width = outputWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfi-lens-wasm",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Lens For Web SDK with WASM",
5
5
  "main": "veryfi-lens.js",
6
6
  "type": "module",