@react-pdf-kit/viewer 0.0.0-experimental.0
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 +204 -0
- package/dist/Combination-54a77a7a.js +701 -0
- package/dist/MostPageTool.module-13578ad6.js +6 -0
- package/dist/OtherTool.module-a4be5f1f.js +6 -0
- package/dist/Paginate.module-4eef00aa.js +8 -0
- package/dist/PaginationContext-9217cab4.js +201 -0
- package/dist/RPLayout.module-b4b23e29.js +14 -0
- package/dist/RPSplitter-f6acf13b.js +71 -0
- package/dist/RPToolbar.module-27d7fe77.js +10 -0
- package/dist/RotateTool.module-67946714.js +6 -0
- package/dist/SearchTool.module-99f60dc7.js +16 -0
- package/dist/ToolbarLayout.module-6e339802.js +12 -0
- package/dist/ZoomTool.module-7082af8c.js +12 -0
- package/dist/assets/style.css +1 -0
- package/dist/assets/style.js +77 -0
- package/dist/clsx-0c6e471a.js +22 -0
- package/dist/components/RPConfig.js +17 -0
- package/dist/components/RPController.js +136 -0
- package/dist/components/RPDropFileZone.js +53 -0
- package/dist/components/RPPages.js +1049 -0
- package/dist/components/RPProvider.js +126 -0
- package/dist/components/RPTheme.js +22 -0
- package/dist/components/icons/CheckIcon.js +22 -0
- package/dist/components/icons/ChevronDownIcon.js +23 -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/DualPageWithCoverIcon.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 +21 -0
- package/dist/components/layout/LayoutContainer.js +35 -0
- package/dist/components/layout/LayoutWrapper.js +11 -0
- package/dist/components/layout/RPDefaultLayout.js +238 -0
- package/dist/components/layout/RPLayout.js +213 -0
- package/dist/components/layout/SkipLink.js +29 -0
- package/dist/components/layout/WrapperLayout.js +26 -0
- package/dist/components/layout/sidebar/RPSidebar.js +107 -0
- package/dist/components/layout/sidebar/RPSplitter.js +8 -0
- package/dist/components/layout/sidebar/Thumbnail.js +145 -0
- package/dist/components/layout/sidebar/Thumbnails.js +77 -0
- package/dist/components/layout/toolbar/DarkModeTool.js +38 -0
- package/dist/components/layout/toolbar/DocumentDialog.js +314 -0
- package/dist/components/layout/toolbar/DocumentProperties.js +40 -0
- package/dist/components/layout/toolbar/FileDownloadTool.js +50 -0
- package/dist/components/layout/toolbar/FileUploadTool.js +49 -0
- package/dist/components/layout/toolbar/FullScreenTool.js +74 -0
- package/dist/components/layout/toolbar/MenuItem.js +19 -0
- package/dist/components/layout/toolbar/MenuSeparator.js +15 -0
- package/dist/components/layout/toolbar/MostPageTool.js +81 -0
- package/dist/components/layout/toolbar/OtherTool.js +199 -0
- package/dist/components/layout/toolbar/Paginate.js +145 -0
- package/dist/components/layout/toolbar/PrintTool.js +72 -0
- package/dist/components/layout/toolbar/PropertyItem.js +12 -0
- package/dist/components/layout/toolbar/RPMenuItem.js +33 -0
- package/dist/components/layout/toolbar/RPMoreOptions.js +220 -0
- package/dist/components/layout/toolbar/RPToolbar.js +151 -0
- package/dist/components/layout/toolbar/RPToolbarEnd.js +121 -0
- package/dist/components/layout/toolbar/RotateTool.js +60 -0
- package/dist/components/layout/toolbar/ScrollModeTool.js +68 -0
- package/dist/components/layout/toolbar/SearchCloseButton.js +32 -0
- package/dist/components/layout/toolbar/SearchResultNavigator.js +109 -0
- package/dist/components/layout/toolbar/SearchTool.js +264 -0
- package/dist/components/layout/toolbar/SelectionModeTool.js +52 -0
- package/dist/components/layout/toolbar/ThumbnailTool.js +39 -0
- package/dist/components/layout/toolbar/ToolbarCustom.js +108 -0
- package/dist/components/layout/toolbar/ToolbarDefault.js +192 -0
- package/dist/components/layout/toolbar/ToolbarLayout.js +154 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +63 -0
- package/dist/components/layout/toolbar/ZoomTool.js +150 -0
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +54 -0
- package/dist/components/layout/toolbar/tools/DualPageTool.js +26 -0
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +204 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +35 -0
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +34 -0
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +199 -0
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +34 -0
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/InputPageTool.js +92 -0
- package/dist/components/layout/toolbar/tools/LastPageTool.js +199 -0
- package/dist/components/layout/toolbar/tools/NextPageTool.js +62 -0
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +62 -0
- package/dist/components/layout/toolbar/tools/PrintTool.js +35 -0
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +47 -0
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +48 -0
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +39 -0
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +26 -0
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +36 -0
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +46 -0
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +58 -0
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +27 -0
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +133 -0
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +58 -0
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +148 -0
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +42 -0
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +29 -0
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +52 -0
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +51 -0
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +43 -0
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +87 -0
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +52 -0
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +64 -0
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +73 -0
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +58 -0
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +67 -0
- package/dist/components/page/AnnotationLayer.js +145 -0
- package/dist/components/page/CanvasLayer.js +88 -0
- package/dist/components/page/CustomElement.js +53 -0
- package/dist/components/page/DualPage.js +100 -0
- package/dist/components/page/DualPageWithCover.js +132 -0
- package/dist/components/page/RPPage.js +144 -0
- package/dist/components/page/SinglePage.js +90 -0
- package/dist/components/page/TextHighlightLayer.js +198 -0
- package/dist/components/page/TextLayer.js +203 -0
- package/dist/components/page/searchHighlight.js +37 -0
- package/dist/components/ui/Button.js +25 -0
- package/dist/components/ui/Checkbox.js +273 -0
- package/dist/components/ui/DropDown.js +36 -0
- package/dist/components/ui/Input.js +28 -0
- package/dist/components/ui/LoadingIndicator.js +47 -0
- package/dist/components/ui/PasswordModal.js +75 -0
- package/dist/components/ui/RPTooltip.js +571 -0
- package/dist/contexts/ConfigContext.js +13 -0
- package/dist/contexts/DarkModeContext.js +28 -0
- package/dist/contexts/DimensionPagesContext.js +89 -0
- package/dist/contexts/DocumentPasswordContext.js +40 -0
- package/dist/contexts/DownloadContext.js +21 -0
- package/dist/contexts/DropFileZoneContext.js +62 -0
- package/dist/contexts/ElementPageContext.js +139 -0
- package/dist/contexts/EventCallbackContext.js +34 -0
- package/dist/contexts/FileInputContext.js +49 -0
- package/dist/contexts/FullScreenContext.js +25 -0
- package/dist/contexts/GlobalCurrentPage.js +19 -0
- package/dist/contexts/HighlightContext.js +31 -0
- package/dist/contexts/IconContext.js +11 -0
- package/dist/contexts/IconToolContext.js +13 -0
- package/dist/contexts/InitialStateContext.js +13 -0
- package/dist/contexts/LayerContext.js +8 -0
- package/dist/contexts/LayoutContainerContext.js +16 -0
- package/dist/contexts/LicenseContext.js +16 -0
- package/dist/contexts/LoaderContext.js +27 -0
- package/dist/contexts/LocalizationContext.js +34 -0
- package/dist/contexts/OtherToolContext.js +18 -0
- package/dist/contexts/PageViewportContext.js +8 -0
- package/dist/contexts/PagesRotateContext.js +43 -0
- package/dist/contexts/PaginationContext.js +39 -0
- package/dist/contexts/PrintContext.js +78 -0
- package/dist/contexts/RPDocumentContext.js +69 -0
- package/dist/contexts/RenderQueueProvider.js +72 -0
- package/dist/contexts/RenderedPagesCache.js +14 -0
- package/dist/contexts/RotationContext.js +38 -0
- package/dist/contexts/ScrollModeContext.js +22 -0
- package/dist/contexts/SearchContext.js +96 -0
- package/dist/contexts/SelectionModeContext.js +24 -0
- package/dist/contexts/SmoothScaleContext.js +67 -0
- package/dist/contexts/SmoothScrollContext.js +12 -0
- package/dist/contexts/ThemeContext.js +7 -0
- package/dist/contexts/ThumbnailsContext.js +43 -0
- package/dist/contexts/ToolComponentContext.js +52 -0
- package/dist/contexts/ToolbarComponentContext.js +48 -0
- package/dist/contexts/ViewModeContext.js +33 -0
- package/dist/contexts/ViewportContext.js +85 -0
- package/dist/contexts/VirtualGridContext.js +15 -0
- package/dist/contexts/VirtualScrollContext.js +53 -0
- package/dist/contexts/ZoomContext.js +107 -0
- package/dist/de_DE-a553b162.js +489 -0
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-4baea9b5.js +1198 -0
- package/dist/index-655864a7.js +27 -0
- package/dist/index-c0faa594.js +309 -0
- package/dist/index-e3ee9457.js +150 -0
- package/dist/libInjectCss.js +9 -0
- package/dist/main.js +289 -0
- package/dist/types/assets/style.d.ts +1 -0
- package/dist/types/components/RPConfig.d.ts +3 -0
- package/dist/types/components/RPController.d.ts +3 -0
- package/dist/types/components/RPDropFileZone.d.ts +2 -0
- package/dist/types/components/RPPages.d.ts +2 -0
- package/dist/types/components/RPProvider.d.ts +3 -0
- package/dist/types/components/RPTheme.d.ts +3 -0
- package/dist/types/components/icons/CheckIcon.d.ts +2 -0
- package/dist/types/components/icons/ChevronDownIcon.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/DualPageWithCoverIcon.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 +8 -0
- package/dist/types/components/layout/LayoutContainer.d.ts +10 -0
- package/dist/types/components/layout/LayoutWrapper.d.ts +8 -0
- package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -0
- package/dist/types/components/layout/RPLayout.d.ts +3 -0
- package/dist/types/components/layout/SkipLink.d.ts +7 -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 +9 -0
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +6 -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/RPMenuItem.d.ts +11 -0
- package/dist/types/components/layout/toolbar/RPMoreOptions.d.ts +3 -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/SearchCloseButton.d.ts +7 -0
- package/dist/types/components/layout/toolbar/SearchResultNavigator.d.ts +1 -0
- package/dist/types/components/layout/toolbar/SearchTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
- package/dist/types/components/layout/toolbar/ThumbnailTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +3 -0
- package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
- package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -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/layout/toolbar/tools/DocumentPropertiesTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/DualPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/DualPageWithCoverTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FileDownloadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FileUploadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FirstPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FullScreenTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/HorizontalScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/InputPageTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/tools/LastPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/NextPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/PageScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/PreviousPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/PrintTool.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/SelectionModeSwitcherTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/SinglePageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ThemeSwitcherTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ThumbnailTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/VerticalScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ZoomInTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ZoomLevelDisplay.d.ts +7 -0
- package/dist/types/components/layout/toolbar/tools/ZoomLevelTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ZoomOutTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.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/components/page/AnnotationLayer.d.ts +6 -0
- package/dist/types/components/page/CanvasLayer.d.ts +8 -0
- package/dist/types/components/page/CustomElement.d.ts +6 -0
- package/dist/types/components/page/DualPage.d.ts +5 -0
- package/dist/types/components/page/DualPageWithCover.d.ts +5 -0
- package/dist/types/components/page/RPPage.d.ts +5 -0
- package/dist/types/components/page/SinglePage.d.ts +5 -0
- package/dist/types/components/page/TextHighlightLayer.d.ts +10 -0
- package/dist/types/components/page/TextLayer.d.ts +6 -0
- package/dist/types/components/page/searchHighlight.d.ts +5 -0
- package/dist/types/components/ui/Button.d.ts +6 -0
- package/dist/types/components/ui/Checkbox.d.ts +10 -0
- package/dist/types/components/ui/DropDown.d.ts +10 -0
- package/dist/types/components/ui/Input.d.ts +6 -0
- package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
- package/dist/types/components/ui/PasswordModal.d.ts +3 -0
- package/dist/types/components/ui/RPTooltip.d.ts +9 -0
- package/dist/types/contexts/ConfigContext.d.ts +5 -0
- package/dist/types/contexts/DarkModeContext.d.ts +5 -0
- package/dist/types/contexts/DimensionPagesContext.d.ts +4 -0
- package/dist/types/contexts/DocumentPasswordContext.d.ts +14 -0
- package/dist/types/contexts/DownloadContext.d.ts +11 -0
- package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
- package/dist/types/contexts/ElementPageContext.d.ts +6 -0
- package/dist/types/contexts/EventCallbackContext.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/GlobalCurrentPage.d.ts +11 -0
- package/dist/types/contexts/HighlightContext.d.ts +8 -0
- package/dist/types/contexts/IconContext.d.ts +7 -0
- package/dist/types/contexts/IconToolContext.d.ts +9 -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 +12 -0
- package/dist/types/contexts/LicenseContext.d.ts +7 -0
- package/dist/types/contexts/LoaderContext.d.ts +12 -0
- package/dist/types/contexts/LocalizationContext.d.ts +5 -0
- package/dist/types/contexts/OtherToolContext.d.ts +9 -0
- package/dist/types/contexts/PageViewportContext.d.ts +4 -0
- package/dist/types/contexts/PagesRotateContext.d.ts +15 -0
- package/dist/types/contexts/PaginationContext.d.ts +5 -0
- package/dist/types/contexts/PrintContext.d.ts +7 -0
- package/dist/types/contexts/RPDocumentContext.d.ts +12 -0
- package/dist/types/contexts/RenderQueueProvider.d.ts +17 -0
- package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
- package/dist/types/contexts/RotationContext.d.ts +5 -0
- package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
- package/dist/types/contexts/SearchContext.d.ts +7 -0
- package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
- package/dist/types/contexts/SmoothScaleContext.d.ts +16 -0
- package/dist/types/contexts/SmoothScrollContext.d.ts +8 -0
- package/dist/types/contexts/ThemeContext.d.ts +4 -0
- package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
- package/dist/types/contexts/ToolComponentContext.d.ts +12 -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/libInjectCss.d.ts +1 -0
- package/dist/types/locales/de_DE.json.d.ts +83 -0
- package/dist/types/locales/en_US.json.d.ts +83 -0
- package/dist/types/locales/it_IT.json.d.ts +83 -0
- package/dist/types/locales/pt_PT.json.d.ts +83 -0
- package/dist/types/locales/th_TH.json.d.ts +83 -0
- package/dist/types/locales/zh_CN.json.d.ts +83 -0
- package/dist/types/main.d.ts +51 -0
- package/dist/types/utils/Queue.d.ts +18 -0
- package/dist/types/utils/annotations.d.ts +18 -0
- package/dist/types/utils/appConsole.d.ts +24 -0
- package/dist/types/utils/approximateFragtion.d.ts +9 -0
- package/dist/types/utils/calculatePage.d.ts +12 -0
- package/dist/types/utils/charators.d.ts +12 -0
- package/dist/types/utils/const.d.ts +3 -0
- package/dist/types/utils/constants.d.ts +5 -0
- package/dist/types/utils/convertPdfDate.d.ts +1 -0
- package/dist/types/utils/dateFormatter.d.ts +1 -0
- package/dist/types/utils/elementPagePosition.d.ts +17 -0
- package/dist/types/utils/formatFileSize.d.ts +1 -0
- package/dist/types/utils/getElementPositionInPage.d.ts +5 -0
- package/dist/types/utils/getScrollDistance.d.ts +1 -0
- package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
- package/dist/types/utils/getWordPositionInPage.d.ts +8 -0
- package/dist/types/utils/getZoomLevel.d.ts +2 -0
- package/dist/types/utils/highlight.d.ts +14 -0
- package/dist/types/utils/hooks/useAccumulateFactor.d.ts +9 -0
- package/dist/types/utils/hooks/useCopyText.d.ts +1 -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/useFlickerSelectText.d.ts +1 -0
- package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
- package/dist/types/utils/hooks/useGrabScroll.d.ts +11 -0
- package/dist/types/utils/hooks/useHighlight.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 +11 -0
- package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
- package/dist/types/utils/hooks/useLocalization.d.ts +10 -0
- package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
- package/dist/types/utils/hooks/usePageRotateContext.d.ts +3 -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/usePinch.d.ts +1 -0
- package/dist/types/utils/hooks/usePresentPage.d.ts +2 -0
- package/dist/types/utils/hooks/usePrint.d.ts +12 -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 +3 -0
- package/dist/types/utils/hooks/useSearch.d.ts +13 -0
- package/dist/types/utils/hooks/useTextSelection.d.ts +7 -0
- package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +17 -0
- package/dist/types/utils/hooks/useWatermark.d.ts +1 -0
- package/dist/types/utils/injectPrintCSS.d.ts +1 -0
- package/dist/types/utils/link_service.d.ts +81 -0
- package/dist/types/utils/renderPage.d.ts +3 -0
- package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
- package/dist/types/utils/smoothScrollTo.d.ts +2 -0
- package/dist/types/utils/types.d.ts +920 -0
- package/dist/types/utils/withRef.d.ts +5 -0
- package/dist/types/utils/zoom.d.ts +2 -0
- package/dist/utils/Queue.js +47 -0
- package/dist/utils/annotations.js +277 -0
- package/dist/utils/appConsole.js +42 -0
- package/dist/utils/approximateFragtion.js +22 -0
- package/dist/utils/calculatePage.js +21 -0
- package/dist/utils/charators.js +48 -0
- package/dist/utils/const.js +9 -0
- package/dist/utils/constants.js +8 -0
- package/dist/utils/convertPdfDate.js +25 -0
- package/dist/utils/dateFormatter.js +7 -0
- package/dist/utils/elementPagePosition.js +11 -0
- package/dist/utils/formatFileSize.js +9 -0
- package/dist/utils/getElementPositionInPage.js +84 -0
- package/dist/utils/getScrollDistance.js +4 -0
- package/dist/utils/getThumbnailViewport.js +7 -0
- package/dist/utils/getWordPositionInPage.js +25 -0
- package/dist/utils/getZoomLevel.js +24 -0
- package/dist/utils/highlight.js +221 -0
- package/dist/utils/hooks/useAccumulateFactor.js +17 -0
- package/dist/utils/hooks/useCopyText.js +36 -0
- package/dist/utils/hooks/useDarkMode.js +11 -0
- package/dist/utils/hooks/useDarkModeProps.js +12 -0
- package/dist/utils/hooks/useDebounce.js +19 -0
- package/dist/utils/hooks/useElementSize.js +21 -0
- package/dist/utils/hooks/useFileDownload.js +33 -0
- package/dist/utils/hooks/useFlickerSelectText.js +25 -0
- package/dist/utils/hooks/useFullScreen.js +29 -0
- package/dist/utils/hooks/useGrabScroll.js +52 -0
- package/dist/utils/hooks/useHighlight.js +55 -0
- package/dist/utils/hooks/useInfiniteScroll.js +19 -0
- package/dist/utils/hooks/useLicense.js +110 -0
- package/dist/utils/hooks/useLoadPdf.js +85 -0
- package/dist/utils/hooks/useLoadWorker.js +16 -0
- package/dist/utils/hooks/useLocalization.js +26 -0
- package/dist/utils/hooks/useMousePressed.js +20 -0
- package/dist/utils/hooks/usePageRotateContext.js +42 -0
- package/dist/utils/hooks/usePaginate.js +37 -0
- package/dist/utils/hooks/usePdfProperties.js +37 -0
- package/dist/utils/hooks/usePinch.js +147 -0
- package/dist/utils/hooks/usePresentPage.js +90 -0
- package/dist/utils/hooks/usePrint.js +185 -0
- package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
- package/dist/utils/hooks/useResizeObserver.js +22 -0
- package/dist/utils/hooks/useRotate.js +27 -0
- package/dist/utils/hooks/useScrollToPage.js +37 -0
- package/dist/utils/hooks/useSearch.js +162 -0
- package/dist/utils/hooks/useTextSelection.js +76 -0
- package/dist/utils/hooks/useThumbnail.js +59 -0
- package/dist/utils/hooks/useVirtualReactWindow.js +96 -0
- package/dist/utils/hooks/useWatermark.js +94 -0
- package/dist/utils/injectPrintCSS.js +22 -0
- package/dist/utils/link_service.js +138 -0
- package/dist/utils/renderPage.js +20 -0
- package/dist/utils/sanitizeExternalUrl.js +16 -0
- package/dist/utils/smoothScrollTo.js +6 -0
- package/dist/utils/types.js +22 -0
- package/dist/utils/withRef.js +8 -0
- package/dist/utils/zoom.js +6 -0
- package/package.json +88 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useContext as n, useState as s } from "react";
|
|
3
|
+
const i = () => {
|
|
4
|
+
throw new Error("setSlots is not initialized yet");
|
|
5
|
+
}, o = u({
|
|
6
|
+
themeSwitcher: !0,
|
|
7
|
+
documentProperties: !0,
|
|
8
|
+
rotateTool: !0,
|
|
9
|
+
fullscreenTool: !0,
|
|
10
|
+
openFileTool: !0,
|
|
11
|
+
dropFileZone: !0,
|
|
12
|
+
downloadTool: !0,
|
|
13
|
+
viewModeTool: !0,
|
|
14
|
+
scrollModeTool: !0,
|
|
15
|
+
printTool: !0,
|
|
16
|
+
thumbnailTool: !0,
|
|
17
|
+
showPrintProgress: !0,
|
|
18
|
+
selectionModeTool: !0,
|
|
19
|
+
jumpNavigationTool: !0,
|
|
20
|
+
sidebarEnable: !0,
|
|
21
|
+
pageNavigationTool: !0,
|
|
22
|
+
searchTool: !0,
|
|
23
|
+
zoomTool: !0,
|
|
24
|
+
setSlots: i
|
|
25
|
+
}), c = () => n(o), T = {
|
|
26
|
+
themeSwitcher: !0,
|
|
27
|
+
documentProperties: !0,
|
|
28
|
+
rotateTool: !0,
|
|
29
|
+
fullscreenTool: !0,
|
|
30
|
+
openFileTool: !0,
|
|
31
|
+
dropFileZone: !0,
|
|
32
|
+
downloadTool: !0,
|
|
33
|
+
viewModeTool: !0,
|
|
34
|
+
scrollModeTool: !0,
|
|
35
|
+
printTool: !0,
|
|
36
|
+
thumbnailTool: !0,
|
|
37
|
+
showPrintProgress: !0,
|
|
38
|
+
selectionModeTool: !0,
|
|
39
|
+
jumpNavigationTool: !0,
|
|
40
|
+
sidebarEnable: !0,
|
|
41
|
+
pageNavigationTool: !0,
|
|
42
|
+
searchTool: !0,
|
|
43
|
+
zoomTool: !0
|
|
44
|
+
}, p = ({ children: e }) => {
|
|
45
|
+
const [t, r] = s(T);
|
|
46
|
+
return /* @__PURE__ */ l(o.Provider, { value: { ...t, setSlots: r }, children: e });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
o as ToolComponentContext,
|
|
50
|
+
p as ToolComponentProvider,
|
|
51
|
+
c as useToolComponentContext
|
|
52
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as l, useContext as n, useMemo as i } from "react";
|
|
3
|
+
const e = l({
|
|
4
|
+
themeSwitcher: !0,
|
|
5
|
+
documentProperties: !0,
|
|
6
|
+
rotateTool: !0,
|
|
7
|
+
fullscreenTool: !0,
|
|
8
|
+
openFileTool: !0,
|
|
9
|
+
dropFileZone: !0,
|
|
10
|
+
downloadTool: !0,
|
|
11
|
+
viewModeTool: !0,
|
|
12
|
+
scrollModeTool: !0,
|
|
13
|
+
printTool: !0,
|
|
14
|
+
showPrintProgress: !0,
|
|
15
|
+
selectionModeTool: !0,
|
|
16
|
+
jumpNavigationTool: !0,
|
|
17
|
+
sidebarEnable: !0
|
|
18
|
+
}), d = () => n(e), T = {
|
|
19
|
+
themeSwitcher: !0,
|
|
20
|
+
documentProperties: !0,
|
|
21
|
+
rotateTool: !0,
|
|
22
|
+
fullscreenTool: !0,
|
|
23
|
+
openFileTool: !0,
|
|
24
|
+
dropFileZone: !0,
|
|
25
|
+
downloadTool: !0,
|
|
26
|
+
viewModeTool: !0,
|
|
27
|
+
scrollModeTool: !0,
|
|
28
|
+
printTool: !0,
|
|
29
|
+
thumbnailTool: !0,
|
|
30
|
+
showPrintProgress: !0,
|
|
31
|
+
selectionModeTool: !0,
|
|
32
|
+
jumpNavigationTool: !0,
|
|
33
|
+
sidebarEnable: !0,
|
|
34
|
+
pageNavigationTool: !0,
|
|
35
|
+
searchTool: !0,
|
|
36
|
+
zoomTool: !0
|
|
37
|
+
}, c = ({ children: r, slots: o }) => {
|
|
38
|
+
const t = i(() => ({
|
|
39
|
+
...T,
|
|
40
|
+
...o
|
|
41
|
+
}), [o]);
|
|
42
|
+
return /* @__PURE__ */ u(e.Provider, { value: t, children: r });
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
e as ToolbarComponentContext,
|
|
46
|
+
c as ToolbarComponentProvider,
|
|
47
|
+
d as useToolbarComponentContext
|
|
48
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as P, useContext as d, useState as E, useCallback as i, useMemo as f } from "react";
|
|
3
|
+
import { appConsole as p } from "../utils/appConsole.js";
|
|
4
|
+
import { ViewMode as e } from "../utils/types.js";
|
|
5
|
+
import { useInitialStateContext as G } from "./InitialStateContext.js";
|
|
6
|
+
import "../de_DE-a553b162.js";
|
|
7
|
+
const s = P({
|
|
8
|
+
columnCount: 1,
|
|
9
|
+
setSinglePage: () => {
|
|
10
|
+
},
|
|
11
|
+
setDualPage: () => {
|
|
12
|
+
},
|
|
13
|
+
setDualPageWithCover: () => {
|
|
14
|
+
},
|
|
15
|
+
viewMode: e.SINGLE_PAGE
|
|
16
|
+
}), S = () => {
|
|
17
|
+
const o = d(s);
|
|
18
|
+
return typeof o.columnCount > "u" && p.error("Please use this hooks inside children component of RPProvider"), o;
|
|
19
|
+
}, w = ({ children: o }) => {
|
|
20
|
+
const { initialViewMode: r = e.SINGLE_PAGE } = G(), u = r === e.SINGLE_PAGE ? 1 : r === e.DUAL_PAGE_WITH_COVER ? -2 : 2, [t, n] = E(u), a = i(() => {
|
|
21
|
+
n(1);
|
|
22
|
+
}, []), l = i(() => {
|
|
23
|
+
n(2);
|
|
24
|
+
}, []), c = i(() => {
|
|
25
|
+
n(-2);
|
|
26
|
+
}, []), m = f(() => t === 1 ? e.SINGLE_PAGE : t === -2 ? e.DUAL_PAGE_WITH_COVER : e.DUAL_PAGE, [t]);
|
|
27
|
+
return /* @__PURE__ */ C(s.Provider, { value: { columnCount: Math.abs(t), setSinglePage: a, setDualPage: l, setDualPageWithCover: c, viewMode: m }, children: o });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
s as ViewModeContext,
|
|
31
|
+
w as ViewModeProvider,
|
|
32
|
+
S as useViewModeContext
|
|
33
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as S, useState as u, useMemo as g, useEffect as c, useContext as B } from "react";
|
|
3
|
+
import { useLayoutContainer as M } from "./LayoutContainerContext.js";
|
|
4
|
+
const w = {
|
|
5
|
+
xs: 320,
|
|
6
|
+
sm: 640,
|
|
7
|
+
md: 768,
|
|
8
|
+
lg: 1024,
|
|
9
|
+
xl: 1280,
|
|
10
|
+
"2xl": 1536
|
|
11
|
+
}, E = {
|
|
12
|
+
width: 0,
|
|
13
|
+
height: 0,
|
|
14
|
+
isMobile: !1,
|
|
15
|
+
currentBreakpoint: "xs",
|
|
16
|
+
orientation: "portrait",
|
|
17
|
+
breakpoints: w,
|
|
18
|
+
isBreakpoint: () => !1,
|
|
19
|
+
isMobileDevice: !1,
|
|
20
|
+
isPortrait: !0,
|
|
21
|
+
isLandscape: !1,
|
|
22
|
+
isSmallScreen: !1
|
|
23
|
+
}, m = S(void 0), O = ({
|
|
24
|
+
children: l,
|
|
25
|
+
mobileWidth: p = 768,
|
|
26
|
+
onLayoutWidthChange: s
|
|
27
|
+
}) => {
|
|
28
|
+
const [a, b] = u(!1), { container: t } = M(), [r, f] = u({
|
|
29
|
+
width: (t == null ? void 0 : t.clientWidth) || window.innerWidth,
|
|
30
|
+
height: (t == null ? void 0 : t.clientHeight) || window.innerHeight,
|
|
31
|
+
isMobile: !1,
|
|
32
|
+
currentBreakpoint: "xs",
|
|
33
|
+
orientation: "portrait"
|
|
34
|
+
}), n = g(() => ({
|
|
35
|
+
...w,
|
|
36
|
+
md: p
|
|
37
|
+
}), [p]), h = (e) => {
|
|
38
|
+
const o = Object.entries(n);
|
|
39
|
+
for (let i = o.length - 1; i >= 0; i--)
|
|
40
|
+
if (e >= o[i][1])
|
|
41
|
+
return o[i][0];
|
|
42
|
+
return "xs";
|
|
43
|
+
}, x = () => {
|
|
44
|
+
const e = navigator.userAgent.toLowerCase();
|
|
45
|
+
return ["iphone", "ipod", "ipad", "android", "mobile", "phone", "tablet"].some((i) => e.includes(i));
|
|
46
|
+
};
|
|
47
|
+
c(() => {
|
|
48
|
+
const e = r.width <= n.md;
|
|
49
|
+
b(e);
|
|
50
|
+
}, [r, n]), c(() => {
|
|
51
|
+
s && s(a, r.width);
|
|
52
|
+
}, [s, a, r]), c(() => {
|
|
53
|
+
if (!t)
|
|
54
|
+
return;
|
|
55
|
+
const e = () => {
|
|
56
|
+
const i = t.clientWidth, d = t.clientHeight;
|
|
57
|
+
f({
|
|
58
|
+
width: i,
|
|
59
|
+
height: d,
|
|
60
|
+
isMobile: x(),
|
|
61
|
+
currentBreakpoint: h(i),
|
|
62
|
+
orientation: d > i ? "portrait" : "landscape"
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
e();
|
|
66
|
+
const o = new ResizeObserver(e);
|
|
67
|
+
return o.observe(t), window.addEventListener("resize", e), () => {
|
|
68
|
+
o.disconnect(), window.removeEventListener("resize", e);
|
|
69
|
+
};
|
|
70
|
+
}, [t]);
|
|
71
|
+
const v = {
|
|
72
|
+
...r,
|
|
73
|
+
breakpoints: n,
|
|
74
|
+
isBreakpoint: (e) => r.width >= n[e],
|
|
75
|
+
isMobileDevice: r.isMobile,
|
|
76
|
+
isPortrait: r.orientation === "portrait",
|
|
77
|
+
isLandscape: r.orientation === "landscape",
|
|
78
|
+
isSmallScreen: a
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ k(m.Provider, { value: v, children: l });
|
|
81
|
+
}, V = () => B(m) ?? E;
|
|
82
|
+
export {
|
|
83
|
+
O as ViewportProvider,
|
|
84
|
+
V as useViewportContext
|
|
85
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useContext as i, useState as s } from "react";
|
|
3
|
+
const t = u({
|
|
4
|
+
columnCount: 1,
|
|
5
|
+
setColumnCount: () => {
|
|
6
|
+
}
|
|
7
|
+
}), m = () => i(t), c = ({ children: o }) => {
|
|
8
|
+
const [r, e] = s(1);
|
|
9
|
+
return /* @__PURE__ */ n(t.Provider, { value: { columnCount: r, setColumnCount: e }, children: o });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
t as VirtualGridContext,
|
|
13
|
+
c as VirtualGridProvider,
|
|
14
|
+
m as useVirtualGridContext
|
|
15
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as g, useContext as R, useState as e } from "react";
|
|
3
|
+
const l = g({
|
|
4
|
+
getVirtualScrollRef: () => {
|
|
5
|
+
},
|
|
6
|
+
getPageScrollElementRef: () => {
|
|
7
|
+
},
|
|
8
|
+
getVirtualScrollableElementRef: () => {
|
|
9
|
+
},
|
|
10
|
+
scrollPosition: {
|
|
11
|
+
scrollTop: 0,
|
|
12
|
+
scrollLeft: 0
|
|
13
|
+
},
|
|
14
|
+
setScrollPosition: () => {
|
|
15
|
+
},
|
|
16
|
+
totalInnerDimensions: {
|
|
17
|
+
height: 0,
|
|
18
|
+
width: 0
|
|
19
|
+
},
|
|
20
|
+
setTotalInnerDimensions: () => {
|
|
21
|
+
}
|
|
22
|
+
}), E = () => R(l), h = ({ children: t }) => {
|
|
23
|
+
const [o, r] = e(), [n, s] = e(), [i, c] = e(), [a, S] = e({
|
|
24
|
+
scrollTop: 0,
|
|
25
|
+
scrollLeft: 0
|
|
26
|
+
}), [u, f] = e({
|
|
27
|
+
height: 0,
|
|
28
|
+
width: 0
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ m(
|
|
31
|
+
l.Provider,
|
|
32
|
+
{
|
|
33
|
+
value: {
|
|
34
|
+
virtualScrollRef: o,
|
|
35
|
+
getVirtualScrollRef: r,
|
|
36
|
+
pageScrollElementRef: i,
|
|
37
|
+
getPageScrollElementRef: c,
|
|
38
|
+
virtualScrollableElementRef: n,
|
|
39
|
+
getVirtualScrollableElementRef: s,
|
|
40
|
+
scrollPosition: a,
|
|
41
|
+
setScrollPosition: S,
|
|
42
|
+
totalInnerDimensions: u,
|
|
43
|
+
setTotalInnerDimensions: f
|
|
44
|
+
},
|
|
45
|
+
children: t
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
l as VirtualScrollContext,
|
|
51
|
+
h as VirtualScrollProvider,
|
|
52
|
+
E as useVirtualScrollContext
|
|
53
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as M, useContext as O, useState as u, useRef as R, useEffect as f, useCallback as x, useMemo as C } from "react";
|
|
3
|
+
import { ZoomLevel as J } from "../utils/types.js";
|
|
4
|
+
import { appConsole as _ } from "../utils/appConsole.js";
|
|
5
|
+
import { useInitialStateContext as j } from "./InitialStateContext.js";
|
|
6
|
+
import { useDocumentContext as F } from "./RPDocumentContext.js";
|
|
7
|
+
import { PAGE_PADDING as T } from "../utils/constants.js";
|
|
8
|
+
import { getZoomLevel as D } from "../utils/getZoomLevel.js";
|
|
9
|
+
import { useLayoutContainer as k } from "./LayoutContainerContext.js";
|
|
10
|
+
import { useViewModeContext as q } from "./ViewModeContext.js";
|
|
11
|
+
import { useRotationContext as B } from "./RotationContext.js";
|
|
12
|
+
import { useGlobalCurrentPage as K } from "./GlobalCurrentPage.js";
|
|
13
|
+
import { useDebounce as Q } from "../utils/hooks/useDebounce.js";
|
|
14
|
+
import "../de_DE-a553b162.js";
|
|
15
|
+
import "../utils/hooks/useLoadPdf.js";
|
|
16
|
+
import "pdfjs-dist";
|
|
17
|
+
import "../utils/getThumbnailViewport.js";
|
|
18
|
+
import "./ConfigContext.js";
|
|
19
|
+
import "./DocumentPasswordContext.js";
|
|
20
|
+
import "../utils/hooks/usePdfProperties.js";
|
|
21
|
+
import "../utils/convertPdfDate.js";
|
|
22
|
+
import "../utils/formatFileSize.js";
|
|
23
|
+
import "./EventCallbackContext.js";
|
|
24
|
+
const W = M({
|
|
25
|
+
zoomLevel: 100,
|
|
26
|
+
currentZoom: 1,
|
|
27
|
+
setZoomLevel: () => {
|
|
28
|
+
}
|
|
29
|
+
}), Le = () => {
|
|
30
|
+
const m = O(W);
|
|
31
|
+
return typeof m.currentZoom != "number" && _.warn("Please use this hooks inside children component of RPProvider"), m;
|
|
32
|
+
}, Pe = ({ children: m }) => {
|
|
33
|
+
const { initialScale: b = J.PAGE_FIT } = j(), [s, H] = u(b), { pages: l } = F(), { pagesRef: t } = k(), { viewMode: p } = q(), [V, z] = u({
|
|
34
|
+
width: (t == null ? void 0 : t.clientWidth) || 0,
|
|
35
|
+
height: (t == null ? void 0 : t.clientHeight) || 0
|
|
36
|
+
}), h = Q(V, 100), { rotate: g } = B(), [n, y] = u(null), d = R(null), { currentPage: v } = K(), [w, N] = u(v);
|
|
37
|
+
f(() => {
|
|
38
|
+
let e = l.get(w);
|
|
39
|
+
e || (e = l.get(1));
|
|
40
|
+
const o = e == null ? void 0 : e.page.getViewport({
|
|
41
|
+
scale: 1,
|
|
42
|
+
rotation: e.defaultRotation + g
|
|
43
|
+
});
|
|
44
|
+
o && JSON.stringify(o) !== JSON.stringify(d.current) && (d.current = o, y(o));
|
|
45
|
+
}, [l, g, w]);
|
|
46
|
+
const c = x(() => {
|
|
47
|
+
if (!n)
|
|
48
|
+
return null;
|
|
49
|
+
const e = ((n == null ? void 0 : n.width) || 0) + 2 * T, o = (n == null ? void 0 : n.height) || 0, i = (t == null ? void 0 : t.clientWidth) || 0, r = (t == null ? void 0 : t.clientHeight) || 0;
|
|
50
|
+
return { pageWidth: e, pageHeight: o, clientWidth: i, clientHeight: r };
|
|
51
|
+
}, [n, t]), L = C(() => {
|
|
52
|
+
const e = c();
|
|
53
|
+
if (!h.width || !h.height || !e)
|
|
54
|
+
return 0;
|
|
55
|
+
if (typeof s == "number")
|
|
56
|
+
return s / 100;
|
|
57
|
+
const { clientWidth: o, clientHeight: i, pageWidth: r, pageHeight: a } = e;
|
|
58
|
+
return D(s, o, i, r, a, p) / 100;
|
|
59
|
+
}, [s, h, c, p]);
|
|
60
|
+
f(() => {
|
|
61
|
+
N(v);
|
|
62
|
+
}, [s]), f(() => {
|
|
63
|
+
const e = (i) => {
|
|
64
|
+
i.forEach((r) => {
|
|
65
|
+
z({ width: r.contentRect.width, height: r.contentRect.height });
|
|
66
|
+
});
|
|
67
|
+
}, o = new ResizeObserver(e);
|
|
68
|
+
return t && o.observe(t), () => {
|
|
69
|
+
o.disconnect();
|
|
70
|
+
};
|
|
71
|
+
}, [t]);
|
|
72
|
+
const P = x(
|
|
73
|
+
(e) => {
|
|
74
|
+
let o = 0;
|
|
75
|
+
if (typeof e == "function") {
|
|
76
|
+
const i = c();
|
|
77
|
+
if (!i)
|
|
78
|
+
return;
|
|
79
|
+
const { clientWidth: r, clientHeight: a, pageWidth: Z, pageHeight: E } = i;
|
|
80
|
+
o = (G) => {
|
|
81
|
+
const A = D(
|
|
82
|
+
G,
|
|
83
|
+
r,
|
|
84
|
+
a,
|
|
85
|
+
Z,
|
|
86
|
+
E,
|
|
87
|
+
p
|
|
88
|
+
);
|
|
89
|
+
return e(A);
|
|
90
|
+
};
|
|
91
|
+
} else
|
|
92
|
+
o = e;
|
|
93
|
+
o && H(o);
|
|
94
|
+
},
|
|
95
|
+
[c]
|
|
96
|
+
), S = C(() => ({
|
|
97
|
+
zoomLevel: s,
|
|
98
|
+
currentZoom: L,
|
|
99
|
+
setZoomLevel: P
|
|
100
|
+
}), [L, s, P]);
|
|
101
|
+
return /* @__PURE__ */ I(W.Provider, { value: S, children: m });
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
W as ZoomContext,
|
|
105
|
+
Pe as ZoomProvider,
|
|
106
|
+
Le as useZoomContext
|
|
107
|
+
};
|