@pdf-viewer/react 1.11.0-beta.0 → 1.11.0-beta.2
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/RotateTool.module-03987eba.js +6 -0
- package/dist/ToolbarLayout.module-082ff242.js +3405 -0
- package/dist/assets/ToolbarLayout.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +2 -2
- package/dist/components/layout/LayoutContainer.js +2 -2
- package/dist/components/layout/RPDefaultLayout.js +2 -3
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +2 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/RPMenuItem.js +23 -0
- package/dist/components/layout/toolbar/RPMoreOptions.js +147 -0
- 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 +20 -21
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +3 -3
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- 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 +6 -3
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +28 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +17 -0
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +25 -0
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +6 -3
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +16 -0
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +69 -0
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +78 -0
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +26 -0
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +43 -0
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +30 -0
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +32 -0
- package/dist/components/page/AnnotationLayer.js +2 -2
- package/dist/components/page/CanvasLayer.js +2 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +2 -2
- package/dist/components/page/TextLayer.js +2 -2
- package/dist/components/ui/Checkbox.js +13 -14
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +329 -687
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/floating-ui.react-dom-88a86594.js +1447 -0
- package/dist/index-48ca3f30.js +307 -0
- package/dist/index-4ba3ab9a.js +1877 -0
- package/dist/main.js +29 -23
- package/dist/types/components/layout/toolbar/RPMenuItem.d.ts +11 -0
- package/dist/types/components/layout/toolbar/RPMoreOptions.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/DocumentPropertiesTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/RotateClockwiseTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/RotateCounterclockwiseTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/DocumentProperties.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/FileDownloadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/FileUploadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/FullScreenTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/MostPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/PrintTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/RotateTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/ScrollModeTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/SelectionModeTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/more-options/ViewModeTool.d.ts +3 -0
- package/dist/types/contexts/SelectionModeContext.d.ts +2 -2
- package/dist/types/main.d.ts +4 -1
- package/dist/types/utils/calculatePage.d.ts +7 -0
- package/dist/types/utils/elementPagePosition.d.ts +17 -0
- package/dist/types/utils/getWordPositionInPage.d.ts +3 -6
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +8 -0
- package/dist/types/utils/types.d.ts +85 -7
- package/dist/utils/calculatePage.js +12 -5
- package/dist/utils/elementPagePosition.js +11 -0
- package/dist/utils/getScrollDistance.js +2 -2
- package/dist/utils/getWordPositionInPage.js +20 -21
- package/dist/utils/getZoomLevel.js +7 -7
- package/dist/utils/hooks/useFileDownload.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -2
- package/dist/utils/hooks/usePresentPage.js +2 -2
- package/dist/utils/hooks/usePrint.js +2 -2
- package/dist/utils/hooks/useScrollToPage.js +4 -3
- package/dist/utils/hooks/useSearch.js +2 -2
- package/dist/utils/hooks/useThumbnail.js +2 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +4 -3
- package/package.json +1 -1
- package/dist/ToolbarLayout.module-310f3470.js +0 -3368
- package/dist/floating-ui.react-dom-bbd2b1a7.js +0 -1330
- package/dist/index-54351a14.js +0 -1995
- package/dist/index-94df4e25.js +0 -139
- package/dist/index-e620205e.js +0 -172
package/dist/main.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { RPProvider as r } from "./components/RPProvider.js";
|
|
2
|
-
import { a as x, R as m, S as l, b as p, u as f, c as a, d as n } from "./ToolbarLayout.module-
|
|
2
|
+
import { a as x, R as m, S as l, b as p, u as f, c as a, d as n } from "./ToolbarLayout.module-082ff242.js";
|
|
3
3
|
import { RPConfig as u } from "./components/RPConfig.js";
|
|
4
4
|
import { RPLayout as P } from "./components/layout/RPLayout.js";
|
|
5
5
|
import { RPController as C } from "./components/RPController.js";
|
|
6
6
|
import { RPTheme as c } from "./components/RPTheme.js";
|
|
7
7
|
import { RPDropFileZone as g } from "./components/RPDropFileZone.js";
|
|
8
|
-
import { useDarkModeContext as
|
|
9
|
-
import { useDocumentContext as
|
|
10
|
-
import { useRotationContext as
|
|
8
|
+
import { useDarkModeContext as D } from "./contexts/DarkModeContext.js";
|
|
9
|
+
import { useDocumentContext as w } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useRotationContext as Z } from "./contexts/RotationContext.js";
|
|
11
11
|
import { useViewModeContext as v } from "./contexts/ViewModeContext.js";
|
|
12
12
|
import { useDropFileZoneContext as V } from "./contexts/DropFileZoneContext.js";
|
|
13
|
-
import { useOpenFileContext as
|
|
14
|
-
import { useZoomContext as
|
|
15
|
-
import { useHighlightContext as
|
|
13
|
+
import { useOpenFileContext as k } from "./contexts/FileInputContext.js";
|
|
14
|
+
import { useZoomContext as B } from "./contexts/ZoomContext.js";
|
|
15
|
+
import { useHighlightContext as I } from "./contexts/HighlightContext.js";
|
|
16
16
|
import { usePdfProperties as z } from "./utils/hooks/usePdfProperties.js";
|
|
17
17
|
import { useFullScreenContext as N } from "./contexts/FullScreenContext.js";
|
|
18
18
|
import { usePageRotateContext as j } from "./utils/hooks/usePageRotateContext.js";
|
|
@@ -29,15 +29,19 @@ import { InputPageTool as fo } from "./components/layout/toolbar/tools/InputPage
|
|
|
29
29
|
import { ZoomInTool as no } from "./components/layout/toolbar/tools/ZoomInTool.js";
|
|
30
30
|
import { ZoomOutTool as uo } from "./components/layout/toolbar/tools/ZoomOutTool.js";
|
|
31
31
|
import { ZoomLevelTool as Po } from "./components/layout/toolbar/tools/ZoomLevelTool.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
32
|
+
import { DocumentPropertiesTool as Co } from "./components/layout/toolbar/tools/DocumentPropertiesTool.js";
|
|
33
|
+
import { RotateClockwiseTool as co } from "./components/layout/toolbar/tools/RotateClockwiseTool.js";
|
|
34
|
+
import { RotateCounterclockwiseTool as ho } from "./components/layout/toolbar/tools/RotateCounterclockwiseTool.js";
|
|
35
|
+
import { RPHorizontalBar as Fo } from "./components/layout/toolbar/tools/defaults/RPHorizontalBar.js";
|
|
36
|
+
import { RPVerticalBar as So } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
|
|
37
|
+
import { Locales as Lo, ScrollMode as vo, ThemeVariables as Mo, ViewMode as Vo, ZoomLevel as bo } from "./utils/types.js";
|
|
35
38
|
export {
|
|
39
|
+
Co as DocumentPropertiesTool,
|
|
36
40
|
_ as FileDownloadTool,
|
|
37
41
|
X as FileUploadTool,
|
|
38
42
|
ro as FullScreenTool,
|
|
39
43
|
fo as InputPageTool,
|
|
40
|
-
|
|
44
|
+
Lo as Locales,
|
|
41
45
|
lo as NextPageTool,
|
|
42
46
|
xo as PreviousPageTool,
|
|
43
47
|
oo as PrintTool,
|
|
@@ -45,36 +49,38 @@ export {
|
|
|
45
49
|
C as RPController,
|
|
46
50
|
x as RPDefaultLayout,
|
|
47
51
|
g as RPDropFileZone,
|
|
48
|
-
|
|
52
|
+
Fo as RPHorizontalBar,
|
|
49
53
|
P as RPLayout,
|
|
50
54
|
m as RPPages,
|
|
51
55
|
r as RPProvider,
|
|
52
56
|
c as RPTheme,
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
So as RPVerticalBar,
|
|
58
|
+
co as RotateClockwiseTool,
|
|
59
|
+
ho as RotateCounterclockwiseTool,
|
|
60
|
+
vo as ScrollMode,
|
|
55
61
|
l as SearchTool,
|
|
56
62
|
J as ThemeSwitcherTool,
|
|
57
|
-
|
|
63
|
+
Mo as ThemeVariables,
|
|
58
64
|
Q as ThumbnailTool,
|
|
59
|
-
|
|
65
|
+
Vo as ViewMode,
|
|
60
66
|
no as ZoomInTool,
|
|
61
|
-
|
|
67
|
+
bo as ZoomLevel,
|
|
62
68
|
Po as ZoomLevelTool,
|
|
63
69
|
uo as ZoomOutTool,
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
D as useDarkModeContext,
|
|
71
|
+
w as useDocumentContext,
|
|
66
72
|
V as useDropFileZoneContext,
|
|
67
73
|
A as useElementPageContext,
|
|
68
74
|
p as useFileDownload,
|
|
69
75
|
N as useFullScreenContext,
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
I as useHighlightContext,
|
|
77
|
+
k as useOpenFileContext,
|
|
72
78
|
j as usePageRotateContext,
|
|
73
79
|
f as usePaginationContext,
|
|
74
80
|
z as usePdfProperties,
|
|
75
81
|
a as usePrintContext,
|
|
76
|
-
|
|
82
|
+
Z as useRotationContext,
|
|
77
83
|
n as useSearchContext,
|
|
78
84
|
v as useViewModeContext,
|
|
79
|
-
|
|
85
|
+
B as useZoomContext
|
|
80
86
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
interface MenuItemProps {
|
|
3
|
+
icon: React.ReactNode;
|
|
4
|
+
label: string;
|
|
5
|
+
tooltip: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
menuSeparator?: boolean;
|
|
8
|
+
menuSeparatorPosition?: 'top' | 'bottom';
|
|
9
|
+
}
|
|
10
|
+
export declare const RPMenuItem: FC<MenuItemProps>;
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { SelectionModeContextType,
|
|
2
|
+
import { SelectionModeContextType, SelectionModeProviderProps } from '../utils/types';
|
|
3
3
|
export declare const SelectionModeContext: import('react').Context<SelectionModeContextType>;
|
|
4
4
|
export declare const useSelectionModeContext: () => SelectionModeContextType;
|
|
5
|
-
export declare const SelectionModeProvider: FC<PropsWithChildren<
|
|
5
|
+
export declare const SelectionModeProvider: FC<PropsWithChildren<SelectionModeProviderProps>>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -36,7 +36,10 @@ export { InputPageTool } from './components/layout/toolbar/tools/InputPageTool';
|
|
|
36
36
|
export { ZoomInTool } from './components/layout/toolbar/tools/ZoomInTool';
|
|
37
37
|
export { ZoomOutTool } from './components/layout/toolbar/tools/ZoomOutTool';
|
|
38
38
|
export { ZoomLevelTool } from './components/layout/toolbar/tools/ZoomLevelTool';
|
|
39
|
+
export { DocumentPropertiesTool } from './components/layout/toolbar/tools/DocumentPropertiesTool';
|
|
40
|
+
export { RotateClockwiseTool } from './components/layout/toolbar/tools/RotateClockwiseTool';
|
|
41
|
+
export { RotateCounterclockwiseTool } from './components/layout/toolbar/tools/RotateCounterclockwiseTool';
|
|
39
42
|
export { RPHorizontalBar } from './components/layout/toolbar/tools/defaults/RPHorizontalBar';
|
|
40
43
|
export { RPVerticalBar } from './components/layout/toolbar/tools/defaults/RPVerticalBar';
|
|
41
|
-
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPDefaultLayoutProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult,
|
|
44
|
+
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPDefaultLayoutProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeInitialProps, ThumbnailToolProps, ViewModeInitialProps, ZoomProps, RPHorizontalBarProps, RPHorizontalBarSlots, RPHorizontalBarIcons, RPVerticalBarProps, RPVerticalBarSlots, RPVerticalBarIcons } from './utils/types';
|
|
42
45
|
export { ViewMode, ScrollMode, ZoomLevel, Locales, ThemeVariables } from './utils/types';
|
|
@@ -3,3 +3,10 @@ export declare const getPositionFromPage: (page: number, totalColumns: number) =
|
|
|
3
3
|
rowIndex: number;
|
|
4
4
|
columnIndex: number;
|
|
5
5
|
};
|
|
6
|
+
export declare const getGridDimension: (pageDimension: {
|
|
7
|
+
widths: number[];
|
|
8
|
+
heights: number[];
|
|
9
|
+
}, totalColumns: number) => {
|
|
10
|
+
rowsHeight: number[];
|
|
11
|
+
columnsWidth: number[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Style {
|
|
2
|
+
width?: string;
|
|
3
|
+
height?: string;
|
|
4
|
+
top?: string;
|
|
5
|
+
left?: string;
|
|
6
|
+
bottom?: string;
|
|
7
|
+
right?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const elementPagePosition: ({ width, height, top, left, bottom, right }: Style) => {
|
|
10
|
+
left: string;
|
|
11
|
+
top: string;
|
|
12
|
+
width: string;
|
|
13
|
+
height: string;
|
|
14
|
+
bottom: string;
|
|
15
|
+
right: string;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getWordPositionInPage: (
|
|
1
|
+
import { RectPosition } from './types';
|
|
2
|
+
export declare const getWordPositionInPage: (pageDimension: {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
|
-
},
|
|
6
|
-
top: number;
|
|
7
|
-
left: number;
|
|
8
|
-
}, wordPosition: WordPositionRect, scale: number, rotation: number) => {
|
|
5
|
+
}, pagesRef: HTMLDivElement, wordPosition: RectPosition, scale: number, rotation: number) => {
|
|
9
6
|
leftInPage: number;
|
|
10
7
|
topInPage: number;
|
|
11
8
|
};
|
|
@@ -6,4 +6,12 @@ export declare const useVirtualReactWindow: () => {
|
|
|
6
6
|
pageDimension: import('../types').DimensionPagesContextType;
|
|
7
7
|
estimatedRowHeight: number;
|
|
8
8
|
estimatedColumnWidth: number;
|
|
9
|
+
gridDimension: {
|
|
10
|
+
rowsHeight: number[];
|
|
11
|
+
columnsWidth: number[];
|
|
12
|
+
};
|
|
13
|
+
totalDimension: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
9
17
|
};
|
|
@@ -462,7 +462,7 @@ export interface RPProviderProps extends PropsWithChildren, LoadPDFOptions, RPCo
|
|
|
462
462
|
characterMap?: CharacterMap;
|
|
463
463
|
}
|
|
464
464
|
export type LocalizationMap = Record<string, Localization>;
|
|
465
|
-
export interface RPControllerProps extends PropsWithChildren, DarkModeProviderProps, RotateProviderProps, LayerProviderProps, ZoomProviderProps, PageProviderProps,
|
|
465
|
+
export interface RPControllerProps extends PropsWithChildren, DarkModeProviderProps, RotateProviderProps, LayerProviderProps, ZoomProviderProps, PageProviderProps, ViewModeInitialProps, ScrollModeInitialProps {
|
|
466
466
|
initialSearch?: string;
|
|
467
467
|
initialThumbnailsVisible?: boolean;
|
|
468
468
|
locale?: string;
|
|
@@ -502,7 +502,7 @@ export interface ZoomContextType {
|
|
|
502
502
|
export type ZoomProps = Omit<ZoomContextType, 'currentZoom'>;
|
|
503
503
|
export type InitialStateContextType = {
|
|
504
504
|
instanceId: string;
|
|
505
|
-
} & ZoomProviderProps & PageProviderProps &
|
|
505
|
+
} & ZoomProviderProps & PageProviderProps & ViewModeInitialProps & ScrollModeInitialProps & RotateProviderProps;
|
|
506
506
|
export interface ZoomProviderProps {
|
|
507
507
|
initialScale?: number | ZoomLevel;
|
|
508
508
|
}
|
|
@@ -515,7 +515,7 @@ export interface ViewModeContextType {
|
|
|
515
515
|
setDualPage: () => void;
|
|
516
516
|
viewMode: ViewMode;
|
|
517
517
|
}
|
|
518
|
-
export interface
|
|
518
|
+
export interface ViewModeInitialProps {
|
|
519
519
|
initialViewMode?: ViewMode;
|
|
520
520
|
}
|
|
521
521
|
export interface ViewportProps {
|
|
@@ -531,10 +531,10 @@ export interface ScrollModeContextType {
|
|
|
531
531
|
scrollMode: ScrollMode;
|
|
532
532
|
setScrollMode: (mode: ScrollMode) => void;
|
|
533
533
|
}
|
|
534
|
-
export interface
|
|
534
|
+
export interface ScrollModeInitialProps {
|
|
535
535
|
initialScrollMode?: ScrollMode;
|
|
536
536
|
}
|
|
537
|
-
export interface
|
|
537
|
+
export interface RectPosition {
|
|
538
538
|
left: number;
|
|
539
539
|
top: number;
|
|
540
540
|
width: number;
|
|
@@ -552,7 +552,7 @@ export interface Match {
|
|
|
552
552
|
str: string;
|
|
553
553
|
oIndex: number;
|
|
554
554
|
pageIndex: number;
|
|
555
|
-
rect:
|
|
555
|
+
rect: RectPosition;
|
|
556
556
|
}
|
|
557
557
|
export interface MatchValue extends Match {
|
|
558
558
|
page: number;
|
|
@@ -616,7 +616,7 @@ export interface SelectionModeContextType {
|
|
|
616
616
|
selectionMode: SelectionMode;
|
|
617
617
|
setSelectionMode: (mode: SelectionMode) => void;
|
|
618
618
|
}
|
|
619
|
-
export interface
|
|
619
|
+
export interface SelectionModeProviderProps {
|
|
620
620
|
initialSelectionMode?: SelectionMode;
|
|
621
621
|
}
|
|
622
622
|
export type LoaderImage = JSX.Element | string;
|
|
@@ -774,4 +774,82 @@ export interface RPVerticalBarProps {
|
|
|
774
774
|
slots?: RPVerticalBarSlots;
|
|
775
775
|
icons?: RPVerticalBarIcons;
|
|
776
776
|
}
|
|
777
|
+
export interface RPMoreOptionsSlots {
|
|
778
|
+
openFileTool?: boolean;
|
|
779
|
+
downloadTool?: boolean;
|
|
780
|
+
printTool?: boolean;
|
|
781
|
+
fullscreenTool?: boolean;
|
|
782
|
+
jumpNavigationTool?: boolean;
|
|
783
|
+
rotateTool?: boolean;
|
|
784
|
+
selectionModeTool?: boolean;
|
|
785
|
+
viewModeTool?: boolean;
|
|
786
|
+
scrollModeTool?: boolean;
|
|
787
|
+
documentProperties?: boolean;
|
|
788
|
+
}
|
|
789
|
+
export interface RPMoreOptionsIcons {
|
|
790
|
+
openFileIcon?: React.ReactNode;
|
|
791
|
+
downloadIcon?: React.ReactNode;
|
|
792
|
+
printIcon?: React.ReactNode;
|
|
793
|
+
fullScreenIcon?: React.ReactNode;
|
|
794
|
+
goToFirstPageIcon?: React.ReactNode;
|
|
795
|
+
goToLastPageIcon?: React.ReactNode;
|
|
796
|
+
rotateClockwiseIcon?: React.ReactNode;
|
|
797
|
+
rotateCounterClockwiseIcon?: React.ReactNode;
|
|
798
|
+
textSelectionIcon?: React.ReactNode;
|
|
799
|
+
handModeIcon?: React.ReactNode;
|
|
800
|
+
singlePageIcon?: React.ReactNode;
|
|
801
|
+
dualPageIcon?: React.ReactNode;
|
|
802
|
+
pageScrollIcon?: React.ReactNode;
|
|
803
|
+
verticalScrollIcon?: React.ReactNode;
|
|
804
|
+
horizontalScrollIcon?: React.ReactNode;
|
|
805
|
+
documentPropertiesIcon?: React.ReactNode;
|
|
806
|
+
}
|
|
807
|
+
export interface RPMoreOptionsProps extends PropsWithChildren {
|
|
808
|
+
slots?: RPMoreOptionsSlots;
|
|
809
|
+
icons?: RPMoreOptionsIcons;
|
|
810
|
+
slotTop?: React.ReactNode;
|
|
811
|
+
slotBottom?: React.ReactNode;
|
|
812
|
+
}
|
|
813
|
+
export interface ToolVisible {
|
|
814
|
+
isToolVisible?: boolean;
|
|
815
|
+
}
|
|
816
|
+
export interface MoreOptionToolProps extends ToolVisible {
|
|
817
|
+
icon?: React.ReactNode;
|
|
818
|
+
}
|
|
819
|
+
export interface MostPageIcons {
|
|
820
|
+
firstPageIcon: React.ReactNode;
|
|
821
|
+
lastPageIcon: React.ReactNode;
|
|
822
|
+
}
|
|
823
|
+
export interface MostPageToolProps extends ToolVisible {
|
|
824
|
+
icons?: MostPageIcons;
|
|
825
|
+
}
|
|
826
|
+
export interface RotateIcons {
|
|
827
|
+
rotateClockwiseIcon: React.ReactNode;
|
|
828
|
+
rotateCounterClockwiseIcon: React.ReactNode;
|
|
829
|
+
}
|
|
830
|
+
export interface RotateToolProps extends ToolVisible {
|
|
831
|
+
icons?: RotateIcons;
|
|
832
|
+
}
|
|
833
|
+
export interface SelectionModeIcons {
|
|
834
|
+
textSelectionIcon: React.ReactNode;
|
|
835
|
+
handModeIcon: React.ReactNode;
|
|
836
|
+
}
|
|
837
|
+
export interface SelectionModeProps extends ToolVisible {
|
|
838
|
+
icons?: SelectionModeIcons;
|
|
839
|
+
}
|
|
840
|
+
export interface ViewModeIcons {
|
|
841
|
+
singlePageIcon: React.ReactNode;
|
|
842
|
+
dualPageIcon: React.ReactNode;
|
|
843
|
+
}
|
|
844
|
+
export interface ViewModeProps extends ToolVisible {
|
|
845
|
+
icons?: ViewModeIcons;
|
|
846
|
+
}
|
|
847
|
+
export interface ScrollModeIcons {
|
|
848
|
+
pageScrollIcon: React.ReactNode;
|
|
849
|
+
verticalScrollIcon: React.ReactNode;
|
|
850
|
+
horizontalScrollIcon: React.ReactNode;
|
|
851
|
+
}
|
|
852
|
+
export interface ScrollModeProps extends ToolVisible {
|
|
853
|
+
icons?: ScrollModeIcons;
|
|
854
|
+
}
|
|
777
855
|
export {};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
return { rowIndex: n, columnIndex:
|
|
1
|
+
const d = (e, t, o) => e * o + t + 1, a = (e, t) => {
|
|
2
|
+
const o = e - 1, n = Math.floor(o / t), s = (o - n * t) % t;
|
|
3
|
+
return { rowIndex: n, columnIndex: s };
|
|
4
|
+
}, h = (e, t) => {
|
|
5
|
+
const o = [], n = [];
|
|
6
|
+
return e.heights.forEach((s, c) => {
|
|
7
|
+
const r = a(c + 1, t), i = e.widths[c];
|
|
8
|
+
o[r.rowIndex] = Math.max(o[r.rowIndex] || 0, s), n[r.columnIndex] = Math.max(n[r.columnIndex] || 0, i);
|
|
9
|
+
}), { rowsHeight: o, columnsWidth: n };
|
|
4
10
|
};
|
|
5
11
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
h as getGridDimension,
|
|
13
|
+
d as getPageFromPosition,
|
|
14
|
+
a as getPositionFromPage
|
|
8
15
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const o = ({ width: a, height: c, top: t, left: r, bottom: e, right: l }) => ({
|
|
2
|
+
left: `calc(${r} * var(--scale-factor))`,
|
|
3
|
+
top: `calc(${t} * var(--scale-factor))`,
|
|
4
|
+
width: `calc(${a} * var(--scale-factor))`,
|
|
5
|
+
height: `calc(${c} * var(--scale-factor))`,
|
|
6
|
+
bottom: `calc(${e} * var(--scale-factor))`,
|
|
7
|
+
right: `calc(${l} * var(--scale-factor))`
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
o as elementPagePosition
|
|
11
|
+
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const a = (i, h, l, o, n) => {
|
|
2
|
+
const c = l.height * o, s = l.width * o, y = l.top * o, w = l.left * o, d = {
|
|
3
|
+
width: n % 180 === 90 ? i.height : i.width,
|
|
4
|
+
height: n % 180 === 90 ? i.width : i.height
|
|
5
|
+
}, r = {
|
|
6
|
+
width: n % 180 === 90 ? c : s,
|
|
7
|
+
height: n % 180 === 90 ? s : c
|
|
8
|
+
}, t = document.createElement("div");
|
|
9
|
+
t.style.width = `${d.width}px`, t.style.height = `${d.height}px`, t.style.position = "absolute", t.style.transform = `rotate(${n}deg)`, t.style.transformOrigin = "center center", t.style.visibility = "hidden", t.style.left = "-99999px";
|
|
10
|
+
const e = document.createElement("div");
|
|
11
|
+
e.style.position = "absolute", e.style.width = `${s}px`, e.style.height = `${c}px`, e.style.position = "absolute", e.style.bottom = `${y}px`, e.style.left = `${w}px`, t.appendChild(e), h.appendChild(t);
|
|
12
|
+
const p = t.getBoundingClientRect(), g = e.getBoundingClientRect();
|
|
13
|
+
h.removeChild(t);
|
|
14
|
+
const u = {
|
|
15
|
+
top: h.clientHeight / 2,
|
|
16
|
+
left: h.clientWidth / 2
|
|
17
|
+
};
|
|
3
18
|
return {
|
|
4
|
-
|
|
5
|
-
|
|
19
|
+
leftInPage: g.left - p.left - u.left + r.width / 2,
|
|
20
|
+
topInPage: g.top - p.top - u.top + r.height / 2
|
|
6
21
|
};
|
|
7
|
-
}, O = (h, c, t, e, n) => {
|
|
8
|
-
const y = t.height * e, a = t.width * e, f = t.top * e, M = t.left * e, { y: d } = s(
|
|
9
|
-
{ x: h.width, y: h.height },
|
|
10
|
-
n % 180 === 0 ? 0 : 90
|
|
11
|
-
), p = M, g = Math.abs(d) - f, o = { x: h.width / 2, y: h.height / 2 }, { x: r, y: u } = s(
|
|
12
|
-
{
|
|
13
|
-
x: c.left + Math.abs(a) / 2,
|
|
14
|
-
y: c.top + Math.abs(y) / 2
|
|
15
|
-
},
|
|
16
|
-
n,
|
|
17
|
-
o
|
|
18
|
-
), { x: I, y: b } = s({ x: p, y: g }, n, o), x = {
|
|
19
|
-
left: I,
|
|
20
|
-
top: b
|
|
21
|
-
}, H = x.left - r, L = x.top - u;
|
|
22
|
-
return { leftInPage: H, topInPage: L };
|
|
23
22
|
};
|
|
24
23
|
export {
|
|
25
|
-
|
|
24
|
+
a as getWordPositionInPage
|
|
26
25
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { SCROLL_BAR_WIDTH as a } from "./constants.js";
|
|
1
|
+
import { SCROLL_BAR_WIDTH as a, PAGE_PADDING as f } from "./constants.js";
|
|
2
2
|
import { ViewMode as u, ZoomLevel as r } from "./types.js";
|
|
3
|
-
const
|
|
3
|
+
const l = (o, t, m, e, A, c) => {
|
|
4
4
|
if (typeof o == "number")
|
|
5
5
|
return o;
|
|
6
|
-
const n =
|
|
6
|
+
const n = c === u.DUAL_PAGE ? 2 * e : e;
|
|
7
7
|
switch (o) {
|
|
8
8
|
case r.PAGE_FIT:
|
|
9
|
-
const
|
|
9
|
+
const s = Math.min(
|
|
10
10
|
(t - a) / n,
|
|
11
|
-
m /
|
|
11
|
+
(m - f) / A
|
|
12
12
|
);
|
|
13
|
-
return Math.floor(
|
|
13
|
+
return Math.floor(s * 100);
|
|
14
14
|
case r.PAGE_WIDTH:
|
|
15
15
|
return Math.floor((t - a) / n * 100);
|
|
16
16
|
case r.ACTUAL:
|
|
@@ -19,5 +19,5 @@ const Z = (o, t, m, e, c, s) => {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
l as getZoomLevel
|
|
23
23
|
};
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import { b as io } from "../../ToolbarLayout.module-
|
|
5
|
+
import { b as io } from "../../ToolbarLayout.module-082ff242.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -52,7 +52,7 @@ import "../../components/layout/toolbar/MenuItem.js";
|
|
|
52
52
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
53
53
|
import "../dateFormatter.js";
|
|
54
54
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
55
|
-
import "../../
|
|
55
|
+
import "../../RotateTool.module-03987eba.js";
|
|
56
56
|
export {
|
|
57
57
|
io as useFileDownload
|
|
58
58
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-10-
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-10-28T03:15:38.185Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "../types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { s as mo } from "../../ToolbarLayout.module-082ff242.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
6
6
|
import "../../contexts/DocumentPasswordContext.js";
|
|
@@ -53,7 +53,7 @@ import "../../components/layout/toolbar/MenuItem.js";
|
|
|
53
53
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
54
54
|
import "../dateFormatter.js";
|
|
55
55
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
56
|
-
import "../../
|
|
56
|
+
import "../../RotateTool.module-03987eba.js";
|
|
57
57
|
import "./useDebounce.js";
|
|
58
58
|
export {
|
|
59
59
|
mo as usePaginate
|
|
@@ -5,7 +5,7 @@ import "../calculatePage.js";
|
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "../../contexts/RPDocumentContext.js";
|
|
7
7
|
import "../../contexts/DocumentPasswordContext.js";
|
|
8
|
-
import {
|
|
8
|
+
import { N as pr } from "../../ToolbarLayout.module-082ff242.js";
|
|
9
9
|
import "../../contexts/DarkModeContext.js";
|
|
10
10
|
import "../../contexts/RotationContext.js";
|
|
11
11
|
import "../../contexts/LayerContext.js";
|
|
@@ -53,7 +53,7 @@ import "../../components/layout/toolbar/MenuItem.js";
|
|
|
53
53
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
54
54
|
import "../dateFormatter.js";
|
|
55
55
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
56
|
-
import "../../
|
|
56
|
+
import "../../RotateTool.module-03987eba.js";
|
|
57
57
|
import "./useDebounce.js";
|
|
58
58
|
export {
|
|
59
59
|
pr as usePresentPage
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import {
|
|
5
|
+
import { v as ir } from "../../ToolbarLayout.module-082ff242.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -52,7 +52,7 @@ import "../../components/layout/toolbar/MenuItem.js";
|
|
|
52
52
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
53
53
|
import "../dateFormatter.js";
|
|
54
54
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
55
|
-
import "../../
|
|
55
|
+
import "../../RotateTool.module-03987eba.js";
|
|
56
56
|
import "pdfjs-dist";
|
|
57
57
|
export {
|
|
58
58
|
ir as usePrint
|
|
@@ -3,7 +3,7 @@ import "../../contexts/ScrollModeContext.js";
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../contexts/RPDocumentContext.js";
|
|
5
5
|
import "../../contexts/DocumentPasswordContext.js";
|
|
6
|
-
import {
|
|
6
|
+
import { r as eo } from "../../ToolbarLayout.module-082ff242.js";
|
|
7
7
|
import "../../contexts/DarkModeContext.js";
|
|
8
8
|
import "../types.js";
|
|
9
9
|
import "../../contexts/RotationContext.js";
|
|
@@ -53,9 +53,10 @@ import "../../components/layout/toolbar/MenuItem.js";
|
|
|
53
53
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
54
54
|
import "../dateFormatter.js";
|
|
55
55
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
56
|
-
import "../../
|
|
56
|
+
import "../../RotateTool.module-03987eba.js";
|
|
57
57
|
import "../smoothScrollTo.js";
|
|
58
58
|
import "../getScrollDistance.js";
|
|
59
|
+
import "../calculatePage.js";
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
eo as useScrollToPage
|
|
61
62
|
};
|