@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,139 @@
1
+ import * as i from "react";
2
+ import { jsx as C } from "react/jsx-runtime";
3
+ function m(e, n) {
4
+ const t = i.createContext(n), r = (s) => {
5
+ const { children: o, ...c } = s, a = i.useMemo(() => c, Object.values(c));
6
+ return /* @__PURE__ */ C(t.Provider, { value: a, children: o });
7
+ };
8
+ r.displayName = e + "Provider";
9
+ function u(s) {
10
+ const o = i.useContext(t);
11
+ if (o)
12
+ return o;
13
+ if (n !== void 0)
14
+ return n;
15
+ throw new Error(`\`${s}\` must be used within \`${e}\``);
16
+ }
17
+ return [r, u];
18
+ }
19
+ function E(e, n = []) {
20
+ let t = [];
21
+ function r(s, o) {
22
+ const c = i.createContext(o), a = t.length;
23
+ t = [...t, o];
24
+ const f = (d) => {
25
+ var b;
26
+ const { scope: l, children: S, ...v } = d, h = ((b = l == null ? void 0 : l[e]) == null ? void 0 : b[a]) || c, z = i.useMemo(() => v, Object.values(v));
27
+ return /* @__PURE__ */ C(h.Provider, { value: z, children: S });
28
+ };
29
+ f.displayName = s + "Provider";
30
+ function x(d, l) {
31
+ var h;
32
+ const S = ((h = l == null ? void 0 : l[e]) == null ? void 0 : h[a]) || c, v = i.useContext(S);
33
+ if (v)
34
+ return v;
35
+ if (o !== void 0)
36
+ return o;
37
+ throw new Error(`\`${d}\` must be used within \`${s}\``);
38
+ }
39
+ return [f, x];
40
+ }
41
+ const u = () => {
42
+ const s = t.map((o) => i.createContext(o));
43
+ return function(c) {
44
+ const a = (c == null ? void 0 : c[e]) || s;
45
+ return i.useMemo(
46
+ () => ({ [`__scope${e}`]: { ...c, [e]: a } }),
47
+ [c, a]
48
+ );
49
+ };
50
+ };
51
+ return u.scopeName = e, [r, P(u, ...n)];
52
+ }
53
+ function P(...e) {
54
+ const n = e[0];
55
+ if (e.length === 1)
56
+ return n;
57
+ const t = () => {
58
+ const r = e.map((u) => ({
59
+ useScope: u(),
60
+ scopeName: u.scopeName
61
+ }));
62
+ return function(s) {
63
+ const o = r.reduce((c, { useScope: a, scopeName: f }) => {
64
+ const d = a(s)[`__scope${f}`];
65
+ return { ...c, ...d };
66
+ }, {});
67
+ return i.useMemo(() => ({ [`__scope${n.scopeName}`]: o }), [o]);
68
+ };
69
+ };
70
+ return t.scopeName = n.scopeName, t;
71
+ }
72
+ function y(e) {
73
+ const n = i.useRef(e);
74
+ return i.useEffect(() => {
75
+ n.current = e;
76
+ }), i.useMemo(() => (...t) => {
77
+ var r;
78
+ return (r = n.current) == null ? void 0 : r.call(n, ...t);
79
+ }, []);
80
+ }
81
+ function $({
82
+ prop: e,
83
+ defaultProp: n,
84
+ onChange: t = () => {
85
+ }
86
+ }) {
87
+ const [r, u] = g({ defaultProp: n, onChange: t }), s = e !== void 0, o = s ? e : r, c = y(t), a = i.useCallback(
88
+ (f) => {
89
+ if (s) {
90
+ const d = typeof f == "function" ? f(e) : f;
91
+ d !== e && c(d);
92
+ } else
93
+ u(f);
94
+ },
95
+ [s, e, u, c]
96
+ );
97
+ return [o, a];
98
+ }
99
+ function g({
100
+ defaultProp: e,
101
+ onChange: n
102
+ }) {
103
+ const t = i.useState(e), [r] = t, u = i.useRef(r), s = y(n);
104
+ return i.useEffect(() => {
105
+ u.current !== r && (s(r), u.current = r);
106
+ }, [r, u, s]), t;
107
+ }
108
+ var p = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
109
+ };
110
+ function _(e) {
111
+ const [n, t] = i.useState(void 0);
112
+ return p(() => {
113
+ if (e) {
114
+ t({ width: e.offsetWidth, height: e.offsetHeight });
115
+ const r = new ResizeObserver((u) => {
116
+ if (!Array.isArray(u) || !u.length)
117
+ return;
118
+ const s = u[0];
119
+ let o, c;
120
+ if ("borderBoxSize" in s) {
121
+ const a = s.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
122
+ o = f.inlineSize, c = f.blockSize;
123
+ } else
124
+ o = e.offsetWidth, c = e.offsetHeight;
125
+ t({ width: o, height: c });
126
+ });
127
+ return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
128
+ } else
129
+ t(void 0);
130
+ }, [e]), n;
131
+ }
132
+ export {
133
+ $ as a,
134
+ _ as b,
135
+ E as c,
136
+ y as d,
137
+ m as e,
138
+ p as u
139
+ };
package/dist/main.js ADDED
@@ -0,0 +1,37 @@
1
+ import { RPDocument as t } from "./components/RPDocument.js";
2
+ import { R as x, a as m, u as n, b as p, c as s } from "./Thumbnails-06fa1aa5.js";
3
+ import { RPConfig as u } from "./components/RPConfig.js";
4
+ import { RPLayout as C } from "./components/layout/RPLayout.js";
5
+ import { RPTheme as P } from "./components/RPTheme.js";
6
+ import { RPDropFileZone as l } from "./components/RPDropFileZone.js";
7
+ import { useDarkModeContext as d } from "./contexts/DarkModeContext.js";
8
+ import { useDocumentContext as M } from "./contexts/RPDocumentContext.js";
9
+ import { useRotateContext as F } from "./contexts/RotateContext.js";
10
+ import { useDarkModeProps as Z } from "./utils/hooks/useDarkModeProps.js";
11
+ import { useViewModeContext as h } from "./contexts/ViewModeContext.js";
12
+ import { useDropFileZoneContext as S } from "./contexts/DropFileZoneContext.js";
13
+ import { useOpenFileContext as y } from "./contexts/FileInputContext.js";
14
+ import { useZoomContext as O } from "./contexts/ZoomContext.js";
15
+ import { ScrollMode as j, ViewMode as q } from "./utils/types.js";
16
+ export {
17
+ u as RPConfig,
18
+ t as RPDocument,
19
+ l as RPDropFileZone,
20
+ C as RPLayout,
21
+ P as RPTheme,
22
+ x as RPViewer,
23
+ j as ScrollMode,
24
+ q as ViewMode,
25
+ d as useDarkModeContext,
26
+ Z as useDarkModeProps,
27
+ M as useDocumentContext,
28
+ S as useDropFileZoneContext,
29
+ m as useFileDownload,
30
+ y as useOpenFileContext,
31
+ n as usePaginateContext,
32
+ p as usePrintContext,
33
+ F as useRotateContext,
34
+ s as useSearchContext,
35
+ h as useViewModeContext,
36
+ O as useZoomContext
37
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RPConfigProps } from '../utils/types';
3
+ export declare const RPConfig: FC<RPConfigProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RPControllerProps } from '../utils/types';
3
+ export declare const RPController: FC<RPControllerProps>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RPDocumentProps } from '../utils/types';
3
+ export declare const RPDocument: FC<RPDocumentProps>;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const RPDropFileZone: FC;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RPThemeContextType } from '../utils/types';
3
+ export declare const RPTheme: FC<RPThemeContextType>;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const RPViewer: FC;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const CheckIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ChevronUpIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ClearIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ClockwiseIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const CloseIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+ export declare const DarkPdfIcon: FC<HTMLAttributes<HTMLImageElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const SinglePageIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const FileDownloadDefaultIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const FileUploadDefaultIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const FullScreenIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const GoToDownIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const HandModeDefaultIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const HorizontalScrollingIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const InfoIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+ export declare const LightPdfIcon: FC<HTMLAttributes<HTMLImageElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+ export declare const LoaderIcon: FC<HTMLAttributes<HTMLImageElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const MoonIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const PageScrollingIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const PrintDefaultTool: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const SearchIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const DualPageIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const SunIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const TextSelectionDefaultIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ThreeDotIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ThumbnailIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const VerticalScrollingIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const WrappedScrollingIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ZoomInIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { FC, SVGAttributes } from 'react';
2
+ export declare const ZoomOutIcon: FC<SVGAttributes<HTMLOrSVGElement>>;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface Props extends PropsWithChildren {
3
+ getContainerRef?: (element: HTMLDivElement) => void;
4
+ toolbarRef: HTMLDivElement | null;
5
+ style?: React.CSSProperties;
6
+ className?: string;
7
+ }
8
+ export declare const Container: FC<Props>;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { RPLayoutProps } from '../../utils/types';
3
+ export declare const RPLayout: FC<RPLayoutProps>;
@@ -0,0 +1,2 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const WrapperLayout: FC<PropsWithChildren>;
@@ -0,0 +1 @@
1
+ export declare const RPSidebar: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FC, RefObject, Dispatch, SetStateAction } from 'react';
2
+ interface Props {
3
+ onWidthChange?: Dispatch<SetStateAction<number>>;
4
+ thumbnailRef: RefObject<HTMLDivElement>;
5
+ }
6
+ export declare const RPSplitter: FC<Props>;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ import { PageViewport } from 'pdfjs-dist/types/web/interfaces';
3
+ interface Props {
4
+ thumbnailSrc?: string;
5
+ pageNumber?: number;
6
+ loading: boolean;
7
+ isFocused: boolean;
8
+ viewport: PageViewport;
9
+ }
10
+ export declare const Thumbnail: FC<Props>;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ show: boolean;
3
+ }
4
+ export declare const Thumbnails: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare const DarkModeTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const DocumentDialog: FC;
@@ -0,0 +1 @@
1
+ export declare const DocumentProperties: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const FileDownloadTool: FC;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const FileUploadTool: FC;
@@ -0,0 +1 @@
1
+ export declare const FullScreenTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { DropdownMenuItemProps } from '@radix-ui/react-dropdown-menu';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ interface Props extends PropsWithChildren, DropdownMenuItemProps {
4
+ }
5
+ export declare const MenuItem: FC<Props>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare const MenuSeparator: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const MostPageTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const OtherTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const Paginate: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const PrintTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ label?: string;
4
+ value?: string | number;
5
+ }
6
+ export declare const PropertyItem: FC<Props>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare const RPToolbar: import('react').ForwardRefExoticComponent<import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export declare const RPToolbarEnd: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const RotateTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const ScrollModeTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const SearchTool: FC;
@@ -0,0 +1 @@
1
+ export declare const SelectionModeTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const ViewModeTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const ZoomTool: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ pageNumber: number;
4
+ }
5
+ export declare const AnnotationLayer: FC<Props>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ pageNumber: number;
4
+ onLoading?: () => void;
5
+ onLoaded?: () => void;
6
+ }
7
+ export declare const CanvasLayer: FC<Props>;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare const DualPage: FC<{
3
+ widths: (idx: number) => number;
4
+ heights: (idx: number) => number;
5
+ }>;
@@ -0,0 +1,6 @@
1
+ interface Props extends React.HTMLAttributes<HTMLDivElement> {
2
+ pageNumber: number;
3
+ onIntersectRatioChange?: (page: number, ratio: number) => void;
4
+ }
5
+ export declare const RPPage: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare const SinglePage: FC<{
3
+ widths: (idx: number) => number;
4
+ heights: (idx: number) => number;
5
+ }>;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ pageNumber: number;
4
+ }
5
+ export declare const TextLayer: FC<Props>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ButtonHTMLAttributes, PropsWithChildren } from 'react';
2
+ interface Props extends PropsWithChildren, ButtonHTMLAttributes<{}> {
3
+ active?: boolean;
4
+ }
5
+ export declare const UIButton: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLButtonElement>>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren, FC } from 'react';
2
+ interface UICheckboxProps {
3
+ value?: boolean;
4
+ onChange?: (value: boolean) => void;
5
+ name: string;
6
+ }
7
+ export declare const UICheckbox: FC<PropsWithChildren<UICheckboxProps>>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ interface Props extends PropsWithChildren, DropdownMenuContentProps {
4
+ triggerComponent: React.ReactElement;
5
+ container: HTMLDivElement | null;
6
+ open?: boolean;
7
+ }
8
+ export declare const UIDropDown: FC<Props>;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import { InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
+ interface Props extends InputHTMLAttributes<HTMLInputElement>, PropsWithChildren {
3
+ icon?: ReactNode;
4
+ }
5
+ export declare const UIInput: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ percentage: number;
4
+ }
5
+ declare const LoadingIndicator: FC<Props>;
6
+ export default LoadingIndicator;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ConfigContextType } from '../utils/types';
3
+ export declare const ConfigContext: import('react').Context<ConfigContextType>;
4
+ export declare const useConfigContext: () => ConfigContextType;
5
+ export declare const ConfigContextProvider: FC<PropsWithChildren & ConfigContextType>;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { DarkMode, DarkModeProviderProps } from '../utils/types';
3
+ export declare const DarkModeContext: React.Context<DarkMode>;
4
+ export declare const useDarkModeContext: () => DarkMode;
5
+ export declare const DarkModeProvider: FC<DarkModeProviderProps>;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { FileDragDropControl } from '../utils/types';
3
+ export declare const DropFileZoneContext: React.Context<FileDragDropControl>;
4
+ export declare const useDropFileZoneContext: () => FileDragDropControl;
5
+ export declare const DropFileZoneProvider: FC<PropsWithChildren>;
@@ -0,0 +1,7 @@
1
+ import { default as React, PropsWithChildren } from 'react';
2
+ interface FileInputContextValue {
3
+ onFileChange: () => void;
4
+ }
5
+ export declare const FileInputProvider: React.FC<PropsWithChildren>;
6
+ export declare const useOpenFileContext: () => FileInputContextValue;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { FullScreenToolProps } from '../utils/types';
3
+ export declare const FullScreenProvider: FC<{
4
+ elementRef: HTMLElement | null;
5
+ children: ReactNode;
6
+ }>;
7
+ export declare const useFullScreenContext: () => FullScreenToolProps;
@@ -0,0 +1,7 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { RPIcons } from '../utils/types';
3
+ export declare const IconContext: import('react').Context<RPIcons>;
4
+ export declare const useIconContext: () => RPIcons;
5
+ export declare const IconProvider: FC<PropsWithChildren<{
6
+ icons?: RPIcons;
7
+ }>>;
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { InitialStateContextType } from '../utils/types';
3
+ export declare const InitialStateContext: import('react').Context<InitialStateContextType>;
4
+ export declare const InitialStateProvider: FC<PropsWithChildren<InitialStateContextType>>;
5
+ export declare const useInitialStateContext: () => InitialStateContextType;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { LayerProviderProps } from '../utils/types';
3
+ export declare const LayerContext: import('react').Context<Omit<LayerProviderProps, "children">>;
4
+ export declare const useLayerContext: () => Omit<LayerProviderProps, "children">;
5
+ export declare const LayerProvider: FC<LayerProviderProps>;