@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,301 @@
1
+ import { jsx as f, Fragment as q, jsxs as M } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { u as A, c as B, a as K, b as z } from "../../index-743c36f0.js";
4
+ import "react-dom";
5
+ import { CheckIcon as X } from "../icons/CheckIcon.js";
6
+ import '../../assets/Checkbox.css';function S(e, t) {
7
+ if (typeof e == "function")
8
+ return e(t);
9
+ e != null && (e.current = t);
10
+ }
11
+ function I(...e) {
12
+ return (t) => {
13
+ let n = !1;
14
+ const r = e.map((o) => {
15
+ const c = S(o, t);
16
+ return !n && typeof c == "function" && (n = !0), c;
17
+ });
18
+ if (n)
19
+ return () => {
20
+ for (let o = 0; o < r.length; o++) {
21
+ const c = r[o];
22
+ typeof c == "function" ? c() : S(e[o], null);
23
+ }
24
+ };
25
+ };
26
+ }
27
+ function T(...e) {
28
+ return i.useCallback(I(...e), e);
29
+ }
30
+ function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
31
+ return function(o) {
32
+ if (e == null || e(o), n === !1 || !o.defaultPrevented)
33
+ return t == null ? void 0 : t(o);
34
+ };
35
+ }
36
+ function $(e) {
37
+ const t = i.useRef({ value: e, previous: e });
38
+ return i.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
39
+ }
40
+ function Z(e, t) {
41
+ return i.useReducer((n, r) => t[n][r] ?? n, e);
42
+ }
43
+ var _ = (e) => {
44
+ const { present: t, children: n } = e, r = G(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), c = T(r.ref, J(o));
45
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: c }) : null;
46
+ };
47
+ _.displayName = "Presence";
48
+ function G(e) {
49
+ const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), c = i.useRef("none"), a = e ? "mounted" : "unmounted", [s, l] = Z(a, {
50
+ mounted: {
51
+ UNMOUNT: "unmounted",
52
+ ANIMATION_OUT: "unmountSuspended"
53
+ },
54
+ unmountSuspended: {
55
+ MOUNT: "mounted",
56
+ ANIMATION_END: "unmounted"
57
+ },
58
+ unmounted: {
59
+ MOUNT: "mounted"
60
+ }
61
+ });
62
+ return i.useEffect(() => {
63
+ const u = R(r.current);
64
+ c.current = s === "mounted" ? u : "none";
65
+ }, [s]), A(() => {
66
+ const u = r.current, p = o.current;
67
+ if (p !== e) {
68
+ const d = c.current, m = R(u);
69
+ e ? l("MOUNT") : m === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(p && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
70
+ }
71
+ }, [e, l]), A(() => {
72
+ if (t) {
73
+ let u;
74
+ const p = t.ownerDocument.defaultView ?? window, C = (m) => {
75
+ const y = R(r.current).includes(m.animationName);
76
+ if (m.target === t && y && (l("ANIMATION_END"), !o.current)) {
77
+ const g = t.style.animationFillMode;
78
+ t.style.animationFillMode = "forwards", u = p.setTimeout(() => {
79
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
80
+ });
81
+ }
82
+ }, d = (m) => {
83
+ m.target === t && (c.current = R(r.current));
84
+ };
85
+ return t.addEventListener("animationstart", d), t.addEventListener("animationcancel", C), t.addEventListener("animationend", C), () => {
86
+ p.clearTimeout(u), t.removeEventListener("animationstart", d), t.removeEventListener("animationcancel", C), t.removeEventListener("animationend", C);
87
+ };
88
+ } else
89
+ l("ANIMATION_END");
90
+ }, [t, l]), {
91
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
92
+ ref: i.useCallback((u) => {
93
+ u && (r.current = getComputedStyle(u)), n(u);
94
+ }, [])
95
+ };
96
+ }
97
+ function R(e) {
98
+ return (e == null ? void 0 : e.animationName) || "none";
99
+ }
100
+ function J(e) {
101
+ var r, o;
102
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
103
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
104
+ }
105
+ var D = i.forwardRef((e, t) => {
106
+ const { children: n, ...r } = e, o = i.Children.toArray(n), c = o.find(Y);
107
+ if (c) {
108
+ const a = c.props.children, s = o.map((l) => l === c ? i.Children.count(a) > 1 ? i.Children.only(null) : i.isValidElement(a) ? a.props.children : null : l);
109
+ return /* @__PURE__ */ f(E, { ...r, ref: t, children: i.isValidElement(a) ? i.cloneElement(a, void 0, s) : null });
110
+ }
111
+ return /* @__PURE__ */ f(E, { ...r, ref: t, children: n });
112
+ });
113
+ D.displayName = "Slot";
114
+ var E = i.forwardRef((e, t) => {
115
+ const { children: n, ...r } = e;
116
+ if (i.isValidElement(n)) {
117
+ const o = ee(n);
118
+ return i.cloneElement(n, {
119
+ ...H(r, n.props),
120
+ // @ts-ignore
121
+ ref: t ? I(t, o) : o
122
+ });
123
+ }
124
+ return i.Children.count(n) > 1 ? i.Children.only(null) : null;
125
+ });
126
+ E.displayName = "SlotClone";
127
+ var Q = ({ children: e }) => /* @__PURE__ */ f(q, { children: e });
128
+ function Y(e) {
129
+ return i.isValidElement(e) && e.type === Q;
130
+ }
131
+ function H(e, t) {
132
+ const n = { ...t };
133
+ for (const r in t) {
134
+ const o = e[r], c = t[r];
135
+ /^on[A-Z]/.test(r) ? o && c ? n[r] = (...s) => {
136
+ c(...s), o(...s);
137
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...c } : r === "className" && (n[r] = [o, c].filter(Boolean).join(" "));
138
+ }
139
+ return { ...e, ...n };
140
+ }
141
+ function ee(e) {
142
+ var r, o;
143
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
144
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
145
+ }
146
+ var te = [
147
+ "a",
148
+ "button",
149
+ "div",
150
+ "form",
151
+ "h2",
152
+ "h3",
153
+ "img",
154
+ "input",
155
+ "label",
156
+ "li",
157
+ "nav",
158
+ "ol",
159
+ "p",
160
+ "span",
161
+ "svg",
162
+ "ul"
163
+ ], U = te.reduce((e, t) => {
164
+ const n = i.forwardRef((r, o) => {
165
+ const { asChild: c, ...a } = r, s = c ? D : t;
166
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(s, { ...a, ref: o });
167
+ });
168
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
169
+ }, {}), w = "Checkbox", [ne, fe] = B(w), [re, oe] = ne(w), W = i.forwardRef(
170
+ (e, t) => {
171
+ const {
172
+ __scopeCheckbox: n,
173
+ name: r,
174
+ checked: o,
175
+ defaultChecked: c,
176
+ required: a,
177
+ disabled: s,
178
+ value: l = "on",
179
+ onCheckedChange: u,
180
+ form: p,
181
+ ...C
182
+ } = e, [d, m] = i.useState(null), k = T(t, (h) => m(h)), y = i.useRef(!1), g = d ? p || !!d.closest("form") : !0, [N = !1, x] = K({
183
+ prop: o,
184
+ defaultProp: c,
185
+ onChange: u
186
+ }), V = i.useRef(N);
187
+ return i.useEffect(() => {
188
+ const h = d == null ? void 0 : d.form;
189
+ if (h) {
190
+ const v = () => x(V.current);
191
+ return h.addEventListener("reset", v), () => h.removeEventListener("reset", v);
192
+ }
193
+ }, [d, x]), /* @__PURE__ */ M(re, { scope: n, state: N, disabled: s, children: [
194
+ /* @__PURE__ */ f(
195
+ U.button,
196
+ {
197
+ type: "button",
198
+ role: "checkbox",
199
+ "aria-checked": b(N) ? "mixed" : N,
200
+ "aria-required": a,
201
+ "data-state": F(N),
202
+ "data-disabled": s ? "" : void 0,
203
+ disabled: s,
204
+ value: l,
205
+ ...C,
206
+ ref: k,
207
+ onKeyDown: O(e.onKeyDown, (h) => {
208
+ h.key === "Enter" && h.preventDefault();
209
+ }),
210
+ onClick: O(e.onClick, (h) => {
211
+ x((v) => b(v) ? !0 : !v), g && (y.current = h.isPropagationStopped(), y.current || h.stopPropagation());
212
+ })
213
+ }
214
+ ),
215
+ g && /* @__PURE__ */ f(
216
+ ie,
217
+ {
218
+ control: d,
219
+ bubbles: !y.current,
220
+ name: r,
221
+ value: l,
222
+ checked: N,
223
+ required: a,
224
+ disabled: s,
225
+ form: p,
226
+ style: { transform: "translateX(-100%)" },
227
+ defaultChecked: b(c) ? !1 : c
228
+ }
229
+ )
230
+ ] });
231
+ }
232
+ );
233
+ W.displayName = w;
234
+ var L = "CheckboxIndicator", j = i.forwardRef(
235
+ (e, t) => {
236
+ const { __scopeCheckbox: n, forceMount: r, ...o } = e, c = oe(L, n);
237
+ return /* @__PURE__ */ f(_, { present: r || b(c.state) || c.state === !0, children: /* @__PURE__ */ f(
238
+ U.span,
239
+ {
240
+ "data-state": F(c.state),
241
+ "data-disabled": c.disabled ? "" : void 0,
242
+ ...o,
243
+ ref: t,
244
+ style: { pointerEvents: "none", ...e.style }
245
+ }
246
+ ) });
247
+ }
248
+ );
249
+ j.displayName = L;
250
+ var ie = (e) => {
251
+ const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...c } = e, a = i.useRef(null), s = $(n), l = z(t);
252
+ i.useEffect(() => {
253
+ const p = a.current, C = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(C, "checked").set;
254
+ if (s !== n && m) {
255
+ const k = new Event("click", { bubbles: r });
256
+ p.indeterminate = b(n), m.call(p, b(n) ? !1 : n), p.dispatchEvent(k);
257
+ }
258
+ }, [s, n, r]);
259
+ const u = i.useRef(b(n) ? !1 : n);
260
+ return /* @__PURE__ */ f(
261
+ "input",
262
+ {
263
+ type: "checkbox",
264
+ "aria-hidden": !0,
265
+ defaultChecked: o ?? u.current,
266
+ ...c,
267
+ tabIndex: -1,
268
+ ref: a,
269
+ style: {
270
+ ...e.style,
271
+ ...l,
272
+ position: "absolute",
273
+ pointerEvents: "none",
274
+ opacity: 0,
275
+ margin: 0
276
+ }
277
+ }
278
+ );
279
+ };
280
+ function b(e) {
281
+ return e === "indeterminate";
282
+ }
283
+ function F(e) {
284
+ return b(e) ? "indeterminate" : e ? "checked" : "unchecked";
285
+ }
286
+ var ce = W, se = j;
287
+ const P = {
288
+ "rp-checkbox": "_rp-checkbox_11dq0_1",
289
+ "rp-checkbox-indicator": "_rp-checkbox-indicator_11dq0_18"
290
+ }, pe = ({
291
+ children: e,
292
+ value: t,
293
+ name: n,
294
+ onChange: r
295
+ }) => /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
296
+ /* @__PURE__ */ f(ce, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ f(se, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ f(X, {}) }) }),
297
+ /* @__PURE__ */ f("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
298
+ ] });
299
+ export {
300
+ pe as UICheckbox
301
+ };
@@ -0,0 +1,29 @@
1
+ import { jsxs as i, jsx as d } from "react/jsx-runtime";
2
+ import { R as l, T as c, P as p, C as _ } from "../../index-3459164c.js";
3
+ import { c as A } from "../../clsx-0c6e471a.js";
4
+ import '../../assets/DropDown.css';const F = "_slideDownAndFade_1000s_1", w = "_slideLeftAndFade_1000s_1", m = "_slideUpAndFade_1000s_1", f = "_slideRightAndFade_1000s_1", g = {
5
+ "rp-dropdown-content": "_rp-dropdown-content_1000s_1",
6
+ slideDownAndFade: F,
7
+ slideLeftAndFade: w,
8
+ slideUpAndFade: m,
9
+ slideRightAndFade: f,
10
+ "rp-dropdown-arrow": "_rp-dropdown-arrow_1000s_30"
11
+ }, x = (e) => {
12
+ const { triggerComponent: n, children: s, container: o, className: r, open: t, ...a } = e;
13
+ return /* @__PURE__ */ i(l, { modal: !1, open: t, children: [
14
+ /* @__PURE__ */ d(c, { asChild: !0, children: n }),
15
+ /* @__PURE__ */ d(p, { container: o, children: /* @__PURE__ */ d(
16
+ _,
17
+ {
18
+ sideOffset: 8,
19
+ align: "end",
20
+ ...a,
21
+ className: A(g["rp-dropdown-content"], r),
22
+ children: s
23
+ }
24
+ ) })
25
+ ] });
26
+ };
27
+ export {
28
+ x as UIDropDown
29
+ };
@@ -0,0 +1,26 @@
1
+ import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
+ import { c as e } from "../../clsx-0c6e471a.js";
3
+ import { forwardRef as u } from "react";
4
+ import '../../assets/Input.css';const r = {
5
+ "rp-input": "_rp-input_zo6kn_1",
6
+ "rp-input-wrapper": "_rp-input-wrapper_zo6kn_22",
7
+ "rp-input-icon": "_rp-input-icon_zo6kn_26"
8
+ }, d = u((i, o) => {
9
+ const { className: s, icon: p, children: t, ...c } = i;
10
+ return /* @__PURE__ */ a("div", { className: r["rp-input-wrapper"], children: [
11
+ /* @__PURE__ */ n(
12
+ "input",
13
+ {
14
+ ...c,
15
+ "data-icon": !!p,
16
+ ref: o,
17
+ className: e(s, r["rp-input"], "ignore-hover")
18
+ }
19
+ ),
20
+ p && /* @__PURE__ */ n("span", { className: r["rp-input-icon"], children: p }),
21
+ t
22
+ ] });
23
+ });
24
+ export {
25
+ d as UIInput
26
+ };
@@ -0,0 +1,6 @@
1
+ import "react/jsx-runtime";
2
+ import { L as p } from "../../Thumbnails-06fa1aa5.js";
3
+ import "../../clsx-0c6e471a.js";
4
+ export {
5
+ p as default
6
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createContext as i, useContext as s } from "react";
3
+ const o = i({
4
+ workerUrlAdded: !1
5
+ }), f = () => s(o), x = (t) => {
6
+ const { children: e, ...r } = t;
7
+ return /* @__PURE__ */ n(o.Provider, { value: r, children: e });
8
+ };
9
+ export {
10
+ o as ConfigContext,
11
+ x as ConfigContextProvider,
12
+ f as useConfigContext
13
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { createContext as f, useContext as i, useEffect as n } from "react";
3
+ import { useDarkMode as u } from "../utils/hooks/useDarkMode.js";
4
+ import { appConsole as p } from "../utils/appConsole.js";
5
+ const a = f({
6
+ darkMode: !1,
7
+ setDarkMode: (e) => {
8
+ }
9
+ }), M = () => {
10
+ const e = i(a);
11
+ return typeof (e == null ? void 0 : e.darkMode) > "u" && p.warn("Please use this hooks inside children component of RPController or RPLayout"), e;
12
+ }, x = ({
13
+ children: e,
14
+ darkMode: o,
15
+ onDarkModeChange: r
16
+ }) => {
17
+ const { darkMode: t, setDarkMode: s } = u(o);
18
+ return n(() => {
19
+ typeof o == "boolean" && s(o);
20
+ }, [o, s]), n(() => {
21
+ r && r(t);
22
+ }, [r, t]), /* @__PURE__ */ d(a.Provider, { value: { darkMode: t, setDarkMode: s }, children: e });
23
+ };
24
+ export {
25
+ a as DarkModeContext,
26
+ x as DarkModeProvider,
27
+ M as useDarkModeContext
28
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { createContext as m, useContext as x, useState as C, useCallback as r } from "react";
3
+ import { useDocumentContext as h } from "./RPDocumentContext.js";
4
+ import { useToolbarComponentContext as P } from "./ToolbarComponentContext.js";
5
+ const p = m({
6
+ dragging: !1,
7
+ handleDragLeave: () => {
8
+ },
9
+ handleDragEnter: () => {
10
+ },
11
+ handleDrop: () => {
12
+ }
13
+ }), T = () => x(p), Z = ({ children: i }) => {
14
+ const [c, o] = C(!1), { setFilename: n, setPdfSrc: a } = h(), { openFileTool: s } = P(), f = r(
15
+ (e) => {
16
+ var l;
17
+ e.preventDefault(), e.stopPropagation(), o(!1);
18
+ const t = (l = e.dataTransfer) == null ? void 0 : l.files[0];
19
+ if (!t || t.type !== "application/pdf")
20
+ return;
21
+ const D = URL.createObjectURL(t);
22
+ n(t.name), a(D);
23
+ },
24
+ [n, a]
25
+ ), u = r(
26
+ (e) => {
27
+ e.preventDefault(), e.stopPropagation(), s && o(!0);
28
+ },
29
+ [s]
30
+ ), g = r((e) => {
31
+ e.preventDefault(), e.stopPropagation(), o(!1);
32
+ }, []);
33
+ return /* @__PURE__ */ d(
34
+ p.Provider,
35
+ {
36
+ value: {
37
+ dragging: c,
38
+ handleDragLeave: g,
39
+ handleDragEnter: u,
40
+ handleDrop: f
41
+ },
42
+ children: i
43
+ }
44
+ );
45
+ };
46
+ export {
47
+ p as DropFileZoneContext,
48
+ Z as DropFileZoneProvider,
49
+ T as useDropFileZoneContext
50
+ };
@@ -0,0 +1,38 @@
1
+ import { jsxs as a, jsx as f } from "react/jsx-runtime";
2
+ import { createContext as d, useRef as m, useContext as x } from "react";
3
+ import { useDocumentContext as C } from "./RPDocumentContext.js";
4
+ const i = d(null), v = ({ children: e }) => {
5
+ const { setFilename: l, setPdfSrc: s } = C(), o = m(null), c = () => {
6
+ var t;
7
+ (t = o.current) == null || t.click();
8
+ }, p = (t) => {
9
+ var r;
10
+ const n = (r = t.target.files) == null ? void 0 : r[0];
11
+ if (!n || n.type !== "application/pdf")
12
+ return;
13
+ const u = URL.createObjectURL(n);
14
+ l(n.name), s(u);
15
+ };
16
+ return /* @__PURE__ */ a(i.Provider, { value: { onFileChange: c }, children: [
17
+ e,
18
+ /* @__PURE__ */ f(
19
+ "input",
20
+ {
21
+ accept: "application/pdf",
22
+ type: "file",
23
+ ref: o,
24
+ style: { display: "none" },
25
+ onChange: p
26
+ }
27
+ )
28
+ ] });
29
+ }, y = () => {
30
+ const e = x(i);
31
+ if (!e)
32
+ throw new Error("useOpenFileContext must be used within FileInputProvider");
33
+ return e;
34
+ };
35
+ export {
36
+ v as FileInputProvider,
37
+ y as useOpenFileContext
38
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { createContext as i, useContext as S } from "react";
3
+ import { useFullScreen as F } from "../utils/hooks/useFullScreen.js";
4
+ const t = i(void 0), p = ({ elementRef: e, children: o }) => {
5
+ const { isFullScreen: r, enterFullScreen: n, exitFullScreen: l, isSupported: u } = F(), c = () => {
6
+ r ? l() : e && n(e);
7
+ };
8
+ return /* @__PURE__ */ s(t.Provider, { value: { isFullScreen: r, toggleFullScreen: c, isSupported: u }, children: o });
9
+ }, f = () => {
10
+ const e = S(t);
11
+ if (!e)
12
+ throw new Error("useFullScreenContext must be used within a FullScreenProvider");
13
+ return e;
14
+ };
15
+ export {
16
+ p as FullScreenProvider,
17
+ f as useFullScreenContext
18
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createContext as n, useContext as c } from "react";
3
+ const o = n({}), u = () => c(o), i = ({
4
+ children: t,
5
+ icons: e = {}
6
+ }) => /* @__PURE__ */ r(o.Provider, { value: e, children: t });
7
+ export {
8
+ o as IconContext,
9
+ i as IconProvider,
10
+ u as useIconContext
11
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createContext as n, useContext as i } from "react";
3
+ const t = n({}), x = ({
4
+ children: e,
5
+ ...o
6
+ }) => /* @__PURE__ */ r(t.Provider, { value: o, children: e }), u = () => i(t);
7
+ export {
8
+ t as InitialStateContext,
9
+ x as InitialStateProvider,
10
+ u as useInitialStateContext
11
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { createContext as n, useContext as u } from "react";
3
+ const e = n({ textLayer: !0 }), s = () => u(e), c = ({ children: t, textLayer: r = !0 }) => /* @__PURE__ */ o(e.Provider, { value: { textLayer: r }, children: t });
4
+ export {
5
+ e as LayerContext,
6
+ c as LayerProvider,
7
+ s as useLayerContext
8
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createContext as u, useContext as a } from "react";
3
+ const t = u({
4
+ container: null,
5
+ contentRef: null
6
+ }), s = () => a(t), C = ({ children: o, container: n, contentRef: e }) => /* @__PURE__ */ r(t.Provider, { value: { container: n, contentRef: e }, children: o });
7
+ export {
8
+ C as LayoutContainerProvider,
9
+ s as useLayoutContainer
10
+ };
@@ -0,0 +1,15 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createContext as s, useContext as i } from "react";
3
+ import { useLicense as c } from "../utils/hooks/useLicense.js";
4
+ const e = s({ isValid: !1 }), a = () => i(e), f = ({
5
+ children: t,
6
+ licenseKey: o
7
+ }) => {
8
+ const r = c(o);
9
+ return /* @__PURE__ */ n(e.Provider, { value: r, children: t });
10
+ };
11
+ export {
12
+ e as LicenseContext,
13
+ f as LicenseProvider,
14
+ a as useLicenseContext
15
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createContext as c, useContext as i, useState as u, useMemo as m } from "react";
3
+ const t = c({
4
+ activeDocumentProperties: !1,
5
+ setActiveDocumentProperties: () => {
6
+ }
7
+ }), v = () => i(t), l = ({ children: o }) => {
8
+ const [e, r] = u(!1), s = m(() => ({
9
+ activeDocumentProperties: e,
10
+ setActiveDocumentProperties: r
11
+ }), [e]);
12
+ return /* @__PURE__ */ n(t.Provider, { value: s, children: o });
13
+ };
14
+ export {
15
+ t as OtherToolContext,
16
+ l as OtherToolProvider,
17
+ v as useOtherToolContext
18
+ };
@@ -0,0 +1,8 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { createContext as r, useContext as n } from "react";
3
+ const e = r({}), s = () => n(e), x = ({ children: t }) => /* @__PURE__ */ o(e.Provider, { value: {}, children: t });
4
+ export {
5
+ e as PageViewportContext,
6
+ x as PageViewportProvider,
7
+ s as usePageViewportContext
8
+ };
@@ -0,0 +1,11 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import { p as m, h as n, u as s } from "../Thumbnails-06fa1aa5.js";
4
+ import "./RPDocumentContext.js";
5
+ import "../utils/appConsole.js";
6
+ import "./InitialStateContext.js";
7
+ export {
8
+ m as PaginateContext,
9
+ n as PaginateProvider,
10
+ s as usePaginateContext
11
+ };
@@ -0,0 +1,8 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import { v as e, P as n, b as P } from "../Thumbnails-06fa1aa5.js";
4
+ export {
5
+ e as PrintContext,
6
+ n as PrintProvider,
7
+ P as usePrintContext
8
+ };
@@ -0,0 +1,49 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createContext as l, useState as m, useEffect as P, useMemo as x, useContext as h } from "react";
3
+ import { useLoadPdf as C } from "../utils/hooks/useLoadPdf.js";
4
+ import { usePdfProperties as v } from "../utils/hooks/usePdfProperties.js";
5
+ import { LoaderIcon as g } from "../components/icons/LoaderIcon.js";
6
+ import { appConsole as D } from "../utils/appConsole.js";
7
+ const c = l({
8
+ pdf: void 0,
9
+ pages: /* @__PURE__ */ new Map(),
10
+ setPdfSrc: () => {
11
+ },
12
+ setFilename: () => {
13
+ }
14
+ }), L = ({ children: t, src: e, characterMap: u }) => {
15
+ const [o, s] = m(e), { pdf: n, pages: i } = C(o, u), [p, f] = m(), d = v(o, n, p);
16
+ P(() => {
17
+ f(e == null ? void 0 : e.split("/").pop()), s(e);
18
+ }, [e]);
19
+ const a = x(() => ({
20
+ pdf: n,
21
+ pages: i,
22
+ pdfSrc: o,
23
+ setPdfSrc: s,
24
+ pdfProperties: d,
25
+ setFilename: f,
26
+ filename: p
27
+ }), [n, i, o, d]);
28
+ return n ? /* @__PURE__ */ r(c.Provider, { value: a, children: t }) : /* @__PURE__ */ r(
29
+ "div",
30
+ {
31
+ style: {
32
+ display: "flex",
33
+ justifyContent: "center",
34
+ alignItems: "center",
35
+ height: "100%",
36
+ width: "100%"
37
+ },
38
+ children: /* @__PURE__ */ r(g, {})
39
+ }
40
+ );
41
+ }, M = () => {
42
+ const t = h(c);
43
+ return t.pdf || D.error("Please use this hooks inside children component of RPDocument"), t;
44
+ };
45
+ export {
46
+ L as DocumentProvider,
47
+ c as default,
48
+ M as useDocumentContext
49
+ };