@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,1049 @@
|
|
|
1
|
+
import { jsx as x, jsxs as xe, Fragment as ft } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as pe, PureComponent as mt, Component as pt, memo as ht, useRef as Z, useMemo as ye, useCallback as se, useEffect as ae, useLayoutEffect as ke } from "react";
|
|
3
|
+
import { RPPage as be } from "./page/RPPage.js";
|
|
4
|
+
import { useVirtualReactWindow as gt } from "../utils/hooks/useVirtualReactWindow.js";
|
|
5
|
+
import { useVirtualScrollContext as vt } from "../contexts/VirtualScrollContext.js";
|
|
6
|
+
import { a as _t, u as wt } from "../PaginationContext-9217cab4.js";
|
|
7
|
+
import { useDocumentContext as Ct } from "../contexts/RPDocumentContext.js";
|
|
8
|
+
import { useViewModeContext as St } from "../contexts/ViewModeContext.js";
|
|
9
|
+
import { useScrollModeContext as It } from "../contexts/ScrollModeContext.js";
|
|
10
|
+
import { SelectionMode as Tt, ViewMode as ze, ScrollMode as Le, ErrorType as Rt } from "../utils/types.js";
|
|
11
|
+
import { useFullScreenContext as xt } from "../contexts/FullScreenContext.js";
|
|
12
|
+
import { c as me } from "../clsx-0c6e471a.js";
|
|
13
|
+
import { DualPage as yt } from "./page/DualPage.js";
|
|
14
|
+
import { DualPageWithCover as bt } from "./page/DualPageWithCover.js";
|
|
15
|
+
import { SinglePage as zt } from "./page/SinglePage.js";
|
|
16
|
+
import { useMousePressed as Lt } from "../utils/hooks/useMousePressed.js";
|
|
17
|
+
import { useSelectionModeContext as Mt } from "../contexts/SelectionModeContext.js";
|
|
18
|
+
import { useGrabScroll as Et } from "../utils/hooks/useGrabScroll.js";
|
|
19
|
+
import { usePinch as Ot } from "../utils/hooks/usePinch.js";
|
|
20
|
+
import { useInitialStateContext as Wt } from "../contexts/InitialStateContext.js";
|
|
21
|
+
import { useLayoutContainer as At } from "../contexts/LayoutContainerContext.js";
|
|
22
|
+
import { useDebounce as Nt } from "../utils/hooks/useDebounce.js";
|
|
23
|
+
import { useLoaderContext as Pt } from "../contexts/LoaderContext.js";
|
|
24
|
+
import Ft from "./ui/PasswordModal.js";
|
|
25
|
+
import { usePresentPage as Dt } from "../utils/hooks/usePresentPage.js";
|
|
26
|
+
import { getPageFromPosition as Ht } from "../utils/calculatePage.js";
|
|
27
|
+
import { useDocumentPasswordContext as kt } from "../contexts/DocumentPasswordContext.js";
|
|
28
|
+
import { LayoutContainer as Ut } from "./layout/LayoutContainer.js";
|
|
29
|
+
import { LayoutWrapper as Vt } from "./layout/LayoutWrapper.js";
|
|
30
|
+
import { useEventCallbackContext as qt } from "../contexts/EventCallbackContext.js";
|
|
31
|
+
import { useCopyText as Gt } from "../utils/hooks/useCopyText.js";
|
|
32
|
+
import { useTextSelection as $t } from "../utils/hooks/useTextSelection.js";
|
|
33
|
+
import { OutputScale as jt } from "pdfjs-dist";
|
|
34
|
+
import { approximateFraction as Ue } from "../utils/approximateFragtion.js";
|
|
35
|
+
import { useSmoothScaleContext as Bt } from "../contexts/SmoothScaleContext.js";
|
|
36
|
+
import "./page/CanvasLayer.js";
|
|
37
|
+
import "../contexts/PagesRotateContext.js";
|
|
38
|
+
import "../contexts/RotationContext.js";
|
|
39
|
+
import "../utils/appConsole.js";
|
|
40
|
+
import "../utils/hooks/useLoadPdf.js";
|
|
41
|
+
import "../utils/getThumbnailViewport.js";
|
|
42
|
+
import "../contexts/ConfigContext.js";
|
|
43
|
+
import "../de_DE-a553b162.js";
|
|
44
|
+
import "../utils/hooks/usePdfProperties.js";
|
|
45
|
+
import "../utils/convertPdfDate.js";
|
|
46
|
+
import "../utils/formatFileSize.js";
|
|
47
|
+
import "../contexts/RenderQueueProvider.js";
|
|
48
|
+
import "../utils/Queue.js";
|
|
49
|
+
import "../utils/renderPage.js";
|
|
50
|
+
import "../contexts/GlobalCurrentPage.js";
|
|
51
|
+
import "../contexts/VirtualGridContext.js";
|
|
52
|
+
import "../utils/smoothScrollTo.js";
|
|
53
|
+
import "../contexts/DimensionPagesContext.js";
|
|
54
|
+
import "../contexts/ZoomContext.js";
|
|
55
|
+
import "../utils/constants.js";
|
|
56
|
+
import "../utils/getZoomLevel.js";
|
|
57
|
+
import "../contexts/SmoothScrollContext.js";
|
|
58
|
+
import "../utils/getScrollDistance.js";
|
|
59
|
+
import "./page/TextLayer.js";
|
|
60
|
+
import "../utils/highlight.js";
|
|
61
|
+
import "../utils/charators.js";
|
|
62
|
+
import "../contexts/SearchContext.js";
|
|
63
|
+
import "../utils/hooks/useSearch.js";
|
|
64
|
+
import "../utils/getWordPositionInPage.js";
|
|
65
|
+
import "./page/AnnotationLayer.js";
|
|
66
|
+
import "../contexts/PrintContext.js";
|
|
67
|
+
import "../utils/hooks/usePrint.js";
|
|
68
|
+
import "../utils/link_service.js";
|
|
69
|
+
import "../utils/annotations.js";
|
|
70
|
+
import "../utils/sanitizeExternalUrl.js";
|
|
71
|
+
import "../utils/dateFormatter.js";
|
|
72
|
+
import "../utils/hooks/useFileDownload.js";
|
|
73
|
+
import "../contexts/DownloadContext.js";
|
|
74
|
+
import "../contexts/LayerContext.js";
|
|
75
|
+
import "./page/TextHighlightLayer.js";
|
|
76
|
+
import "../contexts/HighlightContext.js";
|
|
77
|
+
import "../utils/hooks/useHighlight.js";
|
|
78
|
+
import "./page/searchHighlight.js";
|
|
79
|
+
import "../utils/const.js";
|
|
80
|
+
import "./page/CustomElement.js";
|
|
81
|
+
import "../contexts/ElementPageContext.js";
|
|
82
|
+
import "../contexts/LicenseContext.js";
|
|
83
|
+
import "../utils/hooks/useLicense.js";
|
|
84
|
+
import "../utils/getElementPositionInPage.js";
|
|
85
|
+
import "../utils/withRef.js";
|
|
86
|
+
import "./icons/LoaderIcon.js";
|
|
87
|
+
import "../utils/hooks/useFullScreen.js";
|
|
88
|
+
import "../utils/hooks/useAccumulateFactor.js";
|
|
89
|
+
import "../contexts/LocalizationContext.js";
|
|
90
|
+
import "../utils/hooks/useLocalization.js";
|
|
91
|
+
import "../RPLayout.module-b4b23e29.js";
|
|
92
|
+
import "../contexts/ThemeContext.js";
|
|
93
|
+
import "../contexts/DarkModeContext.js";
|
|
94
|
+
import "../utils/hooks/useDarkMode.js";
|
|
95
|
+
const V = {
|
|
96
|
+
"rp-pages": "_rp-pages_u7m2r_1",
|
|
97
|
+
"rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_u7m2r_6",
|
|
98
|
+
"rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_u7m2r_11",
|
|
99
|
+
"rp-pages-container": "_rp-pages-container_u7m2r_15",
|
|
100
|
+
"rp-viewer": "_rp-viewer_u7m2r_57",
|
|
101
|
+
"rp-cursor-grab": "_rp-cursor-grab_u7m2r_62",
|
|
102
|
+
"rp-cursor-grabbing": "_rp-cursor-grabbing_u7m2r_70",
|
|
103
|
+
"rp-loader": "_rp-loader_u7m2r_78",
|
|
104
|
+
"rp-not-supported": "_rp-not-supported_u7m2r_86",
|
|
105
|
+
"rp-not-supported-content": "_rp-not-supported-content_u7m2r_102"
|
|
106
|
+
};
|
|
107
|
+
function Ae() {
|
|
108
|
+
return Ae = Object.assign ? Object.assign.bind() : function(n) {
|
|
109
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
110
|
+
var t = arguments[e];
|
|
111
|
+
for (var r in t)
|
|
112
|
+
({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
113
|
+
}
|
|
114
|
+
return n;
|
|
115
|
+
}, Ae.apply(null, arguments);
|
|
116
|
+
}
|
|
117
|
+
function Ve(n) {
|
|
118
|
+
if (n === void 0)
|
|
119
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
120
|
+
return n;
|
|
121
|
+
}
|
|
122
|
+
function Ne(n, e) {
|
|
123
|
+
return Ne = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
|
|
124
|
+
return t.__proto__ = r, t;
|
|
125
|
+
}, Ne(n, e);
|
|
126
|
+
}
|
|
127
|
+
function Kt(n, e) {
|
|
128
|
+
n.prototype = Object.create(e.prototype), n.prototype.constructor = n, Ne(n, e);
|
|
129
|
+
}
|
|
130
|
+
var qe = Number.isNaN || function(e) {
|
|
131
|
+
return typeof e == "number" && e !== e;
|
|
132
|
+
};
|
|
133
|
+
function Zt(n, e) {
|
|
134
|
+
return !!(n === e || qe(n) && qe(e));
|
|
135
|
+
}
|
|
136
|
+
function Xt(n, e) {
|
|
137
|
+
if (n.length !== e.length)
|
|
138
|
+
return !1;
|
|
139
|
+
for (var t = 0; t < n.length; t++)
|
|
140
|
+
if (!Zt(n[t], e[t]))
|
|
141
|
+
return !1;
|
|
142
|
+
return !0;
|
|
143
|
+
}
|
|
144
|
+
function Me(n, e) {
|
|
145
|
+
e === void 0 && (e = Xt);
|
|
146
|
+
var t, r = [], i, l = !1;
|
|
147
|
+
function a() {
|
|
148
|
+
for (var c = [], d = 0; d < arguments.length; d++)
|
|
149
|
+
c[d] = arguments[d];
|
|
150
|
+
return l && t === this && e(c, r) || (i = n.apply(this, c), l = !0, t = this, r = c), i;
|
|
151
|
+
}
|
|
152
|
+
return a;
|
|
153
|
+
}
|
|
154
|
+
function Ge(n, e) {
|
|
155
|
+
if (n == null)
|
|
156
|
+
return {};
|
|
157
|
+
var t = {};
|
|
158
|
+
for (var r in n)
|
|
159
|
+
if ({}.hasOwnProperty.call(n, r)) {
|
|
160
|
+
if (e.indexOf(r) !== -1)
|
|
161
|
+
continue;
|
|
162
|
+
t[r] = n[r];
|
|
163
|
+
}
|
|
164
|
+
return t;
|
|
165
|
+
}
|
|
166
|
+
var Yt = typeof performance == "object" && typeof performance.now == "function", $e = Yt ? function() {
|
|
167
|
+
return performance.now();
|
|
168
|
+
} : function() {
|
|
169
|
+
return Date.now();
|
|
170
|
+
};
|
|
171
|
+
function je(n) {
|
|
172
|
+
cancelAnimationFrame(n.id);
|
|
173
|
+
}
|
|
174
|
+
function Jt(n, e) {
|
|
175
|
+
var t = $e();
|
|
176
|
+
function r() {
|
|
177
|
+
$e() - t >= e ? n.call(null) : i.id = requestAnimationFrame(r);
|
|
178
|
+
}
|
|
179
|
+
var i = {
|
|
180
|
+
id: requestAnimationFrame(r)
|
|
181
|
+
};
|
|
182
|
+
return i;
|
|
183
|
+
}
|
|
184
|
+
var Ee = -1;
|
|
185
|
+
function Qt(n) {
|
|
186
|
+
if (n === void 0 && (n = !1), Ee === -1 || n) {
|
|
187
|
+
var e = document.createElement("div"), t = e.style;
|
|
188
|
+
t.width = "50px", t.height = "50px", t.overflow = "scroll", document.body.appendChild(e), Ee = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
189
|
+
}
|
|
190
|
+
return Ee;
|
|
191
|
+
}
|
|
192
|
+
var re = null;
|
|
193
|
+
function Be(n) {
|
|
194
|
+
if (n === void 0 && (n = !1), re === null || n) {
|
|
195
|
+
var e = document.createElement("div"), t = e.style;
|
|
196
|
+
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
197
|
+
var r = document.createElement("div"), i = r.style;
|
|
198
|
+
return i.width = "100px", i.height = "100px", e.appendChild(r), document.body.appendChild(e), e.scrollLeft > 0 ? re = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? re = "negative" : re = "positive-ascending"), document.body.removeChild(e), re;
|
|
199
|
+
}
|
|
200
|
+
return re;
|
|
201
|
+
}
|
|
202
|
+
var er = 150, tr = function(e) {
|
|
203
|
+
var t = e.columnIndex;
|
|
204
|
+
e.data;
|
|
205
|
+
var r = e.rowIndex;
|
|
206
|
+
return r + ":" + t;
|
|
207
|
+
}, he = null, ge = null, ve = null;
|
|
208
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (he = /* @__PURE__ */ new WeakSet(), ge = /* @__PURE__ */ new WeakSet(), ve = /* @__PURE__ */ new WeakSet());
|
|
209
|
+
function rr(n) {
|
|
210
|
+
var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, i = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, d = n.getOffsetForColumnAndAlignment, v = n.getOffsetForRowAndAlignment, g = n.getRowHeight, C = n.getRowOffset, s = n.getRowStartIndexForOffset, m = n.getRowStopIndexForStartIndex, O = n.initInstanceProps, _ = n.shouldResetStyleCacheOnItemSizeChange, N = n.validateProps;
|
|
211
|
+
return e = /* @__PURE__ */ function(y) {
|
|
212
|
+
Kt(S, y);
|
|
213
|
+
function S(W) {
|
|
214
|
+
var o;
|
|
215
|
+
return o = y.call(this, W) || this, o._instanceProps = O(o.props, Ve(o)), o._resetIsScrollingTimeoutId = null, o._outerRef = void 0, o.state = {
|
|
216
|
+
instance: Ve(o),
|
|
217
|
+
isScrolling: !1,
|
|
218
|
+
horizontalScrollDirection: "forward",
|
|
219
|
+
scrollLeft: typeof o.props.initialScrollLeft == "number" ? o.props.initialScrollLeft : 0,
|
|
220
|
+
scrollTop: typeof o.props.initialScrollTop == "number" ? o.props.initialScrollTop : 0,
|
|
221
|
+
scrollUpdateWasRequested: !1,
|
|
222
|
+
verticalScrollDirection: "forward"
|
|
223
|
+
}, o._callOnItemsRendered = void 0, o._callOnItemsRendered = Me(function(f, u, p, w, h, I, z, E) {
|
|
224
|
+
return o.props.onItemsRendered({
|
|
225
|
+
overscanColumnStartIndex: f,
|
|
226
|
+
overscanColumnStopIndex: u,
|
|
227
|
+
overscanRowStartIndex: p,
|
|
228
|
+
overscanRowStopIndex: w,
|
|
229
|
+
visibleColumnStartIndex: h,
|
|
230
|
+
visibleColumnStopIndex: I,
|
|
231
|
+
visibleRowStartIndex: z,
|
|
232
|
+
visibleRowStopIndex: E
|
|
233
|
+
});
|
|
234
|
+
}), o._callOnScroll = void 0, o._callOnScroll = Me(function(f, u, p, w, h) {
|
|
235
|
+
return o.props.onScroll({
|
|
236
|
+
horizontalScrollDirection: p,
|
|
237
|
+
scrollLeft: f,
|
|
238
|
+
scrollTop: u,
|
|
239
|
+
verticalScrollDirection: w,
|
|
240
|
+
scrollUpdateWasRequested: h
|
|
241
|
+
});
|
|
242
|
+
}), o._getItemStyle = void 0, o._getItemStyle = function(f, u) {
|
|
243
|
+
var p = o.props, w = p.columnWidth, h = p.direction, I = p.rowHeight, z = o._getItemStyleCache(_ && w, _ && h, _ && I), E = f + ":" + u, T;
|
|
244
|
+
if (z.hasOwnProperty(E))
|
|
245
|
+
T = z[E];
|
|
246
|
+
else {
|
|
247
|
+
var L = t(o.props, u, o._instanceProps), R = h === "rtl";
|
|
248
|
+
z[E] = T = {
|
|
249
|
+
position: "absolute",
|
|
250
|
+
left: R ? void 0 : L,
|
|
251
|
+
right: R ? L : void 0,
|
|
252
|
+
top: C(o.props, f, o._instanceProps),
|
|
253
|
+
height: g(o.props, f, o._instanceProps),
|
|
254
|
+
width: l(o.props, u, o._instanceProps)
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return T;
|
|
258
|
+
}, o._getItemStyleCache = void 0, o._getItemStyleCache = Me(function(f, u, p) {
|
|
259
|
+
return {};
|
|
260
|
+
}), o._onScroll = function(f) {
|
|
261
|
+
var u = f.currentTarget, p = u.clientHeight, w = u.clientWidth, h = u.scrollLeft, I = u.scrollTop, z = u.scrollHeight, E = u.scrollWidth;
|
|
262
|
+
o.setState(function(T) {
|
|
263
|
+
if (T.scrollLeft === h && T.scrollTop === I)
|
|
264
|
+
return null;
|
|
265
|
+
var L = o.props.direction, R = h;
|
|
266
|
+
if (L === "rtl")
|
|
267
|
+
switch (Be()) {
|
|
268
|
+
case "negative":
|
|
269
|
+
R = -h;
|
|
270
|
+
break;
|
|
271
|
+
case "positive-descending":
|
|
272
|
+
R = E - w - h;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
R = Math.max(0, Math.min(R, E - w));
|
|
276
|
+
var P = Math.max(0, Math.min(I, z - p));
|
|
277
|
+
return {
|
|
278
|
+
isScrolling: !0,
|
|
279
|
+
horizontalScrollDirection: T.scrollLeft < h ? "forward" : "backward",
|
|
280
|
+
scrollLeft: R,
|
|
281
|
+
scrollTop: P,
|
|
282
|
+
verticalScrollDirection: T.scrollTop < I ? "forward" : "backward",
|
|
283
|
+
scrollUpdateWasRequested: !1
|
|
284
|
+
};
|
|
285
|
+
}, o._resetIsScrollingDebounced);
|
|
286
|
+
}, o._outerRefSetter = function(f) {
|
|
287
|
+
var u = o.props.outerRef;
|
|
288
|
+
o._outerRef = f, typeof u == "function" ? u(f) : u != null && typeof u == "object" && u.hasOwnProperty("current") && (u.current = f);
|
|
289
|
+
}, o._resetIsScrollingDebounced = function() {
|
|
290
|
+
o._resetIsScrollingTimeoutId !== null && je(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = Jt(o._resetIsScrolling, er);
|
|
291
|
+
}, o._resetIsScrolling = function() {
|
|
292
|
+
o._resetIsScrollingTimeoutId = null, o.setState({
|
|
293
|
+
isScrolling: !1
|
|
294
|
+
}, function() {
|
|
295
|
+
o._getItemStyleCache(-1);
|
|
296
|
+
});
|
|
297
|
+
}, o;
|
|
298
|
+
}
|
|
299
|
+
S.getDerivedStateFromProps = function(o, f) {
|
|
300
|
+
return or(o, f), N(o), null;
|
|
301
|
+
};
|
|
302
|
+
var b = S.prototype;
|
|
303
|
+
return b.scrollTo = function(o) {
|
|
304
|
+
var f = o.scrollLeft, u = o.scrollTop;
|
|
305
|
+
f !== void 0 && (f = Math.max(0, f)), u !== void 0 && (u = Math.max(0, u)), this.setState(function(p) {
|
|
306
|
+
return f === void 0 && (f = p.scrollLeft), u === void 0 && (u = p.scrollTop), p.scrollLeft === f && p.scrollTop === u ? null : {
|
|
307
|
+
horizontalScrollDirection: p.scrollLeft < f ? "forward" : "backward",
|
|
308
|
+
scrollLeft: f,
|
|
309
|
+
scrollTop: u,
|
|
310
|
+
scrollUpdateWasRequested: !0,
|
|
311
|
+
verticalScrollDirection: p.scrollTop < u ? "forward" : "backward"
|
|
312
|
+
};
|
|
313
|
+
}, this._resetIsScrollingDebounced);
|
|
314
|
+
}, b.scrollToItem = function(o) {
|
|
315
|
+
var f = o.align, u = f === void 0 ? "auto" : f, p = o.columnIndex, w = o.rowIndex, h = this.props, I = h.columnCount, z = h.height, E = h.rowCount, T = h.width, L = this.state, R = L.scrollLeft, P = L.scrollTop, k = Qt();
|
|
316
|
+
p !== void 0 && (p = Math.max(0, Math.min(p, I - 1))), w !== void 0 && (w = Math.max(0, Math.min(w, E - 1)));
|
|
317
|
+
var F = a(this.props, this._instanceProps), D = c(this.props, this._instanceProps), H = D > T ? k : 0, U = F > z ? k : 0;
|
|
318
|
+
this.scrollTo({
|
|
319
|
+
scrollLeft: p !== void 0 ? d(this.props, p, u, R, this._instanceProps, U) : R,
|
|
320
|
+
scrollTop: w !== void 0 ? v(this.props, w, u, P, this._instanceProps, H) : P
|
|
321
|
+
});
|
|
322
|
+
}, b.componentDidMount = function() {
|
|
323
|
+
var o = this.props, f = o.initialScrollLeft, u = o.initialScrollTop;
|
|
324
|
+
if (this._outerRef != null) {
|
|
325
|
+
var p = this._outerRef;
|
|
326
|
+
typeof f == "number" && (p.scrollLeft = f), typeof u == "number" && (p.scrollTop = u);
|
|
327
|
+
}
|
|
328
|
+
this._callPropsCallbacks();
|
|
329
|
+
}, b.componentDidUpdate = function() {
|
|
330
|
+
var o = this.props.direction, f = this.state, u = f.scrollLeft, p = f.scrollTop, w = f.scrollUpdateWasRequested;
|
|
331
|
+
if (w && this._outerRef != null) {
|
|
332
|
+
var h = this._outerRef;
|
|
333
|
+
if (o === "rtl")
|
|
334
|
+
switch (Be()) {
|
|
335
|
+
case "negative":
|
|
336
|
+
h.scrollLeft = -u;
|
|
337
|
+
break;
|
|
338
|
+
case "positive-ascending":
|
|
339
|
+
h.scrollLeft = u;
|
|
340
|
+
break;
|
|
341
|
+
default:
|
|
342
|
+
var I = h.clientWidth, z = h.scrollWidth;
|
|
343
|
+
h.scrollLeft = z - I - u;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
else
|
|
347
|
+
h.scrollLeft = Math.max(0, u);
|
|
348
|
+
h.scrollTop = Math.max(0, p);
|
|
349
|
+
}
|
|
350
|
+
this._callPropsCallbacks();
|
|
351
|
+
}, b.componentWillUnmount = function() {
|
|
352
|
+
this._resetIsScrollingTimeoutId !== null && je(this._resetIsScrollingTimeoutId);
|
|
353
|
+
}, b.render = function() {
|
|
354
|
+
var o = this.props, f = o.children, u = o.className, p = o.columnCount, w = o.direction, h = o.height, I = o.innerRef, z = o.innerElementType, E = o.innerTagName, T = o.itemData, L = o.itemKey, R = L === void 0 ? tr : L, P = o.outerElementType, k = o.outerTagName, F = o.rowCount, D = o.style, H = o.useIsScrolling, U = o.width, ee = this.state.isScrolling, Q = this._getHorizontalRangeToRender(), te = Q[0], le = Q[1], j = this._getVerticalRangeToRender(), _e = j[0], oe = j[1], Y = [];
|
|
355
|
+
if (p > 0 && F)
|
|
356
|
+
for (var G = _e; G <= oe; G++)
|
|
357
|
+
for (var $ = te; $ <= le; $++)
|
|
358
|
+
Y.push(pe(f, {
|
|
359
|
+
columnIndex: $,
|
|
360
|
+
data: T,
|
|
361
|
+
isScrolling: H ? ee : void 0,
|
|
362
|
+
key: R({
|
|
363
|
+
columnIndex: $,
|
|
364
|
+
data: T,
|
|
365
|
+
rowIndex: G
|
|
366
|
+
}),
|
|
367
|
+
rowIndex: G,
|
|
368
|
+
style: this._getItemStyle(G, $)
|
|
369
|
+
}));
|
|
370
|
+
var ce = a(this.props, this._instanceProps), ue = c(this.props, this._instanceProps);
|
|
371
|
+
return pe(P || k || "div", {
|
|
372
|
+
className: u,
|
|
373
|
+
onScroll: this._onScroll,
|
|
374
|
+
ref: this._outerRefSetter,
|
|
375
|
+
style: Ae({
|
|
376
|
+
position: "relative",
|
|
377
|
+
height: h,
|
|
378
|
+
width: U,
|
|
379
|
+
overflow: "auto",
|
|
380
|
+
WebkitOverflowScrolling: "touch",
|
|
381
|
+
willChange: "transform",
|
|
382
|
+
direction: w
|
|
383
|
+
}, D)
|
|
384
|
+
}, pe(z || E || "div", {
|
|
385
|
+
children: Y,
|
|
386
|
+
ref: I,
|
|
387
|
+
style: {
|
|
388
|
+
height: ce,
|
|
389
|
+
pointerEvents: ee ? "none" : void 0,
|
|
390
|
+
width: ue
|
|
391
|
+
}
|
|
392
|
+
}));
|
|
393
|
+
}, b._callPropsCallbacks = function() {
|
|
394
|
+
var o = this.props, f = o.columnCount, u = o.onItemsRendered, p = o.onScroll, w = o.rowCount;
|
|
395
|
+
if (typeof u == "function" && f > 0 && w > 0) {
|
|
396
|
+
var h = this._getHorizontalRangeToRender(), I = h[0], z = h[1], E = h[2], T = h[3], L = this._getVerticalRangeToRender(), R = L[0], P = L[1], k = L[2], F = L[3];
|
|
397
|
+
this._callOnItemsRendered(I, z, R, P, E, T, k, F);
|
|
398
|
+
}
|
|
399
|
+
if (typeof p == "function") {
|
|
400
|
+
var D = this.state, H = D.horizontalScrollDirection, U = D.scrollLeft, ee = D.scrollTop, Q = D.scrollUpdateWasRequested, te = D.verticalScrollDirection;
|
|
401
|
+
this._callOnScroll(U, ee, H, te, Q);
|
|
402
|
+
}
|
|
403
|
+
}, b._getHorizontalRangeToRender = function() {
|
|
404
|
+
var o = this.props, f = o.columnCount, u = o.overscanColumnCount, p = o.overscanColumnsCount, w = o.overscanCount, h = o.rowCount, I = this.state, z = I.horizontalScrollDirection, E = I.isScrolling, T = I.scrollLeft, L = u || p || w || 1;
|
|
405
|
+
if (f === 0 || h === 0)
|
|
406
|
+
return [0, 0, 0, 0];
|
|
407
|
+
var R = r(this.props, T, this._instanceProps), P = i(this.props, R, T, this._instanceProps), k = !E || z === "backward" ? Math.max(1, L) : 1, F = !E || z === "forward" ? Math.max(1, L) : 1;
|
|
408
|
+
return [Math.max(0, R - k), Math.max(0, Math.min(f - 1, P + F)), R, P];
|
|
409
|
+
}, b._getVerticalRangeToRender = function() {
|
|
410
|
+
var o = this.props, f = o.columnCount, u = o.overscanCount, p = o.overscanRowCount, w = o.overscanRowsCount, h = o.rowCount, I = this.state, z = I.isScrolling, E = I.verticalScrollDirection, T = I.scrollTop, L = p || w || u || 1;
|
|
411
|
+
if (f === 0 || h === 0)
|
|
412
|
+
return [0, 0, 0, 0];
|
|
413
|
+
var R = s(this.props, T, this._instanceProps), P = m(this.props, R, T, this._instanceProps), k = !z || E === "backward" ? Math.max(1, L) : 1, F = !z || E === "forward" ? Math.max(1, L) : 1;
|
|
414
|
+
return [Math.max(0, R - k), Math.max(0, Math.min(h - 1, P + F)), R, P];
|
|
415
|
+
}, S;
|
|
416
|
+
}(mt), e.defaultProps = {
|
|
417
|
+
direction: "ltr",
|
|
418
|
+
itemData: void 0,
|
|
419
|
+
useIsScrolling: !1
|
|
420
|
+
}, e;
|
|
421
|
+
}
|
|
422
|
+
var or = function(e, t) {
|
|
423
|
+
var r = e.children, i = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, d = e.overscanColumnsCount, v = e.overscanCount, g = e.overscanRowsCount, C = e.width, s = t.instance;
|
|
424
|
+
if (process.env.NODE_ENV !== "production") {
|
|
425
|
+
if (typeof v == "number" && he && !he.has(s) && (he.add(s), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof g == "number") && ge && !ge.has(s) && (ge.add(s), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && ve && !ve.has(s) && (ve.add(s), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
|
|
426
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
427
|
+
switch (i) {
|
|
428
|
+
case "ltr":
|
|
429
|
+
case "rtl":
|
|
430
|
+
break;
|
|
431
|
+
default:
|
|
432
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + i + '" was specified.'));
|
|
433
|
+
}
|
|
434
|
+
if (typeof C != "number")
|
|
435
|
+
throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (C === null ? "null" : typeof C) + '" was specified.'));
|
|
436
|
+
if (typeof l != "number")
|
|
437
|
+
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (l === null ? "null" : typeof l) + '" was specified.'));
|
|
438
|
+
}
|
|
439
|
+
}, Ke = 50, tt = function(e, t) {
|
|
440
|
+
var r = e.rowCount, i = t.rowMetadataMap, l = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, c = 0;
|
|
441
|
+
if (a >= r && (a = r - 1), a >= 0) {
|
|
442
|
+
var d = i[a];
|
|
443
|
+
c = d.offset + d.size;
|
|
444
|
+
}
|
|
445
|
+
var v = r - a - 1, g = v * l;
|
|
446
|
+
return c + g;
|
|
447
|
+
}, rt = function(e, t) {
|
|
448
|
+
var r = e.columnCount, i = t.columnMetadataMap, l = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, c = 0;
|
|
449
|
+
if (a >= r && (a = r - 1), a >= 0) {
|
|
450
|
+
var d = i[a];
|
|
451
|
+
c = d.offset + d.size;
|
|
452
|
+
}
|
|
453
|
+
var v = r - a - 1, g = v * l;
|
|
454
|
+
return c + g;
|
|
455
|
+
}, X = function(e, t, r, i) {
|
|
456
|
+
var l, a, c;
|
|
457
|
+
if (e === "column" ? (l = i.columnMetadataMap, a = t.columnWidth, c = i.lastMeasuredColumnIndex) : (l = i.rowMetadataMap, a = t.rowHeight, c = i.lastMeasuredRowIndex), r > c) {
|
|
458
|
+
var d = 0;
|
|
459
|
+
if (c >= 0) {
|
|
460
|
+
var v = l[c];
|
|
461
|
+
d = v.offset + v.size;
|
|
462
|
+
}
|
|
463
|
+
for (var g = c + 1; g <= r; g++) {
|
|
464
|
+
var C = a(g);
|
|
465
|
+
l[g] = {
|
|
466
|
+
offset: d,
|
|
467
|
+
size: C
|
|
468
|
+
}, d += C;
|
|
469
|
+
}
|
|
470
|
+
e === "column" ? i.lastMeasuredColumnIndex = r : i.lastMeasuredRowIndex = r;
|
|
471
|
+
}
|
|
472
|
+
return l[r];
|
|
473
|
+
}, Ze = function(e, t, r, i) {
|
|
474
|
+
var l, a;
|
|
475
|
+
e === "column" ? (l = r.columnMetadataMap, a = r.lastMeasuredColumnIndex) : (l = r.rowMetadataMap, a = r.lastMeasuredRowIndex);
|
|
476
|
+
var c = a > 0 ? l[a].offset : 0;
|
|
477
|
+
return c >= i ? ot(e, t, r, a, 0, i) : nr(e, t, r, Math.max(0, a), i);
|
|
478
|
+
}, ot = function(e, t, r, i, l, a) {
|
|
479
|
+
for (; l <= i; ) {
|
|
480
|
+
var c = l + Math.floor((i - l) / 2), d = X(e, t, c, r).offset;
|
|
481
|
+
if (d === a)
|
|
482
|
+
return c;
|
|
483
|
+
d < a ? l = c + 1 : d > a && (i = c - 1);
|
|
484
|
+
}
|
|
485
|
+
return l > 0 ? l - 1 : 0;
|
|
486
|
+
}, nr = function(e, t, r, i, l) {
|
|
487
|
+
for (var a = e === "column" ? t.columnCount : t.rowCount, c = 1; i < a && X(e, t, i, r).offset < l; )
|
|
488
|
+
i += c, c *= 2;
|
|
489
|
+
return ot(e, t, r, Math.min(i, a - 1), Math.floor(i / 2), l);
|
|
490
|
+
}, Xe = function(e, t, r, i, l, a, c) {
|
|
491
|
+
var d = e === "column" ? t.width : t.height, v = X(e, t, r, a), g = e === "column" ? rt(t, a) : tt(t, a), C = Math.max(0, Math.min(g - d, v.offset)), s = Math.max(0, v.offset - d + c + v.size);
|
|
492
|
+
switch (i === "smart" && (l >= s - d && l <= C + d ? i = "auto" : i = "center"), i) {
|
|
493
|
+
case "start":
|
|
494
|
+
return C;
|
|
495
|
+
case "end":
|
|
496
|
+
return s;
|
|
497
|
+
case "center":
|
|
498
|
+
return Math.round(s + (C - s) / 2);
|
|
499
|
+
case "auto":
|
|
500
|
+
default:
|
|
501
|
+
return l >= s && l <= C ? l : s > C || l < s ? s : C;
|
|
502
|
+
}
|
|
503
|
+
}, ir = /* @__PURE__ */ rr({
|
|
504
|
+
getColumnOffset: function(e, t, r) {
|
|
505
|
+
return X("column", e, t, r).offset;
|
|
506
|
+
},
|
|
507
|
+
getColumnStartIndexForOffset: function(e, t, r) {
|
|
508
|
+
return Ze("column", e, r, t);
|
|
509
|
+
},
|
|
510
|
+
getColumnStopIndexForStartIndex: function(e, t, r, i) {
|
|
511
|
+
for (var l = e.columnCount, a = e.width, c = X("column", e, t, i), d = r + a, v = c.offset + c.size, g = t; g < l - 1 && v < d; )
|
|
512
|
+
g++, v += X("column", e, g, i).size;
|
|
513
|
+
return g;
|
|
514
|
+
},
|
|
515
|
+
getColumnWidth: function(e, t, r) {
|
|
516
|
+
return r.columnMetadataMap[t].size;
|
|
517
|
+
},
|
|
518
|
+
getEstimatedTotalHeight: tt,
|
|
519
|
+
getEstimatedTotalWidth: rt,
|
|
520
|
+
getOffsetForColumnAndAlignment: function(e, t, r, i, l, a) {
|
|
521
|
+
return Xe("column", e, t, r, i, l, a);
|
|
522
|
+
},
|
|
523
|
+
getOffsetForRowAndAlignment: function(e, t, r, i, l, a) {
|
|
524
|
+
return Xe("row", e, t, r, i, l, a);
|
|
525
|
+
},
|
|
526
|
+
getRowOffset: function(e, t, r) {
|
|
527
|
+
return X("row", e, t, r).offset;
|
|
528
|
+
},
|
|
529
|
+
getRowHeight: function(e, t, r) {
|
|
530
|
+
return r.rowMetadataMap[t].size;
|
|
531
|
+
},
|
|
532
|
+
getRowStartIndexForOffset: function(e, t, r) {
|
|
533
|
+
return Ze("row", e, r, t);
|
|
534
|
+
},
|
|
535
|
+
getRowStopIndexForStartIndex: function(e, t, r, i) {
|
|
536
|
+
for (var l = e.rowCount, a = e.height, c = X("row", e, t, i), d = r + a, v = c.offset + c.size, g = t; g < l - 1 && v < d; )
|
|
537
|
+
g++, v += X("row", e, g, i).size;
|
|
538
|
+
return g;
|
|
539
|
+
},
|
|
540
|
+
initInstanceProps: function(e, t) {
|
|
541
|
+
var r = e, i = r.estimatedColumnWidth, l = r.estimatedRowHeight, a = {
|
|
542
|
+
columnMetadataMap: {},
|
|
543
|
+
estimatedColumnWidth: i || Ke,
|
|
544
|
+
estimatedRowHeight: l || Ke,
|
|
545
|
+
lastMeasuredColumnIndex: -1,
|
|
546
|
+
lastMeasuredRowIndex: -1,
|
|
547
|
+
rowMetadataMap: {}
|
|
548
|
+
};
|
|
549
|
+
return t.resetAfterColumnIndex = function(c, d) {
|
|
550
|
+
d === void 0 && (d = !0), t.resetAfterIndices({
|
|
551
|
+
columnIndex: c,
|
|
552
|
+
shouldForceUpdate: d
|
|
553
|
+
});
|
|
554
|
+
}, t.resetAfterRowIndex = function(c, d) {
|
|
555
|
+
d === void 0 && (d = !0), t.resetAfterIndices({
|
|
556
|
+
rowIndex: c,
|
|
557
|
+
shouldForceUpdate: d
|
|
558
|
+
});
|
|
559
|
+
}, t.resetAfterIndices = function(c) {
|
|
560
|
+
var d = c.columnIndex, v = c.rowIndex, g = c.shouldForceUpdate, C = g === void 0 ? !0 : g;
|
|
561
|
+
typeof d == "number" && (a.lastMeasuredColumnIndex = Math.min(a.lastMeasuredColumnIndex, d - 1)), typeof v == "number" && (a.lastMeasuredRowIndex = Math.min(a.lastMeasuredRowIndex, v - 1)), t._getItemStyleCache(-1), C && t.forceUpdate();
|
|
562
|
+
}, a;
|
|
563
|
+
},
|
|
564
|
+
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
565
|
+
validateProps: function(e) {
|
|
566
|
+
var t = e.columnWidth, r = e.rowHeight;
|
|
567
|
+
if (process.env.NODE_ENV !== "production") {
|
|
568
|
+
if (typeof t != "function")
|
|
569
|
+
throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (t === null ? "null" : typeof t) + '" was specified.'));
|
|
570
|
+
if (typeof r != "function")
|
|
571
|
+
throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
process.env.NODE_ENV;
|
|
576
|
+
function Ye(n, e) {
|
|
577
|
+
for (var t in n)
|
|
578
|
+
if (!(t in e))
|
|
579
|
+
return !0;
|
|
580
|
+
for (var r in e)
|
|
581
|
+
if (n[r] !== e[r])
|
|
582
|
+
return !0;
|
|
583
|
+
return !1;
|
|
584
|
+
}
|
|
585
|
+
var sr = ["style"], ar = ["style"];
|
|
586
|
+
function lr(n, e) {
|
|
587
|
+
var t = n.style, r = Ge(n, sr), i = e.style, l = Ge(e, ar);
|
|
588
|
+
return !Ye(t, i) && !Ye(r, l);
|
|
589
|
+
}
|
|
590
|
+
let q;
|
|
591
|
+
typeof window < "u" ? q = window : typeof self < "u" ? q = self : q = global;
|
|
592
|
+
let Pe = null, Fe = null;
|
|
593
|
+
const Je = 20, Oe = q.clearTimeout, Qe = q.setTimeout, We = q.cancelAnimationFrame || q.mozCancelAnimationFrame || q.webkitCancelAnimationFrame, et = q.requestAnimationFrame || q.mozRequestAnimationFrame || q.webkitRequestAnimationFrame;
|
|
594
|
+
We == null || et == null ? (Pe = Oe, Fe = function(e) {
|
|
595
|
+
return Qe(e, Je);
|
|
596
|
+
}) : (Pe = function([e, t]) {
|
|
597
|
+
We(e), Oe(t);
|
|
598
|
+
}, Fe = function(e) {
|
|
599
|
+
const t = et(function() {
|
|
600
|
+
Oe(r), e();
|
|
601
|
+
}), r = Qe(function() {
|
|
602
|
+
We(t), e();
|
|
603
|
+
}, Je);
|
|
604
|
+
return [t, r];
|
|
605
|
+
});
|
|
606
|
+
function cr(n) {
|
|
607
|
+
let e, t, r, i, l, a, c;
|
|
608
|
+
const d = typeof document < "u" && document.attachEvent;
|
|
609
|
+
if (!d) {
|
|
610
|
+
a = function(y) {
|
|
611
|
+
const S = y.__resizeTriggers__, b = S.firstElementChild, W = S.lastElementChild, o = b.firstElementChild;
|
|
612
|
+
W.scrollLeft = W.scrollWidth, W.scrollTop = W.scrollHeight, o.style.width = b.offsetWidth + 1 + "px", o.style.height = b.offsetHeight + 1 + "px", b.scrollLeft = b.scrollWidth, b.scrollTop = b.scrollHeight;
|
|
613
|
+
}, l = function(y) {
|
|
614
|
+
return y.offsetWidth !== y.__resizeLast__.width || y.offsetHeight !== y.__resizeLast__.height;
|
|
615
|
+
}, c = function(y) {
|
|
616
|
+
if (y.target.className && typeof y.target.className.indexOf == "function" && y.target.className.indexOf("contract-trigger") < 0 && y.target.className.indexOf("expand-trigger") < 0)
|
|
617
|
+
return;
|
|
618
|
+
const S = this;
|
|
619
|
+
a(this), this.__resizeRAF__ && Pe(this.__resizeRAF__), this.__resizeRAF__ = Fe(function() {
|
|
620
|
+
l(S) && (S.__resizeLast__.width = S.offsetWidth, S.__resizeLast__.height = S.offsetHeight, S.__resizeListeners__.forEach(function(o) {
|
|
621
|
+
o.call(S, y);
|
|
622
|
+
}));
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
let s = !1, m = "";
|
|
626
|
+
r = "animationstart";
|
|
627
|
+
const O = "Webkit Moz O ms".split(" ");
|
|
628
|
+
let _ = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), N = "";
|
|
629
|
+
{
|
|
630
|
+
const y = document.createElement("fakeelement");
|
|
631
|
+
if (y.style.animationName !== void 0 && (s = !0), s === !1) {
|
|
632
|
+
for (let S = 0; S < O.length; S++)
|
|
633
|
+
if (y.style[O[S] + "AnimationName"] !== void 0) {
|
|
634
|
+
N = O[S], m = "-" + N.toLowerCase() + "-", r = _[S], s = !0;
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
t = "resizeanim", e = "@" + m + "keyframes " + t + " { from { opacity: 0; } to { opacity: 0; } } ", i = m + "animation: 1ms " + t + "; ";
|
|
640
|
+
}
|
|
641
|
+
const v = function(s) {
|
|
642
|
+
if (!s.getElementById("detectElementResize")) {
|
|
643
|
+
const m = (e || "") + ".resize-triggers { " + (i || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', O = s.head || s.getElementsByTagName("head")[0], _ = s.createElement("style");
|
|
644
|
+
_.id = "detectElementResize", _.type = "text/css", n != null && _.setAttribute("nonce", n), _.styleSheet ? _.styleSheet.cssText = m : _.appendChild(s.createTextNode(m)), O.appendChild(_);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
return {
|
|
648
|
+
addResizeListener: function(s, m) {
|
|
649
|
+
if (d)
|
|
650
|
+
s.attachEvent("onresize", m);
|
|
651
|
+
else {
|
|
652
|
+
if (!s.__resizeTriggers__) {
|
|
653
|
+
const O = s.ownerDocument, _ = q.getComputedStyle(s);
|
|
654
|
+
_ && _.position === "static" && (s.style.position = "relative"), v(O), s.__resizeLast__ = {}, s.__resizeListeners__ = [], (s.__resizeTriggers__ = O.createElement("div")).className = "resize-triggers";
|
|
655
|
+
const N = O.createElement("div");
|
|
656
|
+
N.className = "expand-trigger", N.appendChild(O.createElement("div"));
|
|
657
|
+
const y = O.createElement("div");
|
|
658
|
+
y.className = "contract-trigger", s.__resizeTriggers__.appendChild(N), s.__resizeTriggers__.appendChild(y), s.appendChild(s.__resizeTriggers__), a(s), s.addEventListener("scroll", c, !0), r && (s.__resizeTriggers__.__animationListener__ = function(b) {
|
|
659
|
+
b.animationName === t && a(s);
|
|
660
|
+
}, s.__resizeTriggers__.addEventListener(r, s.__resizeTriggers__.__animationListener__));
|
|
661
|
+
}
|
|
662
|
+
s.__resizeListeners__.push(m);
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
removeResizeListener: function(s, m) {
|
|
666
|
+
if (d)
|
|
667
|
+
s.detachEvent("onresize", m);
|
|
668
|
+
else if (s.__resizeListeners__.splice(s.__resizeListeners__.indexOf(m), 1), !s.__resizeListeners__.length) {
|
|
669
|
+
s.removeEventListener("scroll", c, !0), s.__resizeTriggers__.__animationListener__ && (s.__resizeTriggers__.removeEventListener(r, s.__resizeTriggers__.__animationListener__), s.__resizeTriggers__.__animationListener__ = null);
|
|
670
|
+
try {
|
|
671
|
+
s.__resizeTriggers__ = !s.removeChild(s.__resizeTriggers__);
|
|
672
|
+
} catch {
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
class ur extends pt {
|
|
679
|
+
constructor(...e) {
|
|
680
|
+
super(...e), this.state = {
|
|
681
|
+
height: this.props.defaultHeight || 0,
|
|
682
|
+
width: this.props.defaultWidth || 0
|
|
683
|
+
}, this._autoSizer = null, this._detectElementResize = null, this._didLogDeprecationWarning = !1, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
|
|
684
|
+
this._timeoutId = null;
|
|
685
|
+
const {
|
|
686
|
+
disableHeight: t,
|
|
687
|
+
disableWidth: r,
|
|
688
|
+
onResize: i
|
|
689
|
+
} = this.props;
|
|
690
|
+
if (this._parentNode) {
|
|
691
|
+
const l = window.getComputedStyle(this._parentNode) || {}, a = parseFloat(l.paddingLeft || "0"), c = parseFloat(l.paddingRight || "0"), d = parseFloat(l.paddingTop || "0"), v = parseFloat(l.paddingBottom || "0"), g = this._parentNode.getBoundingClientRect(), C = g.height - d - v, s = g.width - a - c;
|
|
692
|
+
if (!t && this.state.height !== C || !r && this.state.width !== s) {
|
|
693
|
+
this.setState({
|
|
694
|
+
height: C,
|
|
695
|
+
width: s
|
|
696
|
+
});
|
|
697
|
+
const m = () => {
|
|
698
|
+
this._didLogDeprecationWarning || (this._didLogDeprecationWarning = !0, console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"));
|
|
699
|
+
};
|
|
700
|
+
typeof i == "function" && i({
|
|
701
|
+
height: C,
|
|
702
|
+
width: s,
|
|
703
|
+
// TODO Remove these params in the next major release
|
|
704
|
+
get scaledHeight() {
|
|
705
|
+
return m(), C;
|
|
706
|
+
},
|
|
707
|
+
get scaledWidth() {
|
|
708
|
+
return m(), s;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}, this._setRef = (t) => {
|
|
714
|
+
this._autoSizer = t;
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
componentDidMount() {
|
|
718
|
+
const {
|
|
719
|
+
nonce: e
|
|
720
|
+
} = this.props, t = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
721
|
+
if (t != null && t.ownerDocument && t.ownerDocument.defaultView && t instanceof t.ownerDocument.defaultView.HTMLElement) {
|
|
722
|
+
this._parentNode = t;
|
|
723
|
+
const r = t.ownerDocument.defaultView.ResizeObserver;
|
|
724
|
+
r != null ? (this._resizeObserver = new r(() => {
|
|
725
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
726
|
+
}), this._resizeObserver.observe(t)) : (this._detectElementResize = cr(e), this._detectElementResize.addResizeListener(t, this._onResize)), this._onResize();
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
componentWillUnmount() {
|
|
730
|
+
this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
|
|
731
|
+
}
|
|
732
|
+
render() {
|
|
733
|
+
const {
|
|
734
|
+
children: e,
|
|
735
|
+
defaultHeight: t,
|
|
736
|
+
defaultWidth: r,
|
|
737
|
+
disableHeight: i = !1,
|
|
738
|
+
disableWidth: l = !1,
|
|
739
|
+
doNotBailOutOnEmptyChildren: a = !1,
|
|
740
|
+
nonce: c,
|
|
741
|
+
onResize: d,
|
|
742
|
+
style: v = {},
|
|
743
|
+
tagName: g = "div",
|
|
744
|
+
...C
|
|
745
|
+
} = this.props, {
|
|
746
|
+
height: s,
|
|
747
|
+
width: m
|
|
748
|
+
} = this.state, O = {
|
|
749
|
+
overflow: "visible"
|
|
750
|
+
}, _ = {};
|
|
751
|
+
let N = !1;
|
|
752
|
+
return i || (s === 0 && (N = !0), O.height = 0, _.height = s, _.scaledHeight = s), l || (m === 0 && (N = !0), O.width = 0, _.width = m, _.scaledWidth = m), a && (N = !1), pe(g, {
|
|
753
|
+
ref: this._setRef,
|
|
754
|
+
style: {
|
|
755
|
+
...O,
|
|
756
|
+
...v
|
|
757
|
+
},
|
|
758
|
+
...C
|
|
759
|
+
}, !N && e(_));
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
const dr = ht(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
|
|
763
|
+
const i = Ht(
|
|
764
|
+
e,
|
|
765
|
+
n,
|
|
766
|
+
t.columnCount,
|
|
767
|
+
t.isDualPageWithCover
|
|
768
|
+
);
|
|
769
|
+
if (i <= 0)
|
|
770
|
+
return null;
|
|
771
|
+
if (t.isDualPageWithCover) {
|
|
772
|
+
const a = i === t.totalPages && t.totalPages % 2 === 0;
|
|
773
|
+
if (e === 0 && i === 1 || a && n === 0) {
|
|
774
|
+
const d = t.columnWidths.reduce((v, g) => v + g, 0);
|
|
775
|
+
return /* @__PURE__ */ x(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
style: {
|
|
779
|
+
...r,
|
|
780
|
+
width: d,
|
|
781
|
+
display: "flex",
|
|
782
|
+
justifyContent: "center",
|
|
783
|
+
alignItems: "flex-start"
|
|
784
|
+
},
|
|
785
|
+
children: /* @__PURE__ */ x(be, { style: { position: "relative" }, pageNumber: i }, i)
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return t.columnCount === 2 ? /* @__PURE__ */ x(
|
|
791
|
+
"div",
|
|
792
|
+
{
|
|
793
|
+
style: {
|
|
794
|
+
...r,
|
|
795
|
+
display: "flex",
|
|
796
|
+
justifyContent: n === 0 ? "flex-end" : "flex-start",
|
|
797
|
+
alignItems: "flex-start"
|
|
798
|
+
},
|
|
799
|
+
children: /* @__PURE__ */ x(be, { style: { position: "relative" }, pageNumber: i }, i)
|
|
800
|
+
}
|
|
801
|
+
) : /* @__PURE__ */ x(be, { style: r, pageNumber: i }, i);
|
|
802
|
+
}, lr), en = () => {
|
|
803
|
+
const n = Z(new jt()), { initialPage: e = 1, initialScrollMode: t, instanceId: r } = Wt(), { pagesRef: i, setPagesRef: l, setContentRef: a } = At(), { scrollToPage: c } = _t();
|
|
804
|
+
Gt(i);
|
|
805
|
+
const {
|
|
806
|
+
virtualScrollRef: d,
|
|
807
|
+
getVirtualScrollRef: v,
|
|
808
|
+
getPageScrollElementRef: g,
|
|
809
|
+
getVirtualScrollableElementRef: C,
|
|
810
|
+
setTotalInnerDimensions: s,
|
|
811
|
+
virtualScrollableElementRef: m,
|
|
812
|
+
totalInnerDimensions: O,
|
|
813
|
+
pageScrollElementRef: _
|
|
814
|
+
} = vt(), N = Z(!0), { nextPage: y, prevPage: S, setFocusedPage: b, focusedPage: W, totalPages: o } = wt(), { scrollMode: f } = It(), { viewMode: u } = St(), p = Z(null), { loading: w, error: h } = Ct(), { passwordRequired: I } = kt(), { LoaderImageComponent: z } = Pt(), E = Z(
|
|
815
|
+
O
|
|
816
|
+
), T = Z({
|
|
817
|
+
viewMode: u,
|
|
818
|
+
scrollMode: f
|
|
819
|
+
}), L = Z(!1), R = Z(), { isFullScreen: P } = xt(), {
|
|
820
|
+
pageDimension: k,
|
|
821
|
+
rowCount: F,
|
|
822
|
+
rowHeight: D,
|
|
823
|
+
columnCount: H,
|
|
824
|
+
columnWidth: U,
|
|
825
|
+
estimatedColumnWidth: ee,
|
|
826
|
+
estimatedRowHeight: Q,
|
|
827
|
+
totalDimension: te
|
|
828
|
+
} = gt(), le = Nt(O, 100), { onScroll: j, onTextSelect: _e } = qt();
|
|
829
|
+
$t({ onTextSelect: _e, pagesRef: i });
|
|
830
|
+
const { zoomOriginRef: oe } = Bt(), Y = Z();
|
|
831
|
+
Dt(H, F, m, u);
|
|
832
|
+
const G = Z({
|
|
833
|
+
scrollTop: 0,
|
|
834
|
+
scrollLeft: 0
|
|
835
|
+
});
|
|
836
|
+
Ot(i);
|
|
837
|
+
const { isPressed: $ } = Lt(), { selectionMode: ce } = Mt(), { initializeGrabScroll: ue, resetGrabState: nt } = Et({
|
|
838
|
+
isPressed: $
|
|
839
|
+
}), ne = ye(() => ce === Tt.HAND, [ce]), it = ye(() => {
|
|
840
|
+
const M = Array.from({ length: H }, (A, B) => U(B));
|
|
841
|
+
return {
|
|
842
|
+
columnCount: H,
|
|
843
|
+
isDualPageWithCover: u === ze.DUAL_PAGE_WITH_COVER,
|
|
844
|
+
columnWidths: M,
|
|
845
|
+
totalPages: o
|
|
846
|
+
};
|
|
847
|
+
}, [H, u, U, o]), we = se(
|
|
848
|
+
(M) => {
|
|
849
|
+
const A = document.activeElement !== i;
|
|
850
|
+
!P && A || (["ArrowUp", "ArrowLeft"].includes(M.key) ? (M.preventDefault(), S()) : ["ArrowDown", "ArrowRight"].includes(M.key) && (M.preventDefault(), y()));
|
|
851
|
+
},
|
|
852
|
+
[y, S, P, f]
|
|
853
|
+
);
|
|
854
|
+
ae(() => (window.addEventListener("keydown", we), () => {
|
|
855
|
+
window.removeEventListener("keydown", we);
|
|
856
|
+
}), [we]), ke(() => {
|
|
857
|
+
p.current && (p.current.style.position = "relative"), d && d.resetAfterIndices({
|
|
858
|
+
columnIndex: 0,
|
|
859
|
+
rowIndex: 0,
|
|
860
|
+
shouldForceUpdate: !0
|
|
861
|
+
});
|
|
862
|
+
}, [F, H, k, d]);
|
|
863
|
+
const st = se(
|
|
864
|
+
(M, A) => {
|
|
865
|
+
if (!m)
|
|
866
|
+
return { scrollTop: 0, scrollLeft: 0 };
|
|
867
|
+
const B = G.current.scrollTop > A, K = G.current.scrollLeft > M;
|
|
868
|
+
return B || K ? G.current : {
|
|
869
|
+
scrollTop: m.scrollTop,
|
|
870
|
+
scrollLeft: m.scrollLeft
|
|
871
|
+
};
|
|
872
|
+
},
|
|
873
|
+
[m]
|
|
874
|
+
), De = se(
|
|
875
|
+
(M, A) => {
|
|
876
|
+
if (T.current.viewMode !== u || T.current.scrollMode !== f) {
|
|
877
|
+
Y.current && clearTimeout(Y.current), L.current = !0, c(W, "auto"), Y.current = setTimeout(() => {
|
|
878
|
+
requestAnimationFrame(() => {
|
|
879
|
+
T.current = { viewMode: u, scrollMode: f };
|
|
880
|
+
});
|
|
881
|
+
}, 100);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const K = M.scrollTop, ie = M.scrollLeft;
|
|
885
|
+
if (!A.height || !A.width)
|
|
886
|
+
return;
|
|
887
|
+
L.current = !0;
|
|
888
|
+
const { height: J, width: Ce } = A, { height: Se, width: He } = E.current;
|
|
889
|
+
if (Se === J && He === Ce)
|
|
890
|
+
return;
|
|
891
|
+
let Ie, Te;
|
|
892
|
+
const Re = oe.current;
|
|
893
|
+
if (Re && m) {
|
|
894
|
+
const de = m.getBoundingClientRect(), fe = J / Se - 1, ut = Re.x - de.left + ie, dt = Re.y - de.top + K;
|
|
895
|
+
Ie = Math.round(K + dt * fe) || 0, Te = Math.round(ie + ut * fe) || 0, oe.current = null;
|
|
896
|
+
} else {
|
|
897
|
+
const de = K / Se * J, fe = ie / He * Ce;
|
|
898
|
+
Ie = Math.round(Math.min(de, J)) || 0, Te = Math.round(Math.min(fe, Ce)) || 0;
|
|
899
|
+
}
|
|
900
|
+
m == null || m.scrollTo({
|
|
901
|
+
top: Ie,
|
|
902
|
+
left: Te,
|
|
903
|
+
behavior: "auto"
|
|
904
|
+
}), E.current = {
|
|
905
|
+
height: A.height,
|
|
906
|
+
width: A.width
|
|
907
|
+
};
|
|
908
|
+
},
|
|
909
|
+
[m, u, f, c, oe]
|
|
910
|
+
);
|
|
911
|
+
ke(() => {
|
|
912
|
+
clearTimeout(R.current);
|
|
913
|
+
const M = Array.from({ length: F }).reduce(
|
|
914
|
+
(K, ie, J) => K + D(J),
|
|
915
|
+
0
|
|
916
|
+
), A = Array.from({ length: H }).reduce(
|
|
917
|
+
(K, ie, J) => K + U(J),
|
|
918
|
+
0
|
|
919
|
+
), B = st(A, M);
|
|
920
|
+
G.current = B, De(B, { height: M, width: A }), s({
|
|
921
|
+
height: M,
|
|
922
|
+
width: A
|
|
923
|
+
});
|
|
924
|
+
}, [k, F, H, De]);
|
|
925
|
+
const at = se(
|
|
926
|
+
(M) => {
|
|
927
|
+
G.current = {
|
|
928
|
+
scrollTop: M.scrollTop,
|
|
929
|
+
scrollLeft: M.scrollLeft
|
|
930
|
+
};
|
|
931
|
+
},
|
|
932
|
+
[m]
|
|
933
|
+
);
|
|
934
|
+
ae(() => {
|
|
935
|
+
if (j)
|
|
936
|
+
return _ && _.addEventListener("scroll", j), m && m.addEventListener("scroll", j), () => {
|
|
937
|
+
_ == null || _.removeEventListener("scroll", j), m == null || m.removeEventListener("scroll", j);
|
|
938
|
+
};
|
|
939
|
+
}, [m, _, j]), ae(() => () => {
|
|
940
|
+
Y.current && clearTimeout(Y.current);
|
|
941
|
+
}, []);
|
|
942
|
+
const lt = ye(() => me(V["rp-pages-container"], {
|
|
943
|
+
[V["rp-cursor-grab"]]: ne && !$,
|
|
944
|
+
[V["rp-cursor-grabbing"]]: ne && $
|
|
945
|
+
}), [ne, $]), ct = se(
|
|
946
|
+
(M) => {
|
|
947
|
+
if (ne && M) {
|
|
948
|
+
const A = me(V["rp-pages"]), B = document.querySelector(`.${A}`);
|
|
949
|
+
ue(B);
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
[ne, ue, V]
|
|
953
|
+
);
|
|
954
|
+
return ae(() => {
|
|
955
|
+
w && nt();
|
|
956
|
+
}, [w]), ae(() => {
|
|
957
|
+
if (!(le.height === 0 || !N.current)) {
|
|
958
|
+
if (t === Le.PAGE_SCROLLING) {
|
|
959
|
+
e !== W && _ && b(e), N.current = !1;
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
c(e, "auto"), b(e), N.current = !1;
|
|
963
|
+
}
|
|
964
|
+
}, [
|
|
965
|
+
c,
|
|
966
|
+
t,
|
|
967
|
+
_,
|
|
968
|
+
b,
|
|
969
|
+
le
|
|
970
|
+
]), /* @__PURE__ */ xe(ft, { children: [
|
|
971
|
+
/* @__PURE__ */ x(Vt, { ref: a, children: /* @__PURE__ */ x(
|
|
972
|
+
Ut,
|
|
973
|
+
{
|
|
974
|
+
id: r,
|
|
975
|
+
ref: l,
|
|
976
|
+
tabIndex: -1,
|
|
977
|
+
className: lt,
|
|
978
|
+
style: {
|
|
979
|
+
"--scale-round-x": `${Ue(n.current.sx)[1]}px`,
|
|
980
|
+
"--scale-round-y": `${Ue(n.current.sy)[1]}px`
|
|
981
|
+
},
|
|
982
|
+
children: /* @__PURE__ */ x(ur, { style: { minHeight: "50px" }, children: ({ width: M, height: A }) => /* @__PURE__ */ x("div", { "data-rp": "pages", ref: ct, style: { width: M, height: A }, children: f === Le.PAGE_SCROLLING ? /* @__PURE__ */ x(
|
|
983
|
+
"div",
|
|
984
|
+
{
|
|
985
|
+
ref: g,
|
|
986
|
+
style: { width: M, height: A },
|
|
987
|
+
className: me(V["rp-pages"], V["rp-page-scrolling-wrapper"]),
|
|
988
|
+
children: u === ze.DUAL_PAGE ? /* @__PURE__ */ x(yt, { widths: U, heights: D }) : u === ze.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ x(bt, { widths: U, heights: D }) : /* @__PURE__ */ x(zt, { widths: U, heights: D })
|
|
989
|
+
}
|
|
990
|
+
) : Q ? /* @__PURE__ */ x(
|
|
991
|
+
ir,
|
|
992
|
+
{
|
|
993
|
+
ref: v,
|
|
994
|
+
itemData: it,
|
|
995
|
+
outerRef: C,
|
|
996
|
+
innerRef: p,
|
|
997
|
+
onScroll: at,
|
|
998
|
+
columnCount: H,
|
|
999
|
+
columnWidth: U,
|
|
1000
|
+
rowHeight: D,
|
|
1001
|
+
height: A,
|
|
1002
|
+
width: M,
|
|
1003
|
+
estimatedColumnWidth: ee,
|
|
1004
|
+
estimatedRowHeight: Q,
|
|
1005
|
+
rowCount: F,
|
|
1006
|
+
className: me(
|
|
1007
|
+
V["rp-pages"],
|
|
1008
|
+
f === Le.HORIZONTAL_SCROLLING ? V["rp-pages-horizontal-scroll"] : ""
|
|
1009
|
+
),
|
|
1010
|
+
style: {
|
|
1011
|
+
"--rp-pages-height": `${te.height}px`,
|
|
1012
|
+
"--rp-pages-width": `${te.width}px`,
|
|
1013
|
+
"--rp-row-count": `${F}`,
|
|
1014
|
+
"--rp-column-count": `${H}`
|
|
1015
|
+
},
|
|
1016
|
+
children: dr
|
|
1017
|
+
}
|
|
1018
|
+
) : !w && !h ? /* @__PURE__ */ x(
|
|
1019
|
+
"div",
|
|
1020
|
+
{
|
|
1021
|
+
className: V["rp-loader"],
|
|
1022
|
+
style: {
|
|
1023
|
+
display: "flex",
|
|
1024
|
+
justifyContent: "center",
|
|
1025
|
+
alignItems: "center",
|
|
1026
|
+
height: "100%",
|
|
1027
|
+
width: "100%"
|
|
1028
|
+
},
|
|
1029
|
+
children: z && /* @__PURE__ */ x(z, {})
|
|
1030
|
+
}
|
|
1031
|
+
) : h === Rt.NOT_SUPPORTED ? /* @__PURE__ */ x("div", { className: V["rp-not-supported"], children: /* @__PURE__ */ xe("div", { className: V["rp-not-supported-content"], children: [
|
|
1032
|
+
"React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
|
|
1033
|
+
/* @__PURE__ */ x("div", { children: /* @__PURE__ */ xe("ul", { children: [
|
|
1034
|
+
/* @__PURE__ */ x("li", { children: "Chrome 126+" }),
|
|
1035
|
+
/* @__PURE__ */ x("li", { children: "Edge 126+" }),
|
|
1036
|
+
/* @__PURE__ */ x("li", { children: "Firefox 126+" }),
|
|
1037
|
+
/* @__PURE__ */ x("li", { children: "Safari 18.4+" }),
|
|
1038
|
+
/* @__PURE__ */ x("li", { children: "Safari iOS 18.4+" }),
|
|
1039
|
+
/* @__PURE__ */ x("li", { children: "Chrome Android 126+" })
|
|
1040
|
+
] }) })
|
|
1041
|
+
] }) }) : null }) })
|
|
1042
|
+
}
|
|
1043
|
+
) }),
|
|
1044
|
+
I && /* @__PURE__ */ x(Ft, {})
|
|
1045
|
+
] });
|
|
1046
|
+
};
|
|
1047
|
+
export {
|
|
1048
|
+
en as RPPages
|
|
1049
|
+
};
|