@react-pdf-kit/viewer 2.6.0-beta.2 → 2.6.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/dist/AnnotationLayer-D6BfL976.js +113 -0
  2. package/dist/Button-jStpvb3T.js +21 -0
  3. package/dist/Checkbox-Brta-YKG.js +195 -0
  4. package/dist/Combination-DqNkTtir.js +695 -0
  5. package/dist/Container-DTWaZzc7.js +16 -0
  6. package/dist/CustomThumbnailElement-C2quEICO.js +19 -0
  7. package/dist/DarkPdfIcon-B5ehd9CV.js +9 -0
  8. package/dist/DocumentDialog-DHAWcYIz.js +324 -0
  9. package/dist/DropDown-DikL-krI.js +33 -0
  10. package/dist/Input-Bb_-ljl1.js +31 -0
  11. package/dist/LightPdfIcon-DL8MYtWQ.js +9 -0
  12. package/dist/LoaderIcon-D9YjinGf.js +14 -0
  13. package/dist/LoadingIndicator-MWrbKa6X.js +45 -0
  14. package/dist/MenuItem-BJDWfzAw.js +15 -0
  15. package/dist/MenuSeparator-D1H5l8Ej.js +6 -0
  16. package/dist/MostPageTool.module-BRVv-sGz.js +4 -0
  17. package/dist/OtherTool.module-BQY9Nfqz.js +4 -0
  18. package/dist/Paginate.module-B0GMw-MB.js +8 -0
  19. package/dist/PaginationContext--n91mIJ4.js +232 -0
  20. package/dist/PasswordModal-BDHdSpxf.js +76 -0
  21. package/dist/PropertyItem-evJWWmWZ.js +18 -0
  22. package/dist/RPDropFileZone-BunRfzst.js +35 -0
  23. package/dist/RPLayout.module-Vc3h4xxS.js +14 -0
  24. package/dist/RPPage-BuSGUFzw.js +91 -0
  25. package/dist/RPPages-V5CNUXFD.js +1007 -0
  26. package/dist/RPSplitter-C63X9M8w.js +121 -0
  27. package/dist/RPToolbar.module-BwqWLviy.js +10 -0
  28. package/dist/RPTooltip-ZZoFqP7C.js +381 -0
  29. package/dist/RotateTool.module-DH5yWbvM.js +4 -0
  30. package/dist/SearchTool.module-DUkVXfOn.js +16 -0
  31. package/dist/SkipLink-Bvbn3miT.js +18 -0
  32. package/dist/TextHighlightLayer-BSVgBxR3.js +157 -0
  33. package/dist/TextLayer-DWGFN9SF.js +125 -0
  34. package/dist/Thumbnail-Dwo2-4Ki.js +97 -0
  35. package/dist/Thumbnails-ComClyJJ.js +52 -0
  36. package/dist/ToolbarLayout.module-Zo715dbb.js +12 -0
  37. package/dist/WrapperLayout-Dcd9l9xH.js +13 -0
  38. package/dist/ZoomTool.module-BrIPy8pO.js +11 -0
  39. package/dist/assets/AnnotationLayer.css +1 -0
  40. package/dist/assets/Button.css +1 -0
  41. package/dist/assets/Checkbox.css +1 -0
  42. package/dist/assets/Container.css +1 -0
  43. package/dist/assets/CustomThumbnailElement.css +1 -0
  44. package/dist/assets/DocumentDialog.css +1 -0
  45. package/dist/assets/DropDown.css +1 -0
  46. package/dist/assets/Input.css +1 -0
  47. package/dist/assets/LoaderIcon.css +1 -0
  48. package/dist/assets/LoadingIndicator.css +1 -0
  49. package/dist/assets/MenuItem.css +1 -0
  50. package/dist/assets/MenuSeparator.css +1 -0
  51. package/dist/assets/MostPageTool.css +1 -0
  52. package/dist/assets/OtherTool.css +1 -0
  53. package/dist/assets/Paginate.css +1 -0
  54. package/dist/assets/PasswordModal.css +1 -0
  55. package/dist/assets/PropertyItem.css +1 -0
  56. package/dist/assets/RPDropFileZone.css +1 -0
  57. package/dist/assets/RPLayout.css +1 -0
  58. package/dist/assets/RPPage.css +1 -0
  59. package/dist/assets/RPPages.css +1 -0
  60. package/dist/assets/RPSplitter.css +1 -0
  61. package/dist/assets/RPToolbar.css +1 -0
  62. package/dist/assets/RPTooltip.css +1 -0
  63. package/dist/assets/RotateTool.css +1 -0
  64. package/dist/assets/SearchTool.css +1 -0
  65. package/dist/assets/SkipLink.css +1 -0
  66. package/dist/assets/TextHighlightLayer.css +1 -0
  67. package/dist/assets/TextLayer.css +1 -0
  68. package/dist/assets/Thumbnail.css +1 -0
  69. package/dist/assets/Thumbnails.css +1 -0
  70. package/dist/assets/ToolbarLayout.css +1 -0
  71. package/dist/assets/WrapperLayout.css +1 -0
  72. package/dist/assets/ZoomTool.css +1 -0
  73. package/dist/assets/style.js +2 -77
  74. package/dist/chunk-C_CI6nMA.js +13 -0
  75. package/dist/clsx-B7LyVm5O.js +16 -0
  76. package/dist/components/RPConfig.js +24 -26
  77. package/dist/components/RPController.js +85 -135
  78. package/dist/components/RPDropFileZone.js +3 -61
  79. package/dist/components/RPPages.js +3 -1115
  80. package/dist/components/RPProvider.js +50 -131
  81. package/dist/components/RPTheme.js +20 -21
  82. package/dist/components/icons/CheckIcon.js +16 -22
  83. package/dist/components/icons/ChevronDownIcon.js +17 -23
  84. package/dist/components/icons/ChevronUpIcon.js +16 -22
  85. package/dist/components/icons/ClearIcon.js +26 -25
  86. package/dist/components/icons/ClockwiseIcon.js +16 -22
  87. package/dist/components/icons/CloseIcon.js +16 -22
  88. package/dist/components/icons/DarkPdfIcon.js +2 -15
  89. package/dist/components/icons/DualPageIcon.js +16 -22
  90. package/dist/components/icons/DualPageWithCoverIcon.js +16 -22
  91. package/dist/components/icons/FileDownloadDefaultIcon.js +20 -23
  92. package/dist/components/icons/FileUploadDefaultIcon.js +20 -23
  93. package/dist/components/icons/FullScreenIcon.js +16 -22
  94. package/dist/components/icons/GoToDownIcon.js +16 -22
  95. package/dist/components/icons/HandModeDefaultIcon.js +16 -22
  96. package/dist/components/icons/HorizontalScrollingIcon.js +18 -24
  97. package/dist/components/icons/InfoIcon.js +16 -22
  98. package/dist/components/icons/LightPdfIcon.js +2 -15
  99. package/dist/components/icons/LoaderIcon.js +2 -17
  100. package/dist/components/icons/MoonIcon.js +16 -22
  101. package/dist/components/icons/PageScrollingIcon.js +18 -24
  102. package/dist/components/icons/PrintDefaultIcon.js +20 -23
  103. package/dist/components/icons/SearchIcon.js +16 -22
  104. package/dist/components/icons/SinglePageIcon.js +15 -21
  105. package/dist/components/icons/SunIcon.js +26 -25
  106. package/dist/components/icons/TextSelectionDefaultIcon.js +20 -23
  107. package/dist/components/icons/ThreeDotIcon.js +16 -22
  108. package/dist/components/icons/Thumbnail.js +39 -54
  109. package/dist/components/icons/VerticalScrollingIcon.js +18 -24
  110. package/dist/components/icons/WrappedScrollingIcon.js +18 -24
  111. package/dist/components/icons/ZoomInIcon.js +16 -22
  112. package/dist/components/icons/ZoomOutIcon.js +16 -22
  113. package/dist/components/layout/Container.js +2 -21
  114. package/dist/components/layout/LayoutContainer.js +23 -34
  115. package/dist/components/layout/LayoutWrapper.js +14 -10
  116. package/dist/components/layout/RPDefaultLayout.js +99 -244
  117. package/dist/components/layout/RPLayout.js +70 -220
  118. package/dist/components/layout/SkipLink.js +3 -29
  119. package/dist/components/layout/WrapperLayout.js +2 -27
  120. package/dist/components/layout/sidebar/CustomThumbnailElement.js +2 -68
  121. package/dist/components/layout/sidebar/RPSidebar.js +61 -112
  122. package/dist/components/layout/sidebar/RPSplitter.js +2 -9
  123. package/dist/components/layout/sidebar/Thumbnail.js +3 -155
  124. package/dist/components/layout/sidebar/Thumbnails.js +2 -82
  125. package/dist/components/layout/toolbar/DarkModeTool.js +44 -36
  126. package/dist/components/layout/toolbar/DocumentDialog.js +2 -322
  127. package/dist/components/layout/toolbar/DocumentProperties.js +30 -39
  128. package/dist/components/layout/toolbar/FileDownloadTool.js +54 -50
  129. package/dist/components/layout/toolbar/FileUploadTool.js +54 -49
  130. package/dist/components/layout/toolbar/FullScreenTool.js +62 -72
  131. package/dist/components/layout/toolbar/MenuItem.js +2 -19
  132. package/dist/components/layout/toolbar/MenuSeparator.js +2 -15
  133. package/dist/components/layout/toolbar/MostPageTool.js +62 -81
  134. package/dist/components/layout/toolbar/OtherTool.js +97 -198
  135. package/dist/components/layout/toolbar/Paginate.js +111 -145
  136. package/dist/components/layout/toolbar/PrintTool.js +70 -72
  137. package/dist/components/layout/toolbar/PropertyItem.js +2 -12
  138. package/dist/components/layout/toolbar/RPMenuItem.js +22 -31
  139. package/dist/components/layout/toolbar/RPMoreOptions.js +140 -220
  140. package/dist/components/layout/toolbar/RPToolbar.js +45 -151
  141. package/dist/components/layout/toolbar/RPToolbarEnd.js +23 -121
  142. package/dist/components/layout/toolbar/RotateTool.js +49 -60
  143. package/dist/components/layout/toolbar/ScrollModeTool.js +79 -67
  144. package/dist/components/layout/toolbar/SearchCloseButton.js +23 -31
  145. package/dist/components/layout/toolbar/SearchResultNavigator.js +39 -100
  146. package/dist/components/layout/toolbar/SearchTool.js +226 -267
  147. package/dist/components/layout/toolbar/SelectionModeTool.js +59 -51
  148. package/dist/components/layout/toolbar/ThumbnailTool.js +30 -39
  149. package/dist/components/layout/toolbar/ToolbarCustom.js +56 -113
  150. package/dist/components/layout/toolbar/ToolbarDefault.js +58 -196
  151. package/dist/components/layout/toolbar/ToolbarLayout.js +12 -158
  152. package/dist/components/layout/toolbar/ViewModeTool.js +82 -62
  153. package/dist/components/layout/toolbar/ZoomTool.js +139 -150
  154. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +24 -54
  155. package/dist/components/layout/toolbar/tools/DualPageTool.js +23 -25
  156. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -206
  157. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +23 -35
  158. package/dist/components/layout/toolbar/tools/FileUploadTool.js +23 -34
  159. package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -201
  160. package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -33
  161. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +24 -36
  162. package/dist/components/layout/toolbar/tools/InputPageTool.js +51 -92
  163. package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -201
  164. package/dist/components/layout/toolbar/tools/NextPageTool.js +32 -61
  165. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +24 -36
  166. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +21 -62
  167. package/dist/components/layout/toolbar/tools/PrintTool.js +23 -35
  168. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +23 -47
  169. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +26 -47
  170. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +29 -38
  171. package/dist/components/layout/toolbar/tools/SinglePageTool.js +22 -24
  172. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +24 -35
  173. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +24 -46
  174. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +24 -36
  175. package/dist/components/layout/toolbar/tools/ZoomInTool.js +29 -58
  176. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +26 -26
  177. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +94 -133
  178. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +29 -58
  179. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +60 -148
  180. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +31 -42
  181. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +23 -28
  182. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +25 -52
  183. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -51
  184. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +26 -42
  185. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +57 -87
  186. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +25 -52
  187. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +44 -64
  188. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +80 -71
  189. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +59 -57
  190. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +79 -66
  191. package/dist/components/page/AnnotationLayer.js +2 -146
  192. package/dist/components/page/CanvasLayer.js +47 -71
  193. package/dist/components/page/CustomElement.js +18 -53
  194. package/dist/components/page/DualPage.js +43 -98
  195. package/dist/components/page/DualPageWithCover.js +66 -130
  196. package/dist/components/page/RPPage.js +2 -143
  197. package/dist/components/page/SinglePage.js +27 -88
  198. package/dist/components/page/TextHighlightLayer.js +2 -198
  199. package/dist/components/page/TextLayer.js +2 -202
  200. package/dist/components/page/searchHighlight.js +32 -37
  201. package/dist/components/ui/Button.js +2 -25
  202. package/dist/components/ui/Checkbox.js +2 -273
  203. package/dist/components/ui/DropDown.js +2 -36
  204. package/dist/components/ui/Input.js +2 -28
  205. package/dist/components/ui/LoadingIndicator.js +2 -59
  206. package/dist/components/ui/PasswordModal.js +2 -75
  207. package/dist/components/ui/RPTooltip.js +2 -357
  208. package/dist/contexts/ConfigContext.js +13 -12
  209. package/dist/contexts/DarkModeContext.js +26 -27
  210. package/dist/contexts/DimensionPagesContext.js +49 -60
  211. package/dist/contexts/DocumentPasswordContext.js +37 -35
  212. package/dist/contexts/DownloadContext.js +13 -21
  213. package/dist/contexts/DropFileZoneContext.js +35 -62
  214. package/dist/contexts/ElementPageContext.js +114 -139
  215. package/dist/contexts/ElementThumbnailContext.js +132 -195
  216. package/dist/contexts/EventCallbackContext.js +19 -34
  217. package/dist/contexts/FileInputContext.js +30 -49
  218. package/dist/contexts/FullScreenContext.js +31 -24
  219. package/dist/contexts/GlobalCurrentPage.js +21 -18
  220. package/dist/contexts/HighlightContext.js +22 -31
  221. package/dist/contexts/IconContext.js +9 -11
  222. package/dist/contexts/IconToolContext.js +14 -11
  223. package/dist/contexts/InitialStateContext.js +9 -11
  224. package/dist/contexts/LayerContext.js +9 -8
  225. package/dist/contexts/LayoutContainerContext.js +12 -16
  226. package/dist/contexts/LayoutDropFileZoneContext.js +8 -11
  227. package/dist/contexts/LicenseContext.js +12 -17
  228. package/dist/contexts/LoaderContext.js +14 -27
  229. package/dist/contexts/LocalizationContext.js +22 -33
  230. package/dist/contexts/OtherToolContext.js +17 -17
  231. package/dist/contexts/PageViewportContext.js +9 -8
  232. package/dist/contexts/PagesRotateContext.js +42 -43
  233. package/dist/contexts/PaginationContext.js +2 -40
  234. package/dist/contexts/PrintContext.js +67 -78
  235. package/dist/contexts/RPDocumentContext.js +60 -73
  236. package/dist/contexts/RenderQueueProvider.js +43 -72
  237. package/dist/contexts/RenderedPagesCache.js +17 -13
  238. package/dist/contexts/RotationContext.js +27 -38
  239. package/dist/contexts/ScrollModeContext.js +22 -20
  240. package/dist/contexts/SearchContext.js +39 -97
  241. package/dist/contexts/SelectionModeContext.js +22 -23
  242. package/dist/contexts/SmoothScrollContext.js +18 -16
  243. package/dist/contexts/ThemeContext.js +5 -7
  244. package/dist/contexts/ThumbnailsContext.js +26 -43
  245. package/dist/contexts/ToolComponentContext.js +54 -51
  246. package/dist/contexts/ToolbarComponentContext.js +48 -47
  247. package/dist/contexts/ViewModeContext.js +34 -31
  248. package/dist/contexts/ViewportContext.js +91 -85
  249. package/dist/contexts/VirtualGridContext.js +17 -14
  250. package/dist/contexts/VirtualScrollContext.js +42 -52
  251. package/dist/contexts/ZoomContext.js +95 -107
  252. package/dist/de_DE--0LF-SJR.js +483 -0
  253. package/dist/dist-7FA4Do6I.js +1286 -0
  254. package/dist/dist-BRVqFn7R.js +144 -0
  255. package/dist/dist-C3WNMuW2.js +29 -0
  256. package/dist/dist-CKteKPPA.js +947 -0
  257. package/dist/dist-bK-AHWLF.js +314 -0
  258. package/dist/lib-BiapEtK1.js +10261 -0
  259. package/dist/libInjectCss.js +7 -8
  260. package/dist/main-CHO5p1qM.js +60 -0
  261. package/dist/main.js +53 -296
  262. package/dist/style-9n_QpMZt.js +5 -0
  263. package/dist/useWatermark-CvAAf66v.js +67 -0
  264. package/dist/utils/Queue.js +40 -46
  265. package/dist/utils/annotations.js +227 -261
  266. package/dist/utils/appConsole.js +24 -42
  267. package/dist/utils/approximateFragtion.js +16 -21
  268. package/dist/utils/calculatePage.js +29 -20
  269. package/dist/utils/charators.js +39 -48
  270. package/dist/utils/const.js +8 -11
  271. package/dist/utils/constants.js +4 -8
  272. package/dist/utils/convertPdfDate.js +20 -24
  273. package/dist/utils/dateFormatter.js +7 -7
  274. package/dist/utils/elementPagePosition.js +10 -10
  275. package/dist/utils/formatFileSize.js +17 -8
  276. package/dist/utils/getElementPositionInPage.js +44 -82
  277. package/dist/utils/getScrollDistance.js +4 -4
  278. package/dist/utils/getThumbnailViewport.js +12 -6
  279. package/dist/utils/getWordPositionInPage.js +24 -24
  280. package/dist/utils/getZoomLevel.js +16 -23
  281. package/dist/utils/highlight.js +195 -212
  282. package/dist/utils/hooks/useCopyText.js +23 -33
  283. package/dist/utils/hooks/useDarkMode.js +10 -10
  284. package/dist/utils/hooks/useDarkModeProps.js +9 -10
  285. package/dist/utils/hooks/useDebounce.js +22 -18
  286. package/dist/utils/hooks/useDropFileZone.js +13 -11
  287. package/dist/utils/hooks/useElementSize.js +24 -20
  288. package/dist/utils/hooks/useFileDownload.js +16 -33
  289. package/dist/utils/hooks/useFlickerSelectText.js +19 -24
  290. package/dist/utils/hooks/useFullScreen.js +31 -28
  291. package/dist/utils/hooks/useGrabScroll.js +52 -51
  292. package/dist/utils/hooks/useHighlight.js +92 -92
  293. package/dist/utils/hooks/useInfiniteScroll.js +17 -18
  294. package/dist/utils/hooks/useLicense.js +113 -135
  295. package/dist/utils/hooks/useLoadPdf.js +107 -100
  296. package/dist/utils/hooks/useLoadWorker.js +13 -15
  297. package/dist/utils/hooks/useLocalization.js +25 -25
  298. package/dist/utils/hooks/useMousePressed.js +25 -19
  299. package/dist/utils/hooks/usePageRotateContext.js +25 -41
  300. package/dist/utils/hooks/usePaginate.js +2 -38
  301. package/dist/utils/hooks/usePdfProperties.js +38 -36
  302. package/dist/utils/hooks/usePinch.js +65 -100
  303. package/dist/utils/hooks/usePresentPage.js +69 -92
  304. package/dist/utils/hooks/usePrint.js +167 -178
  305. package/dist/utils/hooks/useRequestAnimationFrame.js +16 -16
  306. package/dist/utils/hooks/useResizeObserver.js +18 -21
  307. package/dist/utils/hooks/useRotate.js +15 -27
  308. package/dist/utils/hooks/useScrollToPage.js +2 -38
  309. package/dist/utils/hooks/useSearch.js +125 -163
  310. package/dist/utils/hooks/useTextSelection.js +69 -75
  311. package/dist/utils/hooks/useThumbnail.js +42 -59
  312. package/dist/utils/hooks/useVirtualReactWindow.js +85 -96
  313. package/dist/utils/hooks/useWatermark.js +2 -78
  314. package/dist/utils/injectPrintCSS.js +6 -21
  315. package/dist/utils/link_service.js +59 -137
  316. package/dist/utils/renderPage.js +20 -19
  317. package/dist/utils/sanitizeExternalUrl.js +12 -15
  318. package/dist/utils/smoothScrollTo.js +8 -5
  319. package/dist/utils/types.js +29 -21
  320. package/dist/utils/withRef.js +7 -7
  321. package/dist/utils/zoom.js +5 -6
  322. package/package.json +7 -7
  323. package/dist/Combination-17ab8af1.js +0 -698
  324. package/dist/MostPageTool.module-13578ad6.js +0 -6
  325. package/dist/OtherTool.module-a4be5f1f.js +0 -6
  326. package/dist/Paginate.module-4eef00aa.js +0 -8
  327. package/dist/PaginationContext-87f832f2.js +0 -233
  328. package/dist/RPLayout.module-92fa19f7.js +0 -14
  329. package/dist/RPSplitter-b62772f9.js +0 -122
  330. package/dist/RPToolbar.module-27d7fe77.js +0 -10
  331. package/dist/RotateTool.module-67946714.js +0 -6
  332. package/dist/SearchTool.module-99f60dc7.js +0 -16
  333. package/dist/ToolbarLayout.module-6e339802.js +0 -12
  334. package/dist/ZoomTool.module-7082af8c.js +0 -12
  335. package/dist/assets/style.css +0 -1
  336. package/dist/clsx-0c6e471a.js +0 -22
  337. package/dist/de_DE-8145915f.js +0 -489
  338. package/dist/index-113053cf.js +0 -309
  339. package/dist/index-11f3cd64.js +0 -983
  340. package/dist/index-23911b43.js +0 -150
  341. package/dist/index-ada501c4.js +0 -27
  342. package/dist/index-d0f0aa9a.js +0 -1542
  343. package/dist/index-e04c91b1.js +0 -11671
