Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dist/components/bbox/Bbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ interface IBboxProps {
onClick?(e: any): void;
}
export interface IRenderBboxProps {
bbox: IBbox;
left: string;
width: string;
height: string;
bottom: string;
top: string;
height: string;
width: string;
disabled: boolean;
related?: boolean;
selected?: boolean;
Expand Down
7 changes: 5 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@duallab/verapdf-js-viewer",
"version": "1.7.22",
"version": "1.7.23",
"description": "Display PDF with an option to highlight a collection of rectangles on top of page rendering. Used by veraPDF web application to visualize locations of validation errors",
"main": "dist/index.js",
"scripts": {
Expand Down
10 changes: 7 additions & 3 deletions src/components/bbox/Bbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ interface IBboxProps {
}

export interface IRenderBboxProps {
bbox: IBbox;
left: string;
width: string;
height: string;
bottom: string;
top: string;
height: string;
width: string;
disabled: boolean;
related?: boolean;
selected?: boolean;
Expand Down Expand Up @@ -177,10 +179,12 @@ const Bbox: FC<IBboxProps> = (props: IBboxProps) => {

if (renderBbox) {
return renderBbox({
bbox,
bottom,
left,
top,
width,
height,
top,
colorScheme,
disabled,
related,
Expand Down
3 changes: 2 additions & 1 deletion src/components/pdfDocument/PdfDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const PdfDocument: FC<IPdfDocumentProps> = (props) => {
const selectedPage = getSelectedPageByLocation(activeBbox.location);
if (selectedPage > -1) {
setPage(selectedPage);
setScrollIntoPage(selectedPage);
}
setSelectedPage(selectedPage);
} else {
Expand All @@ -143,7 +144,7 @@ const PdfDocument: FC<IPdfDocumentProps> = (props) => {
setMaxPage(data.numPages);
setLoaded(true);
props.onLoadSuccess?.(data);
}, [props.onLoadSuccess, bboxes, props.defaultHeight, props.defaultWidth]);
}, [props.onLoadSuccess, bboxes, props.defaultWidth]);

const onPageLoadSuccess = useCallback((data: PageCallback) => {
props.onPageLoadSuccess?.(data);
Expand Down