@pdf-viewer/react 1.1.1-beta.0 → 1.1.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/Container-982378f8.js +38 -0
- package/dist/RPDefaultLayout-5e5126fd.js +2832 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Container.css +1 -1
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +35 -38
- package/dist/components/RPDropFileZone.js +22 -23
- package/dist/components/RPPages.js +2 -3
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +2 -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 +21 -22
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -3
- package/dist/components/layout/toolbar/DocumentProperties.js +14 -15
- package/dist/components/layout/toolbar/FileDownloadTool.js +2 -3
- package/dist/components/layout/toolbar/FileUploadTool.js +22 -20
- package/dist/components/layout/toolbar/FullScreenTool.js +34 -40
- package/dist/components/layout/toolbar/MenuItem.js +6 -6
- package/dist/components/layout/toolbar/MostPageTool.js +2 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -3
- package/dist/components/layout/toolbar/Paginate.js +2 -3
- package/dist/components/layout/toolbar/PrintTool.js +2 -3
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +25 -26
- package/dist/components/layout/toolbar/ScrollModeTool.js +42 -43
- package/dist/components/layout/toolbar/SearchTool.js +3 -5
- package/dist/components/layout/toolbar/SelectionModeTool.js +30 -31
- package/dist/components/layout/toolbar/ZoomTool.js +2 -3
- package/dist/components/page/AnnotationLayer.js +2 -3
- package/dist/components/page/CanvasLayer.js +2 -3
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +2 -3
- package/dist/components/ui/Button.js +10 -10
- package/dist/components/ui/LoadingIndicator.js +2 -3
- package/dist/components/ui/RPTooltip.js +2 -2
- package/dist/contexts/PaginationContext.js +3 -3
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +13 -14
- package/dist/types/components/ui/RPTooltip.d.ts +2 -3
- package/dist/types/contexts/PaginationContext.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/dist/types/utils/hooks/useScrollToPage.d.ts +1 -1
- package/dist/types/utils/types.d.ts +77 -92
- package/dist/utils/hooks/useFileDownload.js +2 -3
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -3
- package/dist/utils/hooks/usePrint.js +2 -3
- package/dist/utils/hooks/useScrollToPage.js +2 -4
- package/dist/utils/hooks/useSearch.js +2 -3
- package/dist/utils/hooks/useThumbnail.js +2 -3
- package/dist/utils/hooks/useVirtualReactWindow.js +2 -3
- package/dist/utils/types.js +8 -17
- package/package.json +1 -2
- package/dist/Container-44b8ad45.js +0 -38
- package/dist/RPDefaultLayout-79c7577a.js +0 -2907
- package/dist/assets/Popover.css +0 -1
- package/dist/components/ui/Popover.js +0 -3060
- package/dist/contexts/LocalizationContext.js +0 -38
- package/dist/th_TH-2fba4a89.js +0 -388
- package/dist/types/components/ui/Popover.d.ts +0 -9
- package/dist/types/contexts/LocalizationContext.d.ts +0 -5
- package/dist/types/locales/en_US.json.d.ts +0 -80
- package/dist/types/locales/it_IT.json.d.ts +0 -80
- package/dist/types/locales/pt_PT.json.d.ts +0 -80
- package/dist/types/locales/th_TH.json.d.ts +0 -80
- package/dist/types/locales/zh_CN.json.d.ts +0 -80
- package/dist/types/utils/hooks/useLocalization.d.ts +0 -10
- package/dist/types/utils/smoothScrollTo.d.ts +0 -2
- package/dist/utils/hooks/useLocalization.js +0 -25
- package/dist/utils/smoothScrollTo.js +0 -18
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { c as p } from "../../clsx-0c6e471a.js";
|
|
4
4
|
import '../../assets/Button.css';const t = {
|
|
5
|
-
"rp-button": "_rp-
|
|
6
|
-
"rp-button-active": "_rp-button-
|
|
7
|
-
}, _ =
|
|
8
|
-
const { children:
|
|
9
|
-
return /* @__PURE__ */
|
|
5
|
+
"rp-button": "_rp-button_uycem_1",
|
|
6
|
+
"rp-button-active": "_rp-button-active_uycem_13"
|
|
7
|
+
}, _ = u((o, r) => {
|
|
8
|
+
const { children: c, active: n, className: e, ...s } = o;
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
10
|
"button",
|
|
11
11
|
{
|
|
12
12
|
tabIndex: 0,
|
|
13
13
|
ref: r,
|
|
14
14
|
...s,
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
15
|
+
className: p(t["rp-button"], e, n ? t["rp-button-active"] : ""),
|
|
16
|
+
children: c
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { L as
|
|
2
|
+
import { L as p } from "../../RPDefaultLayout-5e5126fd.js";
|
|
3
3
|
import "../../clsx-0c6e471a.js";
|
|
4
|
-
import "../../contexts/LocalizationContext.js";
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
p as default
|
|
7
6
|
};
|
|
@@ -554,8 +554,8 @@ const Dt = "_tooltipContent_1i9ed_1", Ht = "_tooltipArrow_1i9ed_8", It = "_fadeI
|
|
|
554
554
|
tooltipArrow: Ht,
|
|
555
555
|
fadeIn: It
|
|
556
556
|
}, kt = Ye(
|
|
557
|
-
({ children: e, content: r, className: t
|
|
558
|
-
/* @__PURE__ */ d(Ce, { asChild: !0, children: /* @__PURE__ */ d("div", { ref:
|
|
557
|
+
({ children: e, content: r, className: t }, o) => /* @__PURE__ */ d(we, { children: /* @__PURE__ */ W(xe, { delayDuration: 1e3, children: [
|
|
558
|
+
/* @__PURE__ */ d(Ce, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: o, className: t, children: e }) }),
|
|
559
559
|
/* @__PURE__ */ W(Pe, { className: ne.tooltipContent, sideOffset: 5, children: [
|
|
560
560
|
/* @__PURE__ */ d(Ae, { className: ne.tooltipArrow }),
|
|
561
561
|
/* @__PURE__ */ d("span", { children: r })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { h as
|
|
3
|
+
import { h as n, P as m, u as p } from "../RPDefaultLayout-5e5126fd.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
m as
|
|
7
|
+
n as PaginateContext,
|
|
8
|
+
m as PaginateProvider,
|
|
9
9
|
p as usePaginationContext
|
|
10
10
|
};
|
package/dist/main.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { RPProvider as t } from "./components/RPProvider.js";
|
|
2
|
-
import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-
|
|
2
|
+
import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-5e5126fd.js";
|
|
3
3
|
import { RPConfig as a } from "./components/RPConfig.js";
|
|
4
|
-
import { RPController as
|
|
4
|
+
import { RPController as l } from "./components/RPController.js";
|
|
5
5
|
import { RPTheme as P } from "./components/RPTheme.js";
|
|
6
6
|
import { RPDropFileZone as d } from "./components/RPDropFileZone.js";
|
|
7
|
-
import { useDarkModeContext as
|
|
7
|
+
import { useDarkModeContext as c } from "./contexts/DarkModeContext.js";
|
|
8
8
|
import { useDocumentContext as M } from "./contexts/RPDocumentContext.js";
|
|
9
9
|
import { useRotationContext as g } from "./contexts/RotationContext.js";
|
|
10
|
-
import { useViewModeContext as
|
|
11
|
-
import { useDropFileZoneContext as
|
|
10
|
+
import { useViewModeContext as S } from "./contexts/ViewModeContext.js";
|
|
11
|
+
import { useDropFileZoneContext as v } from "./contexts/DropFileZoneContext.js";
|
|
12
12
|
import { useOpenFileContext as V } from "./contexts/FileInputContext.js";
|
|
13
13
|
import { useZoomContext as k } from "./contexts/ZoomContext.js";
|
|
14
14
|
import { usePdfProperties as O } from "./utils/hooks/usePdfProperties.js";
|
|
15
15
|
import { useFullScreenContext as j } from "./contexts/FullScreenContext.js";
|
|
16
|
-
import {
|
|
16
|
+
import { ScrollMode as z, ViewMode as A, ZoomLevel as B } from "./utils/types.js";
|
|
17
17
|
export {
|
|
18
|
-
z as Locales,
|
|
19
18
|
a as RPConfig,
|
|
20
|
-
|
|
19
|
+
l as RPController,
|
|
21
20
|
x as RPDefaultLayout,
|
|
22
21
|
d as RPDropFileZone,
|
|
23
22
|
n as RPPages,
|
|
24
23
|
t as RPProvider,
|
|
25
24
|
P as RPTheme,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
z as ScrollMode,
|
|
26
|
+
A as ViewMode,
|
|
27
|
+
B as ZoomLevel,
|
|
28
|
+
c as useDarkModeContext,
|
|
30
29
|
M as useDocumentContext,
|
|
31
|
-
|
|
30
|
+
v as useDropFileZoneContext,
|
|
32
31
|
s as useFileDownload,
|
|
33
32
|
j as useFullScreenContext,
|
|
34
33
|
V as useOpenFileContext,
|
|
@@ -37,6 +36,6 @@ export {
|
|
|
37
36
|
p as usePrintContext,
|
|
38
37
|
g as useRotationContext,
|
|
39
38
|
f as useSearchContext,
|
|
40
|
-
|
|
39
|
+
S as useViewModeContext,
|
|
41
40
|
k as useZoomContext
|
|
42
41
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
interface TooltipProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
content
|
|
4
|
+
content: string;
|
|
5
5
|
className?: string;
|
|
6
|
-
style?: CSSProperties;
|
|
7
6
|
}
|
|
8
7
|
declare const RPTooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
8
|
export default RPTooltip;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { PageControlContextType } from '../utils/types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PaginateContext: React.Context<PageControlContextType>;
|
|
4
4
|
export declare const usePaginationContext: () => PageControlContextType;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const PaginateProvider: FC<PropsWithChildren>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -20,4 +20,4 @@ export { usePdfProperties } from './utils/hooks/usePdfProperties';
|
|
|
20
20
|
export { useFullScreenContext } from './contexts/FullScreenContext';
|
|
21
21
|
export { type PDFDocumentProxy } from 'pdfjs-dist';
|
|
22
22
|
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeProps, ThumbnailToolProps, ViewModeProps, ZoomProps } from './utils/types';
|
|
23
|
-
export { ViewMode, ScrollMode, ZoomLevel
|
|
23
|
+
export { ViewMode, ScrollMode, ZoomLevel } from './utils/types';
|
|
@@ -55,81 +55,81 @@ export declare enum ZoomLevel {
|
|
|
55
55
|
PAGE_WIDTH = "Width"
|
|
56
56
|
}
|
|
57
57
|
export type Localization = {
|
|
58
|
-
searchButtonTooltip
|
|
59
|
-
searchInputPlaceholder
|
|
60
|
-
searchPrevTooltip
|
|
61
|
-
searchNextTooltip
|
|
62
|
-
searchCloseButtonTooltip
|
|
63
|
-
searchMatchCaseLabel
|
|
64
|
-
searchMatchCaseTooltip
|
|
65
|
-
searchWholeWordsLabel
|
|
66
|
-
searchWholeWordsTooltip
|
|
67
|
-
previousPageTooltip
|
|
68
|
-
nextPageTooltip
|
|
69
|
-
zoomOutTooltip
|
|
70
|
-
zoomInTooltip
|
|
71
|
-
zoomSelectTooltip
|
|
72
|
-
zoomActualSize
|
|
73
|
-
zoomPageFit
|
|
74
|
-
zoomPageWidth
|
|
75
|
-
themeEnableDarkTooltip
|
|
76
|
-
themeEnableLightTooltip
|
|
77
|
-
openLocalFileLabel
|
|
78
|
-
openLocalFileTooltip
|
|
79
|
-
downloadFileLabel
|
|
80
|
-
downloadFileTooltip
|
|
81
|
-
printLabel
|
|
82
|
-
printTooltip
|
|
83
|
-
printLoadingMessage
|
|
84
|
-
printCancelLabel
|
|
85
|
-
fullScreenLabel
|
|
86
|
-
fullScreenTooltip
|
|
87
|
-
moreOptionTooltip
|
|
88
|
-
firstPageLabel
|
|
89
|
-
firstPageTooltip
|
|
90
|
-
lastPageLabel
|
|
91
|
-
lastPageTooltip
|
|
92
|
-
rotateClockwiseLabel
|
|
93
|
-
rotateClockwiseTooltip
|
|
94
|
-
rotateCounterclockwiseLabel
|
|
95
|
-
rotateCounterclockwiseTooltip
|
|
96
|
-
textSelectionLabel
|
|
97
|
-
textSelectionTooltip
|
|
98
|
-
handToolLabel
|
|
99
|
-
handToolTooltip
|
|
100
|
-
pageScrollingLabel
|
|
101
|
-
pageScrollingTooltip
|
|
102
|
-
verticalScrollingLabel
|
|
103
|
-
verticalScrollingTooltip
|
|
104
|
-
horizontalLabel
|
|
105
|
-
horizontalTooltip
|
|
106
|
-
wrappedScrollingLabel
|
|
107
|
-
wrappedScrollingTooltip
|
|
108
|
-
singlePageLabel
|
|
109
|
-
singlePageTooltip
|
|
110
|
-
dualPageLabel
|
|
111
|
-
dualPageTooltip
|
|
112
|
-
documentPropertiesLabel
|
|
113
|
-
documentPropertiesTooltip
|
|
114
|
-
propertiesFilenameLabel
|
|
115
|
-
propertiesFileSizeLabel
|
|
116
|
-
propertiesTitleLabel
|
|
117
|
-
propertiesAuthorLabel
|
|
118
|
-
propertiesSubjectLabel
|
|
119
|
-
propertiesKeywordLabel
|
|
120
|
-
propertiesCreatorLabel
|
|
121
|
-
propertiesCreateOnLabel
|
|
122
|
-
propertiesModifiedOnLabel
|
|
123
|
-
propertiesPDFProducerLabel
|
|
124
|
-
propertiesPDFVersionLabel
|
|
125
|
-
propertiesPageCountLabel
|
|
126
|
-
thumbnailTooltip
|
|
127
|
-
passwordModalTitle
|
|
128
|
-
passwordModalMessage
|
|
129
|
-
passwordPlaceholder
|
|
130
|
-
passwordConfirmLabel
|
|
131
|
-
passwordError
|
|
132
|
-
dragDropFileMessage
|
|
58
|
+
searchButtonTooltip: string;
|
|
59
|
+
searchInputPlaceholder: string;
|
|
60
|
+
searchPrevTooltip: string;
|
|
61
|
+
searchNextTooltip: string;
|
|
62
|
+
searchCloseButtonTooltip: string;
|
|
63
|
+
searchMatchCaseLabel: string;
|
|
64
|
+
searchMatchCaseTooltip: string;
|
|
65
|
+
searchWholeWordsLabel: string;
|
|
66
|
+
searchWholeWordsTooltip: string;
|
|
67
|
+
previousPageTooltip: string;
|
|
68
|
+
nextPageTooltip: string;
|
|
69
|
+
zoomOutTooltip: string;
|
|
70
|
+
zoomInTooltip: string;
|
|
71
|
+
zoomSelectTooltip: string;
|
|
72
|
+
zoomActualSize: string;
|
|
73
|
+
zoomPageFit: string;
|
|
74
|
+
zoomPageWidth: string;
|
|
75
|
+
themeEnableDarkTooltip: string;
|
|
76
|
+
themeEnableLightTooltip: string;
|
|
77
|
+
openLocalFileLabel: string;
|
|
78
|
+
openLocalFileTooltip: string;
|
|
79
|
+
downloadFileLabel: string;
|
|
80
|
+
downloadFileTooltip: string;
|
|
81
|
+
printLabel: string;
|
|
82
|
+
printTooltip: string;
|
|
83
|
+
printLoadingMessage: string;
|
|
84
|
+
printCancelLabel: string;
|
|
85
|
+
fullScreenLabel: string;
|
|
86
|
+
fullScreenTooltip: string;
|
|
87
|
+
moreOptionTooltip: string;
|
|
88
|
+
firstPageLabel: string;
|
|
89
|
+
firstPageTooltip: string;
|
|
90
|
+
lastPageLabel: string;
|
|
91
|
+
lastPageTooltip: string;
|
|
92
|
+
rotateClockwiseLabel: string;
|
|
93
|
+
rotateClockwiseTooltip: string;
|
|
94
|
+
rotateCounterclockwiseLabel: string;
|
|
95
|
+
rotateCounterclockwiseTooltip: string;
|
|
96
|
+
textSelectionLabel: string;
|
|
97
|
+
textSelectionTooltip: string;
|
|
98
|
+
handToolLabel: string;
|
|
99
|
+
handToolTooltip: string;
|
|
100
|
+
pageScrollingLabel: string;
|
|
101
|
+
pageScrollingTooltip: string;
|
|
102
|
+
verticalScrollingLabel: string;
|
|
103
|
+
verticalScrollingTooltip: string;
|
|
104
|
+
horizontalLabel: string;
|
|
105
|
+
horizontalTooltip: string;
|
|
106
|
+
wrappedScrollingLabel: string;
|
|
107
|
+
wrappedScrollingTooltip: string;
|
|
108
|
+
singlePageLabel: string;
|
|
109
|
+
singlePageTooltip: string;
|
|
110
|
+
dualPageLabel: string;
|
|
111
|
+
dualPageTooltip: string;
|
|
112
|
+
documentPropertiesLabel: string;
|
|
113
|
+
documentPropertiesTooltip: string;
|
|
114
|
+
propertiesFilenameLabel: string;
|
|
115
|
+
propertiesFileSizeLabel: string;
|
|
116
|
+
propertiesTitleLabel: string;
|
|
117
|
+
propertiesAuthorLabel: string;
|
|
118
|
+
propertiesSubjectLabel: string;
|
|
119
|
+
propertiesKeywordLabel: string;
|
|
120
|
+
propertiesCreatorLabel: string;
|
|
121
|
+
propertiesCreateOnLabel: string;
|
|
122
|
+
propertiesModifiedOnLabel: string;
|
|
123
|
+
propertiesPDFProducerLabel: string;
|
|
124
|
+
propertiesPDFVersionLabel: string;
|
|
125
|
+
propertiesPageCountLabel: string;
|
|
126
|
+
thumbnailTooltip: string;
|
|
127
|
+
passwordModalTitle: string;
|
|
128
|
+
passwordModalMessage: string;
|
|
129
|
+
passwordPlaceholder: string;
|
|
130
|
+
passwordConfirmLabel: string;
|
|
131
|
+
passwordError: string;
|
|
132
|
+
dragDropFileMessage: string;
|
|
133
133
|
};
|
|
134
134
|
interface Attachment {
|
|
135
135
|
content: Uint8Array;
|
|
@@ -233,7 +233,7 @@ export interface SetPageResult {
|
|
|
233
233
|
export interface PageControl {
|
|
234
234
|
focusedPage: number;
|
|
235
235
|
setFocusedPage: (page: number | string) => void;
|
|
236
|
-
goToPage: (page: number | string) =>
|
|
236
|
+
goToPage: (page: number | string) => SetPageResult;
|
|
237
237
|
totalPages: number;
|
|
238
238
|
setTotalPages: (page: number) => void;
|
|
239
239
|
nextPage: () => void;
|
|
@@ -285,7 +285,7 @@ export interface PageNavigationToolProps {
|
|
|
285
285
|
nextPage: () => void;
|
|
286
286
|
prevPage: () => void;
|
|
287
287
|
changePage: (page: number) => void;
|
|
288
|
-
goToPage: (page: number) =>
|
|
288
|
+
goToPage: (page: number) => SetPageResult;
|
|
289
289
|
}
|
|
290
290
|
export interface PreparePrintProgress {
|
|
291
291
|
loadedPages: number;
|
|
@@ -427,12 +427,9 @@ export interface RPProviderProps extends PropsWithChildren, LoadPDFOptions, RPCo
|
|
|
427
427
|
workerUrl?: string;
|
|
428
428
|
characterMap?: CharacterMap;
|
|
429
429
|
}
|
|
430
|
-
export type LocalizationMap = Record<string, Localization>;
|
|
431
430
|
export interface RPControllerProps extends PropsWithChildren, DarkModeProviderProps, RotateProviderProps, LayerProviderProps, ZoomProviderProps, PageProviderProps, ScrollModeProps {
|
|
432
431
|
initialSearch?: string;
|
|
433
432
|
initialThumbnailsVisible?: boolean;
|
|
434
|
-
locale?: string;
|
|
435
|
-
localization?: LocalizationMap;
|
|
436
433
|
}
|
|
437
434
|
export interface RPConfigProps extends Omit<ConfigContextType, 'workerUrlAdded'>, RPThemeContextType, PropsWithChildren {
|
|
438
435
|
workerUrl?: string;
|
|
@@ -571,16 +568,4 @@ export interface LoadPDFOptions {
|
|
|
571
568
|
onLoadError?: (error: any) => void;
|
|
572
569
|
onLoaded?: (pdfDocument: PDFDocumentProxy) => void;
|
|
573
570
|
}
|
|
574
|
-
export interface ScrollPosition {
|
|
575
|
-
left: number;
|
|
576
|
-
top: number;
|
|
577
|
-
}
|
|
578
|
-
export declare const Locales: LocalizationMap;
|
|
579
|
-
export interface LocalizationContextType {
|
|
580
|
-
localeMessages?: Localization;
|
|
581
|
-
}
|
|
582
|
-
export interface LocalizationProps {
|
|
583
|
-
locale?: string;
|
|
584
|
-
localization?: LocalizationMap;
|
|
585
|
-
}
|
|
586
571
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../contexts/RPDocumentContext.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as v } from "../../RPDefaultLayout-5e5126fd.js";
|
|
5
5
|
import "../../contexts/DarkModeContext.js";
|
|
6
6
|
import "../../contexts/RotationContext.js";
|
|
7
7
|
import "../../contexts/LayerContext.js";
|
|
@@ -18,11 +18,10 @@ import "../../contexts/FileInputContext.js";
|
|
|
18
18
|
import "../../contexts/DropFileZoneContext.js";
|
|
19
19
|
import "../../contexts/LayoutContainerContext.js";
|
|
20
20
|
import "../../contexts/DimensionPagesContext.js";
|
|
21
|
-
import "../../contexts/LocalizationContext.js";
|
|
22
21
|
import "../../components/RPConfig.js";
|
|
23
22
|
import "../../contexts/ThemeContext.js";
|
|
24
23
|
import "../../components/RPDropFileZone.js";
|
|
25
24
|
import "../../contexts/ToolbarComponentContext.js";
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
v as useFileDownload
|
|
28
27
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useCallback as g, useEffect as v } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-03-
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-03-20T07:31:15.567Z"), d = "Please visit https://www.react-pdf.dev/license-management/ to generate a new license key.", o = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${d}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
|
|
6
6
|
expired: `Your license key has expired. ${d}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import { g as
|
|
2
|
+
import { g as z } from "../../RPDefaultLayout-5e5126fd.js";
|
|
3
3
|
import "../../contexts/ScrollStateContext.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
@@ -18,12 +18,11 @@ import "../../contexts/FileInputContext.js";
|
|
|
18
18
|
import "../../contexts/DropFileZoneContext.js";
|
|
19
19
|
import "../../contexts/LayoutContainerContext.js";
|
|
20
20
|
import "../../contexts/DimensionPagesContext.js";
|
|
21
|
-
import "../../contexts/LocalizationContext.js";
|
|
22
21
|
import "../../components/RPConfig.js";
|
|
23
22
|
import "../../contexts/ThemeContext.js";
|
|
24
23
|
import "../../components/RPDropFileZone.js";
|
|
25
24
|
import "../../contexts/ToolbarComponentContext.js";
|
|
26
25
|
import "./useDebounce.js";
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
z as usePaginate
|
|
29
28
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
|
-
import { i as
|
|
4
|
+
import { i as z } from "../../RPDefaultLayout-5e5126fd.js";
|
|
5
5
|
import "../../contexts/DarkModeContext.js";
|
|
6
6
|
import "../../contexts/RotationContext.js";
|
|
7
7
|
import "../../contexts/LayerContext.js";
|
|
@@ -18,12 +18,11 @@ import "../../contexts/FileInputContext.js";
|
|
|
18
18
|
import "../../contexts/DropFileZoneContext.js";
|
|
19
19
|
import "../../contexts/LayoutContainerContext.js";
|
|
20
20
|
import "../../contexts/DimensionPagesContext.js";
|
|
21
|
-
import "../../contexts/LocalizationContext.js";
|
|
22
21
|
import "../../components/RPConfig.js";
|
|
23
22
|
import "../../contexts/ThemeContext.js";
|
|
24
23
|
import "../../components/RPDropFileZone.js";
|
|
25
24
|
import "../../contexts/ToolbarComponentContext.js";
|
|
26
25
|
import "pdfjs-dist";
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
z as usePrint
|
|
29
28
|
};
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "../../contexts/ScrollModeContext.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../contexts/RPDocumentContext.js";
|
|
5
|
-
import { f as
|
|
5
|
+
import { f as y } from "../../RPDefaultLayout-5e5126fd.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../types.js";
|
|
8
8
|
import "../../contexts/RotationContext.js";
|
|
@@ -19,13 +19,11 @@ import "../../contexts/FileInputContext.js";
|
|
|
19
19
|
import "../../contexts/DropFileZoneContext.js";
|
|
20
20
|
import "../../contexts/LayoutContainerContext.js";
|
|
21
21
|
import "../../contexts/DimensionPagesContext.js";
|
|
22
|
-
import "../../contexts/LocalizationContext.js";
|
|
23
22
|
import "../../components/RPConfig.js";
|
|
24
23
|
import "../../contexts/ThemeContext.js";
|
|
25
24
|
import "../../components/RPDropFileZone.js";
|
|
26
25
|
import "../../contexts/ToolbarComponentContext.js";
|
|
27
26
|
import "./useDimensionPages.js";
|
|
28
|
-
import "../smoothScrollTo.js";
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
y as useScrollToPage
|
|
31
29
|
};
|
|
@@ -7,7 +7,7 @@ import "pdfjs-dist";
|
|
|
7
7
|
import "../../contexts/RPDocumentContext.js";
|
|
8
8
|
import "../../contexts/ZoomContext.js";
|
|
9
9
|
import "react/jsx-runtime";
|
|
10
|
-
import { n as
|
|
10
|
+
import { n as B } from "../../RPDefaultLayout-5e5126fd.js";
|
|
11
11
|
import "../../contexts/DarkModeContext.js";
|
|
12
12
|
import "../../contexts/RotationContext.js";
|
|
13
13
|
import "../../contexts/LayerContext.js";
|
|
@@ -21,11 +21,10 @@ import "../../contexts/FileInputContext.js";
|
|
|
21
21
|
import "../../contexts/DropFileZoneContext.js";
|
|
22
22
|
import "../../contexts/LayoutContainerContext.js";
|
|
23
23
|
import "../../contexts/DimensionPagesContext.js";
|
|
24
|
-
import "../../contexts/LocalizationContext.js";
|
|
25
24
|
import "../../components/RPConfig.js";
|
|
26
25
|
import "../../contexts/ThemeContext.js";
|
|
27
26
|
import "../../components/RPDropFileZone.js";
|
|
28
27
|
import "../../contexts/ToolbarComponentContext.js";
|
|
29
28
|
export {
|
|
30
|
-
|
|
29
|
+
B as useSearch
|
|
31
30
|
};
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "../renderPage.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../contexts/RPDocumentContext.js";
|
|
5
|
-
import { k as
|
|
5
|
+
import { k as A } from "../../RPDefaultLayout-5e5126fd.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -19,12 +19,11 @@ import "../../contexts/FileInputContext.js";
|
|
|
19
19
|
import "../../contexts/DropFileZoneContext.js";
|
|
20
20
|
import "../../contexts/LayoutContainerContext.js";
|
|
21
21
|
import "../../contexts/DimensionPagesContext.js";
|
|
22
|
-
import "../../contexts/LocalizationContext.js";
|
|
23
22
|
import "../../components/RPConfig.js";
|
|
24
23
|
import "../../contexts/ThemeContext.js";
|
|
25
24
|
import "../../components/RPDropFileZone.js";
|
|
26
25
|
import "../../contexts/ToolbarComponentContext.js";
|
|
27
26
|
import "../getThumbnailViewport.js";
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
A as useThumbnail
|
|
30
29
|
};
|
|
@@ -3,7 +3,7 @@ import "../types.js";
|
|
|
3
3
|
import "../../contexts/ScrollModeContext.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
6
|
-
import { r as
|
|
6
|
+
import { r as v } from "../../RPDefaultLayout-5e5126fd.js";
|
|
7
7
|
import "../../contexts/DarkModeContext.js";
|
|
8
8
|
import "../../contexts/RotationContext.js";
|
|
9
9
|
import "../../contexts/LayerContext.js";
|
|
@@ -19,11 +19,10 @@ import "../../contexts/FileInputContext.js";
|
|
|
19
19
|
import "../../contexts/DropFileZoneContext.js";
|
|
20
20
|
import "../../contexts/LayoutContainerContext.js";
|
|
21
21
|
import "../../contexts/DimensionPagesContext.js";
|
|
22
|
-
import "../../contexts/LocalizationContext.js";
|
|
23
22
|
import "../../components/RPConfig.js";
|
|
24
23
|
import "../../contexts/ThemeContext.js";
|
|
25
24
|
import "../../components/RPDropFileZone.js";
|
|
26
25
|
import "../../contexts/ToolbarComponentContext.js";
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
v as useVirtualReactWindow
|
|
29
28
|
};
|
package/dist/utils/types.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var E = /* @__PURE__ */ ((r) => (r[r.Text = 1] = "Text", r[r.Link = 2] = "Link", r[r.FreeText = 3] = "FreeText", r[r.Line = 4] = "Line", r[r.Square = 5] = "Square", r[r.Circle = 6] = "Circle", r[r.Polygon = 7] = "Polygon", r[r.Polyline = 8] = "Polyline", r[r.Highlight = 9] = "Highlight", r[r.Underline = 10] = "Underline", r[r.Squiggly = 11] = "Squiggly", r[r.StrikeOut = 12] = "StrikeOut", r[r.Stamp = 13] = "Stamp", r[r.Caret = 14] = "Caret", r[r.Ink = 15] = "Ink", r[r.Popup = 16] = "Popup", r[r.FileAttachment = 17] = "FileAttachment", r[r.Widget = 20] = "Widget", r))(E || {}), L = /* @__PURE__ */ ((r) => (r.ACTUAL = "Actual", r.PAGE_FIT = "Fit", r.PAGE_WIDTH = "Width", r))(L || {}), D = /* @__PURE__ */ ((r) => (r.Organization = "organization", r.Developer = "developer", r))(D || {}), p = /* @__PURE__ */ ((r) => (r.SINGLE_PAGE = "Single", r.DUAL_PAGE = "Dual", r))(p || {}), d = /* @__PURE__ */ ((r) => (r.TEXT_COLOR = "--rp-text-color", r.OUTLINE_COLOR = "--rp-outline-color", r.FONT_FAMILY = "--rp-font-family", r.PRIMARY_COLOR = "--rp-primary-color", r.BORDER_RADIUS = "--rp-border-radius", r.DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color", r.ICON_DISABLED = "--rp-icon-disabled", r.ICON_FONT_SIZE = "--rp-icon-font-size", r.TOOLBAR_BACKGROUND = "--rp-toolbar-background", r.TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color", r.TOOLBAR_PADDING = "--rp-toolbar-padding", r.TOOLBAR_GAP = "--rp-toolbar-gap", r.SIDEBAR_WIDTH = "--rp-sidebar-width", r.THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color", r.THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color", r.THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color", r.THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y", r.BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background", r.BUTTON_PADDING = "--rp-button-padding", r.INPUT_PADDING = "--rp-input-padding", r.INPUT_BORDER_RADIUS = "--rp-input-border-radius", r.INPUT_BACKGROUND_COLOR = "--rp-input-background-color", r.PAGES_BACKGROUND_COLOR = "--rp-pages-background-color", r.ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background", r.DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color", r.DROPDOWN_PADDING = "--rp-dropdown-padding", r.DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color", r.DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color", r.DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin", r.OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color", r.DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color", r.PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color", r.PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin", r.PROPERTY_ITEM_GAP = "--rp-property-item-gap", r.DIALOG_TITLE_COLOR = "--rp-dialog-title-color", r.PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color", r.PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size", r.PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size", r.PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight", r.DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size", r.DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight", r.MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size", r))(d || {}), P = /* @__PURE__ */ ((r) => (r.PAGE_SCROLLING = "PAGE", r.VERTICAL_SCROLLING = "VERTICAL", r.HORIZONTAL_SCROLLING = "HORIZONTAL", r))(P || {}), C = /* @__PURE__ */ ((r) => (r.TEXT = "TEXT", r.HAND = "HAND", r))(C || {});
|
|
3
|
-
const o = {
|
|
4
|
-
en_US: O,
|
|
5
|
-
zh_CN: _,
|
|
6
|
-
it_IT: R,
|
|
7
|
-
pt_PT: I,
|
|
8
|
-
th_TH: N
|
|
9
|
-
};
|
|
1
|
+
var O = /* @__PURE__ */ ((r) => (r[r.Text = 1] = "Text", r[r.Link = 2] = "Link", r[r.FreeText = 3] = "FreeText", r[r.Line = 4] = "Line", r[r.Square = 5] = "Square", r[r.Circle = 6] = "Circle", r[r.Polygon = 7] = "Polygon", r[r.Polyline = 8] = "Polyline", r[r.Highlight = 9] = "Highlight", r[r.Underline = 10] = "Underline", r[r.Squiggly = 11] = "Squiggly", r[r.StrikeOut = 12] = "StrikeOut", r[r.Stamp = 13] = "Stamp", r[r.Caret = 14] = "Caret", r[r.Ink = 15] = "Ink", r[r.Popup = 16] = "Popup", r[r.FileAttachment = 17] = "FileAttachment", r[r.Widget = 20] = "Widget", r))(O || {}), _ = /* @__PURE__ */ ((r) => (r.ACTUAL = "Actual", r.PAGE_FIT = "Fit", r.PAGE_WIDTH = "Width", r))(_ || {}), R = /* @__PURE__ */ ((r) => (r.Organization = "organization", r.Developer = "developer", r))(R || {}), I = /* @__PURE__ */ ((r) => (r.SINGLE_PAGE = "Single", r.DUAL_PAGE = "Dual", r))(I || {}), E = /* @__PURE__ */ ((r) => (r.TEXT_COLOR = "--rp-text-color", r.OUTLINE_COLOR = "--rp-outline-color", r.FONT_FAMILY = "--rp-font-family", r.PRIMARY_COLOR = "--rp-primary-color", r.BORDER_RADIUS = "--rp-border-radius", r.DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color", r.ICON_DISABLED = "--rp-icon-disabled", r.ICON_FONT_SIZE = "--rp-icon-font-size", r.TOOLBAR_BACKGROUND = "--rp-toolbar-background", r.TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color", r.TOOLBAR_PADDING = "--rp-toolbar-padding", r.TOOLBAR_GAP = "--rp-toolbar-gap", r.SIDEBAR_WIDTH = "--rp-sidebar-width", r.THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color", r.THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color", r.THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color", r.THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y", r.BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background", r.BUTTON_PADDING = "--rp-button-padding", r.INPUT_PADDING = "--rp-input-padding", r.INPUT_BORDER_RADIUS = "--rp-input-border-radius", r.INPUT_BACKGROUND_COLOR = "--rp-input-background-color", r.PAGES_BACKGROUND_COLOR = "--rp-pages-background-color", r.ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background", r.DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color", r.DROPDOWN_PADDING = "--rp-dropdown-padding", r.DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color", r.DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color", r.DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin", r.OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color", r.DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color", r.PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color", r.PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin", r.PROPERTY_ITEM_GAP = "--rp-property-item-gap", r.DIALOG_TITLE_COLOR = "--rp-dialog-title-color", r.PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color", r.PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size", r.PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size", r.PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight", r.DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size", r.DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight", r.MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size", r))(E || {}), D = /* @__PURE__ */ ((r) => (r.PAGE_SCROLLING = "PAGE", r.VERTICAL_SCROLLING = "VERTICAL", r.HORIZONTAL_SCROLLING = "HORIZONTAL", r))(D || {}), L = /* @__PURE__ */ ((r) => (r.TEXT = "TEXT", r.HAND = "HAND", r))(L || {});
|
|
10
2
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
L as ZoomLevel
|
|
3
|
+
O as AnnotationSubType,
|
|
4
|
+
R as LicenseType,
|
|
5
|
+
D as ScrollMode,
|
|
6
|
+
L as SelectionMode,
|
|
7
|
+
E as ThemeVariables,
|
|
8
|
+
I as ViewMode,
|
|
9
|
+
_ as ZoomLevel
|
|
19
10
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pdf-viewer/react",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "The PDF Viewer component for React and Next.js",
|
|
5
|
-
"version": "1.1.1
|
|
5
|
+
"version": "1.1.1",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"component",
|
|
8
8
|
"frontend",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@radix-ui/react-checkbox": "^1.1.3",
|
|
52
|
-
"@radix-ui/react-popover": "1.0.6",
|
|
53
52
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
54
53
|
"@tanstack/react-query": "^5.60.6",
|
|
55
54
|
"pdfjs-dist": "4.7.76",
|