@@ -1,59 +1,2 @@
1
- import { jsx as a, jsxs as p } from "react/jsx-runtime";
2
- import { c as r } from "../../clsx-0c6e471a.js";
3
- import { usePrintContext as s } from "../../contexts/PrintContext.js";
4
- import { useLocalizationContext as e } from "../../contexts/LocalizationContext.js";
5
- import "react";
6
- import "../../utils/hooks/usePrint.js";
7
- import "../../contexts/RPDocumentContext.js";
8
- import "../../utils/hooks/useLoadPdf.js";
9
- import "pdfjs-dist";
10
- import "../../utils/types.js";
11
- import "../../de_DE-8145915f.js";
12
- import "../../utils/getThumbnailViewport.js";
13
- import "../../contexts/ConfigContext.js";
14
- import "../../contexts/DocumentPasswordContext.js";
15
- import "../../utils/appConsole.js";
16
- import "../../utils/const.js";
17
- import "../../utils/hooks/usePdfProperties.js";
18
- import "../../utils/convertPdfDate.js";
19
- import "../../utils/formatFileSize.js";
20
- import "../../utils/hooks/useLocalization.js";
21
- const m = "_loading_wazy2_1", i = {
22
- "rp-loading-overlay": "_rp-loading-overlay_wazy2_1",
23
- "rp-loading-modal": "_rp-loading-modal_wazy2_14",
24
- "rp-loading-title": "_rp-loading-title_wazy2_27",
25
- "rp-loading-progress-bar": "_rp-loading-progress-bar_wazy2_35",
26
- "rp-loading-progress": "_rp-loading-progress_wazy2_35",
27
- "rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
28
- loading: m
29
- }, E = ({ percentage: t }) => {
30
- const { cancel: l } = s(), { localeMessages: o } = e(), d = (n) => {
31
- n.key === "Escape" && (n.preventDefault(), n.stopPropagation(), l());
32
- };
33
- return t < 1 ? null : /* @__PURE__ */ a("div", { className: r(i["rp-loading-overlay"]), children: /* @__PURE__ */ p("div", { className: r(i["rp-loading-modal"]), children: [
34
- /* @__PURE__ */ p("div", { className: r(i["rp-loading-title"]), children: [
35
- o == null ? void 0 : o.printLoadingMessage,
36
- "..."
37
- ] }),
38
- /* @__PURE__ */ a("div", { className: r(i["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
39
- "div",
40
- {
41
- className: r(i["rp-loading-progress"]),
42
- style: { width: `${t}%` }
43
- }
44
- ) }),
45
- /* @__PURE__ */ a(
46
- "button",
47
- {
48
- className: r(i["rp-loading-cancel-button"]),
49
- onClick: l,
50
- onKeyDown: d,
51
- autoFocus: !0,
52
- children: o == null ? void 0 : o.printCancelLabel
53
- }
54
- )
55
- ] }) });
56
- };
57
- export {
58
- E as default
59
- };
1
+ import { t as e } from "../../LoadingIndicator-MWrbKa6X.js";
2
+ export { e as default };
@@ -1,75 +1,2 @@
1
- import { jsx as o, jsxs as t } from "react/jsx-runtime";
2
- import { useState as _ } from "react";
3
- import { c as a } from "../../clsx-0c6e471a.js";
4
- import { useLocalizationContext as c } from "../../contexts/LocalizationContext.js";
5
- import { useDocumentPasswordContext as v } from "../../contexts/DocumentPasswordContext.js";
6
- import "../../utils/appConsole.js";
7
- import "../../utils/hooks/useLocalization.js";
8
- import "../../de_DE-8145915f.js";
9
- const s = {
10
- "rp-password-overlay": "_rp-password-overlay_18s56_1",
11
- "rp-password-modal": "_rp-password-modal_18s56_13",
12
- "rp-password-title": "_rp-password-title_18s56_27",
13
- "rp-password-content": "_rp-password-content_18s56_35",
14
- "rp-password-form": "_rp-password-form_18s56_41",
15
- "rp-password-input": "_rp-password-input_18s56_45",
16
- "rp-password-input-invalid": "_rp-password-input-invalid_18s56_62",
17
- "rp-password-message-invalid": "_rp-password-message-invalid_18s56_66",
18
- "rp-password-submit-button": "_rp-password-submit-button_18s56_72"
19
- }, S = () => {
20
- const [d, e] = _(""), { localeMessages: r } = c(), { setPassword: l, setPasswordError: m, invalidPassword: p } = v(), w = (i) => {
21
- e(i.target.value), p && m(void 0);
22
- }, n = (i) => {
23
- i.preventDefault(), d && d.trim() && l(d);
24
- }, u = !d.trim();
25
- return /* @__PURE__ */ o("div", { className: a(s["rp-password-overlay"]), role: "dialog", "aria-modal": "true", "aria-labelledby": "password-modal-title", children: /* @__PURE__ */ t("div", { className: a(s["rp-password-modal"]), children: [
26
- /* @__PURE__ */ o("div", { id: "password-modal-title", className: a(s["rp-password-title"]), children: r == null ? void 0 : r.passwordModalTitle }),
27
- /* @__PURE__ */ o("div", { className: a(s["rp-password-content"]), children: r == null ? void 0 : r.passwordModalMessage }),
28
- /* @__PURE__ */ t("form", { onSubmit: n, children: [
29
- /* @__PURE__ */ t("div", { className: a(s["rp-password-form"]), children: [
30
- /* @__PURE__ */ o(
31
- "input",
32
- {
33
- type: "password",
34
- value: d,
35
- onChange: w,
36
- className: a(
37
- s["rp-password-input"],
38
- p && s["rp-password-input-invalid"]
39
- ),
40
- placeholder: r == null ? void 0 : r.passwordPlaceholder,
41
- autoComplete: "off",
42
- "aria-label": r == null ? void 0 : r.passwordPlaceholder,
43
- "aria-required": "true",
44
- "aria-invalid": p,
45
- "aria-describedby": p ? "password-error" : void 0
46
- }
47
- ),
48
- /* @__PURE__ */ o(
49
- "div",
50
- {
51
- id: "password-error",
52
- className: a(s["rp-password-message-invalid"]),
53
- role: "alert",
54
- "aria-live": "polite",
55
- children: p && /* @__PURE__ */ o("span", { children: r == null ? void 0 : r.passwordError })
56
- }
57
- )
58
- ] }),
59
- /* @__PURE__ */ o(
60
- "button",
61
- {
62
- type: "submit",
63
- disabled: u,
64
- className: a(s["rp-password-submit-button"]),
65
- onClick: n,
66
- "aria-label": r == null ? void 0 : r.passwordConfirmLabel,
67
- children: r == null ? void 0 : r.passwordConfirmLabel
68
- }
69
- )
70
- ] })
71
- ] }) });
72
- };
73
- export {
74
- S as default
75
- };
1
+ import { t as e } from "../../PasswordModal-BDHdSpxf.js";
2
+ export { e as default };
@@ -1,357 +1,2 @@
1
- import { jsx as p, jsxs as L } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { P as M, c as K, f as J, a as j, b as g, d as Q, h as Z } from "../../index-113053cf.js";
4
- import { u as $, D as ee } from "../../index-23911b43.js";
5
- import { c as G, R as te, A as oe, C as re, a as ne } from "../../index-d0f0aa9a.js";
6
- import { withRef as se } from "../../utils/withRef.js";
7
- import "react-dom";
8
- import "../../index-ada501c4.js";
9
- var ae = Object.freeze({
10
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
11
- position: "absolute",
12
- border: 0,
13
- width: 1,
14
- height: 1,
15
- padding: 0,
16
- margin: -1,
17
- overflow: "hidden",
18
- clip: "rect(0, 0, 0, 0)",
19
- whiteSpace: "nowrap",
20
- wordWrap: "normal"
21
- }), ie = "VisuallyHidden", F = s.forwardRef(
22
- (e, o) => /* @__PURE__ */ p(
23
- M.span,
24
- {
25
- ...e,
26
- ref: o,
27
- style: { ...ae, ...e.style }
28
- }
29
- )
30
- );
31
- F.displayName = ie;
32
- var le = F, [_, Ne] = K("Tooltip", [
33
- G
34
- ]), A = G(), V = "TooltipProvider", ce = 700, O = "tooltip.open", [ue, I] = _(V), Y = (e) => {
35
- const {
36
- __scopeTooltip: o,
37
- delayDuration: t = ce,
38
- skipDelayDuration: r = 300,
39
- disableHoverableContent: n = !1,
40
- children: l
41
- } = e, i = s.useRef(!0), v = s.useRef(!1), a = s.useRef(0);
42
- return s.useEffect(() => {
43
- const d = a.current;
44
- return () => window.clearTimeout(d);
45
- }, []), /* @__PURE__ */ p(
46
- ue,
47
- {
48
- scope: o,
49
- isOpenDelayedRef: i,
50
- delayDuration: t,
51
- onOpen: s.useCallback(() => {
52
- window.clearTimeout(a.current), i.current = !1;
53
- }, []),
54
- onClose: s.useCallback(() => {
55
- window.clearTimeout(a.current), a.current = window.setTimeout(
56
- () => i.current = !0,
57
- r
58
- );
59
- }, [r]),
60
- isPointerInTransitRef: v,
61
- onPointerInTransitChange: s.useCallback((d) => {
62
- v.current = d;
63
- }, []),
64
- disableHoverableContent: n,
65
- children: l
66
- }
67
- );
68
- };
69
- Y.displayName = V;
70
- var P = "Tooltip", [pe, D] = _(P), B = (e) => {
71
- const {
72
- __scopeTooltip: o,
73
- children: t,
74
- open: r,
75
- defaultOpen: n,
76
- onOpenChange: l,
77
- disableHoverableContent: i,
78
- delayDuration: v
79
- } = e, a = I(P, e.__scopeTooltip), d = A(o), [c, f] = s.useState(null), h = $(), u = s.useRef(0), y = i ?? a.disableHoverableContent, m = v ?? a.delayDuration, T = s.useRef(!1), [x, C] = J({
80
- prop: r,
81
- defaultProp: n ?? !1,
82
- onChange: (S) => {
83
- S ? (a.onOpen(), document.dispatchEvent(new CustomEvent(O))) : a.onClose(), l == null || l(S);
84
- },
85
- caller: P
86
- }), b = s.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), E = s.useCallback(() => {
87
- window.clearTimeout(u.current), u.current = 0, T.current = !1, C(!0);
88
- }, [C]), R = s.useCallback(() => {
89
- window.clearTimeout(u.current), u.current = 0, C(!1);
90
- }, [C]), N = s.useCallback(() => {
91
- window.clearTimeout(u.current), u.current = window.setTimeout(() => {
92
- T.current = !0, C(!0), u.current = 0;
93
- }, m);
94
- }, [m, C]);
95
- return s.useEffect(() => () => {
96
- u.current && (window.clearTimeout(u.current), u.current = 0);
97
- }, []), /* @__PURE__ */ p(te, { ...d, children: /* @__PURE__ */ p(
98
- pe,
99
- {
100
- scope: o,
101
- contentId: h,
102
- open: x,
103
- stateAttribute: b,
104
- trigger: c,
105
- onTriggerChange: f,
106
- onTriggerEnter: s.useCallback(() => {
107
- a.isOpenDelayedRef.current ? N() : E();
108
- }, [a.isOpenDelayedRef, N, E]),
109
- onTriggerLeave: s.useCallback(() => {
110
- y ? R() : (window.clearTimeout(u.current), u.current = 0);
111
- }, [R, y]),
112
- onOpen: E,
113
- onClose: R,
114
- disableHoverableContent: y,
115
- children: t
116
- }
117
- ) });
118
- };
119
- B.displayName = P;
120
- var k = "TooltipTrigger", U = s.forwardRef(
121
- (e, o) => {
122
- const { __scopeTooltip: t, ...r } = e, n = D(k, t), l = I(k, t), i = A(t), v = s.useRef(null), a = j(o, v, n.onTriggerChange), d = s.useRef(!1), c = s.useRef(!1), f = s.useCallback(() => d.current = !1, []);
123
- return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(oe, { asChild: !0, ...i, children: /* @__PURE__ */ p(
124
- M.button,
125
- {
126
- "aria-describedby": n.open ? n.contentId : void 0,
127
- "data-state": n.stateAttribute,
128
- ...r,
129
- ref: a,
130
- onPointerMove: g(e.onPointerMove, (h) => {
131
- h.pointerType !== "touch" && !c.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
132
- }),
133
- onPointerLeave: g(e.onPointerLeave, () => {
134
- n.onTriggerLeave(), c.current = !1;
135
- }),
136
- onPointerDown: g(e.onPointerDown, () => {
137
- n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
138
- }),
139
- onFocus: g(e.onFocus, () => {
140
- d.current || n.onOpen();
141
- }),
142
- onBlur: g(e.onBlur, n.onClose),
143
- onClick: g(e.onClick, n.onClose)
144
- }
145
- ) });
146
- }
147
- );
148
- U.displayName = k;
149
- var de = "TooltipPortal", [Se, fe] = _(de, {
150
- forceMount: void 0
151
- }), w = "TooltipContent", q = s.forwardRef(
152
- (e, o) => {
153
- const t = fe(w, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...l } = e, i = D(w, e.__scopeTooltip);
154
- return /* @__PURE__ */ p(Q, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ p(W, { side: n, ...l, ref: o }) : /* @__PURE__ */ p(ve, { side: n, ...l, ref: o }) });
155
- }
156
- ), ve = s.forwardRef((e, o) => {
157
- const t = D(w, e.__scopeTooltip), r = I(w, e.__scopeTooltip), n = s.useRef(null), l = j(o, n), [i, v] = s.useState(null), { trigger: a, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = r, h = s.useCallback(() => {
158
- v(null), f(!1);
159
- }, [f]), u = s.useCallback(
160
- (y, m) => {
161
- const T = y.currentTarget, x = { x: y.clientX, y: y.clientY }, C = me(x, T.getBoundingClientRect()), b = Ce(x, C), E = xe(m.getBoundingClientRect()), R = we([...b, ...E]);
162
- v(R), f(!0);
163
- },
164
- [f]
165
- );
166
- return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
167
- if (a && c) {
168
- const y = (T) => u(T, c), m = (T) => u(T, a);
169
- return a.addEventListener("pointerleave", y), c.addEventListener("pointerleave", m), () => {
170
- a.removeEventListener("pointerleave", y), c.removeEventListener("pointerleave", m);
171
- };
172
- }
173
- }, [a, c, u, h]), s.useEffect(() => {
174
- if (i) {
175
- const y = (m) => {
176
- const T = m.target, x = { x: m.clientX, y: m.clientY }, C = (a == null ? void 0 : a.contains(T)) || (c == null ? void 0 : c.contains(T)), b = !ge(x, i);
177
- C ? h() : b && (h(), d());
178
- };
179
- return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
180
- }
181
- }, [a, c, i, d, h]), /* @__PURE__ */ p(W, { ...e, ref: l });
182
- }), [he, ye] = _(P, { isInside: !1 }), Te = Z("TooltipContent"), W = s.forwardRef(
183
- (e, o) => {
184
- const {
185
- __scopeTooltip: t,
186
- children: r,
187
- "aria-label": n,
188
- onEscapeKeyDown: l,
189
- onPointerDownOutside: i,
190
- ...v
191
- } = e, a = D(w, t), d = A(t), { onClose: c } = a;
192
- return s.useEffect(() => (document.addEventListener(O, c), () => document.removeEventListener(O, c)), [c]), s.useEffect(() => {
193
- if (a.trigger) {
194
- const f = (h) => {
195
- const u = h.target;
196
- u != null && u.contains(a.trigger) && c();
197
- };
198
- return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
199
- }
200
- }, [a.trigger, c]), /* @__PURE__ */ p(
201
- ee,
202
- {
203
- asChild: !0,
204
- disableOutsidePointerEvents: !1,
205
- onEscapeKeyDown: l,
206
- onPointerDownOutside: i,
207
- onFocusOutside: (f) => f.preventDefault(),
208
- onDismiss: c,
209
- children: /* @__PURE__ */ L(
210
- re,
211
- {
212
- "data-state": a.stateAttribute,
213
- ...d,
214
- ...v,
215
- ref: o,
216
- style: {
217
- ...v.style,
218
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
219
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
220
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
221
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
222
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
223
- },
224
- children: [
225
- /* @__PURE__ */ p(Te, { children: r }),
226
- /* @__PURE__ */ p(he, { scope: t, isInside: !0, children: /* @__PURE__ */ p(le, { id: a.contentId, role: "tooltip", children: n || r }) })
227
- ]
228
- }
229
- )
230
- }
231
- );
232
- }
233
- );
234
- q.displayName = w;
235
- var X = "TooltipArrow", z = s.forwardRef(
236
- (e, o) => {
237
- const { __scopeTooltip: t, ...r } = e, n = A(t);
238
- return ye(
239
- X,
240
- t
241
- ).isInside ? null : /* @__PURE__ */ p(ne, { ...n, ...r, ref: o });
242
- }
243
- );
244
- z.displayName = X;
245
- function me(e, o) {
246
- const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), l = Math.abs(o.left - e.x);
247
- switch (Math.min(t, r, n, l)) {
248
- case l:
249
- return "left";
250
- case n:
251
- return "right";
252
- case t:
253
- return "top";
254
- case r:
255
- return "bottom";
256
- default:
257
- throw new Error("unreachable");
258
- }
259
- }
260
- function Ce(e, o, t = 5) {
261
- const r = [];
262
- switch (o) {
263
- case "top":
264
- r.push(
265
- { x: e.x - t, y: e.y + t },
266
- { x: e.x + t, y: e.y + t }
267
- );
268
- break;
269
- case "bottom":
270
- r.push(
271
- { x: e.x - t, y: e.y - t },
272
- { x: e.x + t, y: e.y - t }
273
- );
274
- break;
275
- case "left":
276
- r.push(
277
- { x: e.x + t, y: e.y - t },
278
- { x: e.x + t, y: e.y + t }
279
- );
280
- break;
281
- case "right":
282
- r.push(
283
- { x: e.x - t, y: e.y - t },
284
- { x: e.x - t, y: e.y + t }
285
- );
286
- break;
287
- }
288
- return r;
289
- }
290
- function xe(e) {
291
- const { top: o, right: t, bottom: r, left: n } = e;
292
- return [
293
- { x: n, y: o },
294
- { x: t, y: o },
295
- { x: t, y: r },
296
- { x: n, y: r }
297
- ];
298
- }
299
- function ge(e, o) {
300
- const { x: t, y: r } = e;
301
- let n = !1;
302
- for (let l = 0, i = o.length - 1; l < o.length; i = l++) {
303
- const v = o[l], a = o[i], d = v.x, c = v.y, f = a.x, h = a.y;
304
- c > r != h > r && t < (f - d) * (r - c) / (h - c) + d && (n = !n);
305
- }
306
- return n;
307
- }
308
- function we(e) {
309
- const o = e.slice();
310
- return o.sort((t, r) => t.x < r.x ? -1 : t.x > r.x ? 1 : t.y < r.y ? -1 : t.y > r.y ? 1 : 0), be(o);
311
- }
312
- function be(e) {
313
- if (e.length <= 1)
314
- return e.slice();
315
- const o = [];
316
- for (let r = 0; r < e.length; r++) {
317
- const n = e[r];
318
- for (; o.length >= 2; ) {
319
- const l = o[o.length - 1], i = o[o.length - 2];
320
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x))
321
- o.pop();
322
- else
323
- break;
324
- }
325
- o.push(n);
326
- }
327
- o.pop();
328
- const t = [];
329
- for (let r = e.length - 1; r >= 0; r--) {
330
- const n = e[r];
331
- for (; t.length >= 2; ) {
332
- const l = t[t.length - 1], i = t[t.length - 2];
333
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x))
334
- t.pop();
335
- else
336
- break;
337
- }
338
- t.push(n);
339
- }
340
- return t.pop(), o.length === 1 && t.length === 1 && o[0].x === t[0].x && o[0].y === t[0].y ? o : o.concat(t);
341
- }
342
- const Ee = "_tooltipContent_12gjy_1", Re = "_tooltipArrow_12gjy_8", Pe = "_fadeIn_12gjy_1", H = {
343
- tooltipContent: Ee,
344
- tooltipArrow: Re,
345
- fadeIn: Pe
346
- }, He = se(
347
- ({ children: e, content: o, className: t, style: r }, n) => /* @__PURE__ */ p(Y, { children: /* @__PURE__ */ L(B, { delayDuration: 1e3, children: [
348
- /* @__PURE__ */ p(U, { asChild: !0, children: /* @__PURE__ */ p("div", { ref: n, className: t, style: r, children: e }) }),
349
- /* @__PURE__ */ L(q, { className: H.tooltipContent, sideOffset: 5, children: [
350
- /* @__PURE__ */ p(z, { className: H.tooltipArrow }),
351
- /* @__PURE__ */ p("span", { children: o })
352
- ] })
353
- ] }) })
354
- );
355
- export {
356
- He as default
357
- };
1
+ import { t as e } from "../../RPTooltip-ZZoFqP7C.js";
2
+ export { e as default };
@@ -1,14 +1,15 @@
1
+ import { createContext as e, useContext as t } from "react";
1
2
  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
