@pdf-viewer/react 0.4.0-beta.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/README.md +3 -0
- package/dist/Container.module-cb7b45b9.js +14 -0
- package/dist/RPSplitter.module-13d612c4.js +7 -0
- package/dist/RPTheme.module-f756e5cd.js +7 -0
- package/dist/Thumbnails-06fa1aa5.js +2657 -0
- package/dist/WrapperLayout.module-147bc943.js +6 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Container.css +1 -0
- package/dist/assets/DropDown.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/LoaderIcon.css +1 -0
- package/dist/assets/MenuItem.css +1 -0
- package/dist/assets/MenuSeparator.css +1 -0
- package/dist/assets/PropertyItem.css +1 -0
- package/dist/assets/RPSplitter.css +1 -0
- package/dist/assets/RPTheme.css +1 -0
- package/dist/assets/RotateTool.css +1 -0
- package/dist/assets/Thumbnails.css +1 -0
- package/dist/assets/WrapperLayout.css +1 -0
- package/dist/clsx-0c6e471a.js +22 -0
- package/dist/components/RPConfig.js +1347 -0
- package/dist/components/RPController.js +49 -0
- package/dist/components/RPDocument.js +9 -0
- package/dist/components/RPDropFileZone.js +33 -0
- package/dist/components/RPTheme.js +21 -0
- package/dist/components/RPViewer.js +37 -0
- package/dist/components/icons/CheckIcon.js +22 -0
- package/dist/components/icons/ChevronUpIcon.js +22 -0
- package/dist/components/icons/ClearIcon.js +25 -0
- package/dist/components/icons/ClockwiseIcon.js +22 -0
- package/dist/components/icons/CloseIcon.js +22 -0
- package/dist/components/icons/DarkPdfIcon.js +15 -0
- package/dist/components/icons/DualPageIcon.js +22 -0
- package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
- package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
- package/dist/components/icons/FullScreenIcon.js +22 -0
- package/dist/components/icons/GoToDownIcon.js +22 -0
- package/dist/components/icons/HandModeDefaultIcon.js +22 -0
- package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
- package/dist/components/icons/InfoIcon.js +22 -0
- package/dist/components/icons/LightPdfIcon.js +15 -0
- package/dist/components/icons/LoaderIcon.js +17 -0
- package/dist/components/icons/MoonIcon.js +22 -0
- package/dist/components/icons/PageScrollingIcon.js +24 -0
- package/dist/components/icons/PrintDefaultIcon.js +23 -0
- package/dist/components/icons/SearchIcon.js +22 -0
- package/dist/components/icons/SinglePageIcon.js +22 -0
- package/dist/components/icons/SunIcon.js +25 -0
- package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
- package/dist/components/icons/ThreeDotIcon.js +22 -0
- package/dist/components/icons/Thumbnail.js +54 -0
- package/dist/components/icons/VerticalScrollingIcon.js +24 -0
- package/dist/components/icons/WrappedScrollingIcon.js +24 -0
- package/dist/components/icons/ZoomInIcon.js +22 -0
- package/dist/components/icons/ZoomOutIcon.js +22 -0
- package/dist/components/layout/Container.js +28 -0
- package/dist/components/layout/RPLayout.js +59 -0
- package/dist/components/layout/WrapperLayout.js +11 -0
- package/dist/components/layout/sidebar/RPSidebar.js +34 -0
- package/dist/components/layout/sidebar/RPSplitter.js +10 -0
- package/dist/components/layout/sidebar/Thumbnail.js +8 -0
- package/dist/components/layout/sidebar/Thumbnails.js +7 -0
- package/dist/components/layout/toolbar/DarkModeTool.js +23 -0
- package/dist/components/layout/toolbar/DocumentDialog.js +36 -0
- package/dist/components/layout/toolbar/DocumentProperties.js +19 -0
- package/dist/components/layout/toolbar/FileDownloadTool.js +11 -0
- package/dist/components/layout/toolbar/FileUploadTool.js +21 -0
- package/dist/components/layout/toolbar/FullScreenTool.js +46 -0
- package/dist/components/layout/toolbar/MenuItem.js +12 -0
- package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
- package/dist/components/layout/toolbar/MostPageTool.js +36 -0
- package/dist/components/layout/toolbar/OtherTool.js +21 -0
- package/dist/components/layout/toolbar/Paginate.js +12 -0
- package/dist/components/layout/toolbar/PrintTool.js +11 -0
- package/dist/components/layout/toolbar/PropertyItem.js +12 -0
- package/dist/components/layout/toolbar/RPToolbar.js +8 -0
- package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
- package/dist/components/layout/toolbar/RotateTool.js +33 -0
- package/dist/components/layout/toolbar/ScrollModeTool.js +54 -0
- package/dist/components/layout/toolbar/SearchTool.js +40 -0
- package/dist/components/layout/toolbar/SelectionModeTool.js +36 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +31 -0
- package/dist/components/layout/toolbar/ZoomTool.js +41 -0
- package/dist/components/page/AnnotationLayer.js +37 -0
- package/dist/components/page/CanvasLayer.js +33 -0
- package/dist/components/page/DualPage.js +6 -0
- package/dist/components/page/RPPage.js +33 -0
- package/dist/components/page/SinglePage.js +6 -0
- package/dist/components/page/TextLayer.js +34 -0
- package/dist/components/ui/Button.js +22 -0
- package/dist/components/ui/Checkbox.js +301 -0
- package/dist/components/ui/DropDown.js +29 -0
- package/dist/components/ui/Input.js +26 -0
- package/dist/components/ui/LoadingIndicator.js +6 -0
- package/dist/contexts/ConfigContext.js +13 -0
- package/dist/contexts/DarkModeContext.js +28 -0
- package/dist/contexts/DropFileZoneContext.js +50 -0
- package/dist/contexts/FileInputContext.js +38 -0
- package/dist/contexts/FullScreenContext.js +18 -0
- package/dist/contexts/IconContext.js +11 -0
- package/dist/contexts/InitialStateContext.js +11 -0
- package/dist/contexts/LayerContext.js +8 -0
- package/dist/contexts/LayoutContainerContext.js +10 -0
- package/dist/contexts/LicenseContext.js +15 -0
- package/dist/contexts/OtherToolContext.js +18 -0
- package/dist/contexts/PageViewportContext.js +8 -0
- package/dist/contexts/PaginateContext.js +11 -0
- package/dist/contexts/PrintContext.js +8 -0
- package/dist/contexts/RPDocumentContext.js +49 -0
- package/dist/contexts/RenderedPagesCache.js +14 -0
- package/dist/contexts/RotateContext.js +23 -0
- package/dist/contexts/ScrollModeContext.js +21 -0
- package/dist/contexts/ScrollStateContext.js +13 -0
- package/dist/contexts/SearchContext.js +8 -0
- package/dist/contexts/SelectionModeContext.js +23 -0
- package/dist/contexts/ThemeContext.js +7 -0
- package/dist/contexts/ThumbnailsContext.js +8 -0
- package/dist/contexts/ToolbarComponentContext.js +41 -0
- package/dist/contexts/ViewModeContext.js +28 -0
- package/dist/contexts/ViewportContext.js +62 -0
- package/dist/contexts/VirtualGridContext.js +15 -0
- package/dist/contexts/VirtualScrollContext.js +53 -0
- package/dist/contexts/ZoomContext.js +46 -0
- package/dist/index-3459164c.js +3609 -0
- package/dist/index-743c36f0.js +139 -0
- package/dist/main.js +37 -0
- package/dist/types/components/RPConfig.d.ts +3 -0
- package/dist/types/components/RPController.d.ts +3 -0
- package/dist/types/components/RPDocument.d.ts +3 -0
- package/dist/types/components/RPDropFileZone.d.ts +2 -0
- package/dist/types/components/RPTheme.d.ts +3 -0
- package/dist/types/components/RPViewer.d.ts +2 -0
- package/dist/types/components/icons/CheckIcon.d.ts +2 -0
- package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
- package/dist/types/components/icons/ClearIcon.d.ts +2 -0
- package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
- package/dist/types/components/icons/CloseIcon.d.ts +2 -0
- package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
- package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
- package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
- package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
- package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/InfoIcon.d.ts +2 -0
- package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
- package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
- package/dist/types/components/icons/MoonIcon.d.ts +2 -0
- package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/SearchIcon.d.ts +2 -0
- package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
- package/dist/types/components/icons/SunIcon.d.ts +2 -0
- package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
- package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
- package/dist/types/components/icons/Thumbnail.d.ts +2 -0
- package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
- package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
- package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
- package/dist/types/components/layout/Container.d.ts +9 -0
- package/dist/types/components/layout/RPLayout.d.ts +3 -0
- package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
- package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
- package/dist/types/components/layout/sidebar/RPSplitter.d.ts +7 -0
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +5 -0
- package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
- package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
- package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
- package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
- package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
- package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -0
- package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
- package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/SearchTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
- package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
- package/dist/types/components/page/CanvasLayer.d.ts +8 -0
- package/dist/types/components/page/DualPage.d.ts +5 -0
- package/dist/types/components/page/RPPage.d.ts +6 -0
- package/dist/types/components/page/SinglePage.d.ts +5 -0
- package/dist/types/components/page/TextLayer.d.ts +6 -0
- package/dist/types/components/ui/Button.d.ts +6 -0
- package/dist/types/components/ui/Checkbox.d.ts +8 -0
- package/dist/types/components/ui/DropDown.d.ts +9 -0
- package/dist/types/components/ui/Input.d.ts +6 -0
- package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
- package/dist/types/contexts/ConfigContext.d.ts +5 -0
- package/dist/types/contexts/DarkModeContext.d.ts +5 -0
- package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
- package/dist/types/contexts/FileInputContext.d.ts +7 -0
- package/dist/types/contexts/FullScreenContext.d.ts +7 -0
- package/dist/types/contexts/IconContext.d.ts +7 -0
- package/dist/types/contexts/InitialStateContext.d.ts +5 -0
- package/dist/types/contexts/LayerContext.d.ts +5 -0
- package/dist/types/contexts/LayoutContainerContext.d.ts +8 -0
- package/dist/types/contexts/LicenseContext.d.ts +7 -0
- package/dist/types/contexts/OtherToolContext.d.ts +9 -0
- package/dist/types/contexts/PageViewportContext.d.ts +4 -0
- package/dist/types/contexts/PaginateContext.d.ts +5 -0
- package/dist/types/contexts/PrintContext.d.ts +7 -0
- package/dist/types/contexts/RPDocumentContext.d.ts +10 -0
- package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
- package/dist/types/contexts/RotateContext.d.ts +5 -0
- package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
- package/dist/types/contexts/ScrollStateContext.d.ts +8 -0
- package/dist/types/contexts/SearchContext.d.ts +7 -0
- package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
- package/dist/types/contexts/ThemeContext.d.ts +4 -0
- package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
- package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
- package/dist/types/contexts/ViewModeContext.d.ts +5 -0
- package/dist/types/contexts/ViewportContext.d.ts +28 -0
- package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
- package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
- package/dist/types/contexts/ZoomContext.d.ts +5 -0
- package/dist/types/main.d.ts +20 -0
- package/dist/types/utils/appConsole.d.ts +24 -0
- package/dist/types/utils/charators.d.ts +12 -0
- package/dist/types/utils/constants.d.ts +2 -0
- package/dist/types/utils/convertPdfDate.d.ts +1 -0
- package/dist/types/utils/dateFormatter.d.ts +1 -0
- package/dist/types/utils/formatFileSize.d.ts +1 -0
- package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
- package/dist/types/utils/getZoomLevel.d.ts +2 -0
- package/dist/types/utils/highlight.d.ts +8 -0
- package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
- package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
- package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
- package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
- package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
- package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
- package/dist/types/utils/hooks/useGrabScroll.d.ts +10 -0
- package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
- package/dist/types/utils/hooks/useLicense.d.ts +2 -0
- package/dist/types/utils/hooks/useLoadPdf.d.ts +7 -0
- package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
- package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
- package/dist/types/utils/hooks/usePageDimension.d.ts +4 -0
- package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
- package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
- package/dist/types/utils/hooks/usePrint.d.ts +11 -0
- package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
- package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
- package/dist/types/utils/hooks/useRotate.d.ts +4 -0
- package/dist/types/utils/hooks/useScrollToPage.d.ts +4 -0
- package/dist/types/utils/hooks/useSearch.d.ts +14 -0
- package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +12 -0
- package/dist/types/utils/hooks/useWatermark.d.ts +4 -0
- package/dist/types/utils/link_service.d.ts +71 -0
- package/dist/types/utils/renderPage.d.ts +2 -0
- package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
- package/dist/types/utils/types.d.ts +562 -0
- package/dist/utils/appConsole.js +42 -0
- package/dist/utils/charators.js +48 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/convertPdfDate.js +25 -0
- package/dist/utils/dateFormatter.js +7 -0
- package/dist/utils/formatFileSize.js +9 -0
- package/dist/utils/getThumbnailViewport.js +7 -0
- package/dist/utils/getZoomLevel.js +18 -0
- package/dist/utils/highlight.js +145 -0
- package/dist/utils/hooks/useDarkMode.js +11 -0
- package/dist/utils/hooks/useDarkModeProps.js +12 -0
- package/dist/utils/hooks/useDebounce.js +15 -0
- package/dist/utils/hooks/useElementSize.js +21 -0
- package/dist/utils/hooks/useFileDownload.js +32 -0
- package/dist/utils/hooks/useFullScreen.js +29 -0
- package/dist/utils/hooks/useGrabScroll.js +45 -0
- package/dist/utils/hooks/useInfiniteScroll.js +19 -0
- package/dist/utils/hooks/useLicense.js +102 -0
- package/dist/utils/hooks/useLoadPdf.js +50 -0
- package/dist/utils/hooks/useLoadWorker.js +13 -0
- package/dist/utils/hooks/useMousePressed.js +20 -0
- package/dist/utils/hooks/usePageDimension.js +24 -0
- package/dist/utils/hooks/usePaginate.js +33 -0
- package/dist/utils/hooks/usePdfProperties.js +40 -0
- package/dist/utils/hooks/usePrint.js +33 -0
- package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
- package/dist/utils/hooks/useResizeObserver.js +22 -0
- package/dist/utils/hooks/useRotate.js +13 -0
- package/dist/utils/hooks/useScrollToPage.js +34 -0
- package/dist/utils/hooks/useSearch.js +33 -0
- package/dist/utils/hooks/useThumbnail.js +34 -0
- package/dist/utils/hooks/useVirtualReactWindow.js +34 -0
- package/dist/utils/hooks/useWatermark.js +62 -0
- package/dist/utils/link_service.js +98 -0
- package/dist/utils/renderPage.js +15 -0
- package/dist/utils/sanitizeExternalUrl.js +16 -0
- package/dist/utils/types.js +10 -0
- package/package.json +90 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { PDFPageProxy } from 'pdfjs-dist';
|
|
2
|
+
import { DocumentInitParameters, PDFDataRangeTransport, PDFDocumentProxy, TypedArray } from 'pdfjs-dist/types/src/display/api';
|
|
3
|
+
import { PageViewport } from 'pdfjs-dist/types/web/interfaces';
|
|
4
|
+
import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
|
|
5
|
+
export interface DocumentContextType {
|
|
6
|
+
pdf?: PDFDocumentProxy;
|
|
7
|
+
pages: Map<number, PdfPage>;
|
|
8
|
+
pdfSrc?: PDFSrc;
|
|
9
|
+
setPdfSrc: React.Dispatch<React.SetStateAction<RPSrc | undefined>>;
|
|
10
|
+
pdfProperties?: PdfProperties;
|
|
11
|
+
setFilename: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
12
|
+
filename?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare enum AnnotationSubType {
|
|
15
|
+
Text = 1,
|
|
16
|
+
Link = 2,
|
|
17
|
+
FreeText = 3,
|
|
18
|
+
Line = 4,
|
|
19
|
+
Square = 5,
|
|
20
|
+
Circle = 6,
|
|
21
|
+
Polygon = 7,
|
|
22
|
+
Polyline = 8,
|
|
23
|
+
Highlight = 9,
|
|
24
|
+
Underline = 10,
|
|
25
|
+
Squiggly = 11,
|
|
26
|
+
StrikeOut = 12,
|
|
27
|
+
Stamp = 13,
|
|
28
|
+
Caret = 14,
|
|
29
|
+
Ink = 15,
|
|
30
|
+
Popup = 16,
|
|
31
|
+
FileAttachment = 17,
|
|
32
|
+
Widget = 20
|
|
33
|
+
}
|
|
34
|
+
interface AnnotationPoint {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}
|
|
38
|
+
export interface OutlineRef {
|
|
39
|
+
gen: number;
|
|
40
|
+
num: number;
|
|
41
|
+
}
|
|
42
|
+
export interface OutlineDestinationName {
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
export type OutlineDestination = [
|
|
46
|
+
OutlineRef | number,
|
|
47
|
+
OutlineDestinationName,
|
|
48
|
+
...any[]
|
|
49
|
+
];
|
|
50
|
+
type OutlineDestinationType = string | OutlineDestination;
|
|
51
|
+
export declare enum ZoomLevel {
|
|
52
|
+
ACTUAL = "Actual",
|
|
53
|
+
PAGE_FIT = "Fit",
|
|
54
|
+
PAGE_WIDTH = "Width"
|
|
55
|
+
}
|
|
56
|
+
export type Localization = {
|
|
57
|
+
searchButtonTooltip: string;
|
|
58
|
+
searchInputPlaceholder: string;
|
|
59
|
+
searchPrevTooltip: string;
|
|
60
|
+
searchNextTooltip: string;
|
|
61
|
+
searchCloseButtonTooltip: string;
|
|
62
|
+
searchMatchCaseLabel: string;
|
|
63
|
+
searchMatchCaseTooltip: string;
|
|
64
|
+
searchWholeWordsLabel: string;
|
|
65
|
+
searchWholeWordsTooltip: string;
|
|
66
|
+
previousPageTooltip: string;
|
|
67
|
+
nextPageTooltip: string;
|
|
68
|
+
zoomOutTooltip: string;
|
|
69
|
+
zoomInTooltip: string;
|
|
70
|
+
zoomSelectTooltip: string;
|
|
71
|
+
zoomActualSize: string;
|
|
72
|
+
zoomPageFit: string;
|
|
73
|
+
zoomPageWidth: string;
|
|
74
|
+
themeEnableDarkTooltip: string;
|
|
75
|
+
themeEnableLightTooltip: string;
|
|
76
|
+
openLocalFileLabel: string;
|
|
77
|
+
openLocalFileTooltip: string;
|
|
78
|
+
downloadFileLabel: string;
|
|
79
|
+
downloadFileTooltip: string;
|
|
80
|
+
printLabel: string;
|
|
81
|
+
printTooltip: string;
|
|
82
|
+
printLoadingMessage: string;
|
|
83
|
+
printCancelLabel: string;
|
|
84
|
+
fullScreenLabel: string;
|
|
85
|
+
fullScreenTooltip: string;
|
|
86
|
+
moreOptionTooltip: string;
|
|
87
|
+
firstPageLabel: string;
|
|
88
|
+
firstPageTooltip: string;
|
|
89
|
+
lastPageLabel: string;
|
|
90
|
+
lastPageTooltip: string;
|
|
91
|
+
rotateClockwiseLabel: string;
|
|
92
|
+
rotateClockwiseTooltip: string;
|
|
93
|
+
rotateCounterclockwiseLabel: string;
|
|
94
|
+
rotateCounterclockwiseTooltip: string;
|
|
95
|
+
textSelectionLabel: string;
|
|
96
|
+
textSelectionTooltip: string;
|
|
97
|
+
handToolLabel: string;
|
|
98
|
+
handToolTooltip: string;
|
|
99
|
+
pageScrollingLabel: string;
|
|
100
|
+
pageScrollingTooltip: string;
|
|
101
|
+
verticalScrollingLabel: string;
|
|
102
|
+
verticalScrollingTooltip: string;
|
|
103
|
+
horizontalLabel: string;
|
|
104
|
+
horizontalTooltip: string;
|
|
105
|
+
wrappedScrollingLabel: string;
|
|
106
|
+
wrappedScrollingTooltip: string;
|
|
107
|
+
singlePageLabel: string;
|
|
108
|
+
singlePageTooltip: string;
|
|
109
|
+
dualPageLabel: string;
|
|
110
|
+
dualPageTooltip: string;
|
|
111
|
+
documentPropertiesLabel: string;
|
|
112
|
+
documentPropertiesTooltip: string;
|
|
113
|
+
propertiesFilenameLabel: string;
|
|
114
|
+
propertiesFileSizeLabel: string;
|
|
115
|
+
propertiesTitleLabel: string;
|
|
116
|
+
propertiesAuthorLabel: string;
|
|
117
|
+
propertiesSubjectLabel: string;
|
|
118
|
+
propertiesKeywordLabel: string;
|
|
119
|
+
propertiesCreatorLabel: string;
|
|
120
|
+
propertiesCreateOnLabel: string;
|
|
121
|
+
propertiesModifiedOnLabel: string;
|
|
122
|
+
propertiesPDFProducerLabel: string;
|
|
123
|
+
propertiesPDFVersionLabel: string;
|
|
124
|
+
propertiesPageCountLabel: string;
|
|
125
|
+
thumbnailTooltip: string;
|
|
126
|
+
passwordModalTitle: string;
|
|
127
|
+
passwordModalMessage: string;
|
|
128
|
+
passwordPlaceholder: string;
|
|
129
|
+
passwordConfirmLabel: string;
|
|
130
|
+
passwordError: string;
|
|
131
|
+
dragDropFileMessage: string;
|
|
132
|
+
};
|
|
133
|
+
interface Attachment {
|
|
134
|
+
content: Uint8Array;
|
|
135
|
+
filename: string;
|
|
136
|
+
}
|
|
137
|
+
export interface Annotation {
|
|
138
|
+
annotationType: number;
|
|
139
|
+
color?: Uint8ClampedArray;
|
|
140
|
+
dest: OutlineDestinationType;
|
|
141
|
+
hasAppearance: boolean;
|
|
142
|
+
id: string;
|
|
143
|
+
rect: number[];
|
|
144
|
+
subtype: string;
|
|
145
|
+
borderStyle: {
|
|
146
|
+
dashArray: number[];
|
|
147
|
+
horizontalCornerRadius: number;
|
|
148
|
+
style: number;
|
|
149
|
+
verticalCornerRadius: number;
|
|
150
|
+
width: number;
|
|
151
|
+
};
|
|
152
|
+
hasPopup?: boolean;
|
|
153
|
+
contents?: string;
|
|
154
|
+
contentsObj?: {
|
|
155
|
+
dir: string;
|
|
156
|
+
str: string;
|
|
157
|
+
};
|
|
158
|
+
modificationDate?: string;
|
|
159
|
+
quadPoints?: AnnotationPoint[][];
|
|
160
|
+
title?: string;
|
|
161
|
+
titleObj?: {
|
|
162
|
+
dir: string;
|
|
163
|
+
str: string;
|
|
164
|
+
};
|
|
165
|
+
parentId?: string;
|
|
166
|
+
parentType?: string;
|
|
167
|
+
file?: Attachment;
|
|
168
|
+
inkLists?: AnnotationPoint[][];
|
|
169
|
+
lineCoordinates: number[];
|
|
170
|
+
action?: string;
|
|
171
|
+
unsafeUrl?: string;
|
|
172
|
+
url?: string;
|
|
173
|
+
newWindow?: boolean;
|
|
174
|
+
vertices?: AnnotationPoint[];
|
|
175
|
+
name?: string;
|
|
176
|
+
fieldType: string;
|
|
177
|
+
pushButton: boolean;
|
|
178
|
+
}
|
|
179
|
+
export interface Destination {
|
|
180
|
+
pageIndex: number;
|
|
181
|
+
bottomOffset: number | DestinationOffsetFromViewport;
|
|
182
|
+
leftOffset: number | DestinationOffsetFromViewport;
|
|
183
|
+
label?: string;
|
|
184
|
+
scaleTo?: number;
|
|
185
|
+
}
|
|
186
|
+
export type DestinationOffsetFromViewport = (viewportWidth: number, viewportHeight: number) => number;
|
|
187
|
+
export interface OutlineRef {
|
|
188
|
+
gen: number;
|
|
189
|
+
num: number;
|
|
190
|
+
}
|
|
191
|
+
export interface RotateContextType {
|
|
192
|
+
rotate: number;
|
|
193
|
+
setRotate: React.Dispatch<React.SetStateAction<number>>;
|
|
194
|
+
}
|
|
195
|
+
export interface RPThemeContextType extends PropsWithChildren {
|
|
196
|
+
customVariables?: Partial<Record<ThemeVariables, string>>;
|
|
197
|
+
customDarkVariables?: Partial<Record<ThemeVariables, string>>;
|
|
198
|
+
}
|
|
199
|
+
export interface DarkMode {
|
|
200
|
+
darkMode: boolean;
|
|
201
|
+
setDarkMode: Dispatch<React.SetStateAction<boolean>>;
|
|
202
|
+
}
|
|
203
|
+
export interface DarkModeProps {
|
|
204
|
+
onDarkModeChange: (value: boolean) => void;
|
|
205
|
+
setDarkMode: React.Dispatch<React.SetStateAction<boolean>>;
|
|
206
|
+
darkMode: boolean;
|
|
207
|
+
}
|
|
208
|
+
export interface License {
|
|
209
|
+
isValid: boolean;
|
|
210
|
+
invalidatedMessage?: string;
|
|
211
|
+
type?: LicenseType;
|
|
212
|
+
}
|
|
213
|
+
export declare enum LicenseType {
|
|
214
|
+
Organization = "organization",
|
|
215
|
+
Developer = "developer"
|
|
216
|
+
}
|
|
217
|
+
export type DecryptedLicense = {
|
|
218
|
+
exp: number;
|
|
219
|
+
avu: number;
|
|
220
|
+
t: LicenseType;
|
|
221
|
+
dmt: 'specific' | 'wildcard';
|
|
222
|
+
dm: string;
|
|
223
|
+
n: string;
|
|
224
|
+
};
|
|
225
|
+
export interface PdfPage {
|
|
226
|
+
page: PDFPageProxy;
|
|
227
|
+
thumbnailViewport: PageViewport;
|
|
228
|
+
thumbnailScale: number;
|
|
229
|
+
}
|
|
230
|
+
export interface SetPageResult {
|
|
231
|
+
success: boolean;
|
|
232
|
+
currentPage: number;
|
|
233
|
+
}
|
|
234
|
+
export interface PageControl {
|
|
235
|
+
focusedPage: number;
|
|
236
|
+
setFocusedPage: (page: number | string) => void;
|
|
237
|
+
goToPage: (page: number | string) => SetPageResult;
|
|
238
|
+
totalPages: number;
|
|
239
|
+
setTotalPages: (page: number) => void;
|
|
240
|
+
nextPage: () => void;
|
|
241
|
+
prevPage: () => void;
|
|
242
|
+
}
|
|
243
|
+
export interface PageControlContextType extends PageControl {
|
|
244
|
+
}
|
|
245
|
+
export interface ThumbnailContextType {
|
|
246
|
+
thumbnailPages: Record<number, ThumbnailRenderedList>;
|
|
247
|
+
addPage: (page: number) => void;
|
|
248
|
+
addToPage: (page: number) => void;
|
|
249
|
+
thumbnailLength: number;
|
|
250
|
+
active: boolean;
|
|
251
|
+
setActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
252
|
+
}
|
|
253
|
+
export interface FileDragDropControl {
|
|
254
|
+
dragging: boolean;
|
|
255
|
+
handleDragLeave: (event: React.DragEvent) => void;
|
|
256
|
+
handleDragEnter: (event: React.DragEvent) => void;
|
|
257
|
+
handleDrop: (event: React.DragEvent) => void;
|
|
258
|
+
}
|
|
259
|
+
export interface ThumbnailRenderedList {
|
|
260
|
+
loading: boolean;
|
|
261
|
+
page: PDFPageProxy;
|
|
262
|
+
thumbnailSrc?: string;
|
|
263
|
+
viewport: PageViewport;
|
|
264
|
+
scale: number;
|
|
265
|
+
}
|
|
266
|
+
export declare enum ViewMode {
|
|
267
|
+
SINGLE_PAGE = "Single",
|
|
268
|
+
DUAL_PAGE = "Dual"
|
|
269
|
+
}
|
|
270
|
+
export type PDFSrc = string | URL | TypedArray | PDFDataRangeTransport | DocumentInitParameters | undefined | null;
|
|
271
|
+
export type RPSrc = Omit<PDFSrc, 'DocumentInitParameters' | 'PDFDataRangeTransport'>;
|
|
272
|
+
export interface FullScreenToolProps {
|
|
273
|
+
isFullScreen: boolean;
|
|
274
|
+
toggleFullScreen: () => void;
|
|
275
|
+
isSupported?: boolean;
|
|
276
|
+
}
|
|
277
|
+
export interface OpenFileToolProps {
|
|
278
|
+
onClick: () => void;
|
|
279
|
+
}
|
|
280
|
+
export interface DownloadToolProps {
|
|
281
|
+
downloadFile: () => void;
|
|
282
|
+
}
|
|
283
|
+
export interface PageNavigationToolProps {
|
|
284
|
+
total: number;
|
|
285
|
+
current: number;
|
|
286
|
+
nextPage: () => void;
|
|
287
|
+
prevPage: () => void;
|
|
288
|
+
changePage: (page: number) => void;
|
|
289
|
+
goToPage: (page: number) => SetPageResult;
|
|
290
|
+
}
|
|
291
|
+
export interface PreparePrintProgress {
|
|
292
|
+
loadedPages: number;
|
|
293
|
+
totalPages: number;
|
|
294
|
+
percentage: number;
|
|
295
|
+
}
|
|
296
|
+
export interface PrintToolProps {
|
|
297
|
+
print: () => void;
|
|
298
|
+
cancel: () => void;
|
|
299
|
+
setOnProgress: (callback: (progress: PreparePrintProgress) => void) => void;
|
|
300
|
+
setOnComplete: (callback: () => void) => void;
|
|
301
|
+
setOnError: (callback: (error: Error) => void) => void;
|
|
302
|
+
progress: PreparePrintProgress;
|
|
303
|
+
}
|
|
304
|
+
export interface ThumbnailToolProps {
|
|
305
|
+
onClick: () => void;
|
|
306
|
+
active: boolean;
|
|
307
|
+
}
|
|
308
|
+
export interface RPSlots {
|
|
309
|
+
themeSwitcher?: boolean | FC<Omit<DarkModeProps, 'onDarkModeChange'>>;
|
|
310
|
+
documentProperties?: boolean;
|
|
311
|
+
rotateTool?: boolean;
|
|
312
|
+
fullscreenTool?: boolean | FC<FullScreenToolProps>;
|
|
313
|
+
openFileTool?: boolean | FC<OpenFileToolProps>;
|
|
314
|
+
dropFileZone?: boolean | React.ReactNode | React.ComponentType;
|
|
315
|
+
downloadTool?: boolean | FC<DownloadToolProps>;
|
|
316
|
+
zoomTool?: boolean | FC<ZoomProps>;
|
|
317
|
+
viewModeTool?: boolean;
|
|
318
|
+
scrollModeTool?: boolean;
|
|
319
|
+
thumbnailTool?: boolean | FC<ThumbnailToolProps>;
|
|
320
|
+
pageNavigationTool?: boolean | FC<PageNavigationToolProps>;
|
|
321
|
+
printTool?: boolean | FC<PrintToolProps>;
|
|
322
|
+
containerWidthSm?: number;
|
|
323
|
+
showPrintProgress?: boolean;
|
|
324
|
+
selectionModeTool?: boolean;
|
|
325
|
+
searchTool?: boolean;
|
|
326
|
+
jumpNavigationTool?: boolean;
|
|
327
|
+
}
|
|
328
|
+
export interface RPIcons {
|
|
329
|
+
goToFirstPageIcon?: React.ReactNode;
|
|
330
|
+
goToLastPageIcon?: React.ReactNode;
|
|
331
|
+
lightModeIcon?: React.ReactNode;
|
|
332
|
+
darkModeIcon?: React.ReactNode;
|
|
333
|
+
fileUploadIcon?: React.ReactNode;
|
|
334
|
+
nextIcon?: React.ReactNode;
|
|
335
|
+
prevIcon?: React.ReactNode;
|
|
336
|
+
fullScreenIcon?: React.ReactNode;
|
|
337
|
+
downloadIcon?: React.ReactNode;
|
|
338
|
+
zoomInIcon?: React.ReactNode;
|
|
339
|
+
zoomOutIcon?: React.ReactNode;
|
|
340
|
+
openFileIcon?: React.ReactNode;
|
|
341
|
+
rotateClockwiseIcon?: React.ReactNode;
|
|
342
|
+
rotateCounterClockwiseIcon?: React.ReactNode;
|
|
343
|
+
pageScrollIcon?: React.ReactNode;
|
|
344
|
+
verticalScrollIcon?: React.ReactNode;
|
|
345
|
+
horizontalScrollIcon?: React.ReactNode;
|
|
346
|
+
documentPropertiesIcon?: React.ReactNode;
|
|
347
|
+
printIcon?: React.ReactNode;
|
|
348
|
+
thumbnailIcon?: React.ReactNode;
|
|
349
|
+
searchIcon?: React.ReactNode;
|
|
350
|
+
textSelectionIcon?: React.ReactNode;
|
|
351
|
+
handModeIcon?: React.ReactNode;
|
|
352
|
+
}
|
|
353
|
+
export interface PdfProperties {
|
|
354
|
+
filename: string;
|
|
355
|
+
fileSize: string;
|
|
356
|
+
title: string;
|
|
357
|
+
author: string;
|
|
358
|
+
subject: string;
|
|
359
|
+
keywords: string;
|
|
360
|
+
creator: string;
|
|
361
|
+
createdOn: string;
|
|
362
|
+
modifierOn: string;
|
|
363
|
+
pdfProducer: string;
|
|
364
|
+
pdfVersion: string;
|
|
365
|
+
pageCount?: number;
|
|
366
|
+
}
|
|
367
|
+
export interface ConfigContextType {
|
|
368
|
+
workerUrlAdded: boolean;
|
|
369
|
+
}
|
|
370
|
+
export declare enum ThemeVariables {
|
|
371
|
+
TEXT_COLOR = "--rp-text-color",
|
|
372
|
+
OUTLINE_COLOR = "--rp-outline-color",
|
|
373
|
+
FONT_FAMILY = "--rp-font-family",
|
|
374
|
+
PRIMARY_COLOR = "--rp-primary-color",
|
|
375
|
+
BORDER_RADIUS = "--rp-border-radius",
|
|
376
|
+
DROP_MASK_BACKGROUND_COLOR = "--rp-drop-mask-background-color",
|
|
377
|
+
ICON_DISABLED = "--rp-icon-disabled",
|
|
378
|
+
ICON_FONT_SIZE = "--rp-icon-font-size",
|
|
379
|
+
TOOLBAR_BACKGROUND = "--rp-toolbar-background",
|
|
380
|
+
TOOLBAR_BORDER_COLOR = "--rp-toolbar-border-color",
|
|
381
|
+
TOOLBAR_PADDING = "--rp-toolbar-padding",
|
|
382
|
+
TOOLBAR_GAP = "--rp-toolbar-gap",
|
|
383
|
+
SIDEBAR_WIDTH = "--rp-sidebar-width",
|
|
384
|
+
THUMBNAIL_BORDER_COLOR = "--rp-thumbnail-border-color",
|
|
385
|
+
THUMBNAIL_BACKGROUND_COLOR = "--rp-thumbnail-background-color",
|
|
386
|
+
THUMBNAIL_ACTIVE_COLOR = "--rp-thumbnail-active-color",
|
|
387
|
+
THUMBNAIL_PADDING_Y = "--rp-thumbnail-padding-y",
|
|
388
|
+
BUTTON_HOVER_BACKGROUND = "--rp-button-hover-background",
|
|
389
|
+
BUTTON_PADDING = "--rp-button-padding",
|
|
390
|
+
INPUT_PADDING = "--rp-input-padding",
|
|
391
|
+
INPUT_BORDER_RADIUS = "--rp-input-border-radius",
|
|
392
|
+
INPUT_BACKGROUND_COLOR = "--rp-input-background-color",
|
|
393
|
+
PAGES_BACKGROUND_COLOR = "--rp-pages-background-color",
|
|
394
|
+
ANNOTATION_LAYER_LINK_HOVER_BACKGROUND = "--rp-annotation-layer__link-hover-background",
|
|
395
|
+
DROPDOWN_BACKGROUND_COLOR = "--rp-dropdown-background-color",
|
|
396
|
+
DROPDOWN_PADDING = "--rp-dropdown-padding",
|
|
397
|
+
DROPDOWN_HOVER_BACKGROUND_COLOR = "--rp-dropdown-hover-background-color",
|
|
398
|
+
DROPDOWN_SEPARATOR_COLOR = "--rp-dropdown-separator-color",
|
|
399
|
+
DROPDOWN_SEPARATOR_MARGIN = "--rp-dropdown-separator-margin",
|
|
400
|
+
OVERLAY_BACKGROUND_COLOR = "--rp-overlay-background-color",
|
|
401
|
+
DIALOG_BACKGROUND_COLOR = "--rp-dialog-background-color",
|
|
402
|
+
PROPERTIES_DIVIDER_COLOR = "--rp-properties-divider-color",
|
|
403
|
+
PROPERTIES_DIVIDER_MARGIN = "--rp-properties-divider-margin",
|
|
404
|
+
PROPERTY_ITEM_GAP = "--rp-property-item-gap",
|
|
405
|
+
DIALOG_TITLE_COLOR = "--rp-dialog-title-color",
|
|
406
|
+
PROPERTY_ITEM_LABEL_COLOR = "--rp-property-item-label-color",
|
|
407
|
+
PROPERTY_CLOSE_ICON_SIZE = "--rp-property-close-icon-size",
|
|
408
|
+
PROPERTY_ITEM_FONT_SIZE = "--rp-property-item-font-size",
|
|
409
|
+
PROPERTY_ITEM_FONT_WEIGHT = "--rp-property-item-font-weight",
|
|
410
|
+
DIALOG_TITLE_FONT_SIZE = "--rp-dialog-title-font-size",
|
|
411
|
+
DIALOG_TITLE_FONT_WEIGHT = "--rp-dialog-title-font-weight",
|
|
412
|
+
MENU_ITEM_ICON_SIZE = "--rp-menu-item-icon-size"
|
|
413
|
+
}
|
|
414
|
+
export interface DarkModeProviderProps extends PropsWithChildren, Partial<Omit<DarkModeProps, 'setDarkMode'>> {
|
|
415
|
+
}
|
|
416
|
+
export interface RotateProviderProps extends PropsWithChildren {
|
|
417
|
+
initialRotate?: number;
|
|
418
|
+
}
|
|
419
|
+
export interface LayerProviderProps extends PropsWithChildren {
|
|
420
|
+
textLayer?: boolean;
|
|
421
|
+
}
|
|
422
|
+
export type RPThemeProps = RPThemeContextType;
|
|
423
|
+
export interface CharacterMapConfig {
|
|
424
|
+
url: string;
|
|
425
|
+
isCompressed: boolean;
|
|
426
|
+
}
|
|
427
|
+
export interface RPDocumentProps extends PropsWithChildren {
|
|
428
|
+
src: RPSrc;
|
|
429
|
+
workerUrl?: string;
|
|
430
|
+
characterMap?: CharacterMapConfig;
|
|
431
|
+
}
|
|
432
|
+
export interface RPControllerProps extends PropsWithChildren, DarkModeProviderProps, RotateProviderProps, LayerProviderProps, ZoomProviderProps, PageProviderProps, ViewportProps, ScrollModeProps {
|
|
433
|
+
}
|
|
434
|
+
export interface RPConfigProps extends Omit<ConfigContextType, 'workerUrlAdded'>, RPThemeContextType, PropsWithChildren {
|
|
435
|
+
workerUrl?: string;
|
|
436
|
+
licenseKey?: string;
|
|
437
|
+
}
|
|
438
|
+
export interface RPLayoutProps extends PropsWithChildren, RPControllerProps {
|
|
439
|
+
slots?: RPSlots;
|
|
440
|
+
icons?: RPIcons;
|
|
441
|
+
initialThumbnailsVisible?: boolean;
|
|
442
|
+
initialSearch?: string;
|
|
443
|
+
showToolbar?: boolean;
|
|
444
|
+
style?: React.CSSProperties;
|
|
445
|
+
className?: string;
|
|
446
|
+
}
|
|
447
|
+
export interface ZoomContextType {
|
|
448
|
+
zoomLevel: number;
|
|
449
|
+
currentZoom: number;
|
|
450
|
+
setZoomLevel: React.Dispatch<React.SetStateAction<number>>;
|
|
451
|
+
}
|
|
452
|
+
export type ZoomProps = Omit<ZoomContextType, 'currentZoom'>;
|
|
453
|
+
export type InitialStateContextType = ZoomProviderProps & PageProviderProps & ViewModeProps & ScrollModeProps & RotateProviderProps;
|
|
454
|
+
export interface ZoomProviderProps {
|
|
455
|
+
initialScale?: number | ZoomLevel;
|
|
456
|
+
}
|
|
457
|
+
export interface PageProviderProps {
|
|
458
|
+
initialPage?: number;
|
|
459
|
+
}
|
|
460
|
+
export interface ViewModeContextType {
|
|
461
|
+
columnCount: number;
|
|
462
|
+
setSinglePage: () => void;
|
|
463
|
+
setDualPage: () => void;
|
|
464
|
+
viewMode: ViewMode;
|
|
465
|
+
}
|
|
466
|
+
export interface ViewModeProps {
|
|
467
|
+
initialViewMode?: ViewMode;
|
|
468
|
+
}
|
|
469
|
+
export interface ViewportProps {
|
|
470
|
+
mobileWidth?: number;
|
|
471
|
+
}
|
|
472
|
+
export declare enum ScrollMode {
|
|
473
|
+
PAGE_SCROLLING = "PAGE",
|
|
474
|
+
VERTICAL_SCROLLING = "VERTICAL",
|
|
475
|
+
HORIZONTAL_SCROLLING = "HORIZONTAL"
|
|
476
|
+
}
|
|
477
|
+
export interface ScrollModeContextType {
|
|
478
|
+
scrollMode: ScrollMode;
|
|
479
|
+
setScrollMode: (mode: ScrollMode) => void;
|
|
480
|
+
}
|
|
481
|
+
export interface ScrollModeProps {
|
|
482
|
+
initialScrollMode?: ScrollMode;
|
|
483
|
+
}
|
|
484
|
+
export interface Match {
|
|
485
|
+
start: {
|
|
486
|
+
idx: number;
|
|
487
|
+
offset: number;
|
|
488
|
+
};
|
|
489
|
+
end: {
|
|
490
|
+
idx: number;
|
|
491
|
+
offset: number;
|
|
492
|
+
};
|
|
493
|
+
str: string;
|
|
494
|
+
oIndex: number;
|
|
495
|
+
pageIndex: number;
|
|
496
|
+
}
|
|
497
|
+
export interface MatchValue extends Match {
|
|
498
|
+
page: number;
|
|
499
|
+
pageMatchIdx: number;
|
|
500
|
+
}
|
|
501
|
+
export interface SearchOptions {
|
|
502
|
+
matchCase?: boolean;
|
|
503
|
+
wholeWords?: boolean;
|
|
504
|
+
}
|
|
505
|
+
export type TextItem = {
|
|
506
|
+
/**
|
|
507
|
+
* - Text content.
|
|
508
|
+
*/
|
|
509
|
+
str: string;
|
|
510
|
+
/**
|
|
511
|
+
* - Text direction: 'ttb', 'ltr' or 'rtl'.
|
|
512
|
+
*/
|
|
513
|
+
dir: string;
|
|
514
|
+
/**
|
|
515
|
+
* - Transformation matrix.
|
|
516
|
+
*/
|
|
517
|
+
transform: Array<any>;
|
|
518
|
+
/**
|
|
519
|
+
* - Width in device space.
|
|
520
|
+
*/
|
|
521
|
+
width: number;
|
|
522
|
+
/**
|
|
523
|
+
* - Height in device space.
|
|
524
|
+
*/
|
|
525
|
+
height: number;
|
|
526
|
+
/**
|
|
527
|
+
* - Font name used by PDF.js for converted font.
|
|
528
|
+
*/
|
|
529
|
+
fontName: string;
|
|
530
|
+
/**
|
|
531
|
+
* - Indicating if the text content is followed by a
|
|
532
|
+
* line-break.
|
|
533
|
+
*/
|
|
534
|
+
hasEOL: boolean;
|
|
535
|
+
};
|
|
536
|
+
export interface SearchContextType {
|
|
537
|
+
search: string;
|
|
538
|
+
setSearch: Dispatch<SetStateAction<string>>;
|
|
539
|
+
loading: boolean;
|
|
540
|
+
matches: MatchValue[];
|
|
541
|
+
totalMatches: number;
|
|
542
|
+
currentMatchPosition: number;
|
|
543
|
+
currentMatch: MatchValue | null;
|
|
544
|
+
nextMatch: () => void;
|
|
545
|
+
prevMatch: () => void;
|
|
546
|
+
searchOptions: SearchOptions;
|
|
547
|
+
setSearchOptions: Dispatch<SetStateAction<SearchOptions>>;
|
|
548
|
+
currentMatchElement: HTMLElement | null;
|
|
549
|
+
setCurrentMatchElement: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
550
|
+
}
|
|
551
|
+
export declare enum SelectionMode {
|
|
552
|
+
TEXT = "TEXT",
|
|
553
|
+
HAND = "HAND"
|
|
554
|
+
}
|
|
555
|
+
export interface SelectionModeContextType {
|
|
556
|
+
selectionMode: SelectionMode;
|
|
557
|
+
setSelectionMode: (mode: SelectionMode) => void;
|
|
558
|
+
}
|
|
559
|
+
export interface SelectionModeProps {
|
|
560
|
+
initialSelectionMode?: SelectionMode;
|
|
561
|
+
}
|
|
562
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var i = (e, n, c) => n in e ? s(e, n, { enumerable: !0, configurable: !0, writable: !0, value: c }) : e[n] = c;
|
|
3
|
+
var o = (e, n, c) => (i(e, typeof n != "symbol" ? n + "" : n, c), c);
|
|
4
|
+
const t = class t {
|
|
5
|
+
constructor() {
|
|
6
|
+
o(this, "isProduction");
|
|
7
|
+
this.isProduction = !0;
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
return t.instance || (t.instance = new t()), t.instance;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Debug level logging - stripped in production
|
|
14
|
+
*/
|
|
15
|
+
debug(...n) {
|
|
16
|
+
this.isProduction || console.debug("[React PDF Debug]:", ...n);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Info level logging - kept in production
|
|
20
|
+
*/
|
|
21
|
+
info(...n) {
|
|
22
|
+
console.info("[React PDF Info]:", ...n);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Warning level logging - kept in production
|
|
26
|
+
*/
|
|
27
|
+
warn(...n) {
|
|
28
|
+
console.warn("[React PDF Warning]:", ...n);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Error level logging - kept in production
|
|
32
|
+
*/
|
|
33
|
+
error(...n) {
|
|
34
|
+
console.error("[React PDF Error]:", ...n);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
o(t, "instance");
|
|
38
|
+
let r = t;
|
|
39
|
+
const u = r.getInstance();
|
|
40
|
+
export {
|
|
41
|
+
u as appConsole
|
|
42
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function i(n) {
|
|
2
|
+
return n < 11904;
|
|
3
|
+
}
|
|
4
|
+
function t(n) {
|
|
5
|
+
return (n & 65408) === 0;
|
|
6
|
+
}
|
|
7
|
+
function u(n) {
|
|
8
|
+
return n >= /* a = */
|
|
9
|
+
97 && n <= /* z = */
|
|
10
|
+
122 || n >= /* A = */
|
|
11
|
+
65 && n <= /* Z = */
|
|
12
|
+
90;
|
|
13
|
+
}
|
|
14
|
+
function r(n) {
|
|
15
|
+
return n >= /* 0 = */
|
|
16
|
+
48 && n <= /* 9 = */
|
|
17
|
+
57;
|
|
18
|
+
}
|
|
19
|
+
function f(n) {
|
|
20
|
+
return n === /* SPACE = */
|
|
21
|
+
32 || n === /* TAB = */
|
|
22
|
+
9 || n === /* CR = */
|
|
23
|
+
13 || n === /* LF = */
|
|
24
|
+
10;
|
|
25
|
+
}
|
|
26
|
+
function s(n) {
|
|
27
|
+
return n >= 13312 && n <= 40959 || n >= 63744 && n <= 64255;
|
|
28
|
+
}
|
|
29
|
+
function e(n) {
|
|
30
|
+
return n >= 12448 && n <= 12543;
|
|
31
|
+
}
|
|
32
|
+
function l(n) {
|
|
33
|
+
return n >= 12352 && n <= 12447;
|
|
34
|
+
}
|
|
35
|
+
function p(n) {
|
|
36
|
+
return n >= 65376 && n <= 65439;
|
|
37
|
+
}
|
|
38
|
+
function A(n) {
|
|
39
|
+
return (n & 65408) === 3584;
|
|
40
|
+
}
|
|
41
|
+
function g(n) {
|
|
42
|
+
return i(n) ? t(n) ? f(n) ? 0 : u(n) || r(n) || n === /* UNDERSCORE = */
|
|
43
|
+
95 ? 1 : 2 : A(n) ? 7 : n === /* NBSP = */
|
|
44
|
+
160 ? 0 : 1 : s(n) ? 3 : e(n) ? 4 : l(n) ? 5 : p(n) ? 6 : 1;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
g as getCharacterType
|
|
48
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const p = new RegExp(
|
|
2
|
+
"^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"
|
|
3
|
+
), t = (s, e, o, c) => {
|
|
4
|
+
const n = parseInt(s, 10);
|
|
5
|
+
return n >= e && n <= o ? n : c;
|
|
6
|
+
}, f = (s) => {
|
|
7
|
+
const e = p.exec(s);
|
|
8
|
+
if (!e)
|
|
9
|
+
return null;
|
|
10
|
+
const o = parseInt(e[1], 10), c = t(e[2], 1, 12, 1) - 1, n = t(e[3], 1, 31, 1);
|
|
11
|
+
let r = t(e[4], 0, 23, 0), a = t(e[5], 0, 59, 0);
|
|
12
|
+
const i = t(e[6], 0, 59, 0), l = e[7] || "Z", d = t(e[8], 0, 23, 0), u = t(e[9], 0, 59, 0);
|
|
13
|
+
switch (l) {
|
|
14
|
+
case "-":
|
|
15
|
+
r += d, a += u;
|
|
16
|
+
break;
|
|
17
|
+
case "+":
|
|
18
|
+
r -= d, a -= u;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return new Date(Date.UTC(o, c, n, r, a, i));
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
f as convertPDFDate
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function i(t, e) {
|
|
2
|
+
if (t == 0)
|
|
3
|
+
return "0 Bytes";
|
|
4
|
+
var o = 1e3, r = e || 2, a = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], B = Math.floor(Math.log(t) / Math.log(o));
|
|
5
|
+
return parseFloat((t / Math.pow(o, B)).toFixed(r)) + " " + a[B];
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as formatFileSize
|
|
9
|
+
};
|