@react-pdf-kit/viewer 2.6.0-beta.2 → 2.6.0-rc.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.
Files changed (343) hide show
  1. package/dist/AnnotationLayer-D6BfL976.js +113 -0
  2. package/dist/Button-jStpvb3T.js +21 -0
  3. package/dist/Checkbox-Brta-YKG.js +195 -0
  4. package/dist/Combination-DqNkTtir.js +695 -0
  5. package/dist/Container-DTWaZzc7.js +16 -0
  6. package/dist/CustomThumbnailElement-C2quEICO.js +19 -0
  7. package/dist/DarkPdfIcon-B5ehd9CV.js +9 -0
  8. package/dist/DocumentDialog-DHAWcYIz.js +324 -0
  9. package/dist/DropDown-DikL-krI.js +33 -0
  10. package/dist/Input-Bb_-ljl1.js +31 -0
  11. package/dist/LightPdfIcon-DL8MYtWQ.js +9 -0
  12. package/dist/LoaderIcon-D9YjinGf.js +14 -0
  13. package/dist/LoadingIndicator-MWrbKa6X.js +45 -0
  14. package/dist/MenuItem-BJDWfzAw.js +15 -0
  15. package/dist/MenuSeparator-D1H5l8Ej.js +6 -0
  16. package/dist/MostPageTool.module-BRVv-sGz.js +4 -0
  17. package/dist/OtherTool.module-BQY9Nfqz.js +4 -0
  18. package/dist/Paginate.module-B0GMw-MB.js +8 -0
  19. package/dist/PaginationContext--n91mIJ4.js +232 -0
  20. package/dist/PasswordModal-BDHdSpxf.js +76 -0
  21. package/dist/PropertyItem-evJWWmWZ.js +18 -0
  22. package/dist/RPDropFileZone-BunRfzst.js +35 -0
  23. package/dist/RPLayout.module-Vc3h4xxS.js +14 -0
  24. package/dist/RPPage-BuSGUFzw.js +91 -0
  25. package/dist/RPPages-V5CNUXFD.js +1007 -0
  26. package/dist/RPSplitter-C63X9M8w.js +121 -0
  27. package/dist/RPToolbar.module-BwqWLviy.js +10 -0
  28. package/dist/RPTooltip-ZZoFqP7C.js +381 -0
  29. package/dist/RotateTool.module-DH5yWbvM.js +4 -0
  30. package/dist/SearchTool.module-DUkVXfOn.js +16 -0
  31. package/dist/SkipLink-Bvbn3miT.js +18 -0
  32. package/dist/TextHighlightLayer-BSVgBxR3.js +157 -0
  33. package/dist/TextLayer-DWGFN9SF.js +125 -0
  34. package/dist/Thumbnail-Dwo2-4Ki.js +97 -0
  35. package/dist/Thumbnails-ComClyJJ.js +52 -0
  36. package/dist/ToolbarLayout.module-Zo715dbb.js +12 -0
  37. package/dist/WrapperLayout-Dcd9l9xH.js +13 -0
  38. package/dist/ZoomTool.module-BrIPy8pO.js +11 -0
  39. package/dist/assets/AnnotationLayer.css +1 -0
  40. package/dist/assets/Button.css +1 -0
  41. package/dist/assets/Checkbox.css +1 -0
  42. package/dist/assets/Container.css +1 -0
  43. package/dist/assets/CustomThumbnailElement.css +1 -0
  44. package/dist/assets/DocumentDialog.css +1 -0
  45. package/dist/assets/DropDown.css +1 -0
  46. package/dist/assets/Input.css +1 -0
  47. package/dist/assets/LoaderIcon.css +1 -0
  48. package/dist/assets/LoadingIndicator.css +1 -0
  49. package/dist/assets/MenuItem.css +1 -0
  50. package/dist/assets/MenuSeparator.css +1 -0
  51. package/dist/assets/MostPageTool.css +1 -0
  52. package/dist/assets/OtherTool.css +1 -0
  53. package/dist/assets/Paginate.css +1 -0
  54. package/dist/assets/PasswordModal.css +1 -0
  55. package/dist/assets/PropertyItem.css +1 -0
  56. package/dist/assets/RPDropFileZone.css +1 -0
  57. package/dist/assets/RPLayout.css +1 -0
  58. package/dist/assets/RPPage.css +1 -0
  59. package/dist/assets/RPPages.css +1 -0
  60. package/dist/assets/RPSplitter.css +1 -0
  61. package/dist/assets/RPToolbar.css +1 -0
  62. package/dist/assets/RPTooltip.css +1 -0
  63. package/dist/assets/RotateTool.css +1 -0
  64. package/dist/assets/SearchTool.css +1 -0
  65. package/dist/assets/SkipLink.css +1 -0
  66. package/dist/assets/TextHighlightLayer.css +1 -0
  67. package/dist/assets/TextLayer.css +1 -0
  68. package/dist/assets/Thumbnail.css +1 -0
  69. package/dist/assets/Thumbnails.css +1 -0
  70. package/dist/assets/ToolbarLayout.css +1 -0
  71. package/dist/assets/WrapperLayout.css +1 -0
  72. package/dist/assets/ZoomTool.css +1 -0
  73. package/dist/assets/style.js +2 -77
  74. package/dist/chunk-C_CI6nMA.js +13 -0
  75. package/dist/clsx-B7LyVm5O.js +16 -0
  76. package/dist/components/RPConfig.js +24 -26
  77. package/dist/components/RPController.js +85 -135
  78. package/dist/components/RPDropFileZone.js +3 -61
  79. package/dist/components/RPPages.js +3 -1115
  80. package/dist/components/RPProvider.js +50 -131
  81. package/dist/components/RPTheme.js +20 -21
  82. package/dist/components/icons/CheckIcon.js +16 -22
  83. package/dist/components/icons/ChevronDownIcon.js +17 -23
  84. package/dist/components/icons/ChevronUpIcon.js +16 -22
  85. package/dist/components/icons/ClearIcon.js +26 -25
  86. package/dist/components/icons/ClockwiseIcon.js +16 -22
  87. package/dist/components/icons/CloseIcon.js +16 -22
  88. package/dist/components/icons/DarkPdfIcon.js +2 -15
  89. package/dist/components/icons/DualPageIcon.js +16 -22
  90. package/dist/components/icons/DualPageWithCoverIcon.js +16 -22
  91. package/dist/components/icons/FileDownloadDefaultIcon.js +20 -23
  92. package/dist/components/icons/FileUploadDefaultIcon.js +20 -23
  93. package/dist/components/icons/FullScreenIcon.js +16 -22
  94. package/dist/components/icons/GoToDownIcon.js +16 -22
  95. package/dist/components/icons/HandModeDefaultIcon.js +16 -22
  96. package/dist/components/icons/HorizontalScrollingIcon.js +18 -24
  97. package/dist/components/icons/InfoIcon.js +16 -22
  98. package/dist/components/icons/LightPdfIcon.js +2 -15
  99. package/dist/components/icons/LoaderIcon.js +2 -17
  100. package/dist/components/icons/MoonIcon.js +16 -22
  101. package/dist/components/icons/PageScrollingIcon.js +18 -24
  102. package/dist/components/icons/PrintDefaultIcon.js +20 -23
  103. package/dist/components/icons/SearchIcon.js +16 -22
  104. package/dist/components/icons/SinglePageIcon.js +15 -21
  105. package/dist/components/icons/SunIcon.js +26 -25
  106. package/dist/components/icons/TextSelectionDefaultIcon.js +20 -23
  107. package/dist/components/icons/ThreeDotIcon.js +16 -22
  108. package/dist/components/icons/Thumbnail.js +39 -54
  109. package/dist/components/icons/VerticalScrollingIcon.js +18 -24
  110. package/dist/components/icons/WrappedScrollingIcon.js +18 -24
  111. package/dist/components/icons/ZoomInIcon.js +16 -22
  112. package/dist/components/icons/ZoomOutIcon.js +16 -22
  113. package/dist/components/layout/Container.js +2 -21
  114. package/dist/components/layout/LayoutContainer.js +23 -34
  115. package/dist/components/layout/LayoutWrapper.js +14 -10
  116. package/dist/components/layout/RPDefaultLayout.js +99 -244
  117. package/dist/components/layout/RPLayout.js +70 -220
  118. package/dist/components/layout/SkipLink.js +3 -29
  119. package/dist/components/layout/WrapperLayout.js +2 -27
  120. package/dist/components/layout/sidebar/CustomThumbnailElement.js +2 -68
  121. package/dist/components/layout/sidebar/RPSidebar.js +61 -112
  122. package/dist/components/layout/sidebar/RPSplitter.js +2 -9
  123. package/dist/components/layout/sidebar/Thumbnail.js +3 -155
  124. package/dist/components/layout/sidebar/Thumbnails.js +2 -82
  125. package/dist/components/layout/toolbar/DarkModeTool.js +44 -36
  126. package/dist/components/layout/toolbar/DocumentDialog.js +2 -322
  127. package/dist/components/layout/toolbar/DocumentProperties.js +30 -39
  128. package/dist/components/layout/toolbar/FileDownloadTool.js +54 -50
  129. package/dist/components/layout/toolbar/FileUploadTool.js +54 -49
  130. package/dist/components/layout/toolbar/FullScreenTool.js +62 -72
  131. package/dist/components/layout/toolbar/MenuItem.js +2 -19
  132. package/dist/components/layout/toolbar/MenuSeparator.js +2 -15
  133. package/dist/components/layout/toolbar/MostPageTool.js +62 -81
  134. package/dist/components/layout/toolbar/OtherTool.js +97 -198
  135. package/dist/components/layout/toolbar/Paginate.js +111 -145
  136. package/dist/components/layout/toolbar/PrintTool.js +70 -72
  137. package/dist/components/layout/toolbar/PropertyItem.js +2 -12
  138. package/dist/components/layout/toolbar/RPMenuItem.js +22 -31
  139. package/dist/components/layout/toolbar/RPMoreOptions.js +140 -220
  140. package/dist/components/layout/toolbar/RPToolbar.js +45 -151
  141. package/dist/components/layout/toolbar/RPToolbarEnd.js +23 -121
  142. package/dist/components/layout/toolbar/RotateTool.js +49 -60
  143. package/dist/components/layout/toolbar/ScrollModeTool.js +79 -67
  144. package/dist/components/layout/toolbar/SearchCloseButton.js +23 -31
  145. package/dist/components/layout/toolbar/SearchResultNavigator.js +39 -100
  146. package/dist/components/layout/toolbar/SearchTool.js +226 -267
  147. package/dist/components/layout/toolbar/SelectionModeTool.js +59 -51
  148. package/dist/components/layout/toolbar/ThumbnailTool.js +30 -39
  149. package/dist/components/layout/toolbar/ToolbarCustom.js +56 -113
  150. package/dist/components/layout/toolbar/ToolbarDefault.js +58 -196
  151. package/dist/components/layout/toolbar/ToolbarLayout.js +12 -158
  152. package/dist/components/layout/toolbar/ViewModeTool.js +82 -62
  153. package/dist/components/layout/toolbar/ZoomTool.js +139 -150
  154. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +24 -54
  155. package/dist/components/layout/toolbar/tools/DualPageTool.js +23 -25
  156. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -206
  157. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +23 -35
  158. package/dist/components/layout/toolbar/tools/FileUploadTool.js +23 -34
  159. package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -201
  160. package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -33
  161. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +24 -36
  162. package/dist/components/layout/toolbar/tools/InputPageTool.js +51 -92
  163. package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -201
  164. package/dist/components/layout/toolbar/tools/NextPageTool.js +32 -61
  165. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +24 -36
  166. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -62
  167. package/dist/components/layout/toolbar/tools/PrintTool.js +23 -35
  168. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +23 -47
  169. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +26 -47
  170. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +29 -38
  171. package/dist/components/layout/toolbar/tools/SinglePageTool.js +22 -24
  172. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +24 -35
  173. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +24 -46
  174. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +24 -36
  175. package/dist/components/layout/toolbar/tools/ZoomInTool.js +29 -58
  176. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +26 -26
  177. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +94 -133
  178. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +29 -58
  179. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +60 -148
  180. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +31 -42
  181. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +23 -28
  182. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +25 -52
  183. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -51
  184. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +26 -42
  185. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +57 -87
  186. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +25 -52
  187. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +44 -64
  188. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +80 -71
  189. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +59 -57
  190. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +79 -66
  191. package/dist/components/page/AnnotationLayer.js +2 -146
  192. package/dist/components/page/CanvasLayer.js +47 -71
  193. package/dist/components/page/CustomElement.js +18 -53
  194. package/dist/components/page/DualPage.js +43 -98
  195. package/dist/components/page/DualPageWithCover.js +66 -130
  196. package/dist/components/page/RPPage.js +2 -143
  197. package/dist/components/page/SinglePage.js +27 -88
  198. package/dist/components/page/TextHighlightLayer.js +2 -198
  199. package/dist/components/page/TextLayer.js +2 -202
  200. package/dist/components/page/searchHighlight.js +32 -37
  201. package/dist/components/ui/Button.js +2 -25
  202. package/dist/components/ui/Checkbox.js +2 -273
  203. package/dist/components/ui/DropDown.js +2 -36
  204. package/dist/components/ui/Input.js +2 -28
  205. package/dist/components/ui/LoadingIndicator.js +2 -59
  206. package/dist/components/ui/PasswordModal.js +2 -75
  207. package/dist/components/ui/RPTooltip.js +2 -357
  208. package/dist/contexts/ConfigContext.js +13 -12
  209. package/dist/contexts/DarkModeContext.js +26 -27
  210. package/dist/contexts/DimensionPagesContext.js +49 -60
  211. package/dist/contexts/DocumentPasswordContext.js +37 -35
  212. package/dist/contexts/DownloadContext.js +13 -21
  213. package/dist/contexts/DropFileZoneContext.js +35 -62
  214. package/dist/contexts/ElementPageContext.js +114 -139
  215. package/dist/contexts/ElementThumbnailContext.js +132 -195
  216. package/dist/contexts/EventCallbackContext.js +19 -34
  217. package/dist/contexts/FileInputContext.js +30 -49
  218. package/dist/contexts/FullScreenContext.js +31 -24
  219. package/dist/contexts/GlobalCurrentPage.js +21 -18
  220. package/dist/contexts/HighlightContext.js +22 -31
  221. package/dist/contexts/IconContext.js +9 -11
  222. package/dist/contexts/IconToolContext.js +14 -11
  223. package/dist/contexts/InitialStateContext.js +9 -11
  224. package/dist/contexts/LayerContext.js +9 -8
  225. package/dist/contexts/LayoutContainerContext.js +12 -16
  226. package/dist/contexts/LayoutDropFileZoneContext.js +8 -11
  227. package/dist/contexts/LicenseContext.js +12 -17
  228. package/dist/contexts/LoaderContext.js +14 -27
  229. package/dist/contexts/LocalizationContext.js +22 -33
  230. package/dist/contexts/OtherToolContext.js +17 -17
  231. package/dist/contexts/PageViewportContext.js +9 -8
  232. package/dist/contexts/PagesRotateContext.js +42 -43
  233. package/dist/contexts/PaginationContext.js +2 -40
  234. package/dist/contexts/PrintContext.js +67 -78
  235. package/dist/contexts/RPDocumentContext.js +60 -73
  236. package/dist/contexts/RenderQueueProvider.js +43 -72
  237. package/dist/contexts/RenderedPagesCache.js +17 -13
  238. package/dist/contexts/RotationContext.js +27 -38
  239. package/dist/contexts/ScrollModeContext.js +22 -20
  240. package/dist/contexts/SearchContext.js +39 -97
  241. package/dist/contexts/SelectionModeContext.js +22 -23
  242. package/dist/contexts/SmoothScrollContext.js +18 -16
  243. package/dist/contexts/ThemeContext.js +5 -7
  244. package/dist/contexts/ThumbnailsContext.js +26 -43
  245. package/dist/contexts/ToolComponentContext.js +54 -51
  246. package/dist/contexts/ToolbarComponentContext.js +48 -47
  247. package/dist/contexts/ViewModeContext.js +34 -31
  248. package/dist/contexts/ViewportContext.js +91 -85
  249. package/dist/contexts/VirtualGridContext.js +17 -14
  250. package/dist/contexts/VirtualScrollContext.js +42 -52
  251. package/dist/contexts/ZoomContext.js +95 -107
  252. package/dist/de_DE--0LF-SJR.js +483 -0
  253. package/dist/dist-7FA4Do6I.js +1286 -0
  254. package/dist/dist-BRVqFn7R.js +144 -0
  255. package/dist/dist-C3WNMuW2.js +29 -0
  256. package/dist/dist-CKteKPPA.js +947 -0
  257. package/dist/dist-bK-AHWLF.js +314 -0
  258. package/dist/lib-BiapEtK1.js +10261 -0
  259. package/dist/libInjectCss.js +7 -8
  260. package/dist/main-CHO5p1qM.js +60 -0
  261. package/dist/main.js +53 -296
  262. package/dist/style-9n_QpMZt.js +5 -0
  263. package/dist/useWatermark-CvAAf66v.js +67 -0
  264. package/dist/utils/Queue.js +40 -46
  265. package/dist/utils/annotations.js +227 -261
  266. package/dist/utils/appConsole.js +24 -42
  267. package/dist/utils/approximateFragtion.js +16 -21
  268. package/dist/utils/calculatePage.js +29 -20
  269. package/dist/utils/charators.js +39 -48
  270. package/dist/utils/const.js +8 -11
  271. package/dist/utils/constants.js +4 -8
  272. package/dist/utils/convertPdfDate.js +20 -24
  273. package/dist/utils/dateFormatter.js +7 -7
  274. package/dist/utils/elementPagePosition.js +10 -10
  275. package/dist/utils/formatFileSize.js +17 -8
  276. package/dist/utils/getElementPositionInPage.js +44 -82
  277. package/dist/utils/getScrollDistance.js +4 -4
  278. package/dist/utils/getThumbnailViewport.js +12 -6
  279. package/dist/utils/getWordPositionInPage.js +24 -24
  280. package/dist/utils/getZoomLevel.js +16 -23
  281. package/dist/utils/highlight.js +195 -212
  282. package/dist/utils/hooks/useCopyText.js +23 -33
  283. package/dist/utils/hooks/useDarkMode.js +10 -10
  284. package/dist/utils/hooks/useDarkModeProps.js +9 -10
  285. package/dist/utils/hooks/useDebounce.js +22 -18
  286. package/dist/utils/hooks/useDropFileZone.js +13 -11
  287. package/dist/utils/hooks/useElementSize.js +24 -20
  288. package/dist/utils/hooks/useFileDownload.js +16 -33
  289. package/dist/utils/hooks/useFlickerSelectText.js +19 -24
  290. package/dist/utils/hooks/useFullScreen.js +31 -28
  291. package/dist/utils/hooks/useGrabScroll.js +52 -51
  292. package/dist/utils/hooks/useHighlight.js +92 -92
  293. package/dist/utils/hooks/useInfiniteScroll.js +17 -18
  294. package/dist/utils/hooks/useLicense.js +113 -135
  295. package/dist/utils/hooks/useLoadPdf.js +107 -100
  296. package/dist/utils/hooks/useLoadWorker.js +13 -15
  297. package/dist/utils/hooks/useLocalization.js +25 -25
  298. package/dist/utils/hooks/useMousePressed.js +25 -19
  299. package/dist/utils/hooks/usePageRotateContext.js +25 -41
  300. package/dist/utils/hooks/usePaginate.js +2 -38
  301. package/dist/utils/hooks/usePdfProperties.js +38 -36
  302. package/dist/utils/hooks/usePinch.js +65 -100
  303. package/dist/utils/hooks/usePresentPage.js +69 -92
  304. package/dist/utils/hooks/usePrint.js +167 -178
  305. package/dist/utils/hooks/useRequestAnimationFrame.js +16 -16
  306. package/dist/utils/hooks/useResizeObserver.js +18 -21
  307. package/dist/utils/hooks/useRotate.js +15 -27
  308. package/dist/utils/hooks/useScrollToPage.js +2 -38
  309. package/dist/utils/hooks/useSearch.js +125 -163
  310. package/dist/utils/hooks/useTextSelection.js +69 -75
  311. package/dist/utils/hooks/useThumbnail.js +42 -59
  312. package/dist/utils/hooks/useVirtualReactWindow.js +85 -96
  313. package/dist/utils/hooks/useWatermark.js +2 -78
  314. package/dist/utils/injectPrintCSS.js +6 -21
  315. package/dist/utils/link_service.js +59 -137
  316. package/dist/utils/renderPage.js +20 -19
  317. package/dist/utils/sanitizeExternalUrl.js +12 -15
  318. package/dist/utils/smoothScrollTo.js +8 -5
  319. package/dist/utils/types.js +29 -21
  320. package/dist/utils/withRef.js +7 -7
  321. package/dist/utils/zoom.js +5 -6
  322. package/package.json +7 -7
  323. package/dist/Combination-17ab8af1.js +0 -698
  324. package/dist/MostPageTool.module-13578ad6.js +0 -6
  325. package/dist/OtherTool.module-a4be5f1f.js +0 -6
  326. package/dist/Paginate.module-4eef00aa.js +0 -8
  327. package/dist/PaginationContext-87f832f2.js +0 -233
  328. package/dist/RPLayout.module-92fa19f7.js +0 -14
  329. package/dist/RPSplitter-b62772f9.js +0 -122
  330. package/dist/RPToolbar.module-27d7fe77.js +0 -10
  331. package/dist/RotateTool.module-67946714.js +0 -6
  332. package/dist/SearchTool.module-99f60dc7.js +0 -16
  333. package/dist/ToolbarLayout.module-6e339802.js +0 -12
  334. package/dist/ZoomTool.module-7082af8c.js +0 -12
  335. package/dist/assets/style.css +0 -1
  336. package/dist/clsx-0c6e471a.js +0 -22
  337. package/dist/de_DE-8145915f.js +0 -489
  338. package/dist/index-113053cf.js +0 -309
  339. package/dist/index-11f3cd64.js +0 -983
  340. package/dist/index-23911b43.js +0 -150
  341. package/dist/index-ada501c4.js +0 -27
  342. package/dist/index-d0f0aa9a.js +0 -1542
  343. package/dist/index-e04c91b1.js +0 -11671
