@react-pdf-kit/viewer 2.8.0-beta.6 → 2.8.0-beta.7
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-CAIvKf_O.js → AnnotationLayer-Dl6VxRzL.js} +2 -2
- package/dist/CanvasLayer-cRwL_IIT.js +105 -0
- package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-B_Jsf8No.js} +7 -7
- package/dist/MenuItem-D-GflAAo.js +31 -0
- package/dist/{PaginationContext-Cwf8sCpK.js → PaginationContext-B3qzCYJu.js} +46 -53
- package/dist/{PasswordModal-CB9Rd2zJ.js → PasswordModal-BW_C2ULg.js} +11 -11
- package/dist/RPLayout.module-DCbTHUuG.js +14 -0
- package/dist/{RPPages-CmXHTAqF.js → RPPages-5yXo7yhq.js} +616 -316
- package/dist/{RPTooltip-ZZoFqP7C.js → RPTooltip-COLVx-C_.js} +123 -91
- package/dist/SearchTool.module-DY8Ucfb_.js +17 -0
- package/dist/{SkipLink-CdcjClGB.js → SkipLink-Dj83gZdk.js} +3 -3
- package/dist/{TextLayer-DWGFN9SF.js → TextLayer-BdoXGj0Z.js} +5 -5
- package/dist/{Thumbnail-CzclS3h_.js → Thumbnail-BVjnCNxv.js} +6 -6
- package/dist/{Thumbnails-DnAsrttK.js → Thumbnails-CrKLESh3.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/PasswordModal.css +1 -1
- package/dist/assets/RPLayout.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/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/LayoutWrapper.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/SkipLink.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +2 -2
- 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 +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +6 -6
- package/dist/components/layout/toolbar/FileDownloadTool.js +6 -6
- package/dist/components/layout/toolbar/FileUploadTool.js +6 -6
- package/dist/components/layout/toolbar/FullScreenTool.js +9 -8
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +23 -29
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +2 -2
- package/dist/components/layout/toolbar/PrintTool.js +6 -6
- package/dist/components/layout/toolbar/RPMenuItem.js +2 -2
- package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +10 -10
- package/dist/components/layout/toolbar/ScrollModeTool.js +15 -15
- package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +133 -121
- package/dist/components/layout/toolbar/SelectionModeTool.js +10 -10
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- 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 +16 -16
- package/dist/components/layout/toolbar/ZoomTool.js +82 -80
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +1 -1
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +1 -1
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +1 -1
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +1 -1
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +1 -1
- 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 +2 -2
- 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 +3 -3
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +2 -2
- 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/TextLayer.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/ElementThumbnailContext.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +11 -7
- package/dist/contexts/ZoomContext.js +119 -61
- package/dist/{de_DE-DwUvXUWH.js → de_DE-C1OrwQKj.js} +18 -0
- package/dist/{main-CKr9unOk.js → main-CdlJS0xf.js} +2 -2
- package/dist/main.js +4 -4
- package/dist/style-CWQAmimK.js +5 -0
- package/dist/types/components/ui/RPTooltip.d.ts +3 -2
- package/dist/types/contexts/RenderQueueProvider.d.ts +2 -0
- package/dist/types/locales/de_DE.json.d.ts +3 -0
- package/dist/types/locales/en_US.json.d.ts +3 -0
- package/dist/types/locales/it_IT.json.d.ts +3 -0
- package/dist/types/locales/pt_PT.json.d.ts +3 -0
- package/dist/types/locales/th_TH.json.d.ts +3 -0
- package/dist/types/locales/zh_CN.json.d.ts +3 -0
- package/dist/types/utils/Queue.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +8 -0
- package/dist/types/utils/hooks/usePinch.d.ts +14 -1
- package/dist/types/utils/hooks/useZoomOrigin.d.ts +4 -0
- package/dist/types/utils/types.d.ts +17 -1
- package/dist/types/utils/zoom.d.ts +2 -0
- package/dist/utils/Queue.js +5 -0
- package/dist/utils/constants.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePinch.js +102 -56
- package/dist/utils/hooks/usePresentPage.js +23 -19
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useZoomOrigin.js +37 -0
- package/dist/utils/renderPage.js +21 -14
- package/dist/utils/types.js +2 -2
- package/dist/utils/zoom.js +8 -2
- package/package.json +1 -1
- package/dist/MenuItem-BJDWfzAw.js +0 -15
- package/dist/RPLayout.module-Vc3h4xxS.js +0 -14
- package/dist/RPPage-C_r8aeTc.js +0 -91
- package/dist/SearchTool.module-DUkVXfOn.js +0 -16
- package/dist/assets/RPPage.css +0 -1
- package/dist/style-C8T5x1fE.js +0 -5
|
@@ -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-B3qzCYJu.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";
|
|
@@ -11,7 +11,7 @@ import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState a
|
|
|
11
11
|
import { AnnotationLayer as b } from "pdfjs-dist";
|
|
12
12
|
import { jsx as x } from "react/jsx-runtime";
|
|
13
13
|
import './assets/AnnotationLayer.css';//#region lib/components/page/AnnotationLayer.module.css
|
|
14
|
-
var S = { "rp-annotation-layer": "_rp-annotation-
|
|
14
|
+
var S = { "rp-annotation-layer": "_rp-annotation-layer_foiun_1" }, C = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/", w = (w) => {
|
|
15
15
|
let { pageNumber: T } = w, E = v(null), { pages: D, pdf: O } = t(), { interactiveForm: k } = n(), A = v(), [j, M] = y(), { goToPage: N } = i(), { scrollMode: P } = r(), { print: F } = a(), { download: I } = m(), L = v(null), R = _(() => D.get(T), [D, T]), z = _(() => R?.page.getViewport(), [R]);
|
|
16
16
|
g(() => {
|
|
17
17
|
A.current &&= (A.current.div.replaceChildren(), void 0);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useDocumentContext as e } from "./contexts/RPDocumentContext.js";
|
|
2
|
+
import { useInitialStateContext as t } from "./contexts/InitialStateContext.js";
|
|
3
|
+
import { useZoomContext as n } from "./contexts/ZoomContext.js";
|
|
4
|
+
import { usePagesRotateContext as r } from "./contexts/PagesRotateContext.js";
|
|
5
|
+
import { useRenderQueue as i } from "./contexts/RenderQueueProvider.js";
|
|
6
|
+
import { useCallback as a, useEffect as o, useRef as s } from "react";
|
|
7
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
8
|
+
import './assets/CanvasLayer.css';//#region lib/components/page/RPPage.module.css
|
|
9
|
+
var l = {
|
|
10
|
+
"rp-page-wrapper": "_rp-page-wrapper_1iuev_1",
|
|
11
|
+
"rp-page": "_rp-page_1iuev_1",
|
|
12
|
+
"rp-canvas-layer": "_rp-canvas-layer_1iuev_17",
|
|
13
|
+
"rp-loader-wrapper": "_rp-loader-wrapper_1iuev_40"
|
|
14
|
+
}, u = (u) => {
|
|
15
|
+
let { pageNumber: d, onLoaded: f, onLoading: p } = u, m = s(null), h = s(null), g = s(null), { pages: _ } = e(), { pageRotate: v } = r(), { currentZoom: y, targetZoom: b, isZooming: x } = n(), { interactiveForm: S } = t(), C = i(), w = s(`page-${d}`), T = s(0), E = s(""), D = s(null), O = s(0), k = s(!1), A = a((e, t = !1) => {
|
|
16
|
+
e && (e.width = 0, e.height = 0, t && e.parentNode && e.parentNode.removeChild(e));
|
|
17
|
+
}, []), j = a((e = h.current) => {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
let t = O.current, n = t ? (b || y || t || 1) / t : 1;
|
|
20
|
+
e.style.setProperty("--rp-canvas-scale-ratio", String(n));
|
|
21
|
+
}, [y, b]), M = a(() => {
|
|
22
|
+
let e = document.createElement("canvas");
|
|
23
|
+
return e.dataset.rp = `page-${d}-canvas`, e.style.opacity = "0", e.style.position = "absolute", e.style.inset = "0", j(e), e;
|
|
24
|
+
}, [d, j]), N = a(() => {
|
|
25
|
+
C.removeQueue(w.current), D.current &&= (D.current.cancel(), null);
|
|
26
|
+
}, [C]), P = a(() => {
|
|
27
|
+
g.current && !g.current.parentNode && (A(g.current), g.current = null);
|
|
28
|
+
}, [A]), F = a((e) => {
|
|
29
|
+
if (!k.current) return A(e), !1;
|
|
30
|
+
let t = m.current;
|
|
31
|
+
if (!t) return A(e), !1;
|
|
32
|
+
let n = h.current;
|
|
33
|
+
return n?.parentNode ? n.replaceWith(e) : t.appendChild(e), e.style.opacity = "1", h.current = e, A(n), !0;
|
|
34
|
+
}, [A]);
|
|
35
|
+
return o(() => (k.current = !0, () => {
|
|
36
|
+
k.current = !1, N(), A(g.current), A(h.current), g.current = null, h.current = null;
|
|
37
|
+
}), [N, A]), o(() => {
|
|
38
|
+
j();
|
|
39
|
+
}, [j]), o(() => {
|
|
40
|
+
w.current = `page-${d}`, E.current = "", O.current = 0, A(g.current, !0), A(h.current, !0), g.current = null, h.current = null;
|
|
41
|
+
}, [A, d]), o(() => {
|
|
42
|
+
x && (N(), P());
|
|
43
|
+
}, [
|
|
44
|
+
N,
|
|
45
|
+
P,
|
|
46
|
+
x
|
|
47
|
+
]), o(() => {
|
|
48
|
+
if (!_ || y === 0 || x) return;
|
|
49
|
+
let e = _.get(d), t = m.current;
|
|
50
|
+
if (!e || !t) return;
|
|
51
|
+
let n = v[d] ?? e.defaultRotation ?? 0, r = `${y}:${n}:${S ? "forms" : "static"}`;
|
|
52
|
+
if (E.current === r) return;
|
|
53
|
+
let i = h.current, a = !!i && i.width > 0 && i.height > 0, o = T.current + 1;
|
|
54
|
+
T.current = o, N(), P(), p && !a && p();
|
|
55
|
+
let s = M();
|
|
56
|
+
return g.current = s, C.enqueue(w.current, {
|
|
57
|
+
page: e.page,
|
|
58
|
+
canvasElem: s,
|
|
59
|
+
options: {
|
|
60
|
+
scale: y,
|
|
61
|
+
rotate: n,
|
|
62
|
+
renderForms: !0,
|
|
63
|
+
interactiveForm: S
|
|
64
|
+
},
|
|
65
|
+
onLoaded: () => {
|
|
66
|
+
if (T.current !== o || g.current !== s) {
|
|
67
|
+
A(s);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (O.current = y, j(s), !F(s)) {
|
|
71
|
+
g.current = null;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
g.current = null, E.current = r, D.current = null, f?.();
|
|
75
|
+
},
|
|
76
|
+
onRenderTask: (e) => {
|
|
77
|
+
T.current === o && (D.current = e);
|
|
78
|
+
}
|
|
79
|
+
}, 3), () => {
|
|
80
|
+
N(), g.current === s && (A(s), g.current = null);
|
|
81
|
+
};
|
|
82
|
+
}, [
|
|
83
|
+
N,
|
|
84
|
+
A,
|
|
85
|
+
P,
|
|
86
|
+
M,
|
|
87
|
+
y,
|
|
88
|
+
S,
|
|
89
|
+
x,
|
|
90
|
+
f,
|
|
91
|
+
p,
|
|
92
|
+
d,
|
|
93
|
+
v,
|
|
94
|
+
_,
|
|
95
|
+
C,
|
|
96
|
+
F,
|
|
97
|
+
j
|
|
98
|
+
]), /* @__PURE__ */ c("div", {
|
|
99
|
+
className: l["rp-canvas-layer"],
|
|
100
|
+
"data-rp": `page-${d}-canvasLayer`,
|
|
101
|
+
ref: m
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
export { l as n, u as t };
|
|
@@ -3,13 +3,13 @@ import { usePrintContext as t } from "./contexts/PrintContext.js";
|
|
|
3
3
|
import { t as n } from "./clsx-B7LyVm5O.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import './assets/LoadingIndicator.css';var a = {
|
|
6
|
-
"rp-loading-overlay": "_rp-loading-
|
|
7
|
-
"rp-loading-modal": "_rp-loading-
|
|
8
|
-
"rp-loading-title": "_rp-loading-
|
|
9
|
-
"rp-loading-progress-bar": "_rp-loading-progress-
|
|
10
|
-
"rp-loading-progress": "_rp-loading-
|
|
11
|
-
"rp-loading-cancel-button": "_rp-loading-cancel-
|
|
12
|
-
loading: "
|
|
6
|
+
"rp-loading-overlay": "_rp-loading-overlay_8gxoj_1",
|
|
7
|
+
"rp-loading-modal": "_rp-loading-modal_8gxoj_14",
|
|
8
|
+
"rp-loading-title": "_rp-loading-title_8gxoj_27",
|
|
9
|
+
"rp-loading-progress-bar": "_rp-loading-progress-bar_8gxoj_35",
|
|
10
|
+
"rp-loading-progress": "_rp-loading-progress_8gxoj_35",
|
|
11
|
+
"rp-loading-cancel-button": "_rp-loading-cancel-button_8gxoj_55",
|
|
12
|
+
loading: "_loading_8gxoj_1"
|
|
13
13
|
}, o = ({ percentage: o }) => {
|
|
14
14
|
let { cancel: s } = t(), { localeMessages: c } = e();
|
|
15
15
|
return o < 1 ? null : /* @__PURE__ */ r("div", {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as e } from "./clsx-B7LyVm5O.js";
|
|
2
|
+
import { r as t } from "./dist-CKteKPPA.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import './assets/MenuItem.css';//#region lib/components/layout/toolbar/MenuItem.module.css
|
|
5
|
+
var r = { "rp-menu-item": "_rp-menu-item_1q6of_1" }, i = (i) => {
|
|
6
|
+
let { children: a, className: o, disabled: s = !1, onClick: c, onSelect: l, ...u } = i, d = (e) => {
|
|
7
|
+
if (s) {
|
|
8
|
+
e?.preventDefault(), e?.stopPropagation();
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
c?.(e);
|
|
12
|
+
}, f = (e) => {
|
|
13
|
+
if (s) {
|
|
14
|
+
e?.preventDefault(), e?.stopPropagation();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
l?.(e);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ n(t, {
|
|
20
|
+
...u,
|
|
21
|
+
tabIndex: 0,
|
|
22
|
+
className: e(r["rp-menu-item"], o),
|
|
23
|
+
disabled: s,
|
|
24
|
+
"aria-disabled": s,
|
|
25
|
+
onClick: d,
|
|
26
|
+
onSelect: f,
|
|
27
|
+
children: a
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as t };
|
|
@@ -14,22 +14,22 @@ import { useDimensionPagesContext as p } from "./contexts/DimensionPagesContext.
|
|
|
14
14
|
import { useSmoothScrollContext as m } from "./contexts/SmoothScrollContext.js";
|
|
15
15
|
import { getScrollDistance as h } from "./utils/getScrollDistance.js";
|
|
16
16
|
import { getGridDimension as g, getPositionFromPage as _ } from "./utils/calculatePage.js";
|
|
17
|
-
import { createContext as v, useCallback as y, useContext as b, useEffect as x,
|
|
18
|
-
import { jsx as
|
|
17
|
+
import { createContext as v, useCallback as y, useContext as b, useEffect as x, useRef as S, useState as C } from "react";
|
|
18
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
19
19
|
//#region lib/utils/hooks/useScrollToPage.ts
|
|
20
|
-
var
|
|
21
|
-
let { viewMode: n } = o(), { scrollMode: r } = a(), { virtualScrollRef: i, virtualScrollableElementRef: u, pageScrollElementRef: d } = s(), { setFocusedPage: f } =
|
|
20
|
+
var T = () => {
|
|
21
|
+
let { viewMode: n } = o(), { scrollMode: r } = a(), { virtualScrollRef: i, virtualScrollableElementRef: u, pageScrollElementRef: d } = s(), { setFocusedPage: f } = O(), v = S(), { columnCount: b } = c(), { widths: C, heights: w } = p(), T = S(r), E = S(n), D = S(b), { targetScrollPage: k, scrollBehavior: A } = m(), j = S(null), M = S();
|
|
22
22
|
x(() => {
|
|
23
23
|
i?.scrollToItem && (v.current = i);
|
|
24
24
|
}, [i]), x(() => {
|
|
25
25
|
T.current = r, E.current = n;
|
|
26
26
|
}, [r, n]);
|
|
27
|
-
let
|
|
27
|
+
let N = y((e, t) => {
|
|
28
28
|
if (!d) return;
|
|
29
29
|
let n = Math.ceil(e / 2) * 2 - 1;
|
|
30
30
|
if (e === n + 1) {
|
|
31
31
|
let e = {
|
|
32
|
-
left:
|
|
32
|
+
left: C[n],
|
|
33
33
|
top: 0
|
|
34
34
|
};
|
|
35
35
|
return new Promise((t) => l(d, e, t));
|
|
@@ -41,7 +41,7 @@ var E = () => {
|
|
|
41
41
|
});
|
|
42
42
|
}, [
|
|
43
43
|
d,
|
|
44
|
-
|
|
44
|
+
C,
|
|
45
45
|
l
|
|
46
46
|
]);
|
|
47
47
|
x(() => {
|
|
@@ -49,11 +49,13 @@ var E = () => {
|
|
|
49
49
|
}, [r, n]), x(() => {
|
|
50
50
|
D.current = b;
|
|
51
51
|
}, [b]);
|
|
52
|
-
let
|
|
53
|
-
f(n)
|
|
52
|
+
let P = y((n, r = A) => {
|
|
53
|
+
f(n), k.current = n, clearTimeout(M.current), M.current = setTimeout(() => {
|
|
54
|
+
k.current === n && (k.current = void 0);
|
|
55
|
+
}, 3e3);
|
|
54
56
|
let i = n - 1, a = i, o = 0;
|
|
55
57
|
if (E.current === t.DUAL_PAGE && T.current === e.PAGE_SCROLLING) {
|
|
56
|
-
|
|
58
|
+
N(n, r);
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
61
|
if (T.current === e.PAGE_SCROLLING) {
|
|
@@ -68,10 +70,8 @@ var E = () => {
|
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
72
|
j.current = null;
|
|
71
|
-
let s = u
|
|
72
|
-
|
|
73
|
-
let c = E.current === t.DUAL_PAGE_WITH_COVER, { columnsWidth: l, rowsHeight: d } = g({
|
|
74
|
-
widths: S,
|
|
73
|
+
let s = u, c = E.current === t.DUAL_PAGE_WITH_COVER, { columnsWidth: l, rowsHeight: d } = g({
|
|
74
|
+
widths: C,
|
|
75
75
|
heights: w
|
|
76
76
|
}, b, c);
|
|
77
77
|
if (T.current === e.HORIZONTAL_SCROLLING) {
|
|
@@ -117,20 +117,22 @@ var E = () => {
|
|
|
117
117
|
}, [
|
|
118
118
|
u,
|
|
119
119
|
b,
|
|
120
|
-
|
|
120
|
+
N,
|
|
121
121
|
f,
|
|
122
122
|
l,
|
|
123
123
|
w,
|
|
124
|
-
|
|
124
|
+
C,
|
|
125
125
|
A
|
|
126
126
|
]);
|
|
127
|
-
return x(() => {
|
|
127
|
+
return x(() => () => {
|
|
128
|
+
clearTimeout(M.current);
|
|
129
|
+
}, []), x(() => {
|
|
128
130
|
if (!u || !j.current) return;
|
|
129
131
|
let { page: e, behavior: t } = j.current;
|
|
130
|
-
j.current = null,
|
|
131
|
-
}, [u,
|
|
132
|
-
},
|
|
133
|
-
let [r, i] =
|
|
132
|
+
j.current = null, P(e, t);
|
|
133
|
+
}, [u, P]), { scrollToPage: P };
|
|
134
|
+
}, E = (n = 1) => {
|
|
135
|
+
let [r, i] = C(n), [s, c] = C(0), { scrollToPage: l } = T(), d = S(n), { viewMode: m } = o(), { scrollMode: h } = a(), { widths: g } = p(), { pagesRef: _ } = u(), v = f(r, 100), b = y((e) => {
|
|
134
136
|
if (!/^[0-9]*$/g.test(e.toString()) || !e) return {
|
|
135
137
|
success: !1,
|
|
136
138
|
currentPage: d.current
|
|
@@ -143,12 +145,12 @@ var E = () => {
|
|
|
143
145
|
success: !0,
|
|
144
146
|
currentPage: +e
|
|
145
147
|
});
|
|
146
|
-
}, [s]), x = y(b, [b]),
|
|
148
|
+
}, [s]), x = y(b, [b]), w = y((e) => {
|
|
147
149
|
i(e), d.current = e;
|
|
148
|
-
}, []),
|
|
150
|
+
}, []), E = y((e, t) => {
|
|
149
151
|
let n = b(e);
|
|
150
152
|
return n.success && l(n.currentPage, t), n;
|
|
151
|
-
}, [b, l]),
|
|
153
|
+
}, [b, l]), D = y((e) => {
|
|
152
154
|
let n = e % 2 == 1;
|
|
153
155
|
if (!_ || n) return !1;
|
|
154
156
|
let r = n ? g[e] : g[e - 1], i = n ? g[e + 1] : g[e];
|
|
@@ -158,43 +160,34 @@ var E = () => {
|
|
|
158
160
|
g,
|
|
159
161
|
_,
|
|
160
162
|
s
|
|
161
|
-
]),
|
|
162
|
-
let e = r - 1;
|
|
163
|
-
O(e) && (e = r - 2), D(e);
|
|
164
|
-
}, [
|
|
165
|
-
D,
|
|
166
|
-
r,
|
|
167
|
-
m,
|
|
168
|
-
h,
|
|
169
|
-
O
|
|
170
|
-
]), A = S(() => m === t.DUAL_PAGE && h === e.PAGE_SCROLLING ? r === s - 1 : r === s, [
|
|
171
|
-
r,
|
|
163
|
+
]), O = y((n) => m === t.DUAL_PAGE && h === e.PAGE_SCROLLING ? n >= s - 1 : n >= s, [
|
|
172
164
|
s,
|
|
173
165
|
m,
|
|
174
166
|
h
|
|
175
|
-
])
|
|
167
|
+
]), k = y(() => {
|
|
168
|
+
let e = d.current, t = e - 1;
|
|
169
|
+
D(t) && (t = e - 2), E(t);
|
|
170
|
+
}, [E, D]);
|
|
176
171
|
return {
|
|
177
172
|
focusedPage: v,
|
|
178
173
|
totalPages: s,
|
|
179
174
|
setFocusedPage: x,
|
|
180
|
-
resetPage:
|
|
175
|
+
resetPage: w,
|
|
181
176
|
setTotalPages: c,
|
|
182
177
|
nextPage: y(() => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
let e = d.current;
|
|
179
|
+
if (O(e)) return;
|
|
180
|
+
let t = e + 1;
|
|
181
|
+
D(t) && (t = e + 2), E(t);
|
|
186
182
|
}, [
|
|
183
|
+
E,
|
|
187
184
|
D,
|
|
188
|
-
|
|
189
|
-
O,
|
|
190
|
-
m,
|
|
191
|
-
h,
|
|
192
|
-
A
|
|
185
|
+
O
|
|
193
186
|
]),
|
|
194
187
|
prevPage: k,
|
|
195
|
-
goToPage:
|
|
188
|
+
goToPage: E
|
|
196
189
|
};
|
|
197
|
-
},
|
|
190
|
+
}, D = v({
|
|
198
191
|
focusedPage: 0,
|
|
199
192
|
setFocusedPage: (e) => {},
|
|
200
193
|
goToPage: (e, t) => ({
|
|
@@ -205,11 +198,11 @@ var E = () => {
|
|
|
205
198
|
setTotalPages: (e) => {},
|
|
206
199
|
prevPage: () => {},
|
|
207
200
|
nextPage: () => {}
|
|
208
|
-
}),
|
|
209
|
-
let e = b(
|
|
201
|
+
}), O = () => {
|
|
202
|
+
let e = b(D);
|
|
210
203
|
return e?.focusedPage === void 0 && n.error("Please use this hooks inside children component of RPProvider"), e;
|
|
211
|
-
},
|
|
212
|
-
let { pdf: t } = r(), { setCurrentPage: n } = d(), { initialPage: a = 1 } = i(), { focusedPage: o, totalPages: s, setFocusedPage: c, resetPage: l, setTotalPages: u, goToPage: f, nextPage: p, prevPage: m } =
|
|
204
|
+
}, k = ({ children: e }) => {
|
|
205
|
+
let { pdf: t } = r(), { setCurrentPage: n } = d(), { initialPage: a = 1 } = i(), { focusedPage: o, totalPages: s, setFocusedPage: c, resetPage: l, setTotalPages: u, goToPage: f, nextPage: p, prevPage: m } = E(a), h = S(!0);
|
|
213
206
|
return x(() => {
|
|
214
207
|
if (!t) {
|
|
215
208
|
h.current || (u(0), l(1));
|
|
@@ -225,7 +218,7 @@ var E = () => {
|
|
|
225
218
|
l
|
|
226
219
|
]), x(() => {
|
|
227
220
|
n(o);
|
|
228
|
-
}, [o, n]), /* @__PURE__ */
|
|
221
|
+
}, [o, n]), /* @__PURE__ */ w(D.Provider, {
|
|
229
222
|
value: {
|
|
230
223
|
focusedPage: o,
|
|
231
224
|
totalPages: s,
|
|
@@ -239,4 +232,4 @@ var E = () => {
|
|
|
239
232
|
});
|
|
240
233
|
};
|
|
241
234
|
//#endregion
|
|
242
|
-
export {
|
|
235
|
+
export { T as a, E as i, k as n, O as r, D as t };
|
|
@@ -3,18 +3,18 @@ import { useLocalizationContext as t } from "./contexts/LocalizationContext.js";
|
|
|
3
3
|
import { t as n } from "./clsx-B7LyVm5O.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);
|
|
@@ -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 };
|