@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.
Files changed (458) hide show
  1. package/README.md +204 -0
  2. package/dist/LayoutWrapper-a871c161.js +19 -0
  3. package/dist/RotateTool.module-03987eba.js +6 -0
  4. package/dist/SearchCloseButton-cbf182aa.js +33 -0
  5. package/dist/ToolbarLayout.module-c588d36b.js +3411 -0
  6. package/dist/ZoomTool.module-6c5eabbb.js +12 -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/LayoutWrapper.css +1 -0
  13. package/dist/assets/LoaderIcon.css +1 -0
  14. package/dist/assets/MenuItem.css +1 -0
  15. package/dist/assets/MenuSeparator.css +1 -0
  16. package/dist/assets/PasswordModal.css +1 -0
  17. package/dist/assets/PropertyItem.css +1 -0
  18. package/dist/assets/RPDropFileZone.css +1 -0
  19. package/dist/assets/RPSplitter.css +1 -0
  20. package/dist/assets/RPTooltip.css +1 -0
  21. package/dist/assets/RotateTool.css +1 -0
  22. package/dist/assets/SearchCloseButton.css +1 -0
  23. package/dist/assets/ToolbarLayout.css +1 -0
  24. package/dist/assets/WrapperLayout.css +1 -0
  25. package/dist/assets/ZoomTool.css +1 -0
  26. package/dist/clsx-0c6e471a.js +22 -0
  27. package/dist/components/RPConfig.js +1492 -0
  28. package/dist/components/RPController.js +92 -0
  29. package/dist/components/RPDropFileZone.js +39 -0
  30. package/dist/components/RPPages.js +66 -0
  31. package/dist/components/RPProvider.js +27 -0
  32. package/dist/components/RPTheme.js +21 -0
  33. package/dist/components/icons/CheckIcon.js +22 -0
  34. package/dist/components/icons/ChevronDownIcon.js +23 -0
  35. package/dist/components/icons/ChevronUpIcon.js +22 -0
  36. package/dist/components/icons/ClearIcon.js +25 -0
  37. package/dist/components/icons/ClockwiseIcon.js +22 -0
  38. package/dist/components/icons/CloseIcon.js +22 -0
  39. package/dist/components/icons/DarkPdfIcon.js +15 -0
  40. package/dist/components/icons/DualPageIcon.js +22 -0
  41. package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
  42. package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
  43. package/dist/components/icons/FullScreenIcon.js +22 -0
  44. package/dist/components/icons/GoToDownIcon.js +22 -0
  45. package/dist/components/icons/HandModeDefaultIcon.js +22 -0
  46. package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
  47. package/dist/components/icons/InfoIcon.js +22 -0
  48. package/dist/components/icons/LightPdfIcon.js +15 -0
  49. package/dist/components/icons/LoaderIcon.js +17 -0
  50. package/dist/components/icons/MoonIcon.js +22 -0
  51. package/dist/components/icons/PageScrollingIcon.js +24 -0
  52. package/dist/components/icons/PrintDefaultIcon.js +23 -0
  53. package/dist/components/icons/SearchIcon.js +22 -0
  54. package/dist/components/icons/SinglePageIcon.js +22 -0
  55. package/dist/components/icons/SunIcon.js +25 -0
  56. package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
  57. package/dist/components/icons/ThreeDotIcon.js +22 -0
  58. package/dist/components/icons/Thumbnail.js +54 -0
  59. package/dist/components/icons/VerticalScrollingIcon.js +24 -0
  60. package/dist/components/icons/WrappedScrollingIcon.js +24 -0
  61. package/dist/components/icons/ZoomInIcon.js +22 -0
  62. package/dist/components/icons/ZoomOutIcon.js +22 -0
  63. package/dist/components/layout/Container.js +21 -0
  64. package/dist/components/layout/LayoutContainer.js +60 -0
  65. package/dist/components/layout/LayoutWrapper.js +6 -0
  66. package/dist/components/layout/RPDefaultLayout.js +16 -0
  67. package/dist/components/layout/RPLayout.js +107 -0
  68. package/dist/components/layout/WrapperLayout.js +13 -0
  69. package/dist/components/layout/sidebar/RPSidebar.js +15 -0
  70. package/dist/components/layout/sidebar/RPSplitter.js +61 -0
  71. package/dist/components/layout/sidebar/Thumbnail.js +59 -0
  72. package/dist/components/layout/sidebar/Thumbnails.js +8 -0
  73. package/dist/components/layout/toolbar/DarkModeTool.js +27 -0
  74. package/dist/components/layout/toolbar/DocumentDialog.js +59 -0
  75. package/dist/components/layout/toolbar/DocumentProperties.js +27 -0
  76. package/dist/components/layout/toolbar/FileDownloadTool.js +15 -0
  77. package/dist/components/layout/toolbar/FileUploadTool.js +25 -0
  78. package/dist/components/layout/toolbar/FullScreenTool.js +59 -0
  79. package/dist/components/layout/toolbar/MenuItem.js +12 -0
  80. package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
  81. package/dist/components/layout/toolbar/MostPageTool.js +60 -0
  82. package/dist/components/layout/toolbar/OtherTool.js +24 -0
  83. package/dist/components/layout/toolbar/Paginate.js +19 -0
  84. package/dist/components/layout/toolbar/PrintTool.js +15 -0
  85. package/dist/components/layout/toolbar/PropertyItem.js +12 -0
  86. package/dist/components/layout/toolbar/RPMenuItem.js +23 -0
  87. package/dist/components/layout/toolbar/RPMoreOptions.js +147 -0
  88. package/dist/components/layout/toolbar/RPToolbar.js +10 -0
  89. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
  90. package/dist/components/layout/toolbar/RotateTool.js +36 -0
  91. package/dist/components/layout/toolbar/ScrollModeTool.js +56 -0
  92. package/dist/components/layout/toolbar/SearchCloseButton.js +9 -0
  93. package/dist/components/layout/toolbar/SearchResultNavigator.js +10 -0
  94. package/dist/components/layout/toolbar/SearchTool.js +61 -0
  95. package/dist/components/layout/toolbar/SelectionModeTool.js +40 -0
  96. package/dist/components/layout/toolbar/ThumbnailTool.js +17 -0
  97. package/dist/components/layout/toolbar/ToolbarCustom.js +95 -0
  98. package/dist/components/layout/toolbar/ToolbarDefault.js +97 -0
  99. package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
  100. package/dist/components/layout/toolbar/ViewModeTool.js +42 -0
  101. package/dist/components/layout/toolbar/ZoomTool.js +130 -0
  102. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +28 -0
  103. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +13 -0
  104. package/dist/components/layout/toolbar/tools/FileUploadTool.js +13 -0
  105. package/dist/components/layout/toolbar/tools/FullScreenTool.js +21 -0
  106. package/dist/components/layout/toolbar/tools/InputPageTool.js +45 -0
  107. package/dist/components/layout/toolbar/tools/NextPageTool.js +72 -0
  108. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -0
  109. package/dist/components/layout/toolbar/tools/PrintTool.js +13 -0
  110. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +17 -0
  111. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +25 -0
  112. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -0
  113. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +23 -0
  114. package/dist/components/layout/toolbar/tools/ZoomInTool.js +28 -0
  115. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +65 -0
  116. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +28 -0
  117. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +70 -0
  118. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
  119. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +16 -0
  120. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +20 -0
  121. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +69 -0
  122. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +20 -0
  123. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +78 -0
  124. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +20 -0
  125. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +26 -0
  126. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +43 -0
  127. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +30 -0
  128. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +32 -0
  129. package/dist/components/page/AnnotationLayer.js +62 -0
  130. package/dist/components/page/CanvasLayer.js +58 -0
  131. package/dist/components/page/CustomElement.js +22 -0
  132. package/dist/components/page/DualPage.js +6 -0
  133. package/dist/components/page/RPPage.js +60 -0
  134. package/dist/components/page/SinglePage.js +6 -0
  135. package/dist/components/page/TextHighlightLayer.js +60 -0
  136. package/dist/components/page/TextLayer.js +60 -0
  137. package/dist/components/page/searchHighlight.js +37 -0
  138. package/dist/components/ui/Button.js +22 -0
  139. package/dist/components/ui/Checkbox.js +264 -0
  140. package/dist/components/ui/DropDown.js +29 -0
  141. package/dist/components/ui/Input.js +26 -0
  142. package/dist/components/ui/LoadingIndicator.js +7 -0
  143. package/dist/components/ui/PasswordModal.js +58 -0
  144. package/dist/components/ui/RPTooltip.js +568 -0
  145. package/dist/contexts/ConfigContext.js +13 -0
  146. package/dist/contexts/DarkModeContext.js +28 -0
  147. package/dist/contexts/DimensionPagesContext.js +42 -0
  148. package/dist/contexts/DocumentPasswordContext.js +40 -0
  149. package/dist/contexts/DownloadContext.js +21 -0
  150. package/dist/contexts/DropFileZoneContext.js +52 -0
  151. package/dist/contexts/ElementPageContext.js +76 -0
  152. package/dist/contexts/FileInputContext.js +39 -0
  153. package/dist/contexts/FullScreenContext.js +18 -0
  154. package/dist/contexts/GlobalCurrentPage.js +16 -0
  155. package/dist/contexts/HighlightContext.js +18 -0
  156. package/dist/contexts/IconContext.js +11 -0
  157. package/dist/contexts/IconToolContext.js +13 -0
  158. package/dist/contexts/InitialStateContext.js +13 -0
  159. package/dist/contexts/LayerContext.js +8 -0
  160. package/dist/contexts/LayoutContainerContext.js +16 -0
  161. package/dist/contexts/LicenseContext.js +15 -0
  162. package/dist/contexts/LoaderContext.js +26 -0
  163. package/dist/contexts/LocalizationContext.js +38 -0
  164. package/dist/contexts/OtherToolContext.js +18 -0
  165. package/dist/contexts/PageViewportContext.js +8 -0
  166. package/dist/contexts/PagesRotateContext.js +25 -0
  167. package/dist/contexts/PaginationContext.js +11 -0
  168. package/dist/contexts/PrintContext.js +8 -0
  169. package/dist/contexts/RPDocumentContext.js +51 -0
  170. package/dist/contexts/RenderQueueProvider.js +10 -0
  171. package/dist/contexts/RenderedPagesCache.js +14 -0
  172. package/dist/contexts/RotationContext.js +28 -0
  173. package/dist/contexts/ScrollModeContext.js +21 -0
  174. package/dist/contexts/SearchContext.js +8 -0
  175. package/dist/contexts/SelectionModeContext.js +23 -0
  176. package/dist/contexts/SmoothScrollContext.js +12 -0
  177. package/dist/contexts/ThemeContext.js +7 -0
  178. package/dist/contexts/ThumbnailsContext.js +8 -0
  179. package/dist/contexts/ToolComponentContext.js +52 -0
  180. package/dist/contexts/ToolbarComponentContext.js +48 -0
  181. package/dist/contexts/ViewModeContext.js +28 -0
  182. package/dist/contexts/ViewportContext.js +85 -0
  183. package/dist/contexts/VirtualGridContext.js +15 -0
  184. package/dist/contexts/VirtualScrollContext.js +53 -0
  185. package/dist/contexts/ZoomContext.js +97 -0
  186. package/dist/floating-ui.react-dom-6b2fe0df.js +1474 -0
  187. package/dist/index-35c7f4a2.js +332 -0
  188. package/dist/index-f563c6f0.js +1889 -0
  189. package/dist/main.js +86 -0
  190. package/dist/th_TH-d627cd51.js +398 -0
  191. package/dist/types/components/RPConfig.d.ts +3 -0
  192. package/dist/types/components/RPController.d.ts +3 -0
  193. package/dist/types/components/RPDropFileZone.d.ts +2 -0
  194. package/dist/types/components/RPPages.d.ts +2 -0
  195. package/dist/types/components/RPProvider.d.ts +3 -0
  196. package/dist/types/components/RPTheme.d.ts +3 -0
  197. package/dist/types/components/icons/CheckIcon.d.ts +2 -0
  198. package/dist/types/components/icons/ChevronDownIcon.d.ts +2 -0
  199. package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
  200. package/dist/types/components/icons/ClearIcon.d.ts +2 -0
  201. package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
  202. package/dist/types/components/icons/CloseIcon.d.ts +2 -0
  203. package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
  204. package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
  205. package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
  206. package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
  207. package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
  208. package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
  209. package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
  210. package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
  211. package/dist/types/components/icons/InfoIcon.d.ts +2 -0
  212. package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
  213. package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
  214. package/dist/types/components/icons/MoonIcon.d.ts +2 -0
  215. package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
  216. package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
  217. package/dist/types/components/icons/SearchIcon.d.ts +2 -0
  218. package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
  219. package/dist/types/components/icons/SunIcon.d.ts +2 -0
  220. package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
  221. package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
  222. package/dist/types/components/icons/Thumbnail.d.ts +2 -0
  223. package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
  224. package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
  225. package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
  226. package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
  227. package/dist/types/components/layout/Container.d.ts +8 -0
  228. package/dist/types/components/layout/LayoutContainer.d.ts +14 -0
  229. package/dist/types/components/layout/LayoutWrapper.d.ts +12 -0
  230. package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -0
  231. package/dist/types/components/layout/RPLayout.d.ts +3 -0
  232. package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
  233. package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
  234. package/dist/types/components/layout/sidebar/RPSplitter.d.ts +9 -0
  235. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
  236. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +8 -0
  237. package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
  238. package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
  239. package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
  240. package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
  241. package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
  242. package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
  243. package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
  244. package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
  245. package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
  246. package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
  247. package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
  248. package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
  249. package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
  250. package/dist/types/components/layout/toolbar/RPMenuItem.d.ts +11 -0
  251. package/dist/types/components/layout/toolbar/RPMoreOptions.d.ts +3 -0
  252. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -0
  253. package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
  254. package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
  255. package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
  256. package/dist/types/components/layout/toolbar/SearchCloseButton.d.ts +7 -0
  257. package/dist/types/components/layout/toolbar/SearchResultNavigator.d.ts +1 -0
  258. package/dist/types/components/layout/toolbar/SearchTool.d.ts +3 -0
  259. package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
  260. package/dist/types/components/layout/toolbar/ThumbnailTool.d.ts +2 -0
  261. package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +3 -0
  262. package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
  263. package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
  264. package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
  265. package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
  266. package/dist/types/components/layout/toolbar/tools/DocumentPropertiesTool.d.ts +3 -0
  267. package/dist/types/components/layout/toolbar/tools/FileDownloadTool.d.ts +3 -0
  268. package/dist/types/components/layout/toolbar/tools/FileUploadTool.d.ts +3 -0
  269. package/dist/types/components/layout/toolbar/tools/FullScreenTool.d.ts +3 -0
  270. package/dist/types/components/layout/toolbar/tools/InputPageTool.d.ts +2 -0
  271. package/dist/types/components/layout/toolbar/tools/NextPageTool.d.ts +3 -0
  272. package/dist/types/components/layout/toolbar/tools/PreviousPageTool.d.ts +3 -0
  273. package/dist/types/components/layout/toolbar/tools/PrintTool.d.ts +3 -0
  274. package/dist/types/components/layout/toolbar/tools/RotateClockwiseTool.d.ts +3 -0
  275. package/dist/types/components/layout/toolbar/tools/RotateCounterclockwiseTool.d.ts +3 -0
  276. package/dist/types/components/layout/toolbar/tools/ThemeSwitcherTool.d.ts +3 -0
  277. package/dist/types/components/layout/toolbar/tools/ThumbnailTool.d.ts +3 -0
  278. package/dist/types/components/layout/toolbar/tools/ZoomInTool.d.ts +3 -0
  279. package/dist/types/components/layout/toolbar/tools/ZoomLevelTool.d.ts +3 -0
  280. package/dist/types/components/layout/toolbar/tools/ZoomOutTool.d.ts +3 -0
  281. package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
  282. package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
  283. package/dist/types/components/layout/toolbar/tools/more-options/DocumentProperties.d.ts +3 -0
  284. package/dist/types/components/layout/toolbar/tools/more-options/FileDownloadTool.d.ts +3 -0
  285. package/dist/types/components/layout/toolbar/tools/more-options/FileUploadTool.d.ts +3 -0
  286. package/dist/types/components/layout/toolbar/tools/more-options/FullScreenTool.d.ts +3 -0
  287. package/dist/types/components/layout/toolbar/tools/more-options/MostPageTool.d.ts +3 -0
  288. package/dist/types/components/layout/toolbar/tools/more-options/PrintTool.d.ts +3 -0
  289. package/dist/types/components/layout/toolbar/tools/more-options/RotateTool.d.ts +3 -0
  290. package/dist/types/components/layout/toolbar/tools/more-options/ScrollModeTool.d.ts +3 -0
  291. package/dist/types/components/layout/toolbar/tools/more-options/SelectionModeTool.d.ts +3 -0
  292. package/dist/types/components/layout/toolbar/tools/more-options/ViewModeTool.d.ts +3 -0
  293. package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
  294. package/dist/types/components/page/CanvasLayer.d.ts +8 -0
  295. package/dist/types/components/page/CustomElement.d.ts +6 -0
  296. package/dist/types/components/page/DualPage.d.ts +5 -0
  297. package/dist/types/components/page/RPPage.d.ts +7 -0
  298. package/dist/types/components/page/SinglePage.d.ts +5 -0
  299. package/dist/types/components/page/TextHighlightLayer.d.ts +10 -0
  300. package/dist/types/components/page/TextLayer.d.ts +6 -0
  301. package/dist/types/components/page/searchHighlight.d.ts +5 -0
  302. package/dist/types/components/ui/Button.d.ts +8 -0
  303. package/dist/types/components/ui/Checkbox.d.ts +9 -0
  304. package/dist/types/components/ui/DropDown.d.ts +10 -0
  305. package/dist/types/components/ui/Input.d.ts +8 -0
  306. package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
  307. package/dist/types/components/ui/PasswordModal.d.ts +3 -0
  308. package/dist/types/components/ui/RPTooltip.d.ts +11 -0
  309. package/dist/types/contexts/ConfigContext.d.ts +5 -0
  310. package/dist/types/contexts/DarkModeContext.d.ts +5 -0
  311. package/dist/types/contexts/DimensionPagesContext.d.ts +4 -0
  312. package/dist/types/contexts/DocumentPasswordContext.d.ts +14 -0
  313. package/dist/types/contexts/DownloadContext.d.ts +11 -0
  314. package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
  315. package/dist/types/contexts/ElementPageContext.d.ts +6 -0
  316. package/dist/types/contexts/FileInputContext.d.ts +7 -0
  317. package/dist/types/contexts/FullScreenContext.d.ts +7 -0
  318. package/dist/types/contexts/GlobalCurrentPage.d.ts +11 -0
  319. package/dist/types/contexts/HighlightContext.d.ts +8 -0
  320. package/dist/types/contexts/IconContext.d.ts +7 -0
  321. package/dist/types/contexts/IconToolContext.d.ts +9 -0
  322. package/dist/types/contexts/InitialStateContext.d.ts +5 -0
  323. package/dist/types/contexts/LayerContext.d.ts +5 -0
  324. package/dist/types/contexts/LayoutContainerContext.d.ts +12 -0
  325. package/dist/types/contexts/LicenseContext.d.ts +7 -0
  326. package/dist/types/contexts/LoaderContext.d.ts +12 -0
  327. package/dist/types/contexts/LocalizationContext.d.ts +5 -0
  328. package/dist/types/contexts/OtherToolContext.d.ts +9 -0
  329. package/dist/types/contexts/PageViewportContext.d.ts +4 -0
  330. package/dist/types/contexts/PagesRotateContext.d.ts +15 -0
  331. package/dist/types/contexts/PaginationContext.d.ts +5 -0
  332. package/dist/types/contexts/PrintContext.d.ts +7 -0
  333. package/dist/types/contexts/RPDocumentContext.d.ts +12 -0
  334. package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
  335. package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
  336. package/dist/types/contexts/RotationContext.d.ts +5 -0
  337. package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
  338. package/dist/types/contexts/SearchContext.d.ts +7 -0
  339. package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
  340. package/dist/types/contexts/SmoothScrollContext.d.ts +8 -0
  341. package/dist/types/contexts/ThemeContext.d.ts +4 -0
  342. package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
  343. package/dist/types/contexts/ToolComponentContext.d.ts +12 -0
  344. package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
  345. package/dist/types/contexts/ViewModeContext.d.ts +5 -0
  346. package/dist/types/contexts/ViewportContext.d.ts +28 -0
  347. package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
  348. package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
  349. package/dist/types/contexts/ZoomContext.d.ts +5 -0
  350. package/dist/types/locales/en_US.json.d.ts +81 -0
  351. package/dist/types/locales/it_IT.json.d.ts +81 -0
  352. package/dist/types/locales/pt_PT.json.d.ts +81 -0
  353. package/dist/types/locales/th_TH.json.d.ts +81 -0
  354. package/dist/types/locales/zh_CN.json.d.ts +81 -0
  355. package/dist/types/main.d.ts +45 -0
  356. package/dist/types/utils/Queue.d.ts +18 -0
  357. package/dist/types/utils/annotations.d.ts +9 -0
  358. package/dist/types/utils/appConsole.d.ts +24 -0
  359. package/dist/types/utils/calculatePage.d.ts +12 -0
  360. package/dist/types/utils/charators.d.ts +12 -0
  361. package/dist/types/utils/const.d.ts +3 -0
  362. package/dist/types/utils/constants.d.ts +5 -0
  363. package/dist/types/utils/convertPdfDate.d.ts +1 -0
  364. package/dist/types/utils/dateFormatter.d.ts +1 -0
  365. package/dist/types/utils/elementPagePosition.d.ts +17 -0
  366. package/dist/types/utils/formatFileSize.d.ts +1 -0
  367. package/dist/types/utils/getScrollDistance.d.ts +1 -0
  368. package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
  369. package/dist/types/utils/getWordPositionInPage.d.ts +8 -0
  370. package/dist/types/utils/getZoomLevel.d.ts +2 -0
  371. package/dist/types/utils/highlight.d.ts +14 -0
  372. package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
  373. package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
  374. package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
  375. package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
  376. package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
  377. package/dist/types/utils/hooks/useFlickerSelectText.d.ts +1 -0
  378. package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
  379. package/dist/types/utils/hooks/useGrabScroll.d.ts +11 -0
  380. package/dist/types/utils/hooks/useHighlight.d.ts +10 -0
  381. package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
  382. package/dist/types/utils/hooks/useLicense.d.ts +2 -0
  383. package/dist/types/utils/hooks/useLoadPdf.d.ts +11 -0
  384. package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
  385. package/dist/types/utils/hooks/useLocalization.d.ts +10 -0
  386. package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
  387. package/dist/types/utils/hooks/usePageRotateContext.d.ts +3 -0
  388. package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
  389. package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
  390. package/dist/types/utils/hooks/usePinch.d.ts +1 -0
  391. package/dist/types/utils/hooks/usePresentPage.d.ts +1 -0
  392. package/dist/types/utils/hooks/usePrint.d.ts +11 -0
  393. package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
  394. package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
  395. package/dist/types/utils/hooks/useRotate.d.ts +4 -0
  396. package/dist/types/utils/hooks/useScrollToPage.d.ts +3 -0
  397. package/dist/types/utils/hooks/useSearch.d.ts +14 -0
  398. package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
  399. package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +17 -0
  400. package/dist/types/utils/hooks/useWatermark.d.ts +1 -0
  401. package/dist/types/utils/link_service.d.ts +71 -0
  402. package/dist/types/utils/renderPage.d.ts +3 -0
  403. package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
  404. package/dist/types/utils/smoothScrollTo.d.ts +2 -0
  405. package/dist/types/utils/types.d.ts +856 -0
  406. package/dist/types/utils/withRef.d.ts +4 -0
  407. package/dist/utils/Queue.js +47 -0
  408. package/dist/utils/annotations.js +306 -0
  409. package/dist/utils/appConsole.js +42 -0
  410. package/dist/utils/calculatePage.js +15 -0
  411. package/dist/utils/charators.js +48 -0
  412. package/dist/utils/const.js +9 -0
  413. package/dist/utils/constants.js +8 -0
  414. package/dist/utils/convertPdfDate.js +25 -0
  415. package/dist/utils/dateFormatter.js +7 -0
  416. package/dist/utils/elementPagePosition.js +11 -0
  417. package/dist/utils/formatFileSize.js +9 -0
  418. package/dist/utils/getScrollDistance.js +4 -0
  419. package/dist/utils/getThumbnailViewport.js +7 -0
  420. package/dist/utils/getWordPositionInPage.js +25 -0
  421. package/dist/utils/getZoomLevel.js +23 -0
  422. package/dist/utils/highlight.js +221 -0
  423. package/dist/utils/hooks/useDarkMode.js +11 -0
  424. package/dist/utils/hooks/useDarkModeProps.js +11 -0
  425. package/dist/utils/hooks/useDebounce.js +19 -0
  426. package/dist/utils/hooks/useElementSize.js +21 -0
  427. package/dist/utils/hooks/useFileDownload.js +58 -0
  428. package/dist/utils/hooks/useFlickerSelectText.js +25 -0
  429. package/dist/utils/hooks/useFullScreen.js +29 -0
  430. package/dist/utils/hooks/useGrabScroll.js +52 -0
  431. package/dist/utils/hooks/useHighlight.js +54 -0
  432. package/dist/utils/hooks/useInfiniteScroll.js +19 -0
  433. package/dist/utils/hooks/useLicense.js +110 -0
  434. package/dist/utils/hooks/useLoadPdf.js +77 -0
  435. package/dist/utils/hooks/useLoadWorker.js +13 -0
  436. package/dist/utils/hooks/useLocalization.js +25 -0
  437. package/dist/utils/hooks/useMousePressed.js +20 -0
  438. package/dist/utils/hooks/usePageRotateContext.js +26 -0
  439. package/dist/utils/hooks/usePaginate.js +60 -0
  440. package/dist/utils/hooks/usePdfProperties.js +37 -0
  441. package/dist/utils/hooks/usePinch.js +79 -0
  442. package/dist/utils/hooks/usePresentPage.js +60 -0
  443. package/dist/utils/hooks/usePrint.js +59 -0
  444. package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
  445. package/dist/utils/hooks/useResizeObserver.js +22 -0
  446. package/dist/utils/hooks/useRotate.js +13 -0
  447. package/dist/utils/hooks/useScrollToPage.js +62 -0
  448. package/dist/utils/hooks/useSearch.js +62 -0
  449. package/dist/utils/hooks/useThumbnail.js +59 -0
  450. package/dist/utils/hooks/useVirtualReactWindow.js +60 -0
  451. package/dist/utils/hooks/useWatermark.js +91 -0
  452. package/dist/utils/link_service.js +98 -0
  453. package/dist/utils/renderPage.js +17 -0
  454. package/dist/utils/sanitizeExternalUrl.js +16 -0
  455. package/dist/utils/smoothScrollTo.js +6 -0
  456. package/dist/utils/types.js +21 -0
  457. package/dist/utils/withRef.js +8 -0
  458. package/package.json +91 -0
