@pdf-viewer/react 0.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/README.md +3 -0
  2. package/dist/Container.module-cb7b45b9.js +14 -0
  3. package/dist/RPSplitter.module-13d612c4.js +7 -0
  4. package/dist/RPTheme.module-f756e5cd.js +7 -0
  5. package/dist/Thumbnails-06fa1aa5.js +2657 -0
  6. package/dist/WrapperLayout.module-147bc943.js +6 -0
  7. package/dist/assets/Button.css +1 -0
  8. package/dist/assets/Checkbox.css +1 -0
  9. package/dist/assets/Container.css +1 -0
  10. package/dist/assets/DropDown.css +1 -0
  11. package/dist/assets/Input.css +1 -0
  12. package/dist/assets/LoaderIcon.css +1 -0
  13. package/dist/assets/MenuItem.css +1 -0
  14. package/dist/assets/MenuSeparator.css +1 -0
  15. package/dist/assets/PropertyItem.css +1 -0
  16. package/dist/assets/RPSplitter.css +1 -0
  17. package/dist/assets/RPTheme.css +1 -0
  18. package/dist/assets/RotateTool.css +1 -0
  19. package/dist/assets/Thumbnails.css +1 -0
  20. package/dist/assets/WrapperLayout.css +1 -0
  21. package/dist/clsx-0c6e471a.js +22 -0
  22. package/dist/components/RPConfig.js +1347 -0
  23. package/dist/components/RPController.js +49 -0
  24. package/dist/components/RPDocument.js +9 -0
  25. package/dist/components/RPDropFileZone.js +33 -0
  26. package/dist/components/RPTheme.js +21 -0
  27. package/dist/components/RPViewer.js +37 -0
  28. package/dist/components/icons/CheckIcon.js +22 -0
  29. package/dist/components/icons/ChevronUpIcon.js +22 -0
  30. package/dist/components/icons/ClearIcon.js +25 -0
  31. package/dist/components/icons/ClockwiseIcon.js +22 -0
  32. package/dist/components/icons/CloseIcon.js +22 -0
  33. package/dist/components/icons/DarkPdfIcon.js +15 -0
  34. package/dist/components/icons/DualPageIcon.js +22 -0
  35. package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
  36. package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
  37. package/dist/components/icons/FullScreenIcon.js +22 -0
  38. package/dist/components/icons/GoToDownIcon.js +22 -0
  39. package/dist/components/icons/HandModeDefaultIcon.js +22 -0
  40. package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
  41. package/dist/components/icons/InfoIcon.js +22 -0
  42. package/dist/components/icons/LightPdfIcon.js +15 -0
  43. package/dist/components/icons/LoaderIcon.js +17 -0
  44. package/dist/components/icons/MoonIcon.js +22 -0
  45. package/dist/components/icons/PageScrollingIcon.js +24 -0
  46. package/dist/components/icons/PrintDefaultIcon.js +23 -0
  47. package/dist/components/icons/SearchIcon.js +22 -0
  48. package/dist/components/icons/SinglePageIcon.js +22 -0
  49. package/dist/components/icons/SunIcon.js +25 -0
  50. package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
  51. package/dist/components/icons/ThreeDotIcon.js +22 -0
  52. package/dist/components/icons/Thumbnail.js +54 -0
  53. package/dist/components/icons/VerticalScrollingIcon.js +24 -0
  54. package/dist/components/icons/WrappedScrollingIcon.js +24 -0
  55. package/dist/components/icons/ZoomInIcon.js +22 -0
  56. package/dist/components/icons/ZoomOutIcon.js +22 -0
  57. package/dist/components/layout/Container.js +28 -0
  58. package/dist/components/layout/RPLayout.js +59 -0
  59. package/dist/components/layout/WrapperLayout.js +11 -0
  60. package/dist/components/layout/sidebar/RPSidebar.js +34 -0
  61. package/dist/components/layout/sidebar/RPSplitter.js +10 -0
  62. package/dist/components/layout/sidebar/Thumbnail.js +8 -0
  63. package/dist/components/layout/sidebar/Thumbnails.js +7 -0
  64. package/dist/components/layout/toolbar/DarkModeTool.js +23 -0
  65. package/dist/components/layout/toolbar/DocumentDialog.js +36 -0
  66. package/dist/components/layout/toolbar/DocumentProperties.js +19 -0
  67. package/dist/components/layout/toolbar/FileDownloadTool.js +11 -0
  68. package/dist/components/layout/toolbar/FileUploadTool.js +21 -0
  69. package/dist/components/layout/toolbar/FullScreenTool.js +46 -0
  70. package/dist/components/layout/toolbar/MenuItem.js +12 -0
  71. package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
  72. package/dist/components/layout/toolbar/MostPageTool.js +36 -0
  73. package/dist/components/layout/toolbar/OtherTool.js +21 -0
  74. package/dist/components/layout/toolbar/Paginate.js +12 -0
  75. package/dist/components/layout/toolbar/PrintTool.js +11 -0
  76. package/dist/components/layout/toolbar/PropertyItem.js +12 -0
  77. package/dist/components/layout/toolbar/RPToolbar.js +8 -0
  78. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
  79. package/dist/components/layout/toolbar/RotateTool.js +33 -0
  80. package/dist/components/layout/toolbar/ScrollModeTool.js +54 -0
  81. package/dist/components/layout/toolbar/SearchTool.js +40 -0
  82. package/dist/components/layout/toolbar/SelectionModeTool.js +36 -0
  83. package/dist/components/layout/toolbar/ViewModeTool.js +31 -0
  84. package/dist/components/layout/toolbar/ZoomTool.js +41 -0
  85. package/dist/components/page/AnnotationLayer.js +37 -0
  86. package/dist/components/page/CanvasLayer.js +33 -0
  87. package/dist/components/page/DualPage.js +6 -0
  88. package/dist/components/page/RPPage.js +33 -0
  89. package/dist/components/page/SinglePage.js +6 -0
  90. package/dist/components/page/TextLayer.js +34 -0
  91. package/dist/components/ui/Button.js +22 -0
  92. package/dist/components/ui/Checkbox.js +301 -0
  93. package/dist/components/ui/DropDown.js +29 -0
  94. package/dist/components/ui/Input.js +26 -0
  95. package/dist/components/ui/LoadingIndicator.js +6 -0
  96. package/dist/contexts/ConfigContext.js +13 -0
  97. package/dist/contexts/DarkModeContext.js +28 -0
  98. package/dist/contexts/DropFileZoneContext.js +50 -0
  99. package/dist/contexts/FileInputContext.js +38 -0
  100. package/dist/contexts/FullScreenContext.js +18 -0
  101. package/dist/contexts/IconContext.js +11 -0
  102. package/dist/contexts/InitialStateContext.js +11 -0
  103. package/dist/contexts/LayerContext.js +8 -0
  104. package/dist/contexts/LayoutContainerContext.js +10 -0
  105. package/dist/contexts/LicenseContext.js +15 -0
  106. package/dist/contexts/OtherToolContext.js +18 -0
  107. package/dist/contexts/PageViewportContext.js +8 -0
  108. package/dist/contexts/PaginateContext.js +11 -0
  109. package/dist/contexts/PrintContext.js +8 -0
  110. package/dist/contexts/RPDocumentContext.js +49 -0
  111. package/dist/contexts/RenderedPagesCache.js +14 -0
  112. package/dist/contexts/RotateContext.js +23 -0
  113. package/dist/contexts/ScrollModeContext.js +21 -0
  114. package/dist/contexts/ScrollStateContext.js +13 -0
  115. package/dist/contexts/SearchContext.js +8 -0
  116. package/dist/contexts/SelectionModeContext.js +23 -0
  117. package/dist/contexts/ThemeContext.js +7 -0
  118. package/dist/contexts/ThumbnailsContext.js +8 -0
  119. package/dist/contexts/ToolbarComponentContext.js +41 -0
  120. package/dist/contexts/ViewModeContext.js +28 -0
  121. package/dist/contexts/ViewportContext.js +62 -0
  122. package/dist/contexts/VirtualGridContext.js +15 -0
  123. package/dist/contexts/VirtualScrollContext.js +53 -0
  124. package/dist/contexts/ZoomContext.js +46 -0
  125. package/dist/index-3459164c.js +3609 -0
  126. package/dist/index-743c36f0.js +139 -0
  127. package/dist/main.js +37 -0
  128. package/dist/types/components/RPConfig.d.ts +3 -0
  129. package/dist/types/components/RPController.d.ts +3 -0
  130. package/dist/types/components/RPDocument.d.ts +3 -0
  131. package/dist/types/components/RPDropFileZone.d.ts +2 -0
  132. package/dist/types/components/RPTheme.d.ts +3 -0
  133. package/dist/types/components/RPViewer.d.ts +2 -0
  134. package/dist/types/components/icons/CheckIcon.d.ts +2 -0
  135. package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
  136. package/dist/types/components/icons/ClearIcon.d.ts +2 -0
  137. package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
  138. package/dist/types/components/icons/CloseIcon.d.ts +2 -0
  139. package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
  140. package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
  141. package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
  142. package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
  143. package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
  144. package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
  145. package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
  146. package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
  147. package/dist/types/components/icons/InfoIcon.d.ts +2 -0
  148. package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
  149. package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
  150. package/dist/types/components/icons/MoonIcon.d.ts +2 -0
  151. package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
  152. package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
  153. package/dist/types/components/icons/SearchIcon.d.ts +2 -0
  154. package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
  155. package/dist/types/components/icons/SunIcon.d.ts +2 -0
  156. package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
  157. package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
  158. package/dist/types/components/icons/Thumbnail.d.ts +2 -0
  159. package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
  160. package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
  161. package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
  162. package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
  163. package/dist/types/components/layout/Container.d.ts +9 -0
  164. package/dist/types/components/layout/RPLayout.d.ts +3 -0
  165. package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
  166. package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
  167. package/dist/types/components/layout/sidebar/RPSplitter.d.ts +7 -0
  168. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
  169. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +5 -0
  170. package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
  171. package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
  172. package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
  173. package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
  174. package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
  175. package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
  176. package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
  177. package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
  178. package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
  179. package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
  180. package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
  181. package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
  182. package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
  183. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -0
  184. package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
  185. package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
  186. package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
  187. package/dist/types/components/layout/toolbar/SearchTool.d.ts +2 -0
  188. package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
  189. package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
  190. package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
  191. package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
  192. package/dist/types/components/page/CanvasLayer.d.ts +8 -0
  193. package/dist/types/components/page/DualPage.d.ts +5 -0
  194. package/dist/types/components/page/RPPage.d.ts +6 -0
  195. package/dist/types/components/page/SinglePage.d.ts +5 -0
  196. package/dist/types/components/page/TextLayer.d.ts +6 -0
  197. package/dist/types/components/ui/Button.d.ts +6 -0
  198. package/dist/types/components/ui/Checkbox.d.ts +8 -0
  199. package/dist/types/components/ui/DropDown.d.ts +9 -0
  200. package/dist/types/components/ui/Input.d.ts +6 -0
  201. package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
  202. package/dist/types/contexts/ConfigContext.d.ts +5 -0
  203. package/dist/types/contexts/DarkModeContext.d.ts +5 -0
  204. package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
  205. package/dist/types/contexts/FileInputContext.d.ts +7 -0
  206. package/dist/types/contexts/FullScreenContext.d.ts +7 -0
  207. package/dist/types/contexts/IconContext.d.ts +7 -0
  208. package/dist/types/contexts/InitialStateContext.d.ts +5 -0
  209. package/dist/types/contexts/LayerContext.d.ts +5 -0
  210. package/dist/types/contexts/LayoutContainerContext.d.ts +8 -0
  211. package/dist/types/contexts/LicenseContext.d.ts +7 -0
  212. package/dist/types/contexts/OtherToolContext.d.ts +9 -0
  213. package/dist/types/contexts/PageViewportContext.d.ts +4 -0
  214. package/dist/types/contexts/PaginateContext.d.ts +5 -0
  215. package/dist/types/contexts/PrintContext.d.ts +7 -0
  216. package/dist/types/contexts/RPDocumentContext.d.ts +10 -0
  217. package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
  218. package/dist/types/contexts/RotateContext.d.ts +5 -0
  219. package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
  220. package/dist/types/contexts/ScrollStateContext.d.ts +8 -0
  221. package/dist/types/contexts/SearchContext.d.ts +7 -0
  222. package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
  223. package/dist/types/contexts/ThemeContext.d.ts +4 -0
  224. package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
  225. package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
  226. package/dist/types/contexts/ViewModeContext.d.ts +5 -0
  227. package/dist/types/contexts/ViewportContext.d.ts +28 -0
  228. package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
  229. package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
  230. package/dist/types/contexts/ZoomContext.d.ts +5 -0
  231. package/dist/types/main.d.ts +20 -0
  232. package/dist/types/utils/appConsole.d.ts +24 -0
  233. package/dist/types/utils/charators.d.ts +12 -0
  234. package/dist/types/utils/constants.d.ts +2 -0
  235. package/dist/types/utils/convertPdfDate.d.ts +1 -0
  236. package/dist/types/utils/dateFormatter.d.ts +1 -0
  237. package/dist/types/utils/formatFileSize.d.ts +1 -0
  238. package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
  239. package/dist/types/utils/getZoomLevel.d.ts +2 -0
  240. package/dist/types/utils/highlight.d.ts +8 -0
  241. package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
  242. package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
  243. package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
  244. package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
  245. package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
  246. package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
  247. package/dist/types/utils/hooks/useGrabScroll.d.ts +10 -0
  248. package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
  249. package/dist/types/utils/hooks/useLicense.d.ts +2 -0
  250. package/dist/types/utils/hooks/useLoadPdf.d.ts +7 -0
  251. package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
  252. package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
  253. package/dist/types/utils/hooks/usePageDimension.d.ts +4 -0
  254. package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
  255. package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
  256. package/dist/types/utils/hooks/usePrint.d.ts +11 -0
  257. package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
  258. package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
  259. package/dist/types/utils/hooks/useRotate.d.ts +4 -0
  260. package/dist/types/utils/hooks/useScrollToPage.d.ts +4 -0
  261. package/dist/types/utils/hooks/useSearch.d.ts +14 -0
  262. package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
  263. package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +12 -0
  264. package/dist/types/utils/hooks/useWatermark.d.ts +4 -0
  265. package/dist/types/utils/link_service.d.ts +71 -0
  266. package/dist/types/utils/renderPage.d.ts +2 -0
  267. package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
  268. package/dist/types/utils/types.d.ts +562 -0
  269. package/dist/utils/appConsole.js +42 -0
  270. package/dist/utils/charators.js +48 -0
  271. package/dist/utils/constants.js +5 -0
  272. package/dist/utils/convertPdfDate.js +25 -0
  273. package/dist/utils/dateFormatter.js +7 -0
  274. package/dist/utils/formatFileSize.js +9 -0
  275. package/dist/utils/getThumbnailViewport.js +7 -0
  276. package/dist/utils/getZoomLevel.js +18 -0
  277. package/dist/utils/highlight.js +145 -0
  278. package/dist/utils/hooks/useDarkMode.js +11 -0
  279. package/dist/utils/hooks/useDarkModeProps.js +12 -0
  280. package/dist/utils/hooks/useDebounce.js +15 -0
  281. package/dist/utils/hooks/useElementSize.js +21 -0
  282. package/dist/utils/hooks/useFileDownload.js +32 -0
  283. package/dist/utils/hooks/useFullScreen.js +29 -0
  284. package/dist/utils/hooks/useGrabScroll.js +45 -0
  285. package/dist/utils/hooks/useInfiniteScroll.js +19 -0
  286. package/dist/utils/hooks/useLicense.js +102 -0
  287. package/dist/utils/hooks/useLoadPdf.js +50 -0
  288. package/dist/utils/hooks/useLoadWorker.js +13 -0
  289. package/dist/utils/hooks/useMousePressed.js +20 -0
  290. package/dist/utils/hooks/usePageDimension.js +24 -0
  291. package/dist/utils/hooks/usePaginate.js +33 -0
  292. package/dist/utils/hooks/usePdfProperties.js +40 -0
  293. package/dist/utils/hooks/usePrint.js +33 -0
  294. package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
  295. package/dist/utils/hooks/useResizeObserver.js +22 -0
  296. package/dist/utils/hooks/useRotate.js +13 -0
  297. package/dist/utils/hooks/useScrollToPage.js +34 -0
  298. package/dist/utils/hooks/useSearch.js +33 -0
  299. package/dist/utils/hooks/useThumbnail.js +34 -0
  300. package/dist/utils/hooks/useVirtualReactWindow.js +34 -0
  301. package/dist/utils/hooks/useWatermark.js +62 -0
  302. package/dist/utils/link_service.js +98 -0
  303. package/dist/utils/renderPage.js +15 -0
  304. package/dist/utils/sanitizeExternalUrl.js +16 -0
  305. package/dist/utils/types.js +10 -0
  306. package/package.json +90 -0
