@react-pdf-kit/viewer 2.7.3 → 2.7.4-rc.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/dist/{AnnotationLayer-SQbmx6wX.js → AnnotationLayer-C_Sk3ZMg.js} +1 -1
- package/dist/{PaginationContext-B3qzCYJu.js → PaginationContext-BmPajxlU.js} +24 -16
- package/dist/{RPPage-BdoE0RrK.js → RPPage-B1UMGNSI.js} +1 -1
- package/dist/{RPPages-Dw7lGXzM.js → RPPages-Dh4RWlPS.js} +346 -341
- package/dist/{Thumbnail-BVjnCNxv.js → Thumbnail-BOvkeGXM.js} +1 -1
- package/dist/{Thumbnails-CrKLESh3.js → Thumbnails-jteSWSw9.js} +2 -2
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +4 -4
- package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
- package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +5 -5
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/DualPage.js +2 -2
- package/dist/components/page/DualPageWithCover.js +2 -2
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +2 -2
- package/dist/contexts/ElementThumbnailContext.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/{de_DE-C1OrwQKj.js → de_DE-x4Z-jQrz.js} +12 -0
- package/dist/{main-CdlJS0xf.js → main-ByQlDC9E.js} +1 -1
- package/dist/main.js +3 -3
- package/dist/types/locales/de_DE.json.d.ts +2 -0
- package/dist/types/locales/en_US.json.d.ts +2 -0
- package/dist/types/locales/it_IT.json.d.ts +2 -0
- package/dist/types/locales/pt_PT.json.d.ts +2 -0
- package/dist/types/locales/th_TH.json.d.ts +2 -0
- package/dist/types/locales/zh_CN.json.d.ts +2 -0
- package/dist/types/utils/const.d.ts +3 -0
- package/dist/types/utils/types.d.ts +4 -1
- package/dist/utils/const.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +73 -63
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/types.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { AnnotationSubType as e } from "./utils/types.js";
|
|
|
2
2
|
import { useDocumentContext as t } from "./contexts/RPDocumentContext.js";
|
|
3
3
|
import { useInitialStateContext as n } from "./contexts/InitialStateContext.js";
|
|
4
4
|
import { useScrollModeContext as r } from "./contexts/ScrollModeContext.js";
|
|
5
|
-
import { r as i } from "./PaginationContext-
|
|
5
|
+
import { r as i } from "./PaginationContext-BmPajxlU.js";
|
|
6
6
|
import { usePrintContext as a } from "./contexts/PrintContext.js";
|
|
7
7
|
import { SimpleLinkService as o } from "./utils/link_service.js";
|
|
8
8
|
import { annotationEventsHandler as s, bindLayerEvents as c, enhanceLinkAccessibility as l, fixTabIndexAccessibility as u, handleAnnotationWidget as d, insertDateText as f, unbindLayerEvents as p } from "./utils/annotations.js";
|
|
@@ -202,31 +202,39 @@ var T = () => {
|
|
|
202
202
|
let e = b(D);
|
|
203
203
|
return e?.focusedPage === void 0 && n.error("Please use this hooks inside children component of RPProvider"), e;
|
|
204
204
|
}, k = ({ children: e }) => {
|
|
205
|
-
let { pdf: t } = r(), { setCurrentPage:
|
|
205
|
+
let { pdf: t, pages: n } = r(), { setCurrentPage: a } = d(), { initialPage: o = 1 } = i(), { focusedPage: s, totalPages: c, setFocusedPage: l, resetPage: u, setTotalPages: f, goToPage: p, nextPage: m, prevPage: h } = E(o), g = S(!0);
|
|
206
206
|
return x(() => {
|
|
207
207
|
if (!t) {
|
|
208
|
-
|
|
208
|
+
g.current || (f(0), u(1));
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
if (!t.numPages) return;
|
|
212
|
-
|
|
213
|
-
let e =
|
|
214
|
-
|
|
212
|
+
f(t.numPages);
|
|
213
|
+
let e = g.current ? o : 1;
|
|
214
|
+
u(Math.min(Math.max(e, 1), t.numPages)), g.current = !1;
|
|
215
215
|
}, [
|
|
216
216
|
t,
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
f,
|
|
218
|
+
u
|
|
219
|
+
]), x(() => {
|
|
220
|
+
!t || !n.size || (f(n.size), s > n.size && u(n.size));
|
|
221
|
+
}, [
|
|
222
|
+
t,
|
|
223
|
+
n,
|
|
224
|
+
s,
|
|
225
|
+
f,
|
|
226
|
+
u
|
|
219
227
|
]), x(() => {
|
|
220
|
-
|
|
221
|
-
}, [
|
|
228
|
+
a(s);
|
|
229
|
+
}, [s, a]), /* @__PURE__ */ w(D.Provider, {
|
|
222
230
|
value: {
|
|
223
|
-
focusedPage:
|
|
224
|
-
totalPages:
|
|
225
|
-
setFocusedPage:
|
|
226
|
-
setTotalPages:
|
|
227
|
-
nextPage:
|
|
228
|
-
prevPage:
|
|
229
|
-
goToPage:
|
|
231
|
+
focusedPage: s,
|
|
232
|
+
totalPages: c,
|
|
233
|
+
setFocusedPage: l,
|
|
234
|
+
setTotalPages: f,
|
|
235
|
+
nextPage: m,
|
|
236
|
+
prevPage: h,
|
|
237
|
+
goToPage: p
|
|
230
238
|
},
|
|
231
239
|
children: e
|
|
232
240
|
});
|
|
@@ -5,7 +5,7 @@ import { useLayerContext as r } from "./contexts/LayerContext.js";
|
|
|
5
5
|
import { useLoaderContext as i } from "./contexts/LoaderContext.js";
|
|
6
6
|
import { CanvasLayer as a } from "./components/page/CanvasLayer.js";
|
|
7
7
|
import { t as o } from "./TextLayer-DWGFN9SF.js";
|
|
8
|
-
import { t as s } from "./AnnotationLayer-
|
|
8
|
+
import { t as s } from "./AnnotationLayer-C_Sk3ZMg.js";
|
|
9
9
|
import { t as c } from "./TextHighlightLayer-BSVgBxR3.js";
|
|
10
10
|
import { CustomElement as l } from "./components/page/CustomElement.js";
|
|
11
11
|
import { withRef as u } from "./utils/withRef.js";
|