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.
- package/core/capture/anydoc.js +2 -2
- package/core/constants.js +1 -1
- package/core/overlay-controls.js +10 -10
- package/core/state.js +4 -4
- package/core/ui-renderer.js +5 -5
- package/core/wasm-processing.js +0 -6
- package/package.json +1 -1
package/core/capture/anydoc.js
CHANGED
|
@@ -83,8 +83,8 @@ export const handleAnydocPageCapture = () => {
|
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
|
|
86
|
-
if (state.
|
|
87
|
-
state.
|
|
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
package/core/overlay-controls.js
CHANGED
|
@@ -11,10 +11,10 @@ export const hideVideoOverlay = () => {
|
|
|
11
11
|
state.captureButton.button.style.display = 'none';
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (typeof state.
|
|
15
|
-
state.
|
|
16
|
-
} else if (state.
|
|
17
|
-
state.
|
|
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.
|
|
43
|
-
state.
|
|
44
|
-
} else if (state.
|
|
45
|
-
state.
|
|
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.
|
|
49
|
-
state.
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
282
|
+
state.torchButtonRef = null;
|
|
283
283
|
state.captureButton = null;
|
|
284
284
|
state.submitButton = null;
|
|
285
|
-
state.
|
|
285
|
+
state.exitButtonRef = null;
|
|
286
286
|
state.longPreview = null;
|
|
287
287
|
state.stitchingButton = null;
|
|
288
288
|
state.checkImagesComponent = null;
|
package/core/ui-renderer.js
CHANGED
|
@@ -33,7 +33,7 @@ const setupVideoOverlayControls = (captureAction) => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (state.exitButton) {
|
|
36
|
-
state.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
149
|
+
state.torchButtonRef = createTorchButton(state.cardOverlay.element, () => {
|
|
150
150
|
toggleTorchLight();
|
|
151
151
|
}, state.lensFlavor);
|
|
152
152
|
}
|
package/core/wasm-processing.js
CHANGED
|
@@ -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;
|