@@ -0,0 +1,8 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface Props extends PropsWithChildren {
3
+ container: HTMLDivElement | null;
4
+ contentRef: HTMLDivElement | null;
5
+ }
6
+ export declare const useLayoutContainer: () => Omit<Props, "children">;
7
+ export declare const LayoutContainerProvider: FC<Props>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { License } from '../utils/types';
3
+ export declare const LicenseContext: import('react').Context<License>;
4
+ export declare const useLicenseContext: () => License;
5
+ export declare const LicenseProvider: FC<PropsWithChildren<{
6
+ licenseKey?: string;
7
+ }>>;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface OtherToolContextValue {
3
+ activeDocumentProperties: boolean;
4
+ setActiveDocumentProperties: React.Dispatch<React.SetStateAction<boolean>>;
5
+ }
6
+ export declare const OtherToolContext: import('react').Context<OtherToolContextValue>;
7
+ export declare const useOtherToolContext: () => OtherToolContextValue;
8
+ export declare const OtherToolProvider: FC<PropsWithChildren>;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const PageViewportContext: import('react').Context<{}>;
3
+ export declare const usePageViewportContext: () => {};
4
+ export declare const PageViewportProvider: FC<PropsWithChildren>;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { PageControlContextType } from '../utils/types';
3
+ export declare const PaginateContext: React.Context<PageControlContextType>;
4
+ export declare const usePaginateContext: () => PageControlContextType;
5
+ export declare const PaginateProvider: FC<PropsWithChildren>;
@@ -0,0 +1,7 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { PrintToolProps } from '../utils/types';
3
+ export declare const PrintContext: React.Context<PrintToolProps>;
4
+ export declare const PrintProvider: FC<{
5
+ children: ReactNode;
6
+ }>;
7
+ export declare const usePrintContext: () => PrintToolProps;
@@ -0,0 +1,10 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { DocumentContextType, RPSrc, CharacterMapConfig } from '../utils/types';
3
+ declare const DocumentContext: React.Context<DocumentContextType>;
4
+ interface Props extends PropsWithChildren {
5
+ src?: RPSrc;
6
+ characterMap?: CharacterMapConfig;
7
+ }
8
+ export declare const DocumentProvider: FC<Props>;
9
+ export declare const useDocumentContext: () => DocumentContextType;
10
+ export default DocumentContext;
@@ -0,0 +1,10 @@
1
+ import { PageViewport } from 'pdfjs-dist';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ interface CacheContext {
4
+ viewports: Map<number, PageViewport>;
5
+ pages: Map<number, any>;
6
+ }
7
+ export declare const RenderedPagesCacheContext: import('react').Context<CacheContext>;
8
+ export declare const useRenderedPagesCache: () => CacheContext;
9
+ export declare const RenderedPagesCacheProvider: FC<PropsWithChildren>;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { RotateContextType } from '../utils/types';
3
+ export declare const RotateContext: import('react').Context<RotateContextType>;
4
+ export declare const useRotateContext: () => RotateContextType;
5
+ export declare const RotateProvider: FC<PropsWithChildren>;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ScrollModeContextType } from '../utils/types';
3
+ export declare const ScrollModeContext: import('react').Context<ScrollModeContextType>;
4
+ export declare const useScrollModeContext: () => ScrollModeContextType;
5
+ export declare const ScrollModeProvider: FC<PropsWithChildren>;
@@ -0,0 +1,8 @@
1
+ import { FC, MutableRefObject, PropsWithChildren } from 'react';
2
+ interface ContextType {
3
+ isScrolling: MutableRefObject<boolean>;
4
+ }
5
+ export declare const ScrollStateContext: import('react').Context<ContextType>;
6
+ export declare const useScrollStateContext: () => ContextType;
7
+ export declare const ScrollStateProvider: FC<PropsWithChildren>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { SearchContextType } from '../utils/types';
2
+ export declare const SearchContext: import('react').Context<SearchContextType>;
3
+ export declare const SearchProvider: ({ children, initialSearch }: {
4
+ children: React.ReactNode;
5
+ initialSearch?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const useSearchContext: () => SearchContextType;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { SelectionModeContextType, SelectionModeProps } from '../utils/types';
3
+ export declare const SelectionModeContext: import('react').Context<SelectionModeContextType>;
4
+ export declare const useSelectionModeContext: () => SelectionModeContextType;
5
+ export declare const SelectionModeProvider: FC<PropsWithChildren<SelectionModeProps>>;
@@ -0,0 +1,4 @@
1
+ import { RPThemeContextType } from '../utils/types';
2
+ export declare const ThemeContext: import('react').Context<RPThemeContextType>;
3
+ export declare const useThemeContext: () => RPThemeContextType;
4
+ export declare const ThemeProvider: import('react').Provider<RPThemeContextType>;
@@ -0,0 +1,7 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ThumbnailContextType } from '../utils/types';
3
+ export declare const ThumbnailContext: React.Context<ThumbnailContextType>;
4
+ export declare const useThumbnailContext: () => ThumbnailContextType;
5
+ export declare const ThumbnailProvider: FC<PropsWithChildren<{
6
+ initialThumbnailsVisible: boolean;
7
+ }>>;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { RPSlots } from '../utils/types';
3
+ export declare const ToolbarComponentContext: import('react').Context<RPSlots>;
4
+ export declare const useToolbarComponentContext: () => RPSlots;
5
+ interface Props extends PropsWithChildren {
6
+ slots?: RPSlots;
7
+ }
8
+ export declare const ToolbarComponentProvider: FC<Props>;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ViewModeContextType } from '../utils/types';
3
+ export declare const ViewModeContext: import('react').Context<ViewModeContextType>;
4
+ export declare const useViewModeContext: () => ViewModeContextType;
5
+ export declare const ViewModeProvider: FC<PropsWithChildren>;
@@ -0,0 +1,28 @@
1
+ import { default as React } from 'react';
2
+ type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
3
+ type Orientation = 'portrait' | 'landscape';
4
+ interface Breakpoints {
5
+ [key: string]: number;
6
+ }
7
+ interface ViewportState {
8
+ width: number;
9
+ height: number;
10
+ isMobile: boolean;
11
+ currentBreakpoint: Breakpoint;
12
+ orientation: Orientation;
13
+ }
14
+ interface ViewportContextType extends ViewportState {
15
+ breakpoints: Breakpoints;
16
+ isBreakpoint: (breakpoint: Breakpoint) => boolean;
17
+ isMobileDevice: boolean;
18
+ isPortrait: boolean;
19
+ isLandscape: boolean;
20
+ isSmallScreen: boolean;
21
+ }
22
+ interface ViewportProviderProps {
23
+ children: React.ReactNode;
24
+ mobileWidth?: number;
25
+ }
26
+ export declare const ViewportProvider: React.FC<ViewportProviderProps>;
27
+ export declare const useViewportContext: () => ViewportContextType;
28
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Dispatch, FC, PropsWithChildren } from 'react';
2
+ interface VirtualGridContextType {
3
+ columnCount: number;
4
+ setColumnCount: Dispatch<React.SetStateAction<number>>;
5
+ }
6
+ export declare const VirtualGridContext: import('react').Context<VirtualGridContextType>;
7
+ export declare const useVirtualGridContext: () => VirtualGridContextType;
8
+ export declare const VirtualGridProvider: FC<PropsWithChildren>;
9
+ export {};
@@ -0,0 +1,30 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { VariableSizeGrid } from 'react-window';
3
+ interface ContextType {
4
+ virtualScrollRef?: VariableSizeGrid;
5
+ getVirtualScrollRef: (element: VariableSizeGrid) => void;
6
+ pageScrollElementRef?: HTMLDivElement;
7
+ getPageScrollElementRef: (element: HTMLDivElement) => void;
8
+ virtualScrollableElementRef?: HTMLDivElement;
9
+ getVirtualScrollableElementRef: (element: HTMLDivElement) => void;
10
+ scrollPosition: {
11
+ scrollTop: number;
12
+ scrollLeft: number;
13
+ };
14
+ setScrollPosition: (position: {
15
+ scrollTop: number;
16
+ scrollLeft: number;
17
+ }) => void;
18
+ totalInnerDimensions: {
19
+ height: number;
20
+ width: number;
21
+ };
22
+ setTotalInnerDimensions: (dimensions: {
23
+ height: number;
24
+ width: number;
25
+ }) => void;
26
+ }
27
+ export declare const VirtualScrollContext: import('react').Context<ContextType>;
28
+ export declare const useVirtualScrollContext: () => ContextType;
29
+ export declare const VirtualScrollProvider: FC<PropsWithChildren>;
30
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ZoomContextType } from '../utils/types';
3
+ export declare const ZoomContext: import('react').Context<ZoomContextType>;
4
+ export declare const useZoomContext: () => ZoomContextType;
5
+ export declare const ZoomProvider: FC<PropsWithChildren>;
@@ -0,0 +1,20 @@
1
+ export { RPDocument } from './components/RPDocument';
2
+ export { RPViewer } from './components/RPViewer';
3
+ export { RPConfig } from './components/RPConfig';
4
+ export { RPLayout } from './components/layout/RPLayout';
5
+ export { RPTheme } from './components/RPTheme';
6
+ export { RPDropFileZone } from './components/RPDropFileZone';
7
+ export { useDarkModeContext } from './contexts/DarkModeContext';
8
+ export { usePaginateContext } from './contexts/PaginateContext';
9
+ export { useDocumentContext } from './contexts/RPDocumentContext';
10
+ export { useRotateContext } from './contexts/RotateContext';
11
+ export { useDarkModeProps } from './utils/hooks/useDarkModeProps';
12
+ export { useViewModeContext } from './contexts/ViewModeContext';
13
+ export { useDropFileZoneContext } from './contexts/DropFileZoneContext';
14
+ export { useFileDownload } from './utils/hooks/useFileDownload';
15
+ export { useOpenFileContext } from './contexts/FileInputContext';
16
+ export { usePrintContext } from './contexts/PrintContext';
17
+ export { useZoomContext } from './contexts/ZoomContext';
18
+ export { useSearchContext } from './contexts/SearchContext';
19
+ export type { RPConfigProps, RPThemeProps, RPDocumentProps, RPLayoutProps, RPIcons, RPSlots, DarkModeProps, ZoomProps, ViewModeProps, DownloadToolProps, OpenFileToolProps, ScrollModeProps, PageNavigationToolProps, PrintToolProps, Localization, MatchValue } from './utils/types';
20
+ export { ViewMode, ScrollMode } from './utils/types';
@@ -0,0 +1,24 @@
1
+ declare class Console {
2
+ private static instance;
3
+ private isProduction;
4
+ private constructor();
5
+ static getInstance(): Console;
6
+ /**
7
+ * Debug level logging - stripped in production
8
+ */
9
+ debug(...args: any[]): void;
10
+ /**
11
+ * Info level logging - kept in production
12
+ */
13
+ info(...args: any[]): void;
14
+ /**
15
+ * Warning level logging - kept in production
16
+ */
17
+ warn(...args: any[]): void;
18
+ /**
19
+ * Error level logging - kept in production
20
+ */
21
+ error(...args: any[]): void;
22
+ }
23
+ export declare const appConsole: Console;
24
+ export {};
@@ -0,0 +1,12 @@
1
+ declare enum CharacterType {
2
+ SPACE = 0,
3
+ ALPHA_LETTER = 1,
4
+ PUNCTUATION = 2,
5
+ HAN_LETTER = 3,
6
+ KATAKANA_LETTER = 4,
7
+ HIRAGANA_LETTER = 5,
8
+ HALF_WIDTH_KATAKANA_LETTER = 6,
9
+ THAI_LETTER = 7
10
+ }
11
+ export declare function getCharacterType(charCode: number): CharacterType;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const PAGE_PADDING = 4;
2
+ export declare const THUMBNAIL_MIN_WIDTH = 200;
@@ -0,0 +1 @@
1
+ export declare const convertPDFDate: (input: string) => Date | null;
@@ -0,0 +1 @@
1
+ export declare const dateFormatter: (date: string) => string;
@@ -0,0 +1 @@
1
+ export declare function formatFileSize(bytes: number, decimalPoint?: number): string;
@@ -0,0 +1,5 @@
1
+ import { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
2
+ export declare const getThumbnailViewport: (page: PDFPageProxy, rotation?: number) => {
3
+ scale: number;
4
+ thumbnailViewport: import('pdfjs-dist/types/src/display/display_utils').PageViewport;
5
+ };
@@ -0,0 +1,2 @@
1
+ import { ZoomLevel } from './types';
2
+ export declare const getZoomLevel: (zoomLevel: number | ZoomLevel, clientWidth: number, clientHeight: number, pageWidth: number, pageHeight: number) => number | undefined;
@@ -0,0 +1,8 @@
1
+ import { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
2
+ import { SearchOptions, Match } from './types';
3
+ export declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: SearchOptions): Match[];
4
+ export declare function highlightMatches(matches: Match[], textContent: TextContent, textDivs: HTMLElement[]): {
5
+ element: HTMLElement;
6
+ index: number;
7
+ }[];
8
+ export declare function resetDivs(textContent: TextContent, textDivs: HTMLElement[]): void;
@@ -0,0 +1,2 @@
1
+ import { DarkMode } from '../types';
2
+ export declare const useDarkMode: (initialDarkMode?: boolean) => DarkMode;
@@ -0,0 +1,2 @@
1
+ import { DarkModeProps } from '../types';
2
+ export declare const useDarkModeProps: () => DarkModeProps;
@@ -0,0 +1 @@
1
+ export declare function useDebounce<T = string>(value: T, delay: number): T;
@@ -0,0 +1,8 @@
1
+ export interface ElementSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ declare const useElementSize: (element: HTMLElement | null) => {
6
+ size: ElementSize;
7
+ };
8
+ export default useElementSize;
@@ -0,0 +1,3 @@
1
+ export declare const useFileDownload: () => {
2
+ downloadFile: () => void;
3
+ };
@@ -0,0 +1,6 @@
1
+ export declare const useFullScreen: () => {
2
+ isFullScreen: boolean;
3
+ enterFullScreen: (element: HTMLElement) => Promise<void>;
4
+ exitFullScreen: () => Promise<void>;
5
+ isSupported: any;
6
+ };
@@ -0,0 +1,10 @@
1
+ interface UseGrabScrollProps {
2
+ isPressed: boolean;
3
+ scrollSpeed?: number;
4
+ }
5
+ interface UseGrabScrollReturn {
6
+ initializeGrabScroll: (element: HTMLElement | null) => void;
7
+ scrollBehavior: 'smooth' | 'unset';
8
+ }
9
+ export declare const useGrabScroll: ({ isPressed, scrollSpeed }: UseGrabScrollProps) => UseGrabScrollReturn;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Options {
2
+ distance?: number;
3
+ loadFirst?: boolean;
4
+ }
5
+ export declare const useInfiniteScroll: (wrapperElement: HTMLElement | null, onLoadMore: () => void, options?: Options) => void;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import { License } from '../types';
2
+ export declare const useLicense: (licenseKey?: string) => License;
@@ -0,0 +1,7 @@
1
+ import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api.js';
2
+ import { PdfPage, RPSrc, CharacterMapConfig } from '../types';
3
+ export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMapConfig) => {
4
+ pdf: PDFDocumentProxy | undefined;
5
+ pages: Map<number, PdfPage>;
6
+ loading: boolean;
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare const useLoadWorker: (workerUrl?: string) => {
2
+ workerUrlAdded: boolean;
3
+ };
@@ -0,0 +1,7 @@
1
+ export declare const useMousePressed: () => {
2
+ isPressed: boolean;
3
+ coordinates: {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ };
@@ -0,0 +1,4 @@
1
+ export declare const usePageDimension: () => {
2
+ widths: number[];
3
+ heights: number[];
4
+ };
@@ -0,0 +1,2 @@
1
+ import { PageControl } from '../types';
2
+ export declare const usePaginate: (initialPage?: number) => PageControl;
@@ -0,0 +1,9 @@
1
+ import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
2
+ import { PdfProperties, PDFSrc } from '../types';
3
+ type CMapSource = {
4
+ url: string;
5
+ cMapPacked: boolean;
6
+ cMapUrl: string;
7
+ };
8
+ export declare const usePdfProperties: (source: PDFSrc | CMapSource, pdf?: PDFDocumentProxy, filename?: string) => PdfProperties | undefined;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { PreparePrintProgress } from '../types';
2
+ interface PrintHookResult {
3
+ print: () => Promise<void>;
4
+ cancel: () => void;
5
+ progress: PreparePrintProgress;
6
+ isComplete: boolean;
7
+ isError: boolean;
8
+ error: Error | null;
9
+ }
10
+ export declare const usePrint: () => PrintHookResult;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ declare const useRequestAnimationFrame: <T extends unknown[]>(callback: (...args: T) => void, deps: unknown[], recurring?: boolean) => {
2
+ start: (...args: T) => void;
3
+ stop: () => void;
4
+ };
5
+ export default useRequestAnimationFrame;
@@ -0,0 +1,6 @@
1
+ export type ResizeObserverCallback = (entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver) => void;
2
+ declare const useResizeObserver: (element: HTMLElement | null, callback: ResizeObserverCallback) => {
3
+ isSupported: boolean;
4
+ stop: () => void;
5
+ };
6
+ export default useResizeObserver;
@@ -0,0 +1,4 @@
1
+ export declare const useRotate: () => {
2
+ handleRotateClockwise: () => void;
3
+ handleRotateCounterclockwise: () => void;
4
+ };
@@ -0,0 +1,4 @@
1
+ import { Align } from 'react-window';
2
+ export declare const useScrollToPage: () => {
3
+ scrollToPage: (page: number, align?: Align) => void;
4
+ };
@@ -0,0 +1,14 @@
1
+ import { SearchOptions, MatchValue } from '../types';
2
+ export declare const useSearch: (options?: SearchOptions, initialSearch?: string) => {
3
+ search: string;
4
+ setSearch: import('react').Dispatch<import('react').SetStateAction<string>>;
5
+ loading: boolean;
6
+ matches: MatchValue[];
7
+ totalMatches: number;
8
+ currentMatchPosition: number;
9
+ currentMatch: MatchValue | null;
10
+ nextMatch: () => void;
11
+ prevMatch: () => void;
12
+ currentMatchElement: HTMLElement | null;
13
+ setCurrentMatchElement: import('react').Dispatch<import('react').SetStateAction<HTMLElement | null>>;
14
+ };
@@ -0,0 +1,7 @@
1
+ import { ThumbnailRenderedList } from '../types';
2
+ export declare const useThumbnail: () => {
3
+ thumbnailPages: Record<number, ThumbnailRenderedList>;
4
+ addPage: (pageNumber: number) => void;
5
+ addToPage: (lastPage: number) => void;
6
+ thumbnailLength: number;
7
+ };
@@ -0,0 +1,12 @@
1
+ export declare const useVirtualReactWindow: () => {
2
+ rowCount: number;
3
+ rowHeight: (idx: number) => number;
4
+ columnCount: number;
5
+ columnWidth: (idx: number) => number;
6
+ pageDimension: {
7
+ widths: number[];
8
+ heights: number[];
9
+ };
10
+ estimatedRowHeight: number;
11
+ estimatedColumnWidth: number;
12
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useWatermark: () => {
2
+ getContainer: (ele: HTMLDivElement) => void;
3
+ container: HTMLDivElement | null;
4
+ };
@@ -0,0 +1,71 @@
1
+ import { IPDFLinkService } from 'pdfjs-dist/types/web/interfaces';
2
+ declare class SimpleLinkService implements IPDFLinkService {
3
+ externalLinkEnabled: boolean;
4
+ constructor();
5
+ /**
6
+ * @type {number}
7
+ */
8
+ get pagesCount(): number;
9
+ /**
10
+ * @type {number}
11
+ */
12
+ get page(): number;
13
+ /**
14
+ * @param {number} _value
15
+ */
16
+ set page(_value: number);
17
+ /**
18
+ * @type {number}
19
+ */
20
+ get rotation(): number;
21
+ /**
22
+ * @param {number} _value
23
+ */
24
+ set rotation(_value: number);
25
+ /**
26
+ * @type {boolean}
27
+ */
28
+ get isInPresentationMode(): boolean;
29
+ /**
30
+ * @param {string|Array} _dest - The named, or explicit, PDF destination.
31
+ */
32
+ goToDestination(_dest: string | Array<any>): Promise<void>;
33
+ /**
34
+ * @param {number|string} _val - The page number, or page label.
35
+ */
36
+ goToPage(_val: number | string): void;
37
+ /**
38
+ * @param {HTMLAnchorElement} link
39
+ * @param {string} url
40
+ * @param {boolean} [_newWindow]
41
+ */
42
+ addLinkAttributes(_link: HTMLAnchorElement, _url: string, _newWindow?: boolean): void;
43
+ /**
44
+ * @param _dest - The PDF destination object.
45
+ * @returns {string} The hyperlink to the PDF object.
46
+ */
47
+ getDestinationHash(_dest: any): string;
48
+ /**
49
+ * @param _hash - The PDF parameters/hash.
50
+ * @returns {string} The hyperlink to the PDF object.
51
+ */
52
+ getAnchorUrl(_hash: any): string;
53
+ /**
54
+ * @param {string} _hash
55
+ */
56
+ setHash(_hash: string): void;
57
+ /**
58
+ * @param {string} _action
59
+ */
60
+ executeNamedAction(_action: string): void;
61
+ /**
62
+ * @param {Object} _action
63
+ */
64
+ executeSetOCGState(_action: object): void;
65
+ /**
66
+ * @param {number} _pageNum - page number.
67
+ * @param {Object} _pageRef - reference to the page.
68
+ */
69
+ cachePageRef(_pageNum: number, _pageRef: object): void;
70
+ }
71
+ export { SimpleLinkService };
@@ -0,0 +1,2 @@
1
+ import { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
2
+ export declare const renderPage: (page: PDFPageProxy, canvasElem: HTMLCanvasElement, scale?: number, rotate?: number) => import('pdfjs-dist/types/src/display/api').RenderTask;
@@ -0,0 +1 @@
1
+ export declare const sanitizeExternalUrl: (url: string, defaultUrl?: string) => string;