@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,8 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
interface Props extends PropsWithChildren {
|
|
3
|
+
container: HTMLDivElement | null;
|
|
4
|
+
contentRef: HTMLDivElement | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const useLayoutContainer: () => Omit<Props, "children">;
|
|
7
|
+
export declare const LayoutContainerProvider: FC<Props>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { License } from '../utils/types';
|
|
3
|
+
export declare const LicenseContext: import('react').Context<License>;
|
|
4
|
+
export declare const useLicenseContext: () => License;
|
|
5
|
+
export declare const LicenseProvider: FC<PropsWithChildren<{
|
|
6
|
+
licenseKey?: string;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
interface OtherToolContextValue {
|
|
3
|
+
activeDocumentProperties: boolean;
|
|
4
|
+
setActiveDocumentProperties: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const OtherToolContext: import('react').Context<OtherToolContextValue>;
|
|
7
|
+
export declare const useOtherToolContext: () => OtherToolContextValue;
|
|
8
|
+
export declare const OtherToolProvider: FC<PropsWithChildren>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { PageControlContextType } from '../utils/types';
|
|
3
|
+
export declare const PaginateContext: React.Context<PageControlContextType>;
|
|
4
|
+
export declare const usePaginateContext: () => PageControlContextType;
|
|
5
|
+
export declare const PaginateProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { PrintToolProps } from '../utils/types';
|
|
3
|
+
export declare const PrintContext: React.Context<PrintToolProps>;
|
|
4
|
+
export declare const PrintProvider: FC<{
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const usePrintContext: () => PrintToolProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { DocumentContextType, RPSrc, CharacterMapConfig } from '../utils/types';
|
|
3
|
+
declare const DocumentContext: React.Context<DocumentContextType>;
|
|
4
|
+
interface Props extends PropsWithChildren {
|
|
5
|
+
src?: RPSrc;
|
|
6
|
+
characterMap?: CharacterMapConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare const DocumentProvider: FC<Props>;
|
|
9
|
+
export declare const useDocumentContext: () => DocumentContextType;
|
|
10
|
+
export default DocumentContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PageViewport } from 'pdfjs-dist';
|
|
2
|
+
import { FC, PropsWithChildren } from 'react';
|
|
3
|
+
interface CacheContext {
|
|
4
|
+
viewports: Map<number, PageViewport>;
|
|
5
|
+
pages: Map<number, any>;
|
|
6
|
+
}
|
|
7
|
+
export declare const RenderedPagesCacheContext: import('react').Context<CacheContext>;
|
|
8
|
+
export declare const useRenderedPagesCache: () => CacheContext;
|
|
9
|
+
export declare const RenderedPagesCacheProvider: FC<PropsWithChildren>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { RotateContextType } from '../utils/types';
|
|
3
|
+
export declare const RotateContext: import('react').Context<RotateContextType>;
|
|
4
|
+
export declare const useRotateContext: () => RotateContextType;
|
|
5
|
+
export declare const RotateProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ScrollModeContextType } from '../utils/types';
|
|
3
|
+
export declare const ScrollModeContext: import('react').Context<ScrollModeContextType>;
|
|
4
|
+
export declare const useScrollModeContext: () => ScrollModeContextType;
|
|
5
|
+
export declare const ScrollModeProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, MutableRefObject, PropsWithChildren } from 'react';
|
|
2
|
+
interface ContextType {
|
|
3
|
+
isScrolling: MutableRefObject<boolean>;
|
|
4
|
+
}
|
|
5
|
+
export declare const ScrollStateContext: import('react').Context<ContextType>;
|
|
6
|
+
export declare const useScrollStateContext: () => ContextType;
|
|
7
|
+
export declare const ScrollStateProvider: FC<PropsWithChildren>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SearchContextType } from '../utils/types';
|
|
2
|
+
export declare const SearchContext: import('react').Context<SearchContextType>;
|
|
3
|
+
export declare const SearchProvider: ({ children, initialSearch }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
initialSearch?: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const useSearchContext: () => SearchContextType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { SelectionModeContextType, SelectionModeProps } from '../utils/types';
|
|
3
|
+
export declare const SelectionModeContext: import('react').Context<SelectionModeContextType>;
|
|
4
|
+
export declare const useSelectionModeContext: () => SelectionModeContextType;
|
|
5
|
+
export declare const SelectionModeProvider: FC<PropsWithChildren<SelectionModeProps>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RPThemeContextType } from '../utils/types';
|
|
2
|
+
export declare const ThemeContext: import('react').Context<RPThemeContextType>;
|
|
3
|
+
export declare const useThemeContext: () => RPThemeContextType;
|
|
4
|
+
export declare const ThemeProvider: import('react').Provider<RPThemeContextType>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ThumbnailContextType } from '../utils/types';
|
|
3
|
+
export declare const ThumbnailContext: React.Context<ThumbnailContextType>;
|
|
4
|
+
export declare const useThumbnailContext: () => ThumbnailContextType;
|
|
5
|
+
export declare const ThumbnailProvider: FC<PropsWithChildren<{
|
|
6
|
+
initialThumbnailsVisible: boolean;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { RPSlots } from '../utils/types';
|
|
3
|
+
export declare const ToolbarComponentContext: import('react').Context<RPSlots>;
|
|
4
|
+
export declare const useToolbarComponentContext: () => RPSlots;
|
|
5
|
+
interface Props extends PropsWithChildren {
|
|
6
|
+
slots?: RPSlots;
|
|
7
|
+
}
|
|
8
|
+
export declare const ToolbarComponentProvider: FC<Props>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ViewModeContextType } from '../utils/types';
|
|
3
|
+
export declare const ViewModeContext: import('react').Context<ViewModeContextType>;
|
|
4
|
+
export declare const useViewModeContext: () => ViewModeContextType;
|
|
5
|
+
export declare const ViewModeProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
type Orientation = 'portrait' | 'landscape';
|
|
4
|
+
interface Breakpoints {
|
|
5
|
+
[key: string]: number;
|
|
6
|
+
}
|
|
7
|
+
interface ViewportState {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
isMobile: boolean;
|
|
11
|
+
currentBreakpoint: Breakpoint;
|
|
12
|
+
orientation: Orientation;
|
|
13
|
+
}
|
|
14
|
+
interface ViewportContextType extends ViewportState {
|
|
15
|
+
breakpoints: Breakpoints;
|
|
16
|
+
isBreakpoint: (breakpoint: Breakpoint) => boolean;
|
|
17
|
+
isMobileDevice: boolean;
|
|
18
|
+
isPortrait: boolean;
|
|
19
|
+
isLandscape: boolean;
|
|
20
|
+
isSmallScreen: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface ViewportProviderProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
mobileWidth?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const ViewportProvider: React.FC<ViewportProviderProps>;
|
|
27
|
+
export declare const useViewportContext: () => ViewportContextType;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dispatch, FC, PropsWithChildren } from 'react';
|
|
2
|
+
interface VirtualGridContextType {
|
|
3
|
+
columnCount: number;
|
|
4
|
+
setColumnCount: Dispatch<React.SetStateAction<number>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const VirtualGridContext: import('react').Context<VirtualGridContextType>;
|
|
7
|
+
export declare const useVirtualGridContext: () => VirtualGridContextType;
|
|
8
|
+
export declare const VirtualGridProvider: FC<PropsWithChildren>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { VariableSizeGrid } from 'react-window';
|
|
3
|
+
interface ContextType {
|
|
4
|
+
virtualScrollRef?: VariableSizeGrid;
|
|
5
|
+
getVirtualScrollRef: (element: VariableSizeGrid) => void;
|
|
6
|
+
pageScrollElementRef?: HTMLDivElement;
|
|
7
|
+
getPageScrollElementRef: (element: HTMLDivElement) => void;
|
|
8
|
+
virtualScrollableElementRef?: HTMLDivElement;
|
|
9
|
+
getVirtualScrollableElementRef: (element: HTMLDivElement) => void;
|
|
10
|
+
scrollPosition: {
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
scrollLeft: number;
|
|
13
|
+
};
|
|
14
|
+
setScrollPosition: (position: {
|
|
15
|
+
scrollTop: number;
|
|
16
|
+
scrollLeft: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
totalInnerDimensions: {
|
|
19
|
+
height: number;
|
|
20
|
+
width: number;
|
|
21
|
+
};
|
|
22
|
+
setTotalInnerDimensions: (dimensions: {
|
|
23
|
+
height: number;
|
|
24
|
+
width: number;
|
|
25
|
+
}) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const VirtualScrollContext: import('react').Context<ContextType>;
|
|
28
|
+
export declare const useVirtualScrollContext: () => ContextType;
|
|
29
|
+
export declare const VirtualScrollProvider: FC<PropsWithChildren>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ZoomContextType } from '../utils/types';
|
|
3
|
+
export declare const ZoomContext: import('react').Context<ZoomContextType>;
|
|
4
|
+
export declare const useZoomContext: () => ZoomContextType;
|
|
5
|
+
export declare const ZoomProvider: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { RPDocument } from './components/RPDocument';
|
|
2
|
+
export { RPViewer } from './components/RPViewer';
|
|
3
|
+
export { RPConfig } from './components/RPConfig';
|
|
4
|
+
export { RPLayout } from './components/layout/RPLayout';
|
|
5
|
+
export { RPTheme } from './components/RPTheme';
|
|
6
|
+
export { RPDropFileZone } from './components/RPDropFileZone';
|
|
7
|
+
export { useDarkModeContext } from './contexts/DarkModeContext';
|
|
8
|
+
export { usePaginateContext } from './contexts/PaginateContext';
|
|
9
|
+
export { useDocumentContext } from './contexts/RPDocumentContext';
|
|
10
|
+
export { useRotateContext } from './contexts/RotateContext';
|
|
11
|
+
export { useDarkModeProps } from './utils/hooks/useDarkModeProps';
|
|
12
|
+
export { useViewModeContext } from './contexts/ViewModeContext';
|
|
13
|
+
export { useDropFileZoneContext } from './contexts/DropFileZoneContext';
|
|
14
|
+
export { useFileDownload } from './utils/hooks/useFileDownload';
|
|
15
|
+
export { useOpenFileContext } from './contexts/FileInputContext';
|
|
16
|
+
export { usePrintContext } from './contexts/PrintContext';
|
|
17
|
+
export { useZoomContext } from './contexts/ZoomContext';
|
|
18
|
+
export { useSearchContext } from './contexts/SearchContext';
|
|
19
|
+
export type { RPConfigProps, RPThemeProps, RPDocumentProps, RPLayoutProps, RPIcons, RPSlots, DarkModeProps, ZoomProps, ViewModeProps, DownloadToolProps, OpenFileToolProps, ScrollModeProps, PageNavigationToolProps, PrintToolProps, Localization, MatchValue } from './utils/types';
|
|
20
|
+
export { ViewMode, ScrollMode } from './utils/types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare class Console {
|
|
2
|
+
private static instance;
|
|
3
|
+
private isProduction;
|
|
4
|
+
private constructor();
|
|
5
|
+
static getInstance(): Console;
|
|
6
|
+
/**
|
|
7
|
+
* Debug level logging - stripped in production
|
|
8
|
+
*/
|
|
9
|
+
debug(...args: any[]): void;
|
|
10
|
+
/**
|
|
11
|
+
* Info level logging - kept in production
|
|
12
|
+
*/
|
|
13
|
+
info(...args: any[]): void;
|
|
14
|
+
/**
|
|
15
|
+
* Warning level logging - kept in production
|
|
16
|
+
*/
|
|
17
|
+
warn(...args: any[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* Error level logging - kept in production
|
|
20
|
+
*/
|
|
21
|
+
error(...args: any[]): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const appConsole: Console;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare enum CharacterType {
|
|
2
|
+
SPACE = 0,
|
|
3
|
+
ALPHA_LETTER = 1,
|
|
4
|
+
PUNCTUATION = 2,
|
|
5
|
+
HAN_LETTER = 3,
|
|
6
|
+
KATAKANA_LETTER = 4,
|
|
7
|
+
HIRAGANA_LETTER = 5,
|
|
8
|
+
HALF_WIDTH_KATAKANA_LETTER = 6,
|
|
9
|
+
THAI_LETTER = 7
|
|
10
|
+
}
|
|
11
|
+
export declare function getCharacterType(charCode: number): CharacterType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertPDFDate: (input: string) => Date | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dateFormatter: (date: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatFileSize(bytes: number, decimalPoint?: number): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
|
|
2
|
+
import { SearchOptions, Match } from './types';
|
|
3
|
+
export declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: SearchOptions): Match[];
|
|
4
|
+
export declare function highlightMatches(matches: Match[], textContent: TextContent, textDivs: HTMLElement[]): {
|
|
5
|
+
element: HTMLElement;
|
|
6
|
+
index: number;
|
|
7
|
+
}[];
|
|
8
|
+
export declare function resetDivs(textContent: TextContent, textDivs: HTMLElement[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDebounce<T = string>(value: T, delay: number): T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseGrabScrollProps {
|
|
2
|
+
isPressed: boolean;
|
|
3
|
+
scrollSpeed?: number;
|
|
4
|
+
}
|
|
5
|
+
interface UseGrabScrollReturn {
|
|
6
|
+
initializeGrabScroll: (element: HTMLElement | null) => void;
|
|
7
|
+
scrollBehavior: 'smooth' | 'unset';
|
|
8
|
+
}
|
|
9
|
+
export declare const useGrabScroll: ({ isPressed, scrollSpeed }: UseGrabScrollProps) => UseGrabScrollReturn;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api.js';
|
|
2
|
+
import { PdfPage, RPSrc, CharacterMapConfig } from '../types';
|
|
3
|
+
export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMapConfig) => {
|
|
4
|
+
pdf: PDFDocumentProxy | undefined;
|
|
5
|
+
pages: Map<number, PdfPage>;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
|
|
2
|
+
import { PdfProperties, PDFSrc } from '../types';
|
|
3
|
+
type CMapSource = {
|
|
4
|
+
url: string;
|
|
5
|
+
cMapPacked: boolean;
|
|
6
|
+
cMapUrl: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const usePdfProperties: (source: PDFSrc | CMapSource, pdf?: PDFDocumentProxy, filename?: string) => PdfProperties | undefined;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PreparePrintProgress } from '../types';
|
|
2
|
+
interface PrintHookResult {
|
|
3
|
+
print: () => Promise<void>;
|
|
4
|
+
cancel: () => void;
|
|
5
|
+
progress: PreparePrintProgress;
|
|
6
|
+
isComplete: boolean;
|
|
7
|
+
isError: boolean;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const usePrint: () => PrintHookResult;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ResizeObserverCallback = (entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver) => void;
|
|
2
|
+
declare const useResizeObserver: (element: HTMLElement | null, callback: ResizeObserverCallback) => {
|
|
3
|
+
isSupported: boolean;
|
|
4
|
+
stop: () => void;
|
|
5
|
+
};
|
|
6
|
+
export default useResizeObserver;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SearchOptions, MatchValue } from '../types';
|
|
2
|
+
export declare const useSearch: (options?: SearchOptions, initialSearch?: string) => {
|
|
3
|
+
search: string;
|
|
4
|
+
setSearch: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
matches: MatchValue[];
|
|
7
|
+
totalMatches: number;
|
|
8
|
+
currentMatchPosition: number;
|
|
9
|
+
currentMatch: MatchValue | null;
|
|
10
|
+
nextMatch: () => void;
|
|
11
|
+
prevMatch: () => void;
|
|
12
|
+
currentMatchElement: HTMLElement | null;
|
|
13
|
+
setCurrentMatchElement: import('react').Dispatch<import('react').SetStateAction<HTMLElement | null>>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useVirtualReactWindow: () => {
|
|
2
|
+
rowCount: number;
|
|
3
|
+
rowHeight: (idx: number) => number;
|
|
4
|
+
columnCount: number;
|
|
5
|
+
columnWidth: (idx: number) => number;
|
|
6
|
+
pageDimension: {
|
|
7
|
+
widths: number[];
|
|
8
|
+
heights: number[];
|
|
9
|
+
};
|
|
10
|
+
estimatedRowHeight: number;
|
|
11
|
+
estimatedColumnWidth: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IPDFLinkService } from 'pdfjs-dist/types/web/interfaces';
|
|
2
|
+
declare class SimpleLinkService implements IPDFLinkService {
|
|
3
|
+
externalLinkEnabled: boolean;
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
* @type {number}
|
|
7
|
+
*/
|
|
8
|
+
get pagesCount(): number;
|
|
9
|
+
/**
|
|
10
|
+
* @type {number}
|
|
11
|
+
*/
|
|
12
|
+
get page(): number;
|
|
13
|
+
/**
|
|
14
|
+
* @param {number} _value
|
|
15
|
+
*/
|
|
16
|
+
set page(_value: number);
|
|
17
|
+
/**
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
get rotation(): number;
|
|
21
|
+
/**
|
|
22
|
+
* @param {number} _value
|
|
23
|
+
*/
|
|
24
|
+
set rotation(_value: number);
|
|
25
|
+
/**
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
get isInPresentationMode(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @param {string|Array} _dest - The named, or explicit, PDF destination.
|
|
31
|
+
*/
|
|
32
|
+
goToDestination(_dest: string | Array<any>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* @param {number|string} _val - The page number, or page label.
|
|
35
|
+
*/
|
|
36
|
+
goToPage(_val: number | string): void;
|
|
37
|
+
/**
|
|
38
|
+
* @param {HTMLAnchorElement} link
|
|
39
|
+
* @param {string} url
|
|
40
|
+
* @param {boolean} [_newWindow]
|
|
41
|
+
*/
|
|
42
|
+
addLinkAttributes(_link: HTMLAnchorElement, _url: string, _newWindow?: boolean): void;
|
|
43
|
+
/**
|
|
44
|
+
* @param _dest - The PDF destination object.
|
|
45
|
+
* @returns {string} The hyperlink to the PDF object.
|
|
46
|
+
*/
|
|
47
|
+
getDestinationHash(_dest: any): string;
|
|
48
|
+
/**
|
|
49
|
+
* @param _hash - The PDF parameters/hash.
|
|
50
|
+
* @returns {string} The hyperlink to the PDF object.
|
|
51
|
+
*/
|
|
52
|
+
getAnchorUrl(_hash: any): string;
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} _hash
|
|
55
|
+
*/
|
|
56
|
+
setHash(_hash: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} _action
|
|
59
|
+
*/
|
|
60
|
+
executeNamedAction(_action: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* @param {Object} _action
|
|
63
|
+
*/
|
|
64
|
+
executeSetOCGState(_action: object): void;
|
|
65
|
+
/**
|
|
66
|
+
* @param {number} _pageNum - page number.
|
|
67
|
+
* @param {Object} _pageRef - reference to the page.
|
|
68
|
+
*/
|
|
69
|
+
cachePageRef(_pageNum: number, _pageRef: object): void;
|
|
70
|
+
}
|
|
71
|
+
export { SimpleLinkService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sanitizeExternalUrl: (url: string, defaultUrl?: string) => string;
|