@react-pdf-kit/viewer 2.0.0-beta.9 → 2.0.0-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/Combination-136ff99c.js +698 -0
- package/dist/MostPageTool.module-13578ad6.js +6 -0
- package/dist/OtherTool.module-a4be5f1f.js +6 -0
- package/dist/Paginate.module-4eef00aa.js +8 -0
- package/dist/PaginationContext-9217cab4.js +201 -0
- package/dist/RPLayout.module-b4b23e29.js +14 -0
- package/dist/RPSplitter-f6acf13b.js +71 -0
- package/dist/RPToolbar.module-27d7fe77.js +10 -0
- package/dist/SearchTool.module-99f60dc7.js +16 -0
- package/dist/ToolbarLayout.module-6e339802.js +12 -0
- package/dist/ZoomTool.module-7082af8c.js +12 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +32 -30
- package/dist/components/RPController.js +81 -152
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1028 -122
- package/dist/components/RPProvider.js +57 -113
- package/dist/components/icons/DualPageWithCoverIcon.js +22 -0
- package/dist/components/layout/LayoutContainer.js +31 -136
- package/dist/components/layout/LayoutWrapper.js +8 -4
- package/dist/components/layout/RPDefaultLayout.js +184 -86
- package/dist/components/layout/RPLayout.js +123 -105
- package/dist/components/layout/SkipLink.js +29 -0
- package/dist/components/layout/WrapperLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +79 -112
- package/dist/components/layout/sidebar/RPSplitter.js +6 -59
- package/dist/components/layout/sidebar/Thumbnail.js +130 -125
- package/dist/components/layout/sidebar/Thumbnails.js +56 -119
- package/dist/components/layout/toolbar/DarkModeTool.js +7 -5
- package/dist/components/layout/toolbar/DocumentDialog.js +305 -131
- package/dist/components/layout/toolbar/DocumentProperties.js +13 -10
- package/dist/components/layout/toolbar/FileDownloadTool.js +34 -124
- package/dist/components/layout/toolbar/FileUploadTool.js +9 -6
- package/dist/components/layout/toolbar/FullScreenTool.js +17 -14
- package/dist/components/layout/toolbar/MenuItem.js +11 -8
- package/dist/components/layout/toolbar/MenuSeparator.js +8 -5
- package/dist/components/layout/toolbar/MostPageTool.js +66 -125
- package/dist/components/layout/toolbar/OtherTool.js +171 -112
- package/dist/components/layout/toolbar/Paginate.js +121 -116
- package/dist/components/layout/toolbar/PrintTool.js +55 -123
- package/dist/components/layout/toolbar/RPMenuItem.js +14 -11
- package/dist/components/layout/toolbar/RPMoreOptions.js +102 -154
- package/dist/components/layout/toolbar/RPToolbar.js +90 -79
- package/dist/components/layout/toolbar/RPToolbarEnd.js +69 -88
- package/dist/components/layout/toolbar/RotateTool.js +13 -10
- package/dist/components/layout/toolbar/ScrollModeTool.js +42 -39
- package/dist/components/layout/toolbar/SearchCloseButton.js +24 -10
- package/dist/components/layout/toolbar/SearchResultNavigator.js +74 -105
- package/dist/components/layout/toolbar/SearchTool.js +245 -121
- package/dist/components/layout/toolbar/SelectionModeTool.js +9 -6
- package/dist/components/layout/toolbar/ThumbnailTool.js +15 -122
- package/dist/components/layout/toolbar/ToolbarCustom.js +75 -143
- package/dist/components/layout/toolbar/ToolbarDefault.js +135 -122
- package/dist/components/layout/toolbar/ToolbarLayout.js +86 -81
- package/dist/components/layout/toolbar/ViewModeTool.js +47 -35
- package/dist/components/layout/toolbar/ZoomTool.js +129 -119
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +18 -122
- package/dist/components/layout/toolbar/tools/DualPageTool.js +11 -129
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +202 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +14 -123
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +10 -8
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +197 -0
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +21 -18
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/InputPageTool.js +52 -136
- package/dist/components/layout/toolbar/tools/LastPageTool.js +197 -0
- package/dist/components/layout/toolbar/tools/NextPageTool.js +39 -129
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +28 -118
- package/dist/components/layout/toolbar/tools/PrintTool.js +14 -123
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +18 -9
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +15 -13
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +24 -14
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +11 -129
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +16 -6
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +23 -131
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +21 -18
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +23 -136
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +80 -141
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +18 -15
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +98 -105
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -123
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +17 -14
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +29 -127
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +31 -130
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +28 -17
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +63 -134
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +33 -131
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +41 -24
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +58 -37
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +44 -25
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +56 -30
- package/dist/components/page/AnnotationLayer.js +130 -125
- package/dist/components/page/CanvasLayer.js +57 -126
- package/dist/components/page/CustomElement.js +1 -1
- package/dist/components/page/DualPage.js +69 -110
- package/dist/components/page/DualPageWithCover.js +131 -0
- package/dist/components/page/RPPage.js +126 -123
- package/dist/components/page/SinglePage.js +59 -110
- package/dist/components/page/TextHighlightLayer.js +187 -129
- package/dist/components/page/TextLayer.js +186 -125
- package/dist/components/ui/Button.js +14 -12
- package/dist/components/ui/Checkbox.js +78 -70
- package/dist/components/ui/DropDown.js +11 -8
- package/dist/components/ui/Input.js +12 -11
- package/dist/components/ui/LoadingIndicator.js +34 -127
- package/dist/components/ui/PasswordModal.js +44 -30
- package/dist/components/ui/RPTooltip.js +121 -135
- package/dist/contexts/DimensionPagesContext.js +1 -1
- package/dist/contexts/DropFileZoneContext.js +1 -1
- package/dist/contexts/ElementPageContext.js +1 -1
- package/dist/contexts/EventCallbackContext.js +12 -8
- package/dist/contexts/FileInputContext.js +1 -1
- package/dist/contexts/HighlightContext.js +1 -1
- package/dist/contexts/LocalizationContext.js +1 -1
- package/dist/contexts/PagesRotateContext.js +1 -1
- package/dist/contexts/PaginationContext.js +15 -118
- package/dist/contexts/PrintContext.js +67 -131
- package/dist/contexts/RPDocumentContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +48 -118
- package/dist/contexts/RotationContext.js +1 -1
- package/dist/contexts/ScrollModeContext.js +1 -1
- package/dist/contexts/SearchContext.js +66 -112
- package/dist/contexts/SelectionModeContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +32 -131
- package/dist/contexts/ViewModeContext.js +19 -15
- package/dist/contexts/ZoomContext.js +1 -1
- package/dist/de_DE-a553b162.js +489 -0
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-61f59539.js +1198 -0
- package/dist/index-655864a7.js +27 -0
- package/dist/{index-c9a2990a.js → index-c0faa594.js} +64 -87
- package/dist/index-e3ee9457.js +150 -0
- package/dist/main.js +193 -130
- package/dist/types/components/icons/DualPageWithCoverIcon.d.ts +2 -0
- package/dist/types/components/layout/LayoutContainer.d.ts +1 -5
- package/dist/types/components/layout/LayoutWrapper.d.ts +1 -5
- package/dist/types/components/layout/SkipLink.d.ts +7 -0
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +1 -3
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -3
- package/dist/types/components/layout/toolbar/tools/DualPageWithCoverTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FirstPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/HorizontalScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/LastPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/PageScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/VerticalScrollingTool.d.ts +3 -0
- package/dist/types/components/page/DualPageWithCover.d.ts +5 -0
- package/dist/types/components/page/RPPage.d.ts +1 -3
- package/dist/types/components/ui/Button.d.ts +1 -3
- package/dist/types/components/ui/Checkbox.d.ts +1 -0
- package/dist/types/components/ui/Input.d.ts +1 -3
- package/dist/types/components/ui/RPTooltip.d.ts +1 -3
- package/dist/types/locales/de_DE.json.d.ts +83 -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/main.d.ts +8 -2
- package/dist/types/utils/annotations.d.ts +10 -1
- package/dist/types/utils/calculatePage.d.ts +3 -3
- package/dist/types/utils/hooks/usePresentPage.d.ts +2 -1
- package/dist/types/utils/hooks/useTextSelection.d.ts +7 -0
- package/dist/types/utils/types.d.ts +34 -3
- package/dist/types/utils/withRef.d.ts +5 -4
- package/dist/utils/annotations.js +145 -150
- package/dist/utils/calculatePage.js +17 -11
- package/dist/utils/getZoomLevel.js +9 -9
- package/dist/utils/highlight.js +139 -139
- package/dist/utils/hooks/useFileDownload.js +23 -130
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +1 -1
- package/dist/utils/hooks/useLocalization.js +12 -11
- package/dist/utils/hooks/usePageRotateContext.js +1 -1
- package/dist/utils/hooks/usePaginate.js +23 -126
- package/dist/utils/hooks/usePinch.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +79 -129
- package/dist/utils/hooks/usePrint.js +175 -130
- package/dist/utils/hooks/useRotate.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +18 -121
- package/dist/utils/hooks/useSearch.js +149 -127
- package/dist/utils/hooks/useTextSelection.js +76 -0
- package/dist/utils/hooks/useThumbnail.js +50 -131
- package/dist/utils/hooks/useVirtualReactWindow.js +84 -128
- package/dist/utils/types.js +14 -13
- package/dist/utils/withRef.js +5 -5
- package/package.json +5 -4
- package/dist/LayoutWrapper-6224491f.js +0 -19
- package/dist/SearchCloseButton-08d57275.js +0 -33
- package/dist/ToolbarLayout.module-8d56d12b.js +0 -3560
- package/dist/floating-ui.react-dom-d22a10b4.js +0 -1474
- package/dist/index-3bf64864.js +0 -1886
- package/dist/th_TH-d627cd51.js +0 -398
|
@@ -1,140 +1,96 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import "../types.js";
|
|
3
|
-
import "../../contexts/ScrollModeContext.js";
|
|
1
|
+
import { useMemo as m, useCallback as _, useEffect as R } from "react";
|
|
2
|
+
import { ScrollMode as C, ViewMode as g } from "../types.js";
|
|
3
|
+
import { useScrollModeContext as x } from "../../contexts/ScrollModeContext.js";
|
|
4
|
+
import { useViewModeContext as G } from "../../contexts/ViewModeContext.js";
|
|
5
|
+
import { useVirtualGridContext as H } from "../../contexts/VirtualGridContext.js";
|
|
6
|
+
import { useVirtualScrollContext as M } from "../../contexts/VirtualScrollContext.js";
|
|
7
|
+
import { useDimensionPagesContext as O } from "../../contexts/DimensionPagesContext.js";
|
|
8
|
+
import { getGridDimension as V } from "../calculatePage.js";
|
|
9
|
+
import "../../de_DE-a553b162.js";
|
|
4
10
|
import "react/jsx-runtime";
|
|
5
|
-
import "../../contexts/RPDocumentContext.js";
|
|
6
|
-
import "../../contexts/DocumentPasswordContext.js";
|
|
7
|
-
import { M as Br } from "../../ToolbarLayout.module-8d56d12b.js";
|
|
8
|
-
import "../../contexts/DarkModeContext.js";
|
|
9
|
-
import "../../contexts/RotationContext.js";
|
|
10
|
-
import "../../contexts/LayerContext.js";
|
|
11
|
-
import "../../contexts/ZoomContext.js";
|
|
12
|
-
import "../../contexts/ViewModeContext.js";
|
|
13
|
-
import "../../contexts/VirtualScrollContext.js";
|
|
14
|
-
import "../../contexts/VirtualGridContext.js";
|
|
15
|
-
import "../../contexts/SelectionModeContext.js";
|
|
16
|
-
import "../../contexts/InitialStateContext.js";
|
|
17
|
-
import "../../contexts/FullScreenContext.js";
|
|
18
|
-
import "../../contexts/FileInputContext.js";
|
|
19
|
-
import "../../contexts/DropFileZoneContext.js";
|
|
20
|
-
import "../../contexts/LayoutContainerContext.js";
|
|
21
|
-
import "../../contexts/DimensionPagesContext.js";
|
|
22
|
-
import "../../contexts/LocalizationContext.js";
|
|
23
|
-
import "../../contexts/HighlightContext.js";
|
|
24
|
-
import "../../contexts/LicenseContext.js";
|
|
25
|
-
import "../../contexts/DownloadContext.js";
|
|
26
|
-
import "../../contexts/SmoothScrollContext.js";
|
|
27
|
-
import "../../contexts/ElementPageContext.js";
|
|
28
|
-
import "../../contexts/PagesRotateContext.js";
|
|
29
|
-
import "../../contexts/GlobalCurrentPage.js";
|
|
30
|
-
import "../../contexts/LoaderContext.js";
|
|
31
|
-
import "../../contexts/ToolComponentContext.js";
|
|
32
|
-
import "../../contexts/IconToolContext.js";
|
|
33
|
-
import "../../contexts/OtherToolContext.js";
|
|
34
|
-
import "../../contexts/EventCallbackContext.js";
|
|
35
|
-
import "../../contexts/ThemeContext.js";
|
|
36
|
-
import "../../contexts/ConfigContext.js";
|
|
37
|
-
import "pdfjs-dist";
|
|
38
|
-
import "../../components/layout/Container.js";
|
|
39
|
-
import "../../contexts/ViewportContext.js";
|
|
40
|
-
import "../../contexts/ToolbarComponentContext.js";
|
|
41
|
-
import "../../components/layout/sidebar/RPSplitter.js";
|
|
42
|
-
import "../../components/layout/WrapperLayout.js";
|
|
43
|
-
import "../../components/RPDropFileZone.js";
|
|
44
|
-
import "../../LayoutWrapper-6224491f.js";
|
|
45
|
-
import "../../components/ui/Button.js";
|
|
46
|
-
import "../../SearchCloseButton-08d57275.js";
|
|
47
|
-
import "../../components/ui/Input.js";
|
|
48
|
-
import "../../components/ui/Checkbox.js";
|
|
49
|
-
import "../../components/icons/LoaderIcon.js";
|
|
50
|
-
import "../../contexts/IconContext.js";
|
|
51
|
-
import "../../components/ui/RPTooltip.js";
|
|
52
|
-
import "../../components/ui/DropDown.js";
|
|
53
|
-
import "../../components/layout/toolbar/MenuItem.js";
|
|
54
|
-
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
55
|
-
import "../dateFormatter.js";
|
|
56
|
-
import "../../components/layout/toolbar/PropertyItem.js";
|
|
57
|
-
import "../../RotateTool.module-67946714.js";
|
|
58
|
-
import "../calculatePage.js";
|
|
59
|
-
import "../../th_TH-d627cd51.js";
|
|
60
11
|
import "../appConsole.js";
|
|
12
|
+
import "../../contexts/InitialStateContext.js";
|
|
13
|
+
import "../../contexts/RPDocumentContext.js";
|
|
61
14
|
import "./useLoadPdf.js";
|
|
15
|
+
import "pdfjs-dist";
|
|
62
16
|
import "../getThumbnailViewport.js";
|
|
17
|
+
import "../../contexts/ConfigContext.js";
|
|
18
|
+
import "../../contexts/DocumentPasswordContext.js";
|
|
63
19
|
import "./usePdfProperties.js";
|
|
64
20
|
import "../convertPdfDate.js";
|
|
65
21
|
import "../formatFileSize.js";
|
|
66
|
-
import "../../
|
|
67
|
-
import "../highlight.js";
|
|
68
|
-
import "../charators.js";
|
|
69
|
-
import "../Queue.js";
|
|
70
|
-
import "../renderPage.js";
|
|
71
|
-
import "../../components/icons/Thumbnail.js";
|
|
72
|
-
import "../../clsx-0c6e471a.js";
|
|
73
|
-
import "../withRef.js";
|
|
74
|
-
import "./useInfiniteScroll.js";
|
|
22
|
+
import "../../contexts/ZoomContext.js";
|
|
75
23
|
import "../constants.js";
|
|
76
|
-
import "../link_service.js";
|
|
77
|
-
import "../annotations.js";
|
|
78
|
-
import "../sanitizeExternalUrl.js";
|
|
79
|
-
import "../../components/page/searchHighlight.js";
|
|
80
|
-
import "../const.js";
|
|
81
|
-
import "../../components/page/CustomElement.js";
|
|
82
24
|
import "../getZoomLevel.js";
|
|
25
|
+
import "../../contexts/LayoutContainerContext.js";
|
|
26
|
+
import "../../contexts/RotationContext.js";
|
|
27
|
+
import "../../contexts/GlobalCurrentPage.js";
|
|
28
|
+
import "../../contexts/EventCallbackContext.js";
|
|
83
29
|
import "./useDebounce.js";
|
|
84
|
-
import "
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
30
|
+
import "../../contexts/PagesRotateContext.js";
|
|
31
|
+
const ct = () => {
|
|
32
|
+
const { viewMode: n } = G(), { scrollMode: c } = x(), { setColumnCount: f } = H(), { virtualScrollableElementRef: w } = M(), t = O(), l = m(() => t.heights.length, [t.heights]), o = m(() => c === C.HORIZONTAL_SCROLLING ? l : n === g.DUAL_PAGE || n === g.DUAL_PAGE_WITH_COVER ? 2 : 1, [n, c, c, l, w]), d = m(() => {
|
|
33
|
+
if (n === g.DUAL_PAGE_WITH_COVER && t.widths.length > 0) {
|
|
34
|
+
const i = [0, 0];
|
|
35
|
+
return t.widths.forEach((u, a) => {
|
|
36
|
+
const s = a + 1;
|
|
37
|
+
if (s === 1)
|
|
38
|
+
return;
|
|
39
|
+
const h = s % 2 === 0 ? 0 : 1;
|
|
40
|
+
i[h] = Math.max(i[h] || 0, u);
|
|
41
|
+
}), i;
|
|
42
|
+
}
|
|
43
|
+
return t.widths.reduce((i, u, a) => {
|
|
44
|
+
const s = a % o;
|
|
45
|
+
return (!i[s] || u > i[s]) && (i[s] = u), i;
|
|
46
|
+
}, []);
|
|
47
|
+
}, [t.widths, o, n]), I = _(
|
|
48
|
+
(e) => {
|
|
49
|
+
const r = e % d.length;
|
|
50
|
+
return d[r] || 0;
|
|
51
|
+
},
|
|
52
|
+
[d]
|
|
53
|
+
), P = _(
|
|
54
|
+
(e) => {
|
|
55
|
+
if (n === g.DUAL_PAGE_WITH_COVER) {
|
|
56
|
+
if (e === 0)
|
|
57
|
+
return t.heights[0] || 0;
|
|
58
|
+
const u = 1 + (e - 1) * o + 1, s = Array.from({ length: o }, (h, E) => u + E - 1).filter((h) => h < t.heights.length).map((h) => t.heights[h] || 0);
|
|
59
|
+
return Math.max(...s, 0);
|
|
60
|
+
}
|
|
61
|
+
const i = Array.from({ length: o }, (u, a) => {
|
|
62
|
+
const s = e * o + a;
|
|
63
|
+
return t.heights[s] || 0;
|
|
64
|
+
});
|
|
65
|
+
return Math.max(...i);
|
|
66
|
+
},
|
|
67
|
+
[t.heights, o, n]
|
|
68
|
+
);
|
|
69
|
+
R(() => {
|
|
70
|
+
f(o);
|
|
71
|
+
}, [o, f]);
|
|
72
|
+
const A = m(() => c === C.HORIZONTAL_SCROLLING || c === C.PAGE_SCROLLING ? 1 : n === g.DUAL_PAGE_WITH_COVER && l > 0 ? 1 + Math.ceil((l - 1) / o) : Math.round(l / o), [o, l, c, n]), L = m(() => t.heights.reduce((e, r) => e + r, 0) / t.heights.length || 0, [t]), D = m(() => t.widths.reduce((e, r) => e + r, 0) / t.widths.length || 0, [t]), p = m(() => {
|
|
73
|
+
const e = n === g.DUAL_PAGE_WITH_COVER, { rowsHeight: r, columnsWidth: i } = V(t, o, e);
|
|
74
|
+
return {
|
|
75
|
+
rowsHeight: r,
|
|
76
|
+
columnsWidth: i
|
|
77
|
+
};
|
|
78
|
+
}, [t, o, n]), W = m(() => ({
|
|
79
|
+
width: p.columnsWidth.reduce((e, r) => e + r, 0),
|
|
80
|
+
height: p.rowsHeight.reduce((e, r) => e + r, 0)
|
|
81
|
+
}), [p]);
|
|
82
|
+
return {
|
|
83
|
+
rowCount: A,
|
|
84
|
+
rowHeight: P,
|
|
85
|
+
columnCount: o,
|
|
86
|
+
columnWidth: I,
|
|
87
|
+
pageDimension: t,
|
|
88
|
+
estimatedRowHeight: L,
|
|
89
|
+
estimatedColumnWidth: D,
|
|
90
|
+
gridDimension: p,
|
|
91
|
+
totalDimension: W
|
|
92
|
+
};
|
|
93
|
+
};
|
|
138
94
|
export {
|
|
139
|
-
|
|
95
|
+
ct as useVirtualReactWindow
|
|
140
96
|
};
|
package/dist/utils/types.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { e as r, z as _, i as R, p as o, t as p } from "../
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { e as r, z as _, i as R, p as o, t as p, d as D } from "../de_DE-a553b162.js";
|
|
2
|
+
var I = /* @__PURE__ */ ((O) => (O[O.Text = 1] = "Text", O[O.Link = 2] = "Link", O[O.FreeText = 3] = "FreeText", O[O.Line = 4] = "Line", O[O.Square = 5] = "Square", O[O.Circle = 6] = "Circle", O[O.Polygon = 7] = "Polygon", O[O.Polyline = 8] = "Polyline", O[O.Highlight = 9] = "Highlight", O[O.Underline = 10] = "Underline", O[O.Squiggly = 11] = "Squiggly", O[O.StrikeOut = 12] = "StrikeOut", O[O.Stamp = 13] = "Stamp", O[O.Caret = 14] = "Caret", O[O.Ink = 15] = "Ink", O[O.Popup = 16] = "Popup", O[O.FileAttachment = 17] = "FileAttachment", O[O.Widget = 20] = "Widget", O))(I || {}), N = /* @__PURE__ */ ((O) => (O.INTERNAL_LINK = "internal-link", O.LINK = "link", O.FILE_ATTACHMENT = "file-attachment", O.FORM_TEXT = "form-text", O.FORM_SELECT = "form-select", O.FORM_CHECKBOX = "form-checkbox", O.FORM_RADIO = "form-radio", O.FORM_BUTTON = "form-button", O.BUTTON = "button", O))(N || {}), L = /* @__PURE__ */ ((O) => (O.NOT_SUPPORTED = "not-supported", O))(L || {}), E = /* @__PURE__ */ ((O) => (O.ACTUAL = "Actual Size", O.PAGE_FIT = "Page Fit", O.PAGE_WIDTH = "Page Width", O))(E || {}), d = /* @__PURE__ */ ((O) => (O.Organization = "organization", O.Developer = "developer", O.FreeTrial = "free-trial", O))(d || {}), C = /* @__PURE__ */ ((O) => (O.SINGLE_PAGE = "Single", O.DUAL_PAGE = "Dual", O.DUAL_PAGE_WITH_COVER = "DualWithCover", O))(C || {}), P = /* @__PURE__ */ ((O) => (O.FONT_FAMILY = "--rp-font-family", O.PRIMARY_COLOR = "--rp-primary-color", O.BORDER_RADIUS = "--rp-border-radius", O.TEXT_COLOR = "--rp-text-color", O.OUTLINE_COLOR = "--rp-outline-color", O.FONT_SIZE = "--rp-font-size", O.DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color", O.LOADER_BACKDROP_COLOR = "--rp-loader-backdrop-color", O.ICON_DISABLED = "--rp-icon-disabled", O.ICON_FONT_SIZE = "--rp-icon-font-size", O.TOOLBAR_BACKGROUND = "--rp-toolbar-background", O.TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color", O.TOOLBAR_PADDING = "--rp-toolbar-padding", O.TOOLBAR_GAP = "--rp-toolbar-gap", O.TOOLBAR_SIZE = "--rp-toolbar-size", O.SIDEBAR_WIDTH = "--rp-sidebar-width", O.THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color", O.THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color", O.THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color", O.THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y", O.BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background", O.BUTTON_PADDING = "--rp-button-padding", O.INPUT_PADDING = "--rp-input-padding", O.INPUT_BORDER_RADIUS = "--rp-input-border-radius", O.INPUT_BACKGROUND_COLOR = "--rp-input-background-color", O.INPUT_PLACEHOLDER_COLOR = "--rp-input-placeholder-color", O.PAGES_BACKGROUND_COLOR = "--rp-pages-background-color", O.ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background", O.DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color", O.DROPDOWN_PADDING = "--rp-dropdown-padding", O.DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color", O.DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color", O.DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin", O.DROPDOWN_PADDING_MENU_ITEM = "--rp-dropdown-padding-menu-item", O.DROPDOWN_FONT_SIZE = "--rp-dropdown-font-size", O.DROPDOWN_BORDER_RADIUS = "--rp-dropdown-border-radius", O.SEARCH_TOOL_DROPDOWN_PADDING = "--rp-search-tool-dropdown-padding", O.POPOVER_FONT_SIZE = "--rp-popover-font-size", O.POPOVER_BACKGROUND_COLOR = "--rp-popover-background-color", O.POPOVER_COLOR = "--rp-popover-color", O.POPOVER_BORDER_COLOR = "--rp-popover-border-color", O.POPOVER_BORDER_RADIUS = "--rp-popover-border-radius", O.OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color", O.DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color", O.PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color", O.PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin", O.PROPERTY_ITEM_GAP = "--rp-property-item-gap", O.DIALOG_TITLE_COLOR = "--rp-dialog-title-color", O.PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color", O.PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size", O.PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size", O.PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight", O.DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size", O.DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight", O.MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size", O.PRINT_PROGRESS_BACKGROUND = "--rp-print-progress-background", O.PRINT_PROGRESS_COLOR = "--rp-print-progress-color", O.DROP_ZONE_BORDER = "--rp-drop-zone-border", O.DROP_ZONE_FONT_COLOR = "--rp-drop-zone-font-color", O.DROP_ZONE_FONT_SIZE = "--rp-drop-zone-font-size", O.DROP_ZONE_BACKGROUND_COLOR = "--rp-drop-zone-background-color", O.CHECKBOX_BORDER_RADIUS = "--rp-checkbox-border-radius", O.CHECKBOX_BORDER_COLOR = "--rp-checkbox-border-color", O.CHECKBOX_INDICATOR_COLOR = "--rp-checkbox-indicator-color", O.HIGHLIGHT_BACKGROUND_COLOR = "--rp-highlight-background-color", O.TEXT_LAYER_HIGHLIGHT_BORDER_RADIUS = "--rp-text-layer-highlight-border-radius", O.CURRENT_HIGHLIGHT_BACKGROUND_COLOR = "--rp-current-highlight-background-color", O.TOOLTIP_BACKGROUND_COLOR = "--rp-tooltip-background-color", O.TOOLTIP_BORDER_RADIUS = "--rp-tooltip-border-radius", O.TOOLTIP_FONT_COLOR = "--rp-tooltip-font-color", O.TOOLTIP_FONT_SIZE = "--rp-tooltip-font-size", O.TOOLTIP_PADDING = "--rp-tooltip-padding", O.PASSWORD_MODAL_BACKGROUND_COLOR = "--rp-password-background-color", O.PASSWORD_MODAL_TITLE_FONT_COLOR = "--rp-password-title-font-color", O.PASSWORD_MODAL_CONTENT_FONT_COLOR = "--rp-password-content-font-color", O.PASSWORD_MODAL_INPUT_PLACEHOLDER_COLOR = "--rp-password-input-placeholder-color", O.PASSWORD_MODAL_INPUT_BORDER_COLOR = "--rp-password-input-border-color", O.PASSWORD_MODAL_INPUT_FONT_COLOR = "--rp-password-input-font-color", O.PASSWORD_MODAL_BUTTON_FONT_COLOR = "--rp-password-button-font-color", O.PASSWORD_MODAL_BUTTON_BACKGROUND_COLOR = "--rp-password-button-background-color", O.PASSWORD_MODAL_BUTTON_BORDER_COLOR = "--rp-password-button-border-color", O.PASSWORD_MODAL_BORDER_COLOR = "--rp-password-border-color", O.CONTAINER_FOCUS_OUTLINE_WIDTH = "--rp-container-focus-outline-width", O.CONTAINER_FOCUS_OUTLINE_COLOR = "--rp-container-focus-outline-color", O.CONTAINER_FOCUS_OUTLINE_OFFSET = "--rp-container-focus-outline-offset", O.BUTTON_BORDER_RADIUS = "--rp-button-border-radius", O.SKIP_LINK_FONT_SIZE = "--rp-skip-link-font-size", O.SKIP_LINK_COLOR = "--rp-skip-link-color", O.SKIP_LINK_BACKGROUND_COLOR = "--rp-skip-link-background-color", O.SKIP_LINK_BORDER_COLOR = "--rp-skip-link-border-color", O))(P || {}), c = /* @__PURE__ */ ((O) => (O.PAGE_SCROLLING = "PAGE", O.VERTICAL_SCROLLING = "VERTICAL", O.HORIZONTAL_SCROLLING = "HORIZONTAL", O))(c || {}), t = /* @__PURE__ */ ((O) => (O.TEXT = "TEXT", O.HAND = "HAND", O))(t || {});
|
|
3
|
+
const U = {
|
|
4
4
|
en_US: r,
|
|
5
5
|
zh_CN: _,
|
|
6
6
|
it_IT: R,
|
|
7
7
|
pt_PT: o,
|
|
8
|
-
th_TH: p
|
|
8
|
+
th_TH: p,
|
|
9
|
+
de_DE: D
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
I as AnnotationSubType,
|
|
12
13
|
N as AnnotationType,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
L as ErrorType,
|
|
15
|
+
d as LicenseType,
|
|
16
|
+
U as Locales,
|
|
17
|
+
c as ScrollMode,
|
|
18
|
+
t as SelectionMode,
|
|
19
|
+
P as ThemeVariables,
|
|
20
|
+
C as ViewMode,
|
|
21
|
+
E as ZoomLevel
|
|
21
22
|
};
|
package/dist/utils/withRef.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { forwardRef as
|
|
2
|
-
const
|
|
3
|
-
const { ref:
|
|
4
|
-
return e
|
|
1
|
+
import { forwardRef as r } from "react";
|
|
2
|
+
const c = (o) => r ? r(o) : (t) => {
|
|
3
|
+
const { ref: n, ...e } = t;
|
|
4
|
+
return o(e, n);
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as withRef
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-pdf-kit/viewer",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"prepare": "husky"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@radix-ui/react-checkbox": "^1.
|
|
43
|
-
"@radix-ui/react-popover": "1.
|
|
44
|
-
"@radix-ui/react-tooltip": "^1.
|
|
42
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
43
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
44
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
45
45
|
"pdfjs-dist": "5.4.530",
|
|
46
46
|
"react-virtualized-auto-sizer": "^1.0.24",
|
|
47
47
|
"react-window": "^1.8.10"
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@radix-ui/react-dialog": "^1.1.2",
|
|
52
52
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
53
53
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
54
|
+
"@tanstack/eslint-plugin-query": "^5.60.1",
|
|
54
55
|
"@types/react": "^18.2.14",
|
|
55
56
|
"@types/react-dom": "^18.2.6",
|
|
56
57
|
"@types/react-window": "^1.8.8",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _ } from "react/jsx-runtime";
|
|
2
|
-
import { withRef as t } from "./utils/withRef.js";
|
|
3
|
-
const o = {
|
|
4
|
-
"rp-layout": "_rp-layout_1e7yi_1",
|
|
5
|
-
"rp-layout-wrapper": "_rp-layout-wrapper_1e7yi_5",
|
|
6
|
-
"rp-content": "_rp-content_1e7yi_11",
|
|
7
|
-
"rp-pages": "_rp-pages_1e7yi_17",
|
|
8
|
-
"rp-container": "_rp-container_1e7yi_22",
|
|
9
|
-
"rp-loader": "_rp-loader_1e7yi_26",
|
|
10
|
-
"rp-theme-variables": "_rp-theme-variables_1e7yi_30",
|
|
11
|
-
"rp-dark-mode": "_rp-dark-mode_1e7yi_141"
|
|
12
|
-
}, y = t((r, e) => {
|
|
13
|
-
const { children: p, ...a } = r;
|
|
14
|
-
return /* @__PURE__ */ _("div", { ref: e, className: o["rp-layout-wrapper"], ...a, children: p });
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
y as L,
|
|
18
|
-
o as c
|
|
19
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import i from "./components/ui/RPTooltip.js";
|
|
3
|
-
import { UIButton as n } from "./components/ui/Button.js";
|
|
4
|
-
import { CloseIcon as p } from "./components/icons/CloseIcon.js";
|
|
5
|
-
import { useLocalizationContext as e } from "./contexts/LocalizationContext.js";
|
|
6
|
-
const a = {
|
|
7
|
-
"rp-search-tool-content": "_rp-search-tool-content_t0ih3_1",
|
|
8
|
-
"rp-search-tool-input": "_rp-search-tool-input_t0ih3_10",
|
|
9
|
-
"rp-search-tool-input-icon": "_rp-search-tool-input-icon_t0ih3_17",
|
|
10
|
-
"rp-search-tool-controls": "_rp-search-tool-controls_t0ih3_27",
|
|
11
|
-
"rp-search-tool-input-wrapper": "_rp-search-tool-input-wrapper_t0ih3_35",
|
|
12
|
-
"rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_t0ih3_41",
|
|
13
|
-
"rp-search-tool-input-clear": "_rp-search-tool-input-clear_t0ih3_46",
|
|
14
|
-
"rp-search-input": "_rp-search-input_t0ih3_60",
|
|
15
|
-
"rp-search-icon-info": "_rp-search-icon-info_t0ih3_66",
|
|
16
|
-
"rp-search-loader-icon": "_rp-search-loader-icon_t0ih3_75",
|
|
17
|
-
"rp-search-tool-result-navigator": "_rp-search-tool-result-navigator_t0ih3_80"
|
|
18
|
-
}, m = ({ onKeyPress: t, handleClose: c }) => {
|
|
19
|
-
const { localeMessages: o } = e();
|
|
20
|
-
return /* @__PURE__ */ r(i, { content: o == null ? void 0 : o.searchCloseButtonTooltip, children: /* @__PURE__ */ r(
|
|
21
|
-
n,
|
|
22
|
-
{
|
|
23
|
-
tabIndex: 0,
|
|
24
|
-
onKeyDown: t,
|
|
25
|
-
"aria-label": o == null ? void 0 : o.searchCloseButtonTooltip,
|
|
26
|
-
children: /* @__PURE__ */ r(p, { onClick: c, className: a["rp-search-tool-input-icon"] })
|
|
27
|
-
}
|
|
28
|
-
) });
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
m as S,
|
|
32
|
-
a as c
|
|
33
|
-
};
|