@react-pdf-kit/viewer 2.8.0-beta.0 → 2.8.0-beta.10
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/README.md +44 -30
- package/dist/{AnnotationLayer-C6UTOVmc.js → AnnotationLayer-CyOYh0Tw.js} +2 -2
- package/dist/{Button-BNlmxWrV.js → Button-DBu3SaMk.js} +1 -1
- package/dist/CanvasLayer-CJqCJ30J.js +111 -0
- package/dist/{Checkbox-Brta-YKG.js → Checkbox-CSIEUyO8.js} +4 -4
- package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
- package/dist/Container-BuamPhw4.js +18 -0
- package/dist/{DocumentDialog-C9G7lVTh.js → DocumentDialog-cRr9sSSH.js} +4 -4
- package/dist/{DropDown-DikL-krI.js → DropDown-CM6xEwZC.js} +2 -2
- package/dist/{Input-DjSWOjCI.js → Input-Dpo1Xfxe.js} +1 -1
- package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
- package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-0E8WHnSN.js} +8 -8
- package/dist/MenuItem-lItnKNd5.js +31 -0
- package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-CaFxd8b5.js} +1 -1
- package/dist/Paginate.module-DhE7N8AA.js +9 -0
- package/dist/PaginationContext-DIzsZhFd.js +194 -0
- package/dist/{PasswordModal-BIr84lGN.js → PasswordModal-CxHFn0pB.js} +13 -13
- package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
- package/dist/RPLayout.module-BH5r8dDc.js +14 -0
- package/dist/RPPages-U8QNLlIa.js +686 -0
- package/dist/{RPTooltip-ZZoFqP7C.js → RPTooltip-QWwWh4HW.js} +127 -95
- package/dist/SearchTool.module-DY8Ucfb_.js +17 -0
- package/dist/{SkipLink-CdcjClGB.js → SkipLink-Dj83gZdk.js} +3 -3
- package/dist/{TextLayer-DWGFN9SF.js → TextLayer-D-V9kogG.js} +5 -5
- package/dist/{Thumbnail-CU1p9tZ6.js → Thumbnail-BXMk0OWF.js} +8 -8
- package/dist/{Thumbnails-VMbfTvqt.js → Thumbnails-BIuN8LZ8.js} +2 -2
- package/dist/assets/AnnotationLayer.css +1 -1
- package/dist/assets/CanvasLayer.css +1 -0
- package/dist/assets/LoadingIndicator.css +1 -1
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/Paginate.css +1 -1
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/RPLayout.css +1 -1
- package/dist/assets/RPPages.css +1 -1
- package/dist/assets/SearchTool.css +1 -1
- package/dist/assets/SkipLink.css +1 -1
- package/dist/assets/TextLayer.css +1 -1
- package/dist/assets/Thumbnail.css +1 -1
- package/dist/assets/style.js +1 -1
- package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
- package/dist/components/RPController.js +39 -39
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/icons/LoaderIcon.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/LayoutContainer.js +7 -7
- package/dist/components/layout/LayoutWrapper.js +5 -5
- package/dist/components/layout/RPDefaultLayout.js +56 -55
- package/dist/components/layout/RPLayout.js +39 -38
- package/dist/components/layout/SkipLink.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +3 -3
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +7 -7
- package/dist/components/layout/toolbar/FileDownloadTool.js +7 -7
- package/dist/components/layout/toolbar/FileUploadTool.js +7 -7
- package/dist/components/layout/toolbar/FullScreenTool.js +10 -9
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +25 -31
- package/dist/components/layout/toolbar/OtherTool.js +6 -6
- package/dist/components/layout/toolbar/Paginate.js +20 -5
- package/dist/components/layout/toolbar/PrintTool.js +7 -7
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +12 -12
- package/dist/components/layout/toolbar/ScrollModeTool.js +18 -18
- package/dist/components/layout/toolbar/SearchCloseButton.js +3 -3
- package/dist/components/layout/toolbar/SearchResultNavigator.js +3 -3
- package/dist/components/layout/toolbar/SearchTool.js +134 -122
- package/dist/components/layout/toolbar/SelectionModeTool.js +12 -12
- package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +18 -18
- package/dist/components/layout/toolbar/ZoomTool.js +86 -84
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
- package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/InputPageTool.js +37 -26
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +25 -23
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +25 -23
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -5
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +8 -8
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +2 -48
- package/dist/components/page/DualPage.js +2 -2
- package/dist/components/page/DualPageWithCover.js +2 -2
- package/dist/components/page/RPPage.js +94 -2
- package/dist/components/page/SinglePage.js +2 -2
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/Input.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +1 -1
- package/dist/components/ui/RPTooltip.js +1 -1
- package/dist/contexts/DimensionPagesContext.js +38 -22
- package/dist/contexts/ElementPageContext.js +46 -39
- package/dist/contexts/ElementThumbnailContext.js +1 -1
- package/dist/contexts/LoaderContext.js +1 -1
- package/dist/contexts/LocalizationContext.js +12 -6
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +26 -18
- package/dist/contexts/RenderedPagesCache.js +32 -13
- package/dist/contexts/VirtualScrollContext.js +10 -13
- package/dist/contexts/ZoomContext.js +119 -61
- package/dist/{de_DE--0LF-SJR.js → de_DE-x4Z-jQrz.js} +54 -6
- package/dist/{dist-7FA4Do6I.js → dist-B2hwhF6G.js} +7 -7
- package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
- package/dist/{dist-C3WNMuW2.js → dist-CNbFpoT1.js} +2 -2
- package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
- package/dist/{dist-CKteKPPA.js → dist-VbpVNBs6.js} +7 -7
- package/dist/icons.js +1 -1
- package/dist/{lib-BiapEtK1.js → lib-CSInlR9T.js} +142 -237
- package/dist/{main-B74-PfMa.js → main-DCzVrq0G.js} +3 -3
- package/dist/main.js +5 -5
- package/dist/style-CJtyyrJx.js +5 -0
- package/dist/types/components/page/CanvasLayer.d.ts +4 -1
- package/dist/types/components/ui/RPTooltip.d.ts +3 -2
- package/dist/types/contexts/RenderQueueProvider.d.ts +2 -0
- package/dist/types/contexts/RenderedPagesCache.d.ts +3 -0
- package/dist/types/contexts/VirtualScrollContext.d.ts +0 -3
- package/dist/types/locales/de_DE.json.d.ts +11 -2
- package/dist/types/locales/en_US.json.d.ts +11 -2
- package/dist/types/locales/it_IT.json.d.ts +11 -2
- package/dist/types/locales/pt_PT.json.d.ts +11 -2
- package/dist/types/locales/th_TH.json.d.ts +11 -2
- package/dist/types/locales/zh_CN.json.d.ts +11 -2
- package/dist/types/utils/Queue.d.ts +1 -0
- package/dist/types/utils/const.d.ts +3 -0
- package/dist/types/utils/constants.d.ts +9 -0
- package/dist/types/utils/documentLayout.d.ts +60 -0
- package/dist/types/utils/hooks/usePinch.d.ts +14 -1
- package/dist/types/utils/hooks/usePresentPage.d.ts +2 -2
- package/dist/types/utils/hooks/useZoomOrigin.d.ts +4 -0
- package/dist/types/utils/types.d.ts +25 -2
- package/dist/types/utils/zoom.d.ts +2 -0
- package/dist/utils/Queue.js +5 -0
- package/dist/utils/const.js +2 -2
- package/dist/utils/constants.js +2 -2
- package/dist/utils/documentLayout.js +141 -0
- package/dist/utils/hooks/useLicense.js +2 -2
- 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/usePinch.js +109 -56
- package/dist/utils/hooks/usePresentPage.js +33 -57
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +66 -67
- package/dist/utils/hooks/useZoomOrigin.js +37 -0
- package/dist/utils/renderPage.js +21 -14
- package/dist/utils/types.js +3 -3
- package/dist/utils/zoom.js +8 -2
- package/package.json +1 -1
- package/dist/Container-DTWaZzc7.js +0 -16
- package/dist/MenuItem-BJDWfzAw.js +0 -15
- package/dist/Paginate.module-B0GMw-MB.js +0 -8
- package/dist/PaginationContext-C5CJiEW-.js +0 -242
- package/dist/RPLayout.module-Vc3h4xxS.js +0 -14
- package/dist/RPPage-BsDixmqF.js +0 -91
- package/dist/RPPages-BkEFexWu.js +0 -1007
- package/dist/SearchTool.module-DUkVXfOn.js +0 -16
- package/dist/assets/RPPage.css +0 -1
- package/dist/contexts/VirtualGridContext.js +0 -18
- package/dist/style-BPQRJJJ7.js +0 -5
- package/dist/types/contexts/VirtualGridContext.d.ts +0 -9
- package/dist/types/utils/calculatePage.d.ts +0 -12
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +0 -17
- package/dist/utils/calculatePage.js +0 -30
- package/dist/utils/hooks/useVirtualReactWindow.js +0 -86
- /package/dist/{TextHighlightLayer-BSVgBxR3.js → TextHighlightLayer-3vIZbRyL.js} +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ScrollMode as e, ViewMode as t } from "./utils/types.js";
|
|
2
|
+
import { appConsole as n } from "./utils/appConsole.js";
|
|
3
|
+
import { useDocumentContext as r } from "./contexts/RPDocumentContext.js";
|
|
4
|
+
import { useInitialStateContext as i } from "./contexts/InitialStateContext.js";
|
|
5
|
+
import { useScrollModeContext as a } from "./contexts/ScrollModeContext.js";
|
|
6
|
+
import { useViewModeContext as o } from "./contexts/ViewModeContext.js";
|
|
7
|
+
import { useVirtualScrollContext as s } from "./contexts/VirtualScrollContext.js";
|
|
8
|
+
import { useLayoutContainer as c } from "./contexts/LayoutContainerContext.js";
|
|
9
|
+
import { useGlobalCurrentPage as l } from "./contexts/GlobalCurrentPage.js";
|
|
10
|
+
import { useDebounce as u } from "./utils/hooks/useDebounce.js";
|
|
11
|
+
import { useDimensionPagesContext as d } from "./contexts/DimensionPagesContext.js";
|
|
12
|
+
import { useSmoothScrollContext as f } from "./contexts/SmoothScrollContext.js";
|
|
13
|
+
import { buildDocumentLayout as p, getScrollTargetForPage as m } from "./utils/documentLayout.js";
|
|
14
|
+
import { createContext as h, useCallback as g, useContext as _, useEffect as v, useRef as y, useState as b } from "react";
|
|
15
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
16
|
+
//#region lib/utils/hooks/useScrollToPage.ts
|
|
17
|
+
var S = () => {
|
|
18
|
+
let { viewMode: t } = o(), { scrollMode: n } = a(), { virtualScrollableElementRef: r, pageScrollElementRef: i } = s(), { setFocusedPage: c } = T(), { widths: l, heights: u } = d(), h = y(n), _ = y(t), b = y({
|
|
19
|
+
widths: l,
|
|
20
|
+
heights: u
|
|
21
|
+
}), { targetScrollPage: x, scrollBehavior: S } = f(), C = y(null), w = y();
|
|
22
|
+
h.current = n, _.current = t, b.current = {
|
|
23
|
+
widths: l,
|
|
24
|
+
heights: u
|
|
25
|
+
};
|
|
26
|
+
let E = g(() => {
|
|
27
|
+
let t = h.current === e.PAGE_SCROLLING;
|
|
28
|
+
return (t ? i : r) ?? (t ? r : i);
|
|
29
|
+
}, [i, r]), D = g((t, n = S) => {
|
|
30
|
+
c(t), x.current = t, clearTimeout(w.current), w.current = setTimeout(() => {
|
|
31
|
+
x.current === t && (x.current = void 0);
|
|
32
|
+
}, 3e3);
|
|
33
|
+
let r = E();
|
|
34
|
+
if (!r) {
|
|
35
|
+
C.current = {
|
|
36
|
+
page: t,
|
|
37
|
+
behavior: n
|
|
38
|
+
};
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let { widths: i, heights: a } = b.current, o = m(p({
|
|
42
|
+
pageDimensions: {
|
|
43
|
+
widths: i,
|
|
44
|
+
heights: a
|
|
45
|
+
},
|
|
46
|
+
viewportWidth: r.clientWidth,
|
|
47
|
+
viewportHeight: r.clientHeight,
|
|
48
|
+
scrollMode: h.current,
|
|
49
|
+
viewMode: _.current,
|
|
50
|
+
focusedPage: t
|
|
51
|
+
}), t);
|
|
52
|
+
if (!o) {
|
|
53
|
+
C.current = {
|
|
54
|
+
page: t,
|
|
55
|
+
behavior: n
|
|
56
|
+
};
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
C.current = null;
|
|
60
|
+
let s = () => {
|
|
61
|
+
r.scrollTo({
|
|
62
|
+
left: Math.floor(o.left),
|
|
63
|
+
top: Math.floor(o.top),
|
|
64
|
+
behavior: n
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
if (h.current === e.PAGE_SCROLLING) {
|
|
68
|
+
requestAnimationFrame(s);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
s();
|
|
72
|
+
}, [
|
|
73
|
+
E,
|
|
74
|
+
S,
|
|
75
|
+
c,
|
|
76
|
+
x
|
|
77
|
+
]);
|
|
78
|
+
return v(() => () => {
|
|
79
|
+
clearTimeout(w.current);
|
|
80
|
+
}, []), v(() => {
|
|
81
|
+
if (!E() || !C.current) return;
|
|
82
|
+
let { page: e, behavior: t } = C.current;
|
|
83
|
+
C.current = null, D(e, t);
|
|
84
|
+
}, [E, D]), { scrollToPage: D };
|
|
85
|
+
}, C = (n = 1) => {
|
|
86
|
+
let [r, i] = b(n), [s, l] = b(0), { scrollToPage: f } = S(), p = y(n), { viewMode: m } = o(), { scrollMode: h } = a(), { widths: _ } = d(), { pagesRef: v } = c(), x = u(r, 100), C = g((e) => {
|
|
87
|
+
if (!/^[0-9]*$/g.test(e.toString()) || !e) return {
|
|
88
|
+
success: !1,
|
|
89
|
+
currentPage: p.current
|
|
90
|
+
};
|
|
91
|
+
let t = +e;
|
|
92
|
+
return t <= 0 || t > s ? {
|
|
93
|
+
success: !1,
|
|
94
|
+
currentPage: p.current
|
|
95
|
+
} : (i(t), p.current = t, {
|
|
96
|
+
success: !0,
|
|
97
|
+
currentPage: +e
|
|
98
|
+
});
|
|
99
|
+
}, [s]), w = g(C, [C]), T = g((e) => {
|
|
100
|
+
i(e), p.current = e;
|
|
101
|
+
}, []), E = g((e, t) => {
|
|
102
|
+
let n = C(e);
|
|
103
|
+
return n.success && f(n.currentPage, t), n;
|
|
104
|
+
}, [C, f]), D = g((e) => {
|
|
105
|
+
let n = e % 2 == 1;
|
|
106
|
+
if (!v || n) return !1;
|
|
107
|
+
let r = n ? _[e] : _[e - 1], i = n ? _[e + 1] : _[e];
|
|
108
|
+
return m === t.DUAL_PAGE && r + i < v.clientWidth;
|
|
109
|
+
}, [
|
|
110
|
+
m,
|
|
111
|
+
_,
|
|
112
|
+
v,
|
|
113
|
+
s
|
|
114
|
+
]), O = g((n) => m === t.DUAL_PAGE && h === e.PAGE_SCROLLING ? n >= s - 1 : n >= s, [
|
|
115
|
+
s,
|
|
116
|
+
m,
|
|
117
|
+
h
|
|
118
|
+
]), k = g(() => {
|
|
119
|
+
let e = p.current, t = e - 1;
|
|
120
|
+
D(t) && (t = e - 2), E(t);
|
|
121
|
+
}, [E, D]);
|
|
122
|
+
return {
|
|
123
|
+
focusedPage: x,
|
|
124
|
+
totalPages: s,
|
|
125
|
+
setFocusedPage: w,
|
|
126
|
+
resetPage: T,
|
|
127
|
+
setTotalPages: l,
|
|
128
|
+
nextPage: g(() => {
|
|
129
|
+
let e = p.current;
|
|
130
|
+
if (O(e)) return;
|
|
131
|
+
let t = e + 1;
|
|
132
|
+
D(t) && (t = e + 2), E(t);
|
|
133
|
+
}, [
|
|
134
|
+
E,
|
|
135
|
+
D,
|
|
136
|
+
O
|
|
137
|
+
]),
|
|
138
|
+
prevPage: k,
|
|
139
|
+
goToPage: E
|
|
140
|
+
};
|
|
141
|
+
}, w = h({
|
|
142
|
+
focusedPage: 0,
|
|
143
|
+
setFocusedPage: (e) => {},
|
|
144
|
+
goToPage: (e, t) => ({
|
|
145
|
+
success: !!e,
|
|
146
|
+
currentPage: +e
|
|
147
|
+
}),
|
|
148
|
+
totalPages: 0,
|
|
149
|
+
setTotalPages: (e) => {},
|
|
150
|
+
prevPage: () => {},
|
|
151
|
+
nextPage: () => {}
|
|
152
|
+
}), T = () => {
|
|
153
|
+
let e = _(w);
|
|
154
|
+
return e?.focusedPage === void 0 && n.error("Please use this hooks inside children component of RPProvider"), e;
|
|
155
|
+
}, E = ({ children: e }) => {
|
|
156
|
+
let { pdf: t, pages: n } = r(), { setCurrentPage: a } = l(), { initialPage: o = 1 } = i(), { focusedPage: s, totalPages: c, setFocusedPage: u, resetPage: d, setTotalPages: f, goToPage: p, nextPage: m, prevPage: h } = C(o), g = y(!0);
|
|
157
|
+
return v(() => {
|
|
158
|
+
if (!t) {
|
|
159
|
+
g.current || (f(0), d(1));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (!t.numPages) return;
|
|
163
|
+
f(t.numPages);
|
|
164
|
+
let e = g.current ? o : 1;
|
|
165
|
+
d(Math.min(Math.max(e, 1), t.numPages)), g.current = !1;
|
|
166
|
+
}, [
|
|
167
|
+
t,
|
|
168
|
+
f,
|
|
169
|
+
d
|
|
170
|
+
]), v(() => {
|
|
171
|
+
!t || !n.size || (f(n.size), s > n.size && d(n.size));
|
|
172
|
+
}, [
|
|
173
|
+
t,
|
|
174
|
+
n,
|
|
175
|
+
s,
|
|
176
|
+
f,
|
|
177
|
+
d
|
|
178
|
+
]), v(() => {
|
|
179
|
+
a(s);
|
|
180
|
+
}, [s, a]), /* @__PURE__ */ x(w.Provider, {
|
|
181
|
+
value: {
|
|
182
|
+
focusedPage: s,
|
|
183
|
+
totalPages: c,
|
|
184
|
+
setFocusedPage: u,
|
|
185
|
+
setTotalPages: f,
|
|
186
|
+
nextPage: m,
|
|
187
|
+
prevPage: h,
|
|
188
|
+
goToPage: p
|
|
189
|
+
},
|
|
190
|
+
children: e
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
//#endregion
|
|
194
|
+
export { S as a, C as i, E as n, T as r, w as t };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useDocumentPasswordContext as e } from "./contexts/DocumentPasswordContext.js";
|
|
2
2
|
import { useLocalizationContext as t } from "./contexts/LocalizationContext.js";
|
|
3
|
-
import { t as n } from "./clsx-
|
|
3
|
+
import { t as n } from "./clsx-DSGuh5YW.js";
|
|
4
4
|
import { useState as r } from "react";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import './assets/PasswordModal.css';//#region lib/components/ui/
|
|
6
|
+
import './assets/PasswordModal.css';//#region lib/components/ui/passwordModal.module.css
|
|
7
7
|
var o = {
|
|
8
|
-
"rp-password-overlay": "_rp-password-
|
|
9
|
-
"rp-password-modal": "_rp-password-
|
|
10
|
-
"rp-password-title": "_rp-password-
|
|
11
|
-
"rp-password-content": "_rp-password-
|
|
12
|
-
"rp-password-form": "_rp-password-
|
|
13
|
-
"rp-password-label": "_rp-password-
|
|
14
|
-
"rp-password-input": "_rp-password-
|
|
15
|
-
"rp-password-input-invalid": "_rp-password-input-
|
|
16
|
-
"rp-password-message-invalid": "_rp-password-message-
|
|
17
|
-
"rp-password-submit-button": "_rp-password-submit-
|
|
8
|
+
"rp-password-overlay": "_rp-password-overlay_1xibg_1",
|
|
9
|
+
"rp-password-modal": "_rp-password-modal_1xibg_13",
|
|
10
|
+
"rp-password-title": "_rp-password-title_1xibg_27",
|
|
11
|
+
"rp-password-content": "_rp-password-content_1xibg_35",
|
|
12
|
+
"rp-password-form": "_rp-password-form_1xibg_41",
|
|
13
|
+
"rp-password-label": "_rp-password-label_1xibg_45",
|
|
14
|
+
"rp-password-input": "_rp-password-input_1xibg_57",
|
|
15
|
+
"rp-password-input-invalid": "_rp-password-input-invalid_1xibg_74",
|
|
16
|
+
"rp-password-message-invalid": "_rp-password-message-invalid_1xibg_78",
|
|
17
|
+
"rp-password-submit-button": "_rp-password-submit-button_1xibg_84"
|
|
18
18
|
}, s = () => {
|
|
19
19
|
let [s, c] = r(""), { localeMessages: l } = t(), { setPassword: u, setPasswordError: d, invalidPassword: f } = e(), p = (e) => {
|
|
20
20
|
c(e.target.value), f && d(void 0);
|
|
@@ -57,7 +57,7 @@ var o = {
|
|
|
57
57
|
onChange: p,
|
|
58
58
|
className: n(o["rp-password-input"], f && o["rp-password-input-invalid"]),
|
|
59
59
|
placeholder: l?.passwordPlaceholder,
|
|
60
|
-
autoComplete: "
|
|
60
|
+
autoComplete: "current-password",
|
|
61
61
|
"aria-label": l?.passwordPlaceholder,
|
|
62
62
|
"aria-required": "true",
|
|
63
63
|
"aria-invalid": f,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDarkModeContext as e } from "./contexts/DarkModeContext.js";
|
|
2
2
|
import { useLocalizationContext as t } from "./contexts/LocalizationContext.js";
|
|
3
3
|
import { useDropFileZoneContext as n } from "./contexts/DropFileZoneContext.js";
|
|
4
|
-
import { t as r } from "./clsx-
|
|
4
|
+
import { t as r } from "./clsx-DSGuh5YW.js";
|
|
5
5
|
import { t as i } from "./LightPdfIcon-DL8MYtWQ.js";
|
|
6
6
|
import { t as a } from "./DarkPdfIcon-B5ehd9CV.js";
|
|
7
7
|
import { useDropFileZone as o } from "./utils/hooks/useDropFileZone.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './assets/RPLayout.css';//#region lib/components/layout/RPLayout.module.css
|
|
2
|
+
var e = {
|
|
3
|
+
"rp-layout": "_rp-layout_1h20a_1",
|
|
4
|
+
"rp-layout-wrapper": "_rp-layout-wrapper_1h20a_5",
|
|
5
|
+
"rp-content": "_rp-content_1h20a_11",
|
|
6
|
+
"rp-sidebar": "_rp-sidebar_1h20a_18",
|
|
7
|
+
"rp-pages": "_rp-pages_1h20a_23",
|
|
8
|
+
"rp-container": "_rp-container_1h20a_29",
|
|
9
|
+
"rp-loader": "_rp-loader_1h20a_33",
|
|
10
|
+
"rp-theme-variables": "_rp-theme-variables_1h20a_37",
|
|
11
|
+
"rp-dark-mode": "_rp-dark-mode_1h20a_158"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as t };
|