- wasmUrl: void 0
6
- }), d = () => s(o), f = (t) => {
7
- const { children: e, ...r } = t;
8
- return /* @__PURE__ */ n(o.Provider, { value: r, children: e });
9
- };
10
- export {
11
- o as ConfigContext,
12
- f as ConfigContextProvider,
13
- d as useConfigContext
3
+ //#region lib/contexts/ConfigContext.tsx
4
+ var r = e({
5
+ workerUrlAdded: !1,
6
+ wasmUrl: void 0
7
+ }), i = () => t(r), a = (e) => {
8
+ let { children: t, ...i } = e;
9
+ return /* @__PURE__ */ n(r.Provider, {
10
+ value: i,
11
+ children: t
12
+ });
14
13
  };
14
+ //#endregion
15
+ export { r as ConfigContext, a as ConfigContextProvider, i as useConfigContext };
@@ -1,28 +1,27 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createContext as f, useContext as a, 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 d = f({
6
- darkMode: !1,
7
- setDarkMode: (e) => {
8
- }
9
- }), M = () => {
10
- const e = a(d);
11
- return typeof (e == null ? void 0 : e.darkMode) > "u" && p.warn("Please use this hooks inside children component of RPProvider"), e;
12
- }, v = ({
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__ */ i(d.Provider, { value: { darkMode: t, setDarkMode: s }, children: e });
23
- };
24
- export {
25
- d as DarkModeContext,
26
- v as DarkModeProvider,
27
- M as useDarkModeContext
1
+ import { appConsole as e } from "../utils/appConsole.js";
2
+ import { useDarkMode as t } from "../utils/hooks/useDarkMode.js";
3
+ import { createContext as n, useContext as r, useEffect as i } from "react";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ //#region lib/contexts/DarkModeContext.tsx
6
+ var o = n({
7
+ darkMode: !1,
8
+ setDarkMode: (e) => {}
9
+ }), s = () => {
10
+ let t = r(o);
11
+ return t?.darkMode === void 0 && e.warn("Please use this hooks inside children component of RPProvider"), t;
12
+ }, c = ({ children: e, darkMode: n, onDarkModeChange: r }) => {
13
+ let { darkMode: s, setDarkMode: c } = t(n);
14
+ return i(() => {
15
+ typeof n == "boolean" && c(n);
16
+ }, [n, c]), i(() => {
17
+ r && r(s);
18
+ }, [r, s]), /* @__PURE__ */ a(o.Provider, {
19
+ value: {
20
+ darkMode: s,
21
+ setDarkMode: c
22
+ },
23
+ children: e
24
+ });
28
25
  };
26
+ //#endregion
27
+ export { o as DarkModeContext, c as DarkModeProvider, s as useDarkModeContext };