@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,24 @@
|
|
|
1
|
+
import { SCROLL_BAR_WIDTH as a, PAGE_PADDING as f } from "./constants.js";
|
|
2
|
+
import { ViewMode as A, ZoomLevel as r } from "./types.js";
|
|
3
|
+
import "../de_DE-a553b162.js";
|
|
4
|
+
const E = (o, t, _, e, c, m) => {
|
|
5
|
+
if (typeof o == "number")
|
|
6
|
+
return o;
|
|
7
|
+
const n = m === A.DUAL_PAGE || m === A.DUAL_PAGE_WITH_COVER ? 2 * e : e;
|
|
8
|
+
switch (o) {
|
|
9
|
+
case r.PAGE_FIT:
|
|
10
|
+
const s = Math.min(
|
|
11
|
+
(t - a) / n,
|
|
12
|
+
(_ - f) / c
|
|
13
|
+
);
|
|
14
|
+
return Math.floor(s * 100);
|
|
15
|
+
case r.PAGE_WIDTH:
|
|
16
|
+
return Math.floor((t - a) / n * 100);
|
|
17
|
+
case r.ACTUAL:
|
|
18
|
+
default:
|
|
19
|
+
return 100;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
E as getZoomLevel
|
|
24
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { getCharacterType as D } from "./charators.js";
|
|
2
|
+
function _(r, c, m, i) {
|
|
3
|
+
const s = [];
|
|
4
|
+
for (const n of r) {
|
|
5
|
+
const o = y(c, n, i);
|
|
6
|
+
s.push(...R(o, c, m));
|
|
7
|
+
}
|
|
8
|
+
return s;
|
|
9
|
+
}
|
|
10
|
+
const L = (r, c) => {
|
|
11
|
+
const m = ["g"];
|
|
12
|
+
c.matchCase || m.push("i");
|
|
13
|
+
let s = r.replace(/[.^$*+?()[{|\\]/g, (n) => `\\${n}`).trim();
|
|
14
|
+
return new RegExp(s, m.join(""));
|
|
15
|
+
};
|
|
16
|
+
function y(r, c, m) {
|
|
17
|
+
const i = [];
|
|
18
|
+
for (const t of r.items)
|
|
19
|
+
if (t.hasEOL)
|
|
20
|
+
if (t.str.endsWith("-")) {
|
|
21
|
+
const d = t.str.lastIndexOf("-");
|
|
22
|
+
i.push(t.str.substring(0, d));
|
|
23
|
+
} else
|
|
24
|
+
i.push(t.str, `
|
|
25
|
+
`);
|
|
26
|
+
else
|
|
27
|
+
i.push(t.str);
|
|
28
|
+
const s = i.join("").replace(/\n/g, " ");
|
|
29
|
+
let n;
|
|
30
|
+
c instanceof RegExp ? n = c.flags.indexOf("g") === -1 ? new RegExp(c, `${c.flags}g`) : c : n = L(c, m);
|
|
31
|
+
const o = [];
|
|
32
|
+
let e;
|
|
33
|
+
for (; (e = n.exec(s)) !== null; )
|
|
34
|
+
m.wholeWords && !W(s, e.index, e[0].length) || o.push([e.index, e[0].length, e[0]]);
|
|
35
|
+
return o;
|
|
36
|
+
}
|
|
37
|
+
function R(r, c, m) {
|
|
38
|
+
function i(d) {
|
|
39
|
+
return d.hasEOL ? d.str.endsWith("-") ? -1 : 1 : 0;
|
|
40
|
+
}
|
|
41
|
+
let s = 0, n = 0;
|
|
42
|
+
const o = c.items, e = o.length - 1, t = [];
|
|
43
|
+
for (let d = 0; d < r.length; d++) {
|
|
44
|
+
let h = r[d][0];
|
|
45
|
+
for (; s !== e && h >= n + o[s].str.length; ) {
|
|
46
|
+
const x = o[s];
|
|
47
|
+
n += x.str.length + i(x), s++;
|
|
48
|
+
}
|
|
49
|
+
const g = {
|
|
50
|
+
idx: s,
|
|
51
|
+
offset: h - n
|
|
52
|
+
};
|
|
53
|
+
for (h += r[d][1]; s !== e && h > n + o[s].str.length; ) {
|
|
54
|
+
const x = o[s];
|
|
55
|
+
n += x.str.length + i(x), s++;
|
|
56
|
+
}
|
|
57
|
+
const l = {
|
|
58
|
+
idx: s,
|
|
59
|
+
offset: h - n
|
|
60
|
+
};
|
|
61
|
+
t.push({
|
|
62
|
+
start: g,
|
|
63
|
+
end: l,
|
|
64
|
+
str: r[d][2],
|
|
65
|
+
oIndex: r[d][0],
|
|
66
|
+
pageIndex: m,
|
|
67
|
+
rect: { left: 0, bottom: 0, width: 0, height: 0 },
|
|
68
|
+
rects: []
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
for (const d of t) {
|
|
72
|
+
const h = [];
|
|
73
|
+
for (let g = d.start.idx; g <= d.end.idx; g++) {
|
|
74
|
+
const l = o[g], x = l.transform[4], C = l.transform[5], a = l.str.length > 0 ? l.width / l.str.length : 0, M = g === d.start.idx ? d.start.offset : 0, N = g === d.end.idx ? d.end.offset : l.str.length, f = x + M * a, E = (N - M) * a, u = (c.styles ?? {})[l.fontName], T = (u == null ? void 0 : u.ascent) ?? 1, v = (u == null ? void 0 : u.descent) != null ? Math.abs(u.descent) : 1 - T, b = C - v * l.height;
|
|
75
|
+
(E > 0 || l.height > 0) && h.push({
|
|
76
|
+
left: f,
|
|
77
|
+
bottom: b,
|
|
78
|
+
width: E,
|
|
79
|
+
height: l.height
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
d.rect = h[0], d.rects = h;
|
|
83
|
+
}
|
|
84
|
+
return t;
|
|
85
|
+
}
|
|
86
|
+
function W(r, c, m) {
|
|
87
|
+
let i = r.slice(0, c).match(/([^\p{M}])\p{M}*$/u);
|
|
88
|
+
if (i) {
|
|
89
|
+
const s = r.charCodeAt(c), n = i[1].charCodeAt(0);
|
|
90
|
+
if (D(s) === D(n))
|
|
91
|
+
return !1;
|
|
92
|
+
}
|
|
93
|
+
if (i = r.slice(c + m).match(/^\p{M}*([^\p{M}])/u), i) {
|
|
94
|
+
const s = r.charCodeAt(c + m - 1), n = i[1].charCodeAt(0);
|
|
95
|
+
if (D(s) === D(n))
|
|
96
|
+
return !1;
|
|
97
|
+
}
|
|
98
|
+
return !0;
|
|
99
|
+
}
|
|
100
|
+
function I(r, c, m) {
|
|
101
|
+
const i = [];
|
|
102
|
+
function s(n, o, e = -1, t = -1, d = "") {
|
|
103
|
+
const h = c.items[n], g = [];
|
|
104
|
+
let l = "", x = "", C = "", a = m[n];
|
|
105
|
+
if (!a)
|
|
106
|
+
return;
|
|
107
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
108
|
+
const f = document.createElement("span");
|
|
109
|
+
a.before(f), f.append(a), m[n] = f, a = f;
|
|
110
|
+
}
|
|
111
|
+
e >= 0 && t >= 0 ? l = h.str.substring(e, t) : e < 0 && t < 0 ? l = h.str : e >= 0 ? l = h.str.substring(e) : t >= 0 && (l = h.str.substring(0, t));
|
|
112
|
+
const M = document.createTextNode(l), N = document.createElement("span");
|
|
113
|
+
if (N.className = "highlight appended " + d, N.setAttribute("data-match-index", `${o}`), N.append(M), g.push(N), i.push({ element: N, index: o }), e > 0)
|
|
114
|
+
if (a.childNodes.length === 1 && a.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
115
|
+
x = h.str.substring(0, e);
|
|
116
|
+
const f = document.createTextNode(x);
|
|
117
|
+
g.unshift(f);
|
|
118
|
+
} else {
|
|
119
|
+
let f = 0;
|
|
120
|
+
const E = [];
|
|
121
|
+
for (const p of a.childNodes) {
|
|
122
|
+
const u = p.nodeType === Node.TEXT_NODE ? p.nodeValue : p.firstChild.nodeValue;
|
|
123
|
+
f += u.length, f <= e ? E.push(p) : e >= f - u.length && t <= f && E.push(
|
|
124
|
+
document.createTextNode(
|
|
125
|
+
u.substring(0, e - (f - u.length))
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
g.unshift(...E);
|
|
130
|
+
}
|
|
131
|
+
if (t > 0) {
|
|
132
|
+
C = h.str.substring(t);
|
|
133
|
+
const f = document.createTextNode(C);
|
|
134
|
+
g.push(f);
|
|
135
|
+
}
|
|
136
|
+
a.replaceChildren(...g);
|
|
137
|
+
}
|
|
138
|
+
for (const [n, o] of r.entries())
|
|
139
|
+
if (o.start.idx === o.end.idx)
|
|
140
|
+
s(o.start.idx, n, o.start.offset, o.end.offset);
|
|
141
|
+
else
|
|
142
|
+
for (let e = o.start.idx, t = o.end.idx; e <= t; e++)
|
|
143
|
+
e === o.start.idx ? s(e, n, o.start.offset, -1, "begin") : e === o.end.idx ? s(e, n, -1, o.end.offset, "end") : s(e, n, -1, -1, "middle");
|
|
144
|
+
return i;
|
|
145
|
+
}
|
|
146
|
+
function V(r, c) {
|
|
147
|
+
const m = r.items.map((i) => i.str);
|
|
148
|
+
for (let i = 0; i < c.length; i++) {
|
|
149
|
+
const s = c[i];
|
|
150
|
+
if (s && s.nodeType !== Node.TEXT_NODE) {
|
|
151
|
+
const n = document.createTextNode(m[i]);
|
|
152
|
+
s.replaceChildren(n);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function H(r = {}) {
|
|
157
|
+
return { matchCase: !1, wholeWords: !1, ...r };
|
|
158
|
+
}
|
|
159
|
+
function S(r, c, m) {
|
|
160
|
+
const i = [];
|
|
161
|
+
function s(n, o, e = -1, t = -1, d) {
|
|
162
|
+
var f, E;
|
|
163
|
+
const h = c.items[n], g = [];
|
|
164
|
+
let l = "", x = "", C = "", a = m[n];
|
|
165
|
+
if (!a)
|
|
166
|
+
return;
|
|
167
|
+
e >= 0 && t >= 0 ? l = h.str.substring(e, t) : e < 0 && t < 0 ? l = h.str : e >= 0 ? l = h.str.substring(e) : t >= 0 && (l = h.str.substring(0, t));
|
|
168
|
+
const M = document.createTextNode(l), N = document.createElement("span");
|
|
169
|
+
if (N.style.background = d, N.append(M), g.push(N), e > 0)
|
|
170
|
+
if (a.childNodes.length === 1 && a.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
171
|
+
x = h.str.substring(0, e);
|
|
172
|
+
const p = document.createTextNode(x);
|
|
173
|
+
g.unshift(p);
|
|
174
|
+
} else {
|
|
175
|
+
let p = 0;
|
|
176
|
+
const u = [];
|
|
177
|
+
for (const T of a.childNodes) {
|
|
178
|
+
const v = T.nodeType === Node.TEXT_NODE ? T.nodeValue || "" : ((f = T.firstChild) == null ? void 0 : f.nodeValue) || "", b = v.length;
|
|
179
|
+
if (p += b, p <= e)
|
|
180
|
+
u.push(T);
|
|
181
|
+
else if (e >= p - b && t <= p) {
|
|
182
|
+
const w = v.substring(0, e - (p - b));
|
|
183
|
+
u.push(document.createTextNode(w));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
g.unshift(...u);
|
|
187
|
+
}
|
|
188
|
+
if (t > 0)
|
|
189
|
+
if (a.childNodes.length === 1 && a.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
190
|
+
C = h.str.substring(t);
|
|
191
|
+
const p = document.createTextNode(C);
|
|
192
|
+
g.push(p);
|
|
193
|
+
} else {
|
|
194
|
+
let p = 0;
|
|
195
|
+
const u = [];
|
|
196
|
+
for (const T of a.childNodes) {
|
|
197
|
+
p >= t && u.push(T);
|
|
198
|
+
const v = T.nodeType === Node.TEXT_NODE ? T.nodeValue || "" : ((E = T.firstChild) == null ? void 0 : E.nodeValue) || "", b = v.length;
|
|
199
|
+
if (p += b, p > t) {
|
|
200
|
+
const w = v.substring(t - (p - b));
|
|
201
|
+
w && u.push(document.createTextNode(w));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
u.length > 0 && g.push(...u);
|
|
205
|
+
}
|
|
206
|
+
a.replaceChildren(...g), i.push({ element: N, index: o });
|
|
207
|
+
}
|
|
208
|
+
for (const [n, o] of r.entries()) {
|
|
209
|
+
const { start: e, end: t, color: d } = o;
|
|
210
|
+
e.idx === t.idx && s(e.idx, n, e.offset, t.offset, d);
|
|
211
|
+
}
|
|
212
|
+
return i;
|
|
213
|
+
}
|
|
214
|
+
export {
|
|
215
|
+
_ as findMatches,
|
|
216
|
+
H as getHighlightOptionsWithDefaults,
|
|
217
|
+
I as highlightMatches,
|
|
218
|
+
S as highlightMultipleColorMatches,
|
|
219
|
+
W as isMatchEntireWord,
|
|
220
|
+
V as resetDivs
|
|
221
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useRef as s, useCallback as l } from "react";
|
|
2
|
+
const v = () => {
|
|
3
|
+
const a = s({ value: 1 }), o = l((c, u) => {
|
|
4
|
+
if (u === 1)
|
|
5
|
+
return 1;
|
|
6
|
+
const t = a.current;
|
|
7
|
+
(t.value > 1 && u < 1 || t.value < 1 && u > 1) && (t.value = 1);
|
|
8
|
+
const r = t.value * u, e = Math.floor(c * r * 100) / (100 * c);
|
|
9
|
+
return e !== 0 && (t.value = r / e), e;
|
|
10
|
+
}, []), n = l(() => {
|
|
11
|
+
a.current.value = 1;
|
|
12
|
+
}, []);
|
|
13
|
+
return { accumulate: o, reset: n };
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
v as useAccumulateFactor
|
|
17
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useRef as o, useEffect as i } from "react";
|
|
2
|
+
const s = /[\x00-\x1F]/g;
|
|
3
|
+
let c = null, r = null;
|
|
4
|
+
function d(e) {
|
|
5
|
+
return c || (c = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, r = /* @__PURE__ */ new Map([["ſt", "ſt"]])), e.replace(
|
|
6
|
+
c,
|
|
7
|
+
(f, u, t) => u ? u.normalize("NFKC") : (r == null ? void 0 : r.get(t)) || ""
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
function p(e, f = !1) {
|
|
11
|
+
return s.test(e) ? f ? e.replace(s, (u) => u === "\0" ? "" : " ") : e.replace(/\x00/g, "") : e;
|
|
12
|
+
}
|
|
13
|
+
const x = (e) => {
|
|
14
|
+
const f = o(!1), u = o(null);
|
|
15
|
+
i(() => {
|
|
16
|
+
if (!e || f.current)
|
|
17
|
+
return;
|
|
18
|
+
const t = (n) => {
|
|
19
|
+
var l;
|
|
20
|
+
const b = document.getSelection();
|
|
21
|
+
if (!b)
|
|
22
|
+
return;
|
|
23
|
+
const a = b.toString();
|
|
24
|
+
a && ((l = n.clipboardData) == null || l.setData(
|
|
25
|
+
"text/plain",
|
|
26
|
+
p(d(a))
|
|
27
|
+
), n.preventDefault(), n.stopPropagation());
|
|
28
|
+
};
|
|
29
|
+
return e.addEventListener("copy", t), u.current = e, f.current = !0, () => {
|
|
30
|
+
u.current && (u.current.removeEventListener("copy", t), f.current = !1);
|
|
31
|
+
};
|
|
32
|
+
}, [e]);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
x as useCopyText
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState as i, useRef as l, useEffect as f } from "react";
|
|
2
|
+
function T(t, u, r) {
|
|
3
|
+
const [c, n] = i(t), e = l(null);
|
|
4
|
+
return f(() => {
|
|
5
|
+
const o = t;
|
|
6
|
+
r && !e.current && (e.current = setTimeout(() => {
|
|
7
|
+
n(o), e.current = null;
|
|
8
|
+
}, r));
|
|
9
|
+
const s = setTimeout(() => {
|
|
10
|
+
e.current && (clearTimeout(e.current), e.current = null), n(t);
|
|
11
|
+
}, u);
|
|
12
|
+
return () => {
|
|
13
|
+
clearTimeout(s);
|
|
14
|
+
};
|
|
15
|
+
}, [t, u, r]), c;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
T as useDebounce
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as a } from "react";
|
|
2
|
+
import d from "./useResizeObserver.js";
|
|
3
|
+
const S = (c) => {
|
|
4
|
+
const [h, u] = a({ width: 0, height: 0 });
|
|
5
|
+
return d(c, (z) => {
|
|
6
|
+
const e = z[0];
|
|
7
|
+
if (e) {
|
|
8
|
+
const t = e.contentBoxSize;
|
|
9
|
+
let i = 0, o = 0;
|
|
10
|
+
if (t) {
|
|
11
|
+
const n = Array.isArray(t) ? t : [t];
|
|
12
|
+
i = n.reduce((r, { inlineSize: s }) => r + s, 0), o = n.reduce((r, { blockSize: s }) => r + s, 0);
|
|
13
|
+
} else
|
|
14
|
+
i = e.contentRect.width, o = e.contentRect.height;
|
|
15
|
+
u({ width: i, height: o });
|
|
16
|
+
}
|
|
17
|
+
}), { size: h };
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
S as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useDocumentContext as c } from "../../contexts/RPDocumentContext.js";
|
|
2
|
+
import { useCallback as a } from "react";
|
|
3
|
+
import { useDownloadContext as s } from "../../contexts/DownloadContext.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "./useLoadPdf.js";
|
|
6
|
+
import "pdfjs-dist";
|
|
7
|
+
import "../types.js";
|
|
8
|
+
import "../../de_DE-a553b162.js";
|
|
9
|
+
import "../getThumbnailViewport.js";
|
|
10
|
+
import "../../contexts/ConfigContext.js";
|
|
11
|
+
import "../../contexts/DocumentPasswordContext.js";
|
|
12
|
+
import "../appConsole.js";
|
|
13
|
+
import "./usePdfProperties.js";
|
|
14
|
+
import "../convertPdfDate.js";
|
|
15
|
+
import "../formatFileSize.js";
|
|
16
|
+
const i = ".pdf", d = (o) => URL.createObjectURL(o), l = async (o) => {
|
|
17
|
+
const r = await (await fetch(o)).blob();
|
|
18
|
+
return d(r);
|
|
19
|
+
}, k = () => {
|
|
20
|
+
const { filename: o, pdfSrc: e } = c(), { downloadFilename: r } = s(), m = (t) => {
|
|
21
|
+
const n = r || t;
|
|
22
|
+
return n.endsWith(i) ? n : `${n}${i}`;
|
|
23
|
+
};
|
|
24
|
+
return { download: a(async () => {
|
|
25
|
+
if (!o || !e)
|
|
26
|
+
throw new Error("There is no PDF source to download");
|
|
27
|
+
const t = document.createElement("a");
|
|
28
|
+
t.href = await l(e), t.download = m(o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
29
|
+
}, [o, e]) };
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
k as useFileDownload
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useRef as u, useCallback as g, useEffect as f } from "react";
|
|
2
|
+
const m = () => {
|
|
3
|
+
const i = u(null), a = u(/firefox/i.test(navigator.userAgent)), o = g(() => {
|
|
4
|
+
var c, d;
|
|
5
|
+
const s = document.getSelection();
|
|
6
|
+
if (!s || s.rangeCount === 0 || a.current)
|
|
7
|
+
return;
|
|
8
|
+
const t = s.getRangeAt(0), l = i.current && (t.compareBoundaryPoints(Range.END_TO_END, i.current) === 0 || t.compareBoundaryPoints(Range.START_TO_END, i.current) === 0);
|
|
9
|
+
let e = l ? t.startContainer : t.endContainer;
|
|
10
|
+
if ((e == null ? void 0 : e.nodeType) === Node.TEXT_NODE && (e = e.parentNode), !l && t.endOffset === 0)
|
|
11
|
+
do {
|
|
12
|
+
for (; !(e != null && e.previousSibling); )
|
|
13
|
+
e = e == null ? void 0 : e.parentNode;
|
|
14
|
+
e = e.previousSibling;
|
|
15
|
+
} while (!e.childNodes.length);
|
|
16
|
+
const n = (c = e == null ? void 0 : e.parentElement) == null ? void 0 : c.closest("[data-rp-text-layer]"), r = n == null ? void 0 : n.querySelector(".endOfContent");
|
|
17
|
+
r && (r.style.width = n.style.width, r.style.height = n.style.height, (d = e == null ? void 0 : e.parentElement) == null || d.insertBefore(r, l ? e : e.nextSibling)), i.current = t.cloneRange();
|
|
18
|
+
}, []);
|
|
19
|
+
f(() => (document == null || document.addEventListener("selectionchange", o), () => {
|
|
20
|
+
document == null || document.removeEventListener("selectionchange", o);
|
|
21
|
+
}), [o]);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
m as useFlickerSelectText
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useState as s, useCallback as n, useEffect as a } from "react";
|
|
2
|
+
const m = () => {
|
|
3
|
+
const [t, r] = s(!1), l = typeof document < "u" && (document.fullscreenEnabled || document.webkitFullscreenEnabled), c = n(async (e) => {
|
|
4
|
+
if (!document.fullscreenElement)
|
|
5
|
+
try {
|
|
6
|
+
await e.requestFullscreen();
|
|
7
|
+
} catch (o) {
|
|
8
|
+
console.error("Error attempting to enter fullscreen:", o);
|
|
9
|
+
}
|
|
10
|
+
}, []), u = n(async () => {
|
|
11
|
+
if (document.fullscreenElement)
|
|
12
|
+
try {
|
|
13
|
+
await document.exitFullscreen();
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.error("Error attempting to exit fullscreen:", e);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
return a(() => {
|
|
19
|
+
const e = () => {
|
|
20
|
+
r(!!document.fullscreenElement);
|
|
21
|
+
};
|
|
22
|
+
return document.addEventListener("fullscreenchange", e), () => {
|
|
23
|
+
document.removeEventListener("fullscreenchange", e);
|
|
24
|
+
};
|
|
25
|
+
}, []), { isFullScreen: t, enterFullScreen: c, exitFullScreen: u, isSupported: l };
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
m as useFullScreen
|
|
29
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useState as T, useRef as p, useCallback as c, useEffect as X } from "react";
|
|
2
|
+
const b = ({
|
|
3
|
+
isPressed: v,
|
|
4
|
+
scrollSpeed: i = 2
|
|
5
|
+
}) => {
|
|
6
|
+
const [L, f] = T("unset"), t = p(null), u = p({
|
|
7
|
+
startY: 0,
|
|
8
|
+
startX: 0,
|
|
9
|
+
startScrollTop: 0,
|
|
10
|
+
startScrollLeft: 0
|
|
11
|
+
}), o = c((r) => {
|
|
12
|
+
t.current && (u.current = {
|
|
13
|
+
startY: r.pageY,
|
|
14
|
+
startX: r.pageX,
|
|
15
|
+
startScrollTop: t.current.scrollTop,
|
|
16
|
+
startScrollLeft: t.current.scrollLeft
|
|
17
|
+
});
|
|
18
|
+
}, []), e = c(() => {
|
|
19
|
+
f("smooth");
|
|
20
|
+
}, []), s = c(
|
|
21
|
+
(r) => {
|
|
22
|
+
if (!v || !t.current)
|
|
23
|
+
return;
|
|
24
|
+
r.preventDefault(), f("unset");
|
|
25
|
+
const { startX: n, startY: a, startScrollTop: l, startScrollLeft: d } = u.current, h = (r.pageX - n) * i, w = (r.pageY - a) * i;
|
|
26
|
+
t.current.scrollTop = l - w, t.current.scrollLeft = d - h;
|
|
27
|
+
},
|
|
28
|
+
[v, i, t]
|
|
29
|
+
), S = c(
|
|
30
|
+
(r) => {
|
|
31
|
+
var n, a, l;
|
|
32
|
+
t.current && ((n = t.current) == null || n.removeEventListener("mousedown", o), (a = t.current) == null || a.removeEventListener("mouseup", e), (l = t.current) == null || l.removeEventListener("mousemove", s)), t.current = r, r && (r == null || r.addEventListener("mousedown", o, { capture: !0 }), r == null || r.addEventListener("mouseup", e), r == null || r.addEventListener("mousemove", s));
|
|
33
|
+
},
|
|
34
|
+
[o, e, s]
|
|
35
|
+
), E = c(() => {
|
|
36
|
+
u.current = {
|
|
37
|
+
...u.current,
|
|
38
|
+
startScrollTop: 0,
|
|
39
|
+
startScrollLeft: 0
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
return X(() => () => {
|
|
43
|
+
t.current && (t.current.removeEventListener("mousedown", o), t.current.removeEventListener("mouseup", e), t.current.removeEventListener("mousemove", s));
|
|
44
|
+
}, [o, e, s]), {
|
|
45
|
+
initializeGrabScroll: S,
|
|
46
|
+
scrollBehavior: L,
|
|
47
|
+
resetGrabState: E
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
b as useGrabScroll
|
|
52
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useState as m, useCallback as r, useEffect as C } from "react";
|
|
2
|
+
import { getHighlightOptionsWithDefaults as H, findMatches as M } from "../highlight.js";
|
|
3
|
+
import "../charators.js";
|
|
4
|
+
const k = (s) => {
|
|
5
|
+
const [n, c] = m(void 0), [f, l] = m([]), u = r(async (t) => {
|
|
6
|
+
if (!t)
|
|
7
|
+
return {};
|
|
8
|
+
const i = t.numPages, e = {};
|
|
9
|
+
for (let o = 1; o <= i; o++) {
|
|
10
|
+
const h = await t.getPage(o);
|
|
11
|
+
e[o.toString()] = await h.getTextContent();
|
|
12
|
+
}
|
|
13
|
+
return e;
|
|
14
|
+
}, []), p = r(async (t) => {
|
|
15
|
+
c(t);
|
|
16
|
+
}, []), g = r(() => {
|
|
17
|
+
l([]), c(void 0);
|
|
18
|
+
}, []);
|
|
19
|
+
return C(() => {
|
|
20
|
+
s && u(s).then((t) => {
|
|
21
|
+
let i = [];
|
|
22
|
+
for (const { keyword: e, highlightColor: o, options: h } of n) {
|
|
23
|
+
if (!e)
|
|
24
|
+
continue;
|
|
25
|
+
const y = H(h);
|
|
26
|
+
for (const a of Object.keys(t)) {
|
|
27
|
+
const b = M(
|
|
28
|
+
[e],
|
|
29
|
+
t[a],
|
|
30
|
+
Number(a) - 1,
|
|
31
|
+
y
|
|
32
|
+
).map((w, x) => ({
|
|
33
|
+
...w,
|
|
34
|
+
page: Number(a),
|
|
35
|
+
pageMatchIdx: x,
|
|
36
|
+
color: o,
|
|
37
|
+
keyword: e
|
|
38
|
+
}));
|
|
39
|
+
i = [...i, ...b];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
l(i);
|
|
43
|
+
}).catch(() => {
|
|
44
|
+
g();
|
|
45
|
+
});
|
|
46
|
+
}, [n, s, g, u]), {
|
|
47
|
+
highlight: p,
|
|
48
|
+
clear: g,
|
|
49
|
+
highlightMatches: f,
|
|
50
|
+
highlightKeywords: n
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
k as useHighlight
|
|
55
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback as l, useEffect as f } from "react";
|
|
2
|
+
const v = (s, c, h = {}) => {
|
|
3
|
+
const { distance: i = 10, loadFirst: t = !1 } = h, o = l(
|
|
4
|
+
(u) => {
|
|
5
|
+
if (!s)
|
|
6
|
+
return;
|
|
7
|
+
s.scrollHeight - s.clientHeight - s.scrollTop < i && c();
|
|
8
|
+
},
|
|
9
|
+
[c, s, i]
|
|
10
|
+
);
|
|
11
|
+
f(() => {
|
|
12
|
+
t && c();
|
|
13
|
+
}, [t]), f(() => (s == null || s.addEventListener("scroll", o), () => {
|
|
14
|
+
s == null || s.removeEventListener("scroll", o);
|
|
15
|
+
}), [o, s]);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
v as useInfiniteScroll
|
|
19
|
+
};
|