@@ -0,0 +1,4 @@
1
+ import { ForwardRefRenderFunction, PropsWithoutRef, Ref } from 'react';
2
+ export declare const withRef: <R extends HTMLElement, P = object>(render: ForwardRefRenderFunction<R, PropsWithoutRef<P>>) => import('react').ForwardRefExoticComponent<PropsWithoutRef<P> & import('react').RefAttributes<R>> | ((props: PropsWithoutRef<P> & {
3
+ ref?: Ref<R>;
4
+ }) => import('react').ReactNode);
@@ -0,0 +1,47 @@
1
+ var m = Object.defineProperty;
2
+ var _ = (s, e, t) => e in s ? m(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var n = (s, e, t) => (_(s, typeof e != "symbol" ? e + "" : e, t), t);
4
+ class d {
5
+ constructor(e) {
6
+ n(this, "_items", []);
7
+ n(this, "_triggerEnqueue");
8
+ this._triggerEnqueue = e;
9
+ }
10
+ // Add item to queue with priority (lower number = higher priority)
11
+ enqueue(e, t, i = 0) {
12
+ const r = { id: e, data: t, priority: i }, u = this._items.findIndex((h) => h.priority > i);
13
+ u === -1 ? this._items.push(r) : this._items.splice(u, 0, r), this._triggerEnqueue(t);
14
+ }
15
+ // Remove and return highest priority item
16
+ dequeue() {
17
+ return this._items.shift();
18
+ }
19
+ // Remove item by id
20
+ removeQueue(e) {
21
+ const t = this._items.findIndex((i) => i.id === e);
22
+ return t !== -1 ? (this._items.splice(t, 1), !0) : !1;
23
+ }
24
+ // Change priority of item by id
25
+ changePagePriority(e, t) {
26
+ const i = this._items.find((r) => new RegExp(e).test(r.id));
27
+ return i ? (this.removeQueue(i.id), this.enqueue(i.id, i.data, t), !0) : !1;
28
+ }
29
+ peekAll() {
30
+ return this._items;
31
+ }
32
+ // Check if queue is empty
33
+ isEmpty() {
34
+ return this._items.length === 0;
35
+ }
36
+ // Get current size of queue
37
+ size() {
38
+ return this._items.length;
39
+ }
40
+ // Clear all items
41
+ clear() {
42
+ this._items = [];
43
+ }
44
+ }
45
+ export {
46
+ d as Queue
47
+ };
@@ -0,0 +1,306 @@
1
+ import { sanitizeExternalUrl as L } from "./sanitizeExternalUrl.js";
2
+ import { AnnotationSubType as _, AnnotationType as l } from "./types.js";
3
+ import { dateFormatter as I } from "./dateFormatter.js";
4
+ const v = ["click", "dblclick", "input", "change"], g = /* @__PURE__ */ new Map(), E = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
5
+ function x(e, t) {
6
+ const n = E(e, t);
7
+ return g.has(n) ? g.get(n) ?? null : null;
8
+ }
9
+ const B = (e, t, n) => {
10
+ g.set(E(e, t), n);
11
+ }, O = (e, t) => {
12
+ switch (t[1].name) {
13
+ case "XYZ":
14
+ return {
15
+ bottomOffset: (n, a) => t[3] === null ? a : t[3],
16
+ leftOffset: (n, a) => t[2] === null ? 0 : t[2],
17
+ pageIndex: e,
18
+ scaleTo: t[4]
19
+ };
20
+ case "Fit":
21
+ case "FitB":
22
+ return {
23
+ bottomOffset: 0,
24
+ leftOffset: 0,
25
+ pageIndex: e,
26
+ scaleTo: 1
27
+ };
28
+ case "FitH":
29
+ case "FitBH":
30
+ return {
31
+ bottomOffset: t[2],
32
+ leftOffset: 0,
33
+ pageIndex: e,
34
+ scaleTo: 1
35
+ };
36
+ default:
37
+ return {
38
+ bottomOffset: 0,
39
+ leftOffset: 0,
40
+ pageIndex: e,
41
+ scaleTo: 1
42
+ };
43
+ }
44
+ };
45
+ async function b(e, t) {
46
+ let n;
47
+ if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
48
+ const a = n[0], s = x(e, a);
49
+ if (s === null) {
50
+ const r = await e.getPageIndex(a);
51
+ return B(e, a, r), await b(e, n);
52
+ } else
53
+ return O(s, n);
54
+ } else
55
+ return O(n[0], n);
56
+ }
57
+ const H = (e) => {
58
+ const n = e.target.parentNode;
59
+ if (!n)
60
+ return;
61
+ const a = new MutationObserver((s) => {
62
+ s.forEach(() => {
63
+ n.querySelectorAll(
64
+ '[data-l10n-id="pdfjs-annotation-date-time-string"]'
65
+ ).forEach((o) => {
66
+ const c = o.getAttribute("data-l10n-args");
67
+ if (c) {
68
+ try {
69
+ const { dateObj: i } = JSON.parse(c);
70
+ i && (o.textContent = I(i));
71
+ } catch {
72
+ }
73
+ a.disconnect();
74
+ }
75
+ });
76
+ });
77
+ });
78
+ return a.observe(n, {
79
+ childList: !0,
80
+ // Watch for changes to child elements
81
+ subtree: !0,
82
+ // Watch all descendants, not just direct children
83
+ attributes: !0
84
+ // Watch for changes to attributes
85
+ }), () => a.disconnect();
86
+ }, M = (e, t, n, a) => {
87
+ if (e.type !== "click")
88
+ return;
89
+ const s = e.target, r = s.getAttribute("data-element-id"), o = s.getAttribute("href");
90
+ if (o && o !== "#")
91
+ return;
92
+ const c = t.find((i) => i.id === r);
93
+ !c || c.annotationType !== _.Link || c.dest && b(n, c.dest).then((i) => {
94
+ a(i);
95
+ });
96
+ };
97
+ function P(e, t) {
98
+ for (const n of v)
99
+ e.addEventListener(n, t);
100
+ }
101
+ function U(e, t) {
102
+ for (const n of v)
103
+ e.removeEventListener(n, t);
104
+ }
105
+ function V(e) {
106
+ const { id: t, url: n, unsafeUrl: a } = e;
107
+ new MutationObserver((r, o) => {
108
+ const c = document.querySelector(`[data-annotation-id="${t}"]`);
109
+ if (c) {
110
+ const i = c.querySelector("a"), p = L((n || a) ?? "", "");
111
+ i && (i == null || i.setAttribute("target", "_blank"), i == null || i.setAttribute("href", p), i == null || i.setAttribute("rel", "noopener noreferrer")), o.disconnect();
112
+ }
113
+ }).observe(document.body, { childList: !0, subtree: !0 });
114
+ }
115
+ function $(e, t, n) {
116
+ const { rotation: a, scale: s } = t, r = a % 180 === 0;
117
+ if (e.fieldType === "Btn" && e.pushButton) {
118
+ const o = e.rect[2] - e.rect[0], c = e.rect[3] - e.rect[1], i = document.createElement("canvas");
119
+ i.setAttribute("width", ((r ? o : c) * s).toString()), i.setAttribute("height", ((r ? c : o) * s).toString()), n.set(e.id, i);
120
+ }
121
+ }
122
+ function k(e) {
123
+ var r;
124
+ let t = e;
125
+ for (; t.tagName !== "SECTION"; )
126
+ t = t.parentElement;
127
+ const n = t.getAttribute("aria-haspopup") === "dialog", a = t.classList.contains("popupAnnotation");
128
+ if (!n && !a)
129
+ return;
130
+ let s = t.id || t.getAttribute("aria-controls");
131
+ if (s || (s = (r = t.firstChild) == null ? void 0 : r.id), s && t.parentElement) {
132
+ const o = t.parentElement.querySelector(`[aria-controls="${s}"]`);
133
+ o && new MutationObserver((i, p) => {
134
+ const h = document.querySelectorAll(".popupDate");
135
+ h.length > 0 && (h.forEach((m) => {
136
+ if (m.innerHTML)
137
+ return !1;
138
+ const N = m.getAttribute("data-l10n-args");
139
+ if (N) {
140
+ const { date: y, time: A } = JSON.parse(N);
141
+ y && A && (m.textContent = `${y}, ${A}`);
142
+ }
143
+ }), p.disconnect());
144
+ }).observe(o, { childList: !0, subtree: !0 });
145
+ }
146
+ }
147
+ function d(e, t, n) {
148
+ const a = [];
149
+ if (n)
150
+ for (const s of n)
151
+ s[e] === t && a.push(s);
152
+ return a;
153
+ }
154
+ function u(e, t) {
155
+ return { type: e, data: t };
156
+ }
157
+ async function S(e, t) {
158
+ if (e.dest)
159
+ if (typeof e.dest == "string") {
160
+ const n = await b(t, e.dest);
161
+ return u(l.INTERNAL_LINK, {
162
+ referencedPage: n.pageIndex,
163
+ offset: null
164
+ });
165
+ } else {
166
+ const n = await t.getPageIndex(e.dest[0]);
167
+ return u(l.INTERNAL_LINK, {
168
+ referencedPage: n,
169
+ offset: {
170
+ left: e.dest[2],
171
+ bottom: e.dest[3]
172
+ }
173
+ });
174
+ }
175
+ else if (e.url)
176
+ return u(l.LINK, {
177
+ url: e.url,
178
+ unsafeUrl: e.unsafeUrl
179
+ });
180
+ }
181
+ function T(e) {
182
+ for (const t of e.getElementsByTagName("span")) {
183
+ let n = t.textContent;
184
+ const a = JSON.parse(t.dataset.l10nArgs ?? "{}");
185
+ if (n)
186
+ for (const s in a)
187
+ n = n.replace(`{{${s}}}`, a[s]);
188
+ t.textContent = n;
189
+ }
190
+ }
191
+ function w(e) {
192
+ return u(l.FILE_ATTACHMENT, e.file);
193
+ }
194
+ function f(e, t) {
195
+ switch (e.type) {
196
+ case "textarea":
197
+ case "text":
198
+ return u(l.FORM_TEXT, {
199
+ fieldName: e.name,
200
+ value: e.value
201
+ });
202
+ case "select-one":
203
+ case "select-multiple":
204
+ const n = [];
205
+ for (const s of e.options)
206
+ n.push({
207
+ value: s.value,
208
+ label: s.label
209
+ });
210
+ const a = [];
211
+ for (const s of e.selectedOptions)
212
+ a.push({
213
+ value: s.value,
214
+ label: s.label
215
+ });
216
+ return u(l.FORM_SELECT, {
217
+ fieldName: e.name,
218
+ value: a,
219
+ options: n
220
+ });
221
+ case "checkbox":
222
+ return u(l.FORM_CHECKBOX, {
223
+ fieldName: e.name,
224
+ checked: e.checked
225
+ });
226
+ case "radio":
227
+ return u(l.FORM_RADIO, {
228
+ fieldName: e.name,
229
+ ...t
230
+ });
231
+ case "button":
232
+ return u(l.FORM_BUTTON, {
233
+ fieldName: e.name,
234
+ ...t
235
+ });
236
+ }
237
+ }
238
+ async function D(e, t, n) {
239
+ var s;
240
+ let a = e.target.parentNode;
241
+ if (a.tagName === "DIV" && (a = a.firstChild), k(a), typeof a.className != "object")
242
+ if (a.className === "linkAnnotation" && e.type === "click") {
243
+ const r = (s = a.dataset) == null ? void 0 : s.annotationId;
244
+ if (r) {
245
+ const o = d("id", r, n);
246
+ if (o.length)
247
+ return await S(o[0], t);
248
+ }
249
+ } else if (
250
+ /* annotation.className.includes('popupAnnotation') || */
251
+ a.className.includes("textAnnotation")
252
+ )
253
+ T(a);
254
+ else if (a.className.includes("fileAttachmentAnnotation")) {
255
+ T(a);
256
+ const r = a.dataset.annotationId;
257
+ if (r && e.type === "dblclick")
258
+ return w(d("id", r, n)[0]);
259
+ } else if (a.className.includes("textWidgetAnnotation") && e.type === "input") {
260
+ let r = a.getElementsByTagName("input")[0];
261
+ return r || (r = a.getElementsByTagName("textarea")[0]), f(r);
262
+ } else {
263
+ if (a.className.includes("choiceWidgetAnnotation") && e.type === "input")
264
+ return f(a.getElementsByTagName("select")[0]);
265
+ if (a.className.includes("buttonWidgetAnnotation checkBox") && e.type === "change")
266
+ return f(a.getElementsByTagName("input")[0]);
267
+ if (a.className.includes("buttonWidgetAnnotation radioButton") && e.type === "change") {
268
+ const r = a.dataset.annotationId;
269
+ if (r) {
270
+ const o = d("id", r, n)[0], c = [];
271
+ for (const i of d(
272
+ "fieldName",
273
+ o.fieldName,
274
+ n
275
+ ))
276
+ i.buttonValue && c.push(i.buttonValue);
277
+ return f(a.getElementsByTagName("input")[0], {
278
+ value: o.buttonValue,
279
+ defaultValue: o.fieldValue,
280
+ options: c
281
+ });
282
+ }
283
+ } else if (a.className.includes("buttonWidgetAnnotation pushButton") && e.type === "click") {
284
+ const r = a.dataset.annotationId;
285
+ if (r) {
286
+ const o = d("id", r, n)[0], { action: c } = o;
287
+ return c && ["Print", "SaveAs"].includes(c) ? { type: l.BUTTON, data: o } : o.resetForm ? f(
288
+ { name: o.fieldName, type: "button" },
289
+ { actions: o.actions, reset: !0 }
290
+ ) : f(
291
+ { name: o.fieldName, type: "button" },
292
+ { actions: o.actions, reset: !1 }
293
+ );
294
+ }
295
+ }
296
+ }
297
+ }
298
+ export {
299
+ D as annotationEventsHandler,
300
+ H as annotationsEvents,
301
+ P as bindLayerEvents,
302
+ V as handleAnnotationLink,
303
+ $ as handleAnnotationWidget,
304
+ M as handleClick,
305
+ U as unbindLayerEvents
306
+ };
@@ -0,0 +1,42 @@
1
+ var s = Object.defineProperty;
2
+ var i = (e, n, c) => n in e ? s(e, n, { enumerable: !0, configurable: !0, writable: !0, value: c }) : e[n] = c;
3
+ var o = (e, n, c) => (i(e, typeof n != "symbol" ? n + "" : n, c), c);
4
+ const t = class t {
5
+ constructor() {
6
+ o(this, "isProduction");
7
+ this.isProduction = !0;
8
+ }
9
+ static getInstance() {
10
+ return t.instance || (t.instance = new t()), t.instance;
11
+ }
12
+ /**
13
+ * Debug level logging - stripped in production
14
+ */
15
+ debug(...n) {
16
+ this.isProduction || console.debug("[React PDF Debug]:", ...n);
17
+ }
18
+ /**
19
+ * Info level logging - kept in production
20
+ */
21
+ info(...n) {
22
+ console.info("[React PDF Info]:", ...n);
23
+ }
24
+ /**
25
+ * Warning level logging - kept in production
26
+ */
27
+ warn(...n) {
28
+ console.warn("[React PDF Warning]:", ...n);
29
+ }
30
+ /**
31
+ * Error level logging - kept in production
32
+ */
33
+ error(...n) {
34
+ console.error("[React PDF Error]:", ...n);
35
+ }
36
+ };
37
+ o(t, "instance");
38
+ let r = t;
39
+ const u = r.getInstance();
40
+ export {
41
+ u as appConsole
42
+ };
@@ -0,0 +1,15 @@
1
+ const d = (e, t, o) => e * o + t + 1, a = (e, t) => {
2
+ const o = e - 1, n = Math.floor(o / t), s = (o - n * t) % t;
3
+ return { rowIndex: n, columnIndex: s };
4
+ }, h = (e, t) => {
5
+ const o = [], n = [];
6
+ return e.heights.forEach((s, c) => {
7
+ const r = a(c + 1, t), i = e.widths[c];
8
+ o[r.rowIndex] = Math.max(o[r.rowIndex] || 0, s), n[r.columnIndex] = Math.max(n[r.columnIndex] || 0, i);
9
+ }), { rowsHeight: o, columnsWidth: n };
10
+ };
11
+ export {
12
+ h as getGridDimension,
13
+ d as getPageFromPosition,
14
+ a as getPositionFromPage
15
+ };
@@ -0,0 +1,48 @@
1
+ function i(n) {
2
+ return n < 11904;
3
+ }
4
+ function t(n) {
5
+ return (n & 65408) === 0;
6
+ }
7
+ function u(n) {
8
+ return n >= /* a = */
9
+ 97 && n <= /* z = */
10
+ 122 || n >= /* A = */
11
+ 65 && n <= /* Z = */
12
+ 90;
13
+ }
14
+ function r(n) {
15
+ return n >= /* 0 = */
16
+ 48 && n <= /* 9 = */
17
+ 57;
18
+ }
19
+ function f(n) {
20
+ return n === /* SPACE = */
21
+ 32 || n === /* TAB = */
22
+ 9 || n === /* CR = */
23
+ 13 || n === /* LF = */
24
+ 10;
25
+ }
26
+ function s(n) {
27
+ return n >= 13312 && n <= 40959 || n >= 63744 && n <= 64255;
28
+ }
29
+ function e(n) {
30
+ return n >= 12448 && n <= 12543;
31
+ }
32
+ function l(n) {
33
+ return n >= 12352 && n <= 12447;
34
+ }
35
+ function p(n) {
36
+ return n >= 65376 && n <= 65439;
37
+ }
38
+ function A(n) {
39
+ return (n & 65408) === 3584;
40
+ }
41
+ function g(n) {
42
+ return i(n) ? t(n) ? f(n) ? 0 : u(n) || r(n) || n === /* UNDERSCORE = */
43
+ 95 ? 1 : 2 : A(n) ? 7 : n === /* NBSP = */
44
+ 160 ? 0 : 1 : s(n) ? 3 : e(n) ? 4 : l(n) ? 5 : p(n) ? 6 : 1;
45
+ }
46
+ export {
47
+ g as getCharacterType
48
+ };
@@ -0,0 +1,9 @@
1
+ const e = {
2
+ keyword: "",
3
+ regExp: new RegExp(" "),
4
+ wholeWords: !1
5
+ }, E = "This feature is only available for the Organization license";
6
+ export {
7
+ e as EMPTY_KEYWORD_REGEXP,
8
+ E as ORGANIZATION_ALLOWED_FEATURES_MESSAGE
9
+ };
@@ -0,0 +1,8 @@
1
+ const _ = 4, A = 200, o = 20, t = 25, I = 1e3;
2
+ export {
3
+ I as MAX_ZOOM_SCALE,
4
+ t as MIN_ZOOM_SCALE,
5
+ _ as PAGE_PADDING,
6
+ o as SCROLL_BAR_WIDTH,
7
+ A as THUMBNAIL_MIN_WIDTH
8
+ };
@@ -0,0 +1,25 @@
1
+ const p = new RegExp(
2
+ "^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"
3
+ ), t = (s, e, o, c) => {
4
+ const n = parseInt(s, 10);
5
+ return n >= e && n <= o ? n : c;
6
+ }, f = (s) => {
7
+ const e = p.exec(s);
8
+ if (!e)
9
+ return null;
10
+ const o = parseInt(e[1], 10), c = t(e[2], 1, 12, 1) - 1, n = t(e[3], 1, 31, 1);
11
+ let r = t(e[4], 0, 23, 0), a = t(e[5], 0, 59, 0);
12
+ const i = t(e[6], 0, 59, 0), l = e[7] || "Z", d = t(e[8], 0, 23, 0), u = t(e[9], 0, 59, 0);
13
+ switch (l) {
14
+ case "-":
15
+ r += d, a += u;
16
+ break;
17
+ case "+":
18
+ r -= d, a -= u;
19
+ break;
20
+ }
21
+ return new Date(Date.UTC(o, c, n, r, a, i));
22
+ };
23
+ export {
24
+ f as convertPDFDate
25
+ };
@@ -0,0 +1,7 @@
1
+ const e = new Intl.DateTimeFormat("en-US", {
2
+ dateStyle: "short",
3
+ timeStyle: "medium"
4
+ }).format, r = (t) => e(new Date(t));
5
+ export {
6
+ r as dateFormatter
7
+ };
@@ -0,0 +1,11 @@
1
+ const o = ({ width: a, height: c, top: t, left: r, bottom: e, right: l }) => ({
2
+ left: `calc(${r} * var(--scale-factor))`,
3
+ top: `calc(${t} * var(--scale-factor))`,
4
+ width: `calc(${a} * var(--scale-factor))`,
5
+ height: `calc(${c} * var(--scale-factor))`,
6
+ bottom: `calc(${e} * var(--scale-factor))`,
7
+ right: `calc(${l} * var(--scale-factor))`
8
+ });
9
+ export {
10
+ o as elementPagePosition
11
+ };
@@ -0,0 +1,9 @@
1
+ function i(t, e) {
2
+ if (t == 0)
3
+ return "0 Bytes";
4
+ var o = 1e3, r = e || 2, a = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], B = Math.floor(Math.log(t) / Math.log(o));
5
+ return parseFloat((t / Math.pow(o, B)).toFixed(r)) + " " + a[B];
6
+ }
7
+ export {
8
+ i as formatFileSize
9
+ };
@@ -0,0 +1,4 @@
1
+ const n = (e, r) => e.slice(0, r).reduce((t, c) => t + c, 0);
2
+ export {
3
+ n as getScrollDistance
4
+ };
@@ -0,0 +1,7 @@
1
+ const n = (t, o = 0) => {
2
+ const e = 100 / t.getViewport({ scale: 1 }).width, i = t.getViewport({ scale: e, rotation: o });
3
+ return { scale: e, thumbnailViewport: i };
4
+ };
5
+ export {
6
+ n as getThumbnailViewport
7
+ };
@@ -0,0 +1,25 @@
1
+ const a = (i, h, l, o, n) => {
2
+ const c = l.height * o, s = l.width * o, y = l.top * o, w = l.left * o, d = {
3
+ width: n % 180 === 90 ? i.height : i.width,
4
+ height: n % 180 === 90 ? i.width : i.height
5
+ }, r = {
6
+ width: n % 180 === 90 ? c : s,
7
+ height: n % 180 === 90 ? s : c
8
+ }, t = document.createElement("div");
9
+ t.style.width = `${d.width}px`, t.style.height = `${d.height}px`, t.style.position = "absolute", t.style.transform = `rotate(${n}deg)`, t.style.transformOrigin = "center center", t.style.visibility = "hidden", t.style.left = "-99999px";
10
+ const e = document.createElement("div");
11
+ e.style.position = "absolute", e.style.width = `${s}px`, e.style.height = `${c}px`, e.style.position = "absolute", e.style.bottom = `${y}px`, e.style.left = `${w}px`, t.appendChild(e), h.appendChild(t);
12
+ const p = t.getBoundingClientRect(), g = e.getBoundingClientRect();
13
+ h.removeChild(t);
14
+ const u = {
15
+ top: h.clientHeight / 2,
16
+ left: h.clientWidth / 2
17
+ };
18
+ return {
19
+ leftInPage: g.left - p.left - u.left + r.width / 2,
20
+ topInPage: g.top - p.top - u.top + r.height / 2
21
+ };
22
+ };
23
+ export {
24
+ a as getWordPositionInPage
25
+ };
@@ -0,0 +1,23 @@
1
+ import { SCROLL_BAR_WIDTH as a, PAGE_PADDING as f } from "./constants.js";
2
+ import { ViewMode as u, ZoomLevel as r } from "./types.js";
3
+ const l = (o, t, m, e, A, c) => {
4
+ if (typeof o == "number")
5
+ return o;
6
+ const n = c === u.DUAL_PAGE ? 2 * e : e;
7
+ switch (o) {
8
+ case r.PAGE_FIT:
9
+ const s = Math.min(
10
+ (t - a) / n,
11
+ (m - f) / A
12
+ );
13
+ return Math.floor(s * 100);
14
+ case r.PAGE_WIDTH:
15
+ return Math.floor((t - a) / n * 100);
16
+ case r.ACTUAL:
17
+ default:
18
+ return 100;
19
+ }
20
+ };
21
+ export {
22
+ l as getZoomLevel
23
+ };