@react-pdf-kit/viewer 2.0.0-beta.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/LayoutWrapper-a871c161.js +19 -0
- package/dist/RotateTool.module-03987eba.js +6 -0
- package/dist/SearchCloseButton-cbf182aa.js +33 -0
- package/dist/ToolbarLayout.module-c588d36b.js +3411 -0
- package/dist/ZoomTool.module-6c5eabbb.js +12 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Container.css +1 -0
- package/dist/assets/DropDown.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/LayoutWrapper.css +1 -0
- package/dist/assets/LoaderIcon.css +1 -0
- package/dist/assets/MenuItem.css +1 -0
- package/dist/assets/MenuSeparator.css +1 -0
- package/dist/assets/PasswordModal.css +1 -0
- package/dist/assets/PropertyItem.css +1 -0
- package/dist/assets/RPDropFileZone.css +1 -0
- package/dist/assets/RPSplitter.css +1 -0
- package/dist/assets/RPTooltip.css +1 -0
- package/dist/assets/RotateTool.css +1 -0
- package/dist/assets/SearchCloseButton.css +1 -0
- package/dist/assets/ToolbarLayout.css +1 -0
- package/dist/assets/WrapperLayout.css +1 -0
- package/dist/assets/ZoomTool.css +1 -0
- package/dist/clsx-0c6e471a.js +22 -0
- package/dist/components/RPConfig.js +1492 -0
- package/dist/components/RPController.js +92 -0
- package/dist/components/RPDropFileZone.js +39 -0
- package/dist/components/RPPages.js +66 -0
- package/dist/components/RPProvider.js +27 -0
- package/dist/components/RPTheme.js +21 -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/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 +60 -0
- package/dist/components/layout/LayoutWrapper.js +6 -0
- package/dist/components/layout/RPDefaultLayout.js +16 -0
- package/dist/components/layout/RPLayout.js +107 -0
- package/dist/components/layout/WrapperLayout.js +13 -0
- package/dist/components/layout/sidebar/RPSidebar.js +15 -0
- package/dist/components/layout/sidebar/RPSplitter.js +61 -0
- package/dist/components/layout/sidebar/Thumbnail.js +59 -0
- package/dist/components/layout/sidebar/Thumbnails.js +8 -0
- package/dist/components/layout/toolbar/DarkModeTool.js +27 -0
- package/dist/components/layout/toolbar/DocumentDialog.js +59 -0
- package/dist/components/layout/toolbar/DocumentProperties.js +27 -0
- package/dist/components/layout/toolbar/FileDownloadTool.js +15 -0
- package/dist/components/layout/toolbar/FileUploadTool.js +25 -0
- package/dist/components/layout/toolbar/FullScreenTool.js +59 -0
- package/dist/components/layout/toolbar/MenuItem.js +12 -0
- package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
- package/dist/components/layout/toolbar/MostPageTool.js +60 -0
- package/dist/components/layout/toolbar/OtherTool.js +24 -0
- package/dist/components/layout/toolbar/Paginate.js +19 -0
- package/dist/components/layout/toolbar/PrintTool.js +15 -0
- package/dist/components/layout/toolbar/PropertyItem.js +12 -0
- package/dist/components/layout/toolbar/RPMenuItem.js +23 -0
- package/dist/components/layout/toolbar/RPMoreOptions.js +147 -0
- package/dist/components/layout/toolbar/RPToolbar.js +10 -0
- package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
- package/dist/components/layout/toolbar/RotateTool.js +36 -0
- package/dist/components/layout/toolbar/ScrollModeTool.js +56 -0
- package/dist/components/layout/toolbar/SearchCloseButton.js +9 -0
- package/dist/components/layout/toolbar/SearchResultNavigator.js +10 -0
- package/dist/components/layout/toolbar/SearchTool.js +61 -0
- package/dist/components/layout/toolbar/SelectionModeTool.js +40 -0
- package/dist/components/layout/toolbar/ThumbnailTool.js +17 -0
- package/dist/components/layout/toolbar/ToolbarCustom.js +95 -0
- package/dist/components/layout/toolbar/ToolbarDefault.js +97 -0
- package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +42 -0
- package/dist/components/layout/toolbar/ZoomTool.js +130 -0
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +28 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +13 -0
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +13 -0
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +21 -0
- package/dist/components/layout/toolbar/tools/InputPageTool.js +45 -0
- package/dist/components/layout/toolbar/tools/NextPageTool.js +72 -0
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -0
- package/dist/components/layout/toolbar/tools/PrintTool.js +13 -0
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +17 -0
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +25 -0
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -0
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +23 -0
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +28 -0
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +65 -0
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +28 -0
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +70 -0
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +16 -0
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +69 -0
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +78 -0
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +20 -0
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +26 -0
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +43 -0
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +30 -0
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +32 -0
- package/dist/components/page/AnnotationLayer.js +62 -0
- package/dist/components/page/CanvasLayer.js +58 -0
- package/dist/components/page/CustomElement.js +22 -0
- package/dist/components/page/DualPage.js +6 -0
- package/dist/components/page/RPPage.js +60 -0
- package/dist/components/page/SinglePage.js +6 -0
- package/dist/components/page/TextHighlightLayer.js +60 -0
- package/dist/components/page/TextLayer.js +60 -0
- package/dist/components/page/searchHighlight.js +37 -0
- package/dist/components/ui/Button.js +22 -0
- package/dist/components/ui/Checkbox.js +264 -0
- package/dist/components/ui/DropDown.js +29 -0
- package/dist/components/ui/Input.js +26 -0
- package/dist/components/ui/LoadingIndicator.js +7 -0
- package/dist/components/ui/PasswordModal.js +58 -0
- package/dist/components/ui/RPTooltip.js +568 -0
- package/dist/contexts/ConfigContext.js +13 -0
- package/dist/contexts/DarkModeContext.js +28 -0
- package/dist/contexts/DimensionPagesContext.js +42 -0
- package/dist/contexts/DocumentPasswordContext.js +40 -0
- package/dist/contexts/DownloadContext.js +21 -0
- package/dist/contexts/DropFileZoneContext.js +52 -0
- package/dist/contexts/ElementPageContext.js +76 -0
- package/dist/contexts/FileInputContext.js +39 -0
- package/dist/contexts/FullScreenContext.js +18 -0
- package/dist/contexts/GlobalCurrentPage.js +16 -0
- package/dist/contexts/HighlightContext.js +18 -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 +15 -0
- package/dist/contexts/LoaderContext.js +26 -0
- package/dist/contexts/LocalizationContext.js +38 -0
- package/dist/contexts/OtherToolContext.js +18 -0
- package/dist/contexts/PageViewportContext.js +8 -0
- package/dist/contexts/PagesRotateContext.js +25 -0
- package/dist/contexts/PaginationContext.js +11 -0
- package/dist/contexts/PrintContext.js +8 -0
- package/dist/contexts/RPDocumentContext.js +51 -0
- package/dist/contexts/RenderQueueProvider.js +10 -0
- package/dist/contexts/RenderedPagesCache.js +14 -0
- package/dist/contexts/RotationContext.js +28 -0
- package/dist/contexts/ScrollModeContext.js +21 -0
- package/dist/contexts/SearchContext.js +8 -0
- package/dist/contexts/SelectionModeContext.js +23 -0
- package/dist/contexts/SmoothScrollContext.js +12 -0
- package/dist/contexts/ThemeContext.js +7 -0
- package/dist/contexts/ThumbnailsContext.js +8 -0
- package/dist/contexts/ToolComponentContext.js +52 -0
- package/dist/contexts/ToolbarComponentContext.js +48 -0
- package/dist/contexts/ViewModeContext.js +28 -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 +97 -0
- package/dist/floating-ui.react-dom-6b2fe0df.js +1474 -0
- package/dist/index-35c7f4a2.js +332 -0
- package/dist/index-f563c6f0.js +1889 -0
- package/dist/main.js +86 -0
- package/dist/th_TH-d627cd51.js +398 -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/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 +14 -0
- package/dist/types/components/layout/LayoutWrapper.d.ts +12 -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/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 +8 -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 +3 -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/FileDownloadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FileUploadTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FullScreenTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/InputPageTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/tools/NextPageTool.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/ThemeSwitcherTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ThumbnailTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ZoomInTool.d.ts +3 -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/RPPage.d.ts +7 -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 +8 -0
- package/dist/types/components/ui/Checkbox.d.ts +9 -0
- package/dist/types/components/ui/DropDown.d.ts +10 -0
- package/dist/types/components/ui/Input.d.ts +8 -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 +11 -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/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 +16 -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/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/locales/en_US.json.d.ts +81 -0
- package/dist/types/locales/it_IT.json.d.ts +81 -0
- package/dist/types/locales/pt_PT.json.d.ts +81 -0
- package/dist/types/locales/th_TH.json.d.ts +81 -0
- package/dist/types/locales/zh_CN.json.d.ts +81 -0
- package/dist/types/main.d.ts +45 -0
- package/dist/types/utils/Queue.d.ts +18 -0
- package/dist/types/utils/annotations.d.ts +9 -0
- package/dist/types/utils/appConsole.d.ts +24 -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/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/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 +1 -0
- package/dist/types/utils/hooks/usePrint.d.ts +11 -0
- package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
- package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
- package/dist/types/utils/hooks/useRotate.d.ts +4 -0
- package/dist/types/utils/hooks/useScrollToPage.d.ts +3 -0
- package/dist/types/utils/hooks/useSearch.d.ts +14 -0
- package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
- package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +17 -0
- package/dist/types/utils/hooks/useWatermark.d.ts +1 -0
- package/dist/types/utils/link_service.d.ts +71 -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 +856 -0
- package/dist/types/utils/withRef.d.ts +4 -0
- package/dist/utils/Queue.js +47 -0
- package/dist/utils/annotations.js +306 -0
- package/dist/utils/appConsole.js +42 -0
- package/dist/utils/calculatePage.js +15 -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/getScrollDistance.js +4 -0
- package/dist/utils/getThumbnailViewport.js +7 -0
- package/dist/utils/getWordPositionInPage.js +25 -0
- package/dist/utils/getZoomLevel.js +23 -0
- package/dist/utils/highlight.js +221 -0
- package/dist/utils/hooks/useDarkMode.js +11 -0
- package/dist/utils/hooks/useDarkModeProps.js +11 -0
- package/dist/utils/hooks/useDebounce.js +19 -0
- package/dist/utils/hooks/useElementSize.js +21 -0
- package/dist/utils/hooks/useFileDownload.js +58 -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 +54 -0
- package/dist/utils/hooks/useInfiniteScroll.js +19 -0
- package/dist/utils/hooks/useLicense.js +110 -0
- package/dist/utils/hooks/useLoadPdf.js +77 -0
- package/dist/utils/hooks/useLoadWorker.js +13 -0
- package/dist/utils/hooks/useLocalization.js +25 -0
- package/dist/utils/hooks/useMousePressed.js +20 -0
- package/dist/utils/hooks/usePageRotateContext.js +26 -0
- package/dist/utils/hooks/usePaginate.js +60 -0
- package/dist/utils/hooks/usePdfProperties.js +37 -0
- package/dist/utils/hooks/usePinch.js +79 -0
- package/dist/utils/hooks/usePresentPage.js +60 -0
- package/dist/utils/hooks/usePrint.js +59 -0
- package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
- package/dist/utils/hooks/useResizeObserver.js +22 -0
- package/dist/utils/hooks/useRotate.js +13 -0
- package/dist/utils/hooks/useScrollToPage.js +62 -0
- package/dist/utils/hooks/useSearch.js +62 -0
- package/dist/utils/hooks/useThumbnail.js +59 -0
- package/dist/utils/hooks/useVirtualReactWindow.js +60 -0
- package/dist/utils/hooks/useWatermark.js +91 -0
- package/dist/utils/link_service.js +98 -0
- package/dist/utils/renderPage.js +17 -0
- package/dist/utils/sanitizeExternalUrl.js +16 -0
- package/dist/utils/smoothScrollTo.js +6 -0
- package/dist/utils/types.js +21 -0
- package/dist/utils/withRef.js +8 -0
- package/package.json +91 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { getCharacterType as X } from "./charators.js";
|
|
2
|
+
function V(r, c, a, i) {
|
|
3
|
+
const o = [];
|
|
4
|
+
for (const n of r) {
|
|
5
|
+
const s = y(c, n, i);
|
|
6
|
+
o.push(...I(s, c, a));
|
|
7
|
+
}
|
|
8
|
+
return o;
|
|
9
|
+
}
|
|
10
|
+
const D = (r, c) => {
|
|
11
|
+
const a = ["g"];
|
|
12
|
+
c.matchCase || a.push("i");
|
|
13
|
+
let o = r.replace(/[.^$*+?()[{|\\]/g, (n) => `\\${n}`).trim();
|
|
14
|
+
return new RegExp(o, a.join(""));
|
|
15
|
+
};
|
|
16
|
+
function y(r, c, a) {
|
|
17
|
+
const i = [];
|
|
18
|
+
for (const t of r.items)
|
|
19
|
+
if (t.hasEOL)
|
|
20
|
+
if (t.str.endsWith("-")) {
|
|
21
|
+
const l = t.str.lastIndexOf("-");
|
|
22
|
+
i.push(t.str.substring(0, l));
|
|
23
|
+
} else
|
|
24
|
+
i.push(t.str, `
|
|
25
|
+
`);
|
|
26
|
+
else
|
|
27
|
+
i.push(t.str);
|
|
28
|
+
const o = 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 = D(c, a);
|
|
31
|
+
const s = [];
|
|
32
|
+
let e;
|
|
33
|
+
for (; (e = n.exec(o)) !== null; )
|
|
34
|
+
a.wholeWords && !L(o, e.index, e[0].length) || s.push([e.index, e[0].length, e[0]]);
|
|
35
|
+
return s;
|
|
36
|
+
}
|
|
37
|
+
function I(r, c, a) {
|
|
38
|
+
function i(l) {
|
|
39
|
+
return l.hasEOL ? l.str.endsWith("-") ? -1 : 1 : 0;
|
|
40
|
+
}
|
|
41
|
+
let o = 0, n = 0;
|
|
42
|
+
const s = c.items, e = s.length - 1, t = [];
|
|
43
|
+
for (let l = 0; l < r.length; l++) {
|
|
44
|
+
let d = r[l][0];
|
|
45
|
+
for (; o !== e && d >= n + s[o].str.length; ) {
|
|
46
|
+
const f = s[o];
|
|
47
|
+
n += f.str.length + i(f), o++;
|
|
48
|
+
}
|
|
49
|
+
const p = {
|
|
50
|
+
idx: o,
|
|
51
|
+
offset: d - n
|
|
52
|
+
};
|
|
53
|
+
for (d += r[l][1]; o !== e && d > n + s[o].str.length; ) {
|
|
54
|
+
const f = s[o];
|
|
55
|
+
n += f.str.length + i(f), o++;
|
|
56
|
+
}
|
|
57
|
+
const m = {
|
|
58
|
+
idx: o,
|
|
59
|
+
offset: d - n
|
|
60
|
+
};
|
|
61
|
+
t.push({
|
|
62
|
+
start: p,
|
|
63
|
+
end: m,
|
|
64
|
+
str: r[l][2],
|
|
65
|
+
oIndex: r[l][0],
|
|
66
|
+
pageIndex: a,
|
|
67
|
+
rect: {
|
|
68
|
+
left: 0,
|
|
69
|
+
top: 0,
|
|
70
|
+
width: 0,
|
|
71
|
+
height: 0
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
for (const l of t) {
|
|
76
|
+
const d = s[l.start.idx], p = s[l.end.idx], m = d.transform[4], f = d.transform[5], E = m + d.width * l.start.offset / d.str.length, h = f, b = m + p.width * l.end.offset / p.str.length, N = f, u = {
|
|
77
|
+
left: Math.min(E, b),
|
|
78
|
+
top: Math.min(h, N),
|
|
79
|
+
width: Math.abs(b - E),
|
|
80
|
+
height: Math.max(d.height, p.height)
|
|
81
|
+
};
|
|
82
|
+
l.rect = u;
|
|
83
|
+
}
|
|
84
|
+
return t;
|
|
85
|
+
}
|
|
86
|
+
function L(r, c, a) {
|
|
87
|
+
let i = r.slice(0, c).match(/([^\p{M}])\p{M}*$/u);
|
|
88
|
+
if (i) {
|
|
89
|
+
const o = r.charCodeAt(c), n = i[1].charCodeAt(0);
|
|
90
|
+
if (X(o) === X(n))
|
|
91
|
+
return !1;
|
|
92
|
+
}
|
|
93
|
+
if (i = r.slice(c + a).match(/^\p{M}*([^\p{M}])/u), i) {
|
|
94
|
+
const o = r.charCodeAt(c + a - 1), n = i[1].charCodeAt(0);
|
|
95
|
+
if (X(o) === X(n))
|
|
96
|
+
return !1;
|
|
97
|
+
}
|
|
98
|
+
return !0;
|
|
99
|
+
}
|
|
100
|
+
function H(r, c, a) {
|
|
101
|
+
const i = [];
|
|
102
|
+
function o(n, s, e = -1, t = -1, l = "") {
|
|
103
|
+
const d = c.items[n], p = [];
|
|
104
|
+
let m = "", f = "", E = "", h = a[n];
|
|
105
|
+
if (!h)
|
|
106
|
+
return;
|
|
107
|
+
if (h.nodeType === Node.TEXT_NODE) {
|
|
108
|
+
const u = document.createElement("span");
|
|
109
|
+
h.before(u), u.append(h), a[n] = u, h = u;
|
|
110
|
+
}
|
|
111
|
+
e >= 0 && t >= 0 ? m = d.str.substring(e, t) : e < 0 && t < 0 ? m = d.str : e >= 0 ? m = d.str.substring(e) : t >= 0 && (m = d.str.substring(0, t));
|
|
112
|
+
const b = document.createTextNode(m), N = document.createElement("span");
|
|
113
|
+
if (N.className = "highlight appended " + l, N.setAttribute("data-match-index", `${s}`), N.append(b), p.push(N), i.push({ element: N, index: s }), e > 0)
|
|
114
|
+
if (h.childNodes.length === 1 && h.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
115
|
+
f = d.str.substring(0, e);
|
|
116
|
+
const u = document.createTextNode(f);
|
|
117
|
+
p.unshift(u);
|
|
118
|
+
} else {
|
|
119
|
+
let u = 0;
|
|
120
|
+
const C = [];
|
|
121
|
+
for (const g of h.childNodes) {
|
|
122
|
+
const x = g.nodeType === Node.TEXT_NODE ? g.nodeValue : g.firstChild.nodeValue;
|
|
123
|
+
u += x.length, u <= e ? C.push(g) : e >= u - x.length && t <= u && C.push(
|
|
124
|
+
document.createTextNode(
|
|
125
|
+
x.substring(0, e - (u - x.length))
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
p.unshift(...C);
|
|
130
|
+
}
|
|
131
|
+
if (t > 0) {
|
|
132
|
+
E = d.str.substring(t);
|
|
133
|
+
const u = document.createTextNode(E);
|
|
134
|
+
p.push(u);
|
|
135
|
+
}
|
|
136
|
+
h.replaceChildren(...p);
|
|
137
|
+
}
|
|
138
|
+
for (const [n, s] of r.entries())
|
|
139
|
+
if (s.start.idx === s.end.idx)
|
|
140
|
+
o(s.start.idx, n, s.start.offset, s.end.offset);
|
|
141
|
+
else
|
|
142
|
+
for (let e = s.start.idx, t = s.end.idx; e <= t; e++)
|
|
143
|
+
e === s.start.idx ? o(e, n, s.start.offset, -1, "begin") : e === s.end.idx ? o(e, n, -1, s.end.offset, "end") : o(e, n, -1, -1, "middle");
|
|
144
|
+
return i;
|
|
145
|
+
}
|
|
146
|
+
function R(r, c) {
|
|
147
|
+
const a = r.items.map((i) => i.str);
|
|
148
|
+
for (let i = 0; i < c.length; i++) {
|
|
149
|
+
const o = c[i];
|
|
150
|
+
if (o && o.nodeType !== Node.TEXT_NODE) {
|
|
151
|
+
const n = document.createTextNode(a[i]);
|
|
152
|
+
o.replaceChildren(n);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function W(r = {}) {
|
|
157
|
+
return { matchCase: !1, wholeWords: !1, ...r };
|
|
158
|
+
}
|
|
159
|
+
function A(r, c, a) {
|
|
160
|
+
const i = [];
|
|
161
|
+
function o(n, s, e = -1, t = -1, l) {
|
|
162
|
+
var u, C;
|
|
163
|
+
const d = c.items[n], p = [];
|
|
164
|
+
let m = "", f = "", E = "", h = a[n];
|
|
165
|
+
if (!h)
|
|
166
|
+
return;
|
|
167
|
+
e >= 0 && t >= 0 ? m = d.str.substring(e, t) : e < 0 && t < 0 ? m = d.str : e >= 0 ? m = d.str.substring(e) : t >= 0 && (m = d.str.substring(0, t));
|
|
168
|
+
const b = document.createTextNode(m), N = document.createElement("span");
|
|
169
|
+
if (N.style.background = l, N.append(b), p.push(N), e > 0)
|
|
170
|
+
if (h.childNodes.length === 1 && h.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
171
|
+
f = d.str.substring(0, e);
|
|
172
|
+
const g = document.createTextNode(f);
|
|
173
|
+
p.unshift(g);
|
|
174
|
+
} else {
|
|
175
|
+
let g = 0;
|
|
176
|
+
const x = [];
|
|
177
|
+
for (const T of h.childNodes) {
|
|
178
|
+
const v = T.nodeType === Node.TEXT_NODE ? T.nodeValue || "" : ((u = T.firstChild) == null ? void 0 : u.nodeValue) || "", M = v.length;
|
|
179
|
+
if (g += M, g <= e)
|
|
180
|
+
x.push(T);
|
|
181
|
+
else if (e >= g - M && t <= g) {
|
|
182
|
+
const w = v.substring(0, e - (g - M));
|
|
183
|
+
x.push(document.createTextNode(w));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
p.unshift(...x);
|
|
187
|
+
}
|
|
188
|
+
if (t > 0)
|
|
189
|
+
if (h.childNodes.length === 1 && h.childNodes[0].nodeType === Node.TEXT_NODE) {
|
|
190
|
+
E = d.str.substring(t);
|
|
191
|
+
const g = document.createTextNode(E);
|
|
192
|
+
p.push(g);
|
|
193
|
+
} else {
|
|
194
|
+
let g = 0;
|
|
195
|
+
const x = [];
|
|
196
|
+
for (const T of h.childNodes) {
|
|
197
|
+
g >= t && x.push(T);
|
|
198
|
+
const v = T.nodeType === Node.TEXT_NODE ? T.nodeValue || "" : ((C = T.firstChild) == null ? void 0 : C.nodeValue) || "", M = v.length;
|
|
199
|
+
if (g += M, g > t) {
|
|
200
|
+
const w = v.substring(t - (g - M));
|
|
201
|
+
w && x.push(document.createTextNode(w));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
x.length > 0 && p.push(...x);
|
|
205
|
+
}
|
|
206
|
+
h.replaceChildren(...p), i.push({ element: N, index: s });
|
|
207
|
+
}
|
|
208
|
+
for (const [n, s] of r.entries()) {
|
|
209
|
+
const { start: e, end: t, color: l } = s;
|
|
210
|
+
e.idx === t.idx && o(e.idx, n, e.offset, t.offset, l);
|
|
211
|
+
}
|
|
212
|
+
return i;
|
|
213
|
+
}
|
|
214
|
+
export {
|
|
215
|
+
V as findMatches,
|
|
216
|
+
W as getHighlightOptionsWithDefaults,
|
|
217
|
+
H as highlightMatches,
|
|
218
|
+
A as highlightMultipleColorMatches,
|
|
219
|
+
L as isMatchEntireWord,
|
|
220
|
+
R as resetDivs
|
|
221
|
+
};
|
|
@@ -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,58 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../contexts/RPDocumentContext.js";
|
|
4
|
+
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
+
import { b as io } from "../../ToolbarLayout.module-c588d36b.js";
|
|
6
|
+
import "../../contexts/DarkModeContext.js";
|
|
7
|
+
import "../../contexts/RotationContext.js";
|
|
8
|
+
import "../../contexts/LayerContext.js";
|
|
9
|
+
import "../../contexts/ZoomContext.js";
|
|
10
|
+
import "../../contexts/ViewModeContext.js";
|
|
11
|
+
import "../../contexts/ScrollModeContext.js";
|
|
12
|
+
import "../../contexts/VirtualScrollContext.js";
|
|
13
|
+
import "../../contexts/VirtualGridContext.js";
|
|
14
|
+
import "../../contexts/SelectionModeContext.js";
|
|
15
|
+
import "../../contexts/InitialStateContext.js";
|
|
16
|
+
import "../../contexts/FullScreenContext.js";
|
|
17
|
+
import "../../contexts/FileInputContext.js";
|
|
18
|
+
import "../../contexts/DropFileZoneContext.js";
|
|
19
|
+
import "../../contexts/LayoutContainerContext.js";
|
|
20
|
+
import "../../contexts/DimensionPagesContext.js";
|
|
21
|
+
import "../../contexts/LocalizationContext.js";
|
|
22
|
+
import "../../contexts/HighlightContext.js";
|
|
23
|
+
import "../../contexts/LicenseContext.js";
|
|
24
|
+
import "../../contexts/DownloadContext.js";
|
|
25
|
+
import "../../contexts/SmoothScrollContext.js";
|
|
26
|
+
import "../../contexts/ElementPageContext.js";
|
|
27
|
+
import "../../contexts/PagesRotateContext.js";
|
|
28
|
+
import "../../contexts/GlobalCurrentPage.js";
|
|
29
|
+
import "../../contexts/LoaderContext.js";
|
|
30
|
+
import "../../contexts/ToolComponentContext.js";
|
|
31
|
+
import "../../contexts/IconToolContext.js";
|
|
32
|
+
import "../../contexts/OtherToolContext.js";
|
|
33
|
+
import "../../components/RPConfig.js";
|
|
34
|
+
import "../../components/layout/Container.js";
|
|
35
|
+
import "../../contexts/ViewportContext.js";
|
|
36
|
+
import "../../contexts/ToolbarComponentContext.js";
|
|
37
|
+
import "../../components/layout/sidebar/RPSplitter.js";
|
|
38
|
+
import "../../components/layout/WrapperLayout.js";
|
|
39
|
+
import "../../LayoutWrapper-a871c161.js";
|
|
40
|
+
import "../../contexts/ThemeContext.js";
|
|
41
|
+
import "../../components/RPDropFileZone.js";
|
|
42
|
+
import "../../components/ui/Button.js";
|
|
43
|
+
import "../../SearchCloseButton-cbf182aa.js";
|
|
44
|
+
import "../../components/ui/Input.js";
|
|
45
|
+
import "../../components/ui/Checkbox.js";
|
|
46
|
+
import "../../components/icons/LoaderIcon.js";
|
|
47
|
+
import "../../contexts/IconContext.js";
|
|
48
|
+
import "../../components/ui/RPTooltip.js";
|
|
49
|
+
import "../../components/ui/DropDown.js";
|
|
50
|
+
import "../../ZoomTool.module-6c5eabbb.js";
|
|
51
|
+
import "../../components/layout/toolbar/MenuItem.js";
|
|
52
|
+
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
53
|
+
import "../dateFormatter.js";
|
|
54
|
+
import "../../components/layout/toolbar/PropertyItem.js";
|
|
55
|
+
import "../../RotateTool.module-03987eba.js";
|
|
56
|
+
export {
|
|
57
|
+
io as useFileDownload
|
|
58
|
+
};
|
|
@@ -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,54 @@
|
|
|
1
|
+
import { useState as l, useCallback as x, useEffect as C } from "react";
|
|
2
|
+
import { getHighlightOptionsWithDefaults as H, findMatches as M } from "../highlight.js";
|
|
3
|
+
const d = (i) => {
|
|
4
|
+
const [n, a] = l(void 0), [u, r] = l([]), f = x(async (t) => {
|
|
5
|
+
if (!t)
|
|
6
|
+
return {};
|
|
7
|
+
const s = t.numPages, e = {};
|
|
8
|
+
for (let o = 1; o <= s; o++) {
|
|
9
|
+
const g = await t.getPage(o);
|
|
10
|
+
e[o.toString()] = await g.getTextContent();
|
|
11
|
+
}
|
|
12
|
+
return e;
|
|
13
|
+
}, []), m = async (t) => {
|
|
14
|
+
a(t);
|
|
15
|
+
}, c = () => {
|
|
16
|
+
r([]), a(void 0);
|
|
17
|
+
};
|
|
18
|
+
return C(() => {
|
|
19
|
+
i && f(i).then((t) => {
|
|
20
|
+
let s = [];
|
|
21
|
+
for (const { keyword: e, highlightColor: o, options: g } of n) {
|
|
22
|
+
if (!e)
|
|
23
|
+
continue;
|
|
24
|
+
const p = H(g);
|
|
25
|
+
for (const h of Object.keys(t)) {
|
|
26
|
+
const y = M(
|
|
27
|
+
[e],
|
|
28
|
+
t[h],
|
|
29
|
+
Number(h) - 1,
|
|
30
|
+
p
|
|
31
|
+
).map((b, w) => ({
|
|
32
|
+
...b,
|
|
33
|
+
page: Number(h),
|
|
34
|
+
pageMatchIdx: w,
|
|
35
|
+
color: o,
|
|
36
|
+
keyword: e
|
|
37
|
+
}));
|
|
38
|
+
s = [...s, ...y];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
r(s);
|
|
42
|
+
}).catch(() => {
|
|
43
|
+
c();
|
|
44
|
+
});
|
|
45
|
+
}, [n, i]), {
|
|
46
|
+
highlight: m,
|
|
47
|
+
clear: c,
|
|
48
|
+
highlightMatches: u,
|
|
49
|
+
highlightKeywords: n
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
d as useHighlight
|
|
54
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
|
+
import { appConsole as l } from "../appConsole.js";
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2026-01-05T03:59:23.044Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
4
|
+
invalidLicense: `You are currently using without a valid license. ${d}`,
|
|
5
|
+
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
|
|
6
|
+
expired: `Your license key has expired. ${d}`,
|
|
7
|
+
exceededVersion: "Your license does not support the current version of React PDF. The library version you are using exceeds the supported range of your license.",
|
|
8
|
+
invalidSignature: "Invalid license key: Signature mismatch"
|
|
9
|
+
};
|
|
10
|
+
function L(r) {
|
|
11
|
+
const t = r.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s+/g, ""), e = atob(t), n = new Uint8Array(e.length);
|
|
12
|
+
for (let i = 0; i < e.length; i++)
|
|
13
|
+
n[i] = e.charCodeAt(i);
|
|
14
|
+
return n.buffer;
|
|
15
|
+
}
|
|
16
|
+
function S(r) {
|
|
17
|
+
const t = atob(r), e = new Uint8Array(t.length);
|
|
18
|
+
for (let n = 0; n < t.length; n++)
|
|
19
|
+
e[n] = t.charCodeAt(n);
|
|
20
|
+
return e.buffer;
|
|
21
|
+
}
|
|
22
|
+
async function I(r, t = "SHA-256") {
|
|
23
|
+
try {
|
|
24
|
+
const { data: e, signature: n } = JSON.parse(atob(r)), i = L(`-----BEGIN PUBLIC KEY-----
|
|
25
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx
|
|
26
|
+
gr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b
|
|
27
|
+
HLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y
|
|
28
|
+
Bm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W
|
|
29
|
+
vXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD
|
|
30
|
+
vzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR
|
|
31
|
+
kwIDAQAB
|
|
32
|
+
-----END PUBLIC KEY-----`), a = await window.crypto.subtle.importKey(
|
|
33
|
+
"spki",
|
|
34
|
+
// str2ab(publicKeyContent), // Convert PEM string to ArrayBuffer
|
|
35
|
+
i,
|
|
36
|
+
{ name: "RSA-PSS", hash: t },
|
|
37
|
+
!0,
|
|
38
|
+
["verify"]
|
|
39
|
+
);
|
|
40
|
+
if (!await window.crypto.subtle.verify(
|
|
41
|
+
{ name: "RSA-PSS", saltLength: 32 },
|
|
42
|
+
a,
|
|
43
|
+
S(n),
|
|
44
|
+
// Convert signature to ArrayBuffer
|
|
45
|
+
new TextEncoder().encode(atob(e))
|
|
46
|
+
))
|
|
47
|
+
throw new Error(s.invalidSignature);
|
|
48
|
+
return JSON.parse(atob(e));
|
|
49
|
+
} catch {
|
|
50
|
+
throw new Error(s.invalidLicense);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const y = (r, t) => r === "specific" ? t === window.location.host : window.location.host.includes(t), u = {
|
|
54
|
+
isValid: !0,
|
|
55
|
+
invalidatedMessage: s.invalidLicense,
|
|
56
|
+
type: void 0
|
|
57
|
+
}, x = (r) => {
|
|
58
|
+
const [t, e] = E(u), n = h(async () => {
|
|
59
|
+
if (e((c) => ({ ...c, validating: !0 })), !r)
|
|
60
|
+
throw e({ ...u, validating: !1 }), new Error(s.invalidLicense);
|
|
61
|
+
let i;
|
|
62
|
+
try {
|
|
63
|
+
i = await I(r);
|
|
64
|
+
} catch (c) {
|
|
65
|
+
throw l.warn(c.message), new Error(c.message);
|
|
66
|
+
}
|
|
67
|
+
l.debug(">>> validatedLicense", i);
|
|
68
|
+
const { avu: a, exp: o, dmt: m, dm: w, t: f } = i;
|
|
69
|
+
if (!o)
|
|
70
|
+
throw new Error("License is missing expiration timestamp");
|
|
71
|
+
if (o > Number.MAX_SAFE_INTEGER / 1e3)
|
|
72
|
+
throw new Error("Invalid expiration timestamp: value too large");
|
|
73
|
+
const p = new Date(o * 1e3), g = (/* @__PURE__ */ new Date()).getTime();
|
|
74
|
+
if (p.getTime() < g)
|
|
75
|
+
throw new Error(s.expired);
|
|
76
|
+
if (!a)
|
|
77
|
+
throw new Error("License is missing available until version timestamp");
|
|
78
|
+
if (a > Number.MAX_SAFE_INTEGER / 1e3)
|
|
79
|
+
throw new Error("Invalid available until version timestamp: value too large");
|
|
80
|
+
const v = new Date(a * 1e3);
|
|
81
|
+
if (l.debug("availableUntilTimestamp", v), v.getTime() < b.getTime())
|
|
82
|
+
throw new Error(s.exceededVersion);
|
|
83
|
+
if (!y(m, w))
|
|
84
|
+
throw new Error(s.mismatchedDomain);
|
|
85
|
+
return {
|
|
86
|
+
isValid: !0,
|
|
87
|
+
type: f,
|
|
88
|
+
invalidatedMessage: void 0
|
|
89
|
+
};
|
|
90
|
+
}, [r]);
|
|
91
|
+
return A(() => {
|
|
92
|
+
n().then(({ isValid: i, type: a, invalidatedMessage: o }) => {
|
|
93
|
+
e({
|
|
94
|
+
isValid: i,
|
|
95
|
+
type: a,
|
|
96
|
+
invalidatedMessage: o,
|
|
97
|
+
validating: !1
|
|
98
|
+
});
|
|
99
|
+
}).catch((i) => {
|
|
100
|
+
e({
|
|
101
|
+
...u,
|
|
102
|
+
isValid: !1,
|
|
103
|
+
validating: !1
|
|
104
|
+
}), l.warn(i.message);
|
|
105
|
+
});
|
|
106
|
+
}, [n]), t;
|
|
107
|
+
};
|
|
108
|
+
export {
|
|
109
|
+
x as useLicense
|
|
110
|
+
};
|