@@ -0,0 +1,232 @@
1
+ import { ScrollMode as e, ViewMode as t } from "./utils/types.js";
2
+ import { appConsole as n } from "./utils/appConsole.js";
3
+ import { useDocumentContext as r } from "./contexts/RPDocumentContext.js";
4
+ import { useInitialStateContext as i } from "./contexts/InitialStateContext.js";
5
+ import { useScrollModeContext as a } from "./contexts/ScrollModeContext.js";
6
+ import { useViewModeContext as o } from "./contexts/ViewModeContext.js";
7
+ import { useVirtualScrollContext as s } from "./contexts/VirtualScrollContext.js";
8
+ import { useVirtualGridContext as c } from "./contexts/VirtualGridContext.js";
9
+ import { smoothScrollTo as l } from "./utils/smoothScrollTo.js";
10
+ import { useLayoutContainer as u } from "./contexts/LayoutContainerContext.js";
11
+ import { useGlobalCurrentPage as d } from "./contexts/GlobalCurrentPage.js";
12
+ import { useDebounce as f } from "./utils/hooks/useDebounce.js";
13
+ import { useDimensionPagesContext as p } from "./contexts/DimensionPagesContext.js";
14
+ import { useSmoothScrollContext as m } from "./contexts/SmoothScrollContext.js";
15
+ import { getScrollDistance as h } from "./utils/getScrollDistance.js";
16
+ import { getGridDimension as g } from "./utils/calculatePage.js";
17
+ import { createContext as _, useCallback as v, useContext as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
18
+ import { jsx as w } from "react/jsx-runtime";
19
+ //#region lib/utils/hooks/useScrollToPage.ts
20
+ var T = () => {
21
+ let { viewMode: n } = o(), { scrollMode: r } = a(), { virtualScrollRef: i, virtualScrollableElementRef: u, pageScrollElementRef: d } = s(), { setFocusedPage: f } = O(), _ = S(), { columnCount: y } = c(), { widths: x, heights: C } = p(), w = S(r), T = S(n), E = S(y), { targetScrollPage: D, scrollBehavior: k } = m(), A = S(null);
22
+ b(() => {
23
+ i?.scrollToItem && (_.current = i);
24
+ }, [i]), b(() => {
25
+ w.current = r, T.current = n;
26
+ }, [r, n]);
27
+ let j = v((e, t) => {
28
+ if (!d) return;
29
+ let n = Math.ceil(e / 2) * 2 - 1;
30
+ if (e === n + 1) {
31
+ let e = {
32
+ left: x[n],
33
+ top: 0
34
+ };
35
+ return new Promise((t) => l(d, e, t));
36
+ }
37
+ return d?.scrollTo({
38
+ left: 0,
39
+ top: 0,
40
+ behavior: t
41
+ });
42
+ }, [
43
+ d,
44
+ x,
45
+ l
46
+ ]);
47
+ b(() => {
48
+ w.current = r, T.current = n;
49
+ }, [r, n]), b(() => {
50
+ E.current = y;
51
+ }, [y]);
52
+ let M = v((n, r = k) => {
53
+ f(n);
54
+ let i = n - 1, a = i, o = 0;
55
+ if (T.current === t.DUAL_PAGE && w.current === e.PAGE_SCROLLING) {
56
+ j(n, r);
57
+ return;
58
+ }
59
+ if (w.current === e.PAGE_SCROLLING) {
60
+ f(n);
61
+ return;
62
+ }
63
+ if (!_.current || !u) {
64
+ A.current = {
65
+ page: n,
66
+ behavior: r
67
+ };
68
+ return;
69
+ }
70
+ A.current = null;
71
+ let s = u;
72
+ r === "smooth" && (D.current = n);
73
+ let { columnsWidth: c, rowsHeight: l } = g({
74
+ widths: x,
75
+ heights: C
76
+ }, y);
77
+ if (w.current === e.HORIZONTAL_SCROLLING) {
78
+ o = i;
79
+ let e = h(c, o), t = {
80
+ left: Math.floor(e),
81
+ top: 0
82
+ };
83
+ return s.scrollTo({
84
+ ...t,
85
+ behavior: r
86
+ });
87
+ }
88
+ if (T.current === t.DUAL_PAGE) {
89
+ o = i % 2, a = Math.floor(i / 2);
90
+ let e = h(c, o), t = h(l, a), n = {
91
+ left: Math.floor(e),
92
+ top: Math.floor(t)
93
+ };
94
+ return s.scrollTo({
95
+ ...n,
96
+ behavior: r
97
+ });
98
+ }
99
+ let d = h(l, a), p = {
100
+ left: 0,
101
+ top: Math.floor(d)
102
+ };
103
+ return s.scrollTo({
104
+ ...p,
105
+ behavior: r
106
+ });
107
+ }, [
108
+ u,
109
+ y,
110
+ j,
111
+ f,
112
+ l,
113
+ C,
114
+ x,
115
+ k
116
+ ]);
117
+ return b(() => {
118
+ if (!u || !A.current) return;
119
+ let { page: e, behavior: t } = A.current;
120
+ A.current = null, M(e, t);
121
+ }, [u, M]), { scrollToPage: M };
122
+ }, E = (n = 1) => {
123
+ let [r, i] = C(n), [s, c] = C(0), { scrollToPage: l } = T(), d = S(n), { viewMode: m } = o(), { scrollMode: h } = a(), { widths: g } = p(), { pagesRef: _ } = u(), y = f(r, 100), b = v((e) => {
124
+ if (!/^[0-9]*$/g.test(e.toString()) || !e) return {
125
+ success: !1,
126
+ currentPage: d.current
127
+ };
128
+ let t = +e;
129
+ return t < 0 || t > s ? {
130
+ success: !1,
131
+ currentPage: d.current
132
+ } : (i(t), d.current = t, {
133
+ success: !0,
134
+ currentPage: +e
135
+ });
136
+ }, [s]), w = v(b, [b]), E = v((e) => {
137
+ i(e), d.current = e;
138
+ }, []), D = v((e, t) => {
139
+ let n = b(e);
140
+ return n.success && l(n.currentPage, t), n;
141
+ }, [b, l]), O = v((e) => {
142
+ let n = e % 2 == 1;
143
+ if (!_ || n) return !1;
144
+ let r = n ? g[e] : g[e - 1], i = n ? g[e + 1] : g[e];
145
+ return m === t.DUAL_PAGE && r + i < _.clientWidth;
146
+ }, [
147
+ m,
148
+ g,
149
+ _,
150
+ s
151
+ ]), k = v(() => {
152
+ let e = r - 1;
153
+ O(e) && (e = r - 2), D(e);
154
+ }, [
155
+ D,
156
+ r,
157
+ m,
158
+ h,
159
+ O
160
+ ]), A = x(() => m === t.DUAL_PAGE && h === e.PAGE_SCROLLING ? r === s - 1 : r === s, [
161
+ r,
162
+ s,
163
+ m,
164
+ h
165
+ ]);
166
+ return {
167
+ focusedPage: y,
168
+ totalPages: s,
169
+ setFocusedPage: w,
170
+ resetPage: E,
171
+ setTotalPages: c,
172
+ nextPage: v(() => {
173
+ if (A) return;
174
+ let e = r + 1;
175
+ O(e) && (e = r + 2), D(e);
176
+ }, [
177
+ D,
178
+ r,
179
+ O,
180
+ m,
181
+ h,
182
+ A
183
+ ]),
184
+ prevPage: k,
185
+ goToPage: D
186
+ };
187
+ }, D = _({
188
+ focusedPage: 0,
189
+ setFocusedPage: (e) => {},
190
+ goToPage: (e, t) => ({
191
+ success: !!e,
192
+ currentPage: +e
193
+ }),
194
+ totalPages: 0,
195
+ setTotalPages: (e) => {},
196
+ prevPage: () => {},
197
+ nextPage: () => {}
198
+ }), O = () => {
199
+ let e = y(D);
200
+ return e?.focusedPage === void 0 && n.error("Please use this hooks inside children component of RPProvider"), e;
201
+ }, k = ({ children: e }) => {
202
+ let { pdf: t } = r(), { setCurrentPage: n } = d(), { initialPage: a = 1 } = i(), { focusedPage: o, totalPages: s, setFocusedPage: c, resetPage: l, setTotalPages: u, goToPage: f, nextPage: p, prevPage: m } = E(a), h = S(!0);
203
+ return b(() => {
204
+ if (!t) {
205
+ h.current || (u(0), l(1));
206
+ return;
207
+ }
208
+ if (!t.numPages) return;
209
+ u(t.numPages);
210
+ let e = h.current ? a : 1;
211
+ l(Math.min(Math.max(e, 1), t.numPages)), h.current = !1;
212
+ }, [
213
+ t,
214
+ u,
215
+ l
216
+ ]), b(() => {
217
+ n(o);
218
+ }, [o, n]), /* @__PURE__ */ w(D.Provider, {
219
+ value: {
220
+ focusedPage: o,
221
+ totalPages: s,
222
+ setFocusedPage: c,
223
+ setTotalPages: u,
224
+ nextPage: p,
225
+ prevPage: m,
226
+ goToPage: f
227
+ },
228
+ children: e
229
+ });
230
+ };
231
+ //#endregion
232
+ export { T as a, E as i, k as n, O as r, D as t };
@@ -0,0 +1,76 @@
1
+ import { useDocumentPasswordContext as e } from "./contexts/DocumentPasswordContext.js";
2
+ import { useLocalizationContext as t } from "./contexts/LocalizationContext.js";
3
+ import { t as n } from "./clsx-B7LyVm5O.js";
4
+ import { useState as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import './assets/PasswordModal.css';//#region lib/components/ui/PasswordModal.module.css
7
+ var o = {
8
+ "rp-password-overlay": "_rp-password-overlay_18s56_1",
9
+ "rp-password-modal": "_rp-password-modal_18s56_13",
10
+ "rp-password-title": "_rp-password-title_18s56_27",
11
+ "rp-password-content": "_rp-password-content_18s56_35",
12
+ "rp-password-form": "_rp-password-form_18s56_41",
13
+ "rp-password-input": "_rp-password-input_18s56_45",
14
+ "rp-password-input-invalid": "_rp-password-input-invalid_18s56_62",
15
+ "rp-password-message-invalid": "_rp-password-message-invalid_18s56_66",
16
+ "rp-password-submit-button": "_rp-password-submit-button_18s56_72"
17
+ }, s = () => {
18
+ let [s, c] = r(""), { localeMessages: l } = t(), { setPassword: u, setPasswordError: d, invalidPassword: f } = e(), p = (e) => {
19
+ c(e.target.value), f && d(void 0);
20
+ }, m = (e) => {
21
+ e.preventDefault(), s && s.trim() && u(s);
22
+ }, h = !s.trim();
23
+ return /* @__PURE__ */ i("div", {
24
+ className: n(o["rp-password-overlay"]),
25
+ role: "dialog",
26
+ "aria-modal": "true",
27
+ "aria-labelledby": "password-modal-title",
28
+ children: /* @__PURE__ */ a("div", {
29
+ className: n(o["rp-password-modal"]),
30
+ children: [
31
+ /* @__PURE__ */ i("div", {
32
+ id: "password-modal-title",
33
+ className: n(o["rp-password-title"]),
34
+ children: l?.passwordModalTitle
35
+ }),
36
+ /* @__PURE__ */ i("div", {
37
+ className: n(o["rp-password-content"]),
38
+ children: l?.passwordModalMessage
39
+ }),
40
+ /* @__PURE__ */ a("form", {
41
+ onSubmit: m,
42
+ children: [/* @__PURE__ */ a("div", {
43
+ className: n(o["rp-password-form"]),
44
+ children: [/* @__PURE__ */ i("input", {
45
+ type: "password",
46
+ value: s,
47
+ onChange: p,
48
+ className: n(o["rp-password-input"], f && o["rp-password-input-invalid"]),
49
+ placeholder: l?.passwordPlaceholder,
50
+ autoComplete: "off",
51
+ "aria-label": l?.passwordPlaceholder,
52
+ "aria-required": "true",
53
+ "aria-invalid": f,
54
+ "aria-describedby": f ? "password-error" : void 0
55
+ }), /* @__PURE__ */ i("div", {
56
+ id: "password-error",
57
+ className: n(o["rp-password-message-invalid"]),
58
+ role: "alert",
59
+ "aria-live": "polite",
60
+ children: f && /* @__PURE__ */ i("span", { children: l?.passwordError })
61
+ })]
62
+ }), /* @__PURE__ */ i("button", {
63
+ type: "submit",
64
+ disabled: h,
65
+ className: n(o["rp-password-submit-button"]),
66
+ onClick: m,
67
+ "aria-label": l?.passwordConfirmLabel,
68
+ children: l?.passwordConfirmLabel
69
+ })]
70
+ })
71
+ ]
72
+ })
73
+ });
74
+ };
75
+ //#endregion
76
+ export { s as t };
@@ -0,0 +1,18 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import './assets/PropertyItem.css';//#region lib/components/layout/toolbar/PropertyItem.module.css
3
+ var n = {
4
+ "rp-property-item-wrapper": "_rp-property-item-wrapper_jno3l_1",
5
+ "rp-property-item-label": "_rp-property-item-label_jno3l_11",
6
+ "rp-property-item-value": "_rp-property-item-value_jno3l_15"
7
+ }, r = ({ label: r, value: i }) => /* @__PURE__ */ t("div", {
8
+ className: n["rp-property-item-wrapper"],
9
+ children: [/* @__PURE__ */ e("div", {
10
+ className: n["rp-property-item-label"],
11
+ children: r
12
+ }), /* @__PURE__ */ e("div", {
13
+ className: n["rp-property-item-value"],
14
+ children: i || "-"
15
+ })]
16
+ });
17
+ //#endregion
18
+ export { r as t };
@@ -0,0 +1,35 @@
1
+ import { useDarkModeContext as e } from "./contexts/DarkModeContext.js";
2
+ import { useDropFileZoneContext as t } from "./contexts/DropFileZoneContext.js";
3
+ import { useLocalizationContext as n } from "./contexts/LocalizationContext.js";
4
+ import { t as r } from "./clsx-B7LyVm5O.js";
5
+ import { t as i } from "./LightPdfIcon-DL8MYtWQ.js";
6
+ import { t as a } from "./DarkPdfIcon-B5ehd9CV.js";
7
+ import { useDropFileZone as o } from "./utils/hooks/useDropFileZone.js";
8
+ import { useCallback as s } from "react";
9
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ import './assets/RPDropFileZone.css';//#region lib/components/RPDropFileZone.module.css
11
+ var d = {
12
+ "rp-drop-zone": "_rp-drop-zone_1sc50_1",
13
+ "rp-drop-zone-transparent": "_rp-drop-zone-transparent_1sc50_15"
14
+ }, f = {}, p = () => {
15
+ let { dragging: p, handleDragLeave: m, handleDrop: h } = t(), { darkMode: g } = e(), { localeMessages: _ } = n(), { DropFileZoneLayout: v, DropFileZoneTool: y, DropFileZoneToolbar: b } = o(), x = [
16
+ v,
17
+ y,
18
+ b
19
+ ].includes(!1), S = s((e) => {
20
+ e.preventDefault();
21
+ }, []);
22
+ if (!p || x) return null;
23
+ let C = (e) => e ? typeof e == "function" ? /* @__PURE__ */ l(e, {}) : typeof e == "boolean" ? null : /* @__PURE__ */ l(c, { children: e }) : null, w = /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { children: l(g ? a : i, {}) }), /* @__PURE__ */ l("p", { children: _?.dragDropFileMessage })] });
24
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
25
+ className: r(d["rp-drop-zone"], g ? f["rp-dark-mode"] : ""),
26
+ children: /* @__PURE__ */ l(() => C(v) ?? C(y) ?? C(b) ?? w, {})
27
+ }), /* @__PURE__ */ l("div", {
28
+ className: d["rp-drop-zone-transparent"],
29
+ onDragOver: S,
30
+ onDragLeave: m,
31
+ onDrop: h
32
+ })] });
33
+ };
34
+ //#endregion
35
+ export { p as t };
@@ -0,0 +1,14 @@
1
+ import './assets/RPLayout.css';//#region lib/components/layout/RPLayout.module.css
2
+ var e = {
3
+ "rp-layout": "_rp-layout_1yzm4_1",
4
+ "rp-layout-wrapper": "_rp-layout-wrapper_1yzm4_5",
5
+ "rp-content": "_rp-content_1yzm4_11",
6
+ "rp-sidebar": "_rp-sidebar_1yzm4_18",
7
+ "rp-pages": "_rp-pages_1yzm4_23",
8
+ "rp-container": "_rp-container_1yzm4_29",
9
+ "rp-loader": "_rp-loader_1yzm4_33",
10
+ "rp-theme-variables": "_rp-theme-variables_1yzm4_37",
11
+ "rp-dark-mode": "_rp-dark-mode_1yzm4_156"
12
+ };
13
+ //#endregion
14
+ export { e as t };
@@ -0,0 +1,91 @@
1
+ import { useDocumentContext as e } from "./contexts/RPDocumentContext.js";
2
+ import { useZoomContext as t } from "./contexts/ZoomContext.js";
3
+ import { usePagesRotateContext as n } from "./contexts/PagesRotateContext.js";
4
+ import { useLayerContext as r } from "./contexts/LayerContext.js";
5
+ import { useLoaderContext as i } from "./contexts/LoaderContext.js";
6
+ import { CanvasLayer as a } from "./components/page/CanvasLayer.js";
7
+ import { t as o } from "./TextLayer-DWGFN9SF.js";
8
+ import { t as s } from "./AnnotationLayer-D6BfL976.js";
9
+ import { t as c } from "./TextHighlightLayer-BSVgBxR3.js";
10
+ import { CustomElement as l } from "./components/page/CustomElement.js";
11
+ import { withRef as u } from "./utils/withRef.js";
12
+ import { useCallback as d, useEffect as f, useImperativeHandle as p, useMemo as m, useRef as h, useState as g } from "react";
13
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import './assets/RPPage.css';//#region lib/components/page/RPPage.module.css
15
+ var y = {
16
+ "rp-page-wrapper": "_rp-page-wrapper_krysr_1",
17
+ "rp-page": "_rp-page_krysr_1",
18
+ "rp-loader-wrapper": "_rp-loader-wrapper_krysr_17"
19
+ }, b = u((u, b) => {
20
+ let { pageNumber: x, style: S, ...C } = u, { pages: w } = e(), { pageRotate: T } = n(), { textLayer: E } = r(), { currentZoom: D } = t(), { LoaderImageComponent: O } = i(), k = h(w.get(x)), [A, j] = g(!1), M = h(null), [N, P] = g({
21
+ width: 0,
22
+ height: 0
23
+ });
24
+ p(b, () => M.current);
25
+ let F = m(() => k.current ? T[x] : 0, [x, T]);
26
+ f(() => {
27
+ w && (k.current = w.get(x), k.current && P(k.current.page.getViewport({
28
+ scale: D,
29
+ rotation: F
30
+ })));
31
+ }, [
32
+ w,
33
+ x,
34
+ F,
35
+ D
36
+ ]);
37
+ let I = m(() => {
38
+ switch (F) {
39
+ case 90: return `${N.width / 2}px ${N.width / 2}px`;
40
+ case -90:
41
+ case 270: return `${N.height / 2}px ${N.height / 2}px`;
42
+ default: return "center";
43
+ }
44
+ }, [F, N]), L = d(() => {
45
+ j(!0);
46
+ }, []), R = d(() => {
47
+ j(!1);
48
+ }, []);
49
+ return /* @__PURE__ */ _("div", {
50
+ ref: M,
51
+ id: `page-${x}`,
52
+ "data-rp": `page-${x}`,
53
+ ...C,
54
+ style: {
55
+ ...S,
56
+ "--rp-rotate": `${F}deg`,
57
+ "--rp-page-rotate-translate": `${I}`,
58
+ "--user-unit": N.userUnit || 1,
59
+ "--scale-factor": D,
60
+ "--total-scale-factor": "calc(var(--scale-factor) * var(--user-unit))"
61
+ },
62
+ className: y["rp-page-wrapper"],
63
+ children: /* @__PURE__ */ v("div", {
64
+ style: {
65
+ width: `${N.width}px`,
66
+ height: `${N.height}px`
67
+ },
68
+ className: y["rp-page"],
69
+ children: [
70
+ /* @__PURE__ */ _(a, {
71
+ onLoading: L,
72
+ onLoaded: R,
73
+ pageNumber: x
74
+ }),
75
+ A && O && /* @__PURE__ */ _("div", {
76
+ className: y["rp-loader-wrapper"],
77
+ children: /* @__PURE__ */ _(O, {})
78
+ }),
79
+ /* @__PURE__ */ _(l, { pageNumber: x }),
80
+ E && /* @__PURE__ */ _(o, { pageNumber: x }),
81
+ /* @__PURE__ */ _(c, {
82
+ pageNumber: x,
83
+ viewport: N
84
+ }),
85
+ /* @__PURE__ */ _(s, { pageNumber: x })
86
+ ]
87
+ })
88
+ });
89
+ });
90
+ //#endregion
91
+ export { b as t };