veryfi-lens-wasm 3.5.0 → 3.5.1
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/components/reviewGallery.js +30 -13
- package/core/constants.js +1 -1
- package/flavors/document.js +2 -7
- package/package.json +1 -1
|
@@ -731,8 +731,9 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
731
731
|
return img;
|
|
732
732
|
};
|
|
733
733
|
|
|
734
|
-
// Dashed "+" tile used to add a document (strip) or a page (grid).
|
|
735
|
-
|
|
734
|
+
// Dashed "+" tile used to add a document (strip) or a page (grid). The grid
|
|
735
|
+
// tile is much larger than the strip tile, so type sizes are passed in.
|
|
736
|
+
const buildAddTile = (label, onClick, sizeStyle = {}, { plusSize = '26px', labelSize = '11px' } = {}) => {
|
|
736
737
|
const tile = document.createElement('button');
|
|
737
738
|
tile.classList.add('veryfi-rg-tile');
|
|
738
739
|
Object.assign(tile.style, {
|
|
@@ -752,11 +753,11 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
752
753
|
});
|
|
753
754
|
const plus = document.createElement('span');
|
|
754
755
|
plus.textContent = '+';
|
|
755
|
-
Object.assign(plus.style, { fontSize:
|
|
756
|
+
Object.assign(plus.style, { fontSize: plusSize, lineHeight: '1', fontWeight: '400' });
|
|
756
757
|
const lbl = document.createElement('span');
|
|
757
758
|
lbl.textContent = label;
|
|
758
759
|
Object.assign(lbl.style, {
|
|
759
|
-
fontSize:
|
|
760
|
+
fontSize: labelSize,
|
|
760
761
|
fontWeight: '600',
|
|
761
762
|
textAlign: 'center',
|
|
762
763
|
lineHeight: '1.1',
|
|
@@ -847,7 +848,7 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
847
848
|
flexDirection: 'column',
|
|
848
849
|
alignItems: 'center',
|
|
849
850
|
justifyContent: 'center',
|
|
850
|
-
|
|
851
|
+
height: '100%',
|
|
851
852
|
minHeight: '100%',
|
|
852
853
|
});
|
|
853
854
|
|
|
@@ -855,21 +856,28 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
855
856
|
Object.assign(media.style, {
|
|
856
857
|
position: 'relative',
|
|
857
858
|
width: '100%',
|
|
859
|
+
// Fill the grid area so the document can use every available pixel of
|
|
860
|
+
// vertical space; minHeight:0 lets it shrink inside the flex column.
|
|
861
|
+
flex: '1 1 auto',
|
|
862
|
+
minHeight: '0',
|
|
858
863
|
display: 'flex',
|
|
859
864
|
alignItems: 'center',
|
|
860
865
|
justifyContent: 'center',
|
|
861
866
|
// Not clipped: field-detection overlays (scan caption, field pills) extend
|
|
862
867
|
// just outside the image bounds.
|
|
863
868
|
overflow: 'visible',
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
869
|
+
// No card behind the document — it would show as borders around a capture
|
|
870
|
+
// whose aspect ratio doesn't match the area.
|
|
871
|
+
background: 'transparent',
|
|
867
872
|
});
|
|
868
873
|
const thumb = buildPageThumb(page);
|
|
869
|
-
//
|
|
870
|
-
Object.assign(thumb.style, {
|
|
871
|
-
|
|
872
|
-
|
|
874
|
+
// Scale to the available area while keeping the capture's aspect ratio.
|
|
875
|
+
Object.assign(thumb.style, {
|
|
876
|
+
width: 'auto',
|
|
877
|
+
height: 'auto',
|
|
878
|
+
maxWidth: '100%',
|
|
879
|
+
maxHeight: '100%',
|
|
880
|
+
});
|
|
873
881
|
if (thumb.tagName === 'VIDEO') thumb.controls = true;
|
|
874
882
|
thumb.addEventListener('click', (e) => e.stopPropagation());
|
|
875
883
|
media.appendChild(thumb);
|
|
@@ -1029,6 +1037,9 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
1029
1037
|
|
|
1030
1038
|
if (detailIndex !== null) {
|
|
1031
1039
|
gridEl.style.gridTemplateColumns = '1fr';
|
|
1040
|
+
// Let the single detail row fill the scroll area instead of hugging its
|
|
1041
|
+
// content, so the document gets the full height.
|
|
1042
|
+
gridEl.style.alignContent = 'stretch';
|
|
1032
1043
|
// Clicking the backdrop (anywhere in the grid area that isn't the toolbar
|
|
1033
1044
|
// or the image — including below the image) returns to the gallery grid.
|
|
1034
1045
|
// Only when there is a grid to go back to.
|
|
@@ -1044,6 +1055,7 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
1044
1055
|
return;
|
|
1045
1056
|
}
|
|
1046
1057
|
gridEl.onclick = null;
|
|
1058
|
+
gridEl.style.alignContent = 'start';
|
|
1047
1059
|
|
|
1048
1060
|
// Stacked layout: one full-width preview per row (landscape captures such as
|
|
1049
1061
|
// checks read better this way). Otherwise a responsive multi-column grid.
|
|
@@ -1056,7 +1068,12 @@ export const createReviewGallery = (container, callbacks = {}, options = {}) =>
|
|
|
1056
1068
|
gridEl.appendChild(tile);
|
|
1057
1069
|
});
|
|
1058
1070
|
if (allowAddPageNow) {
|
|
1059
|
-
const addTile = buildAddTile(
|
|
1071
|
+
const addTile = buildAddTile(
|
|
1072
|
+
o.addPageText,
|
|
1073
|
+
() => callbacks.onAddPage?.(),
|
|
1074
|
+
{ aspectRatio: o.pageAspectRatio },
|
|
1075
|
+
{ plusSize: '40px', labelSize: '16px' }
|
|
1076
|
+
);
|
|
1060
1077
|
addTile.style.animationDelay = `${pages.length * 45}ms`;
|
|
1061
1078
|
gridEl.appendChild(addTile);
|
|
1062
1079
|
}
|
package/core/constants.js
CHANGED
package/flavors/document.js
CHANGED
|
@@ -8,13 +8,8 @@ export const setup = async (state, refs, actions) => {
|
|
|
8
8
|
actions.handleDocumentAutoCaptureDone = handleDocumentAutoCaptureDone;
|
|
9
9
|
actions.logDocument = logDocument;
|
|
10
10
|
actions.checkIfDocumentOnCapture = checkIfDocumentOnCapture;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// single-document experience (collapsed Retake/Confirm) unless the partner
|
|
14
|
-
// opts into multi-page (maxPagesPerDocument) or multi-document capture
|
|
15
|
-
// (maxDocuments, or the legacy multiSubmission flag).
|
|
16
|
-
if (state.maxPagesPerDocument == null) state.maxPagesPerDocument = 1;
|
|
17
|
-
if (state.maxDocuments == null) state.maxDocuments = state.multiSubmission ? null : 1;
|
|
11
|
+
state.maxPagesPerDocument = 1;
|
|
12
|
+
state.maxDocuments = 1;
|
|
18
13
|
};
|
|
19
14
|
|
|
20
15
|
export const render = async (state, refs, actions) => {
|