@react-pdf-kit/viewer 2.0.0-beta.0 → 2.0.0-beta.10
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.
- package/dist/Combination-54a77a7a.js +701 -0
- package/dist/MostPageTool.module-13578ad6.js +6 -0
- package/dist/OtherTool.module-a4be5f1f.js +6 -0
- package/dist/Paginate.module-206a7d7d.js +8 -0
- package/dist/PaginationContext-9217cab4.js +201 -0
- package/dist/{LayoutWrapper-a871c161.js → RPLayout.module-967bf4bc.js} +3 -9
- package/dist/RPToolbar.module-27d7fe77.js +10 -0
- package/dist/{RotateTool.module-03987eba.js → RotateTool.module-67946714.js} +1 -1
- package/dist/SearchTool.module-99f60dc7.js +16 -0
- package/dist/ToolbarLayout.module-1fee0a18.js +11 -0
- package/dist/{ZoomTool.module-6c5eabbb.js → ZoomTool.module-7082af8c.js} +1 -1
- package/dist/assets/style.css +1 -0
- package/dist/assets/style.js +75 -0
- package/dist/components/RPConfig.js +14 -1489
- package/dist/components/RPController.js +109 -66
- package/dist/components/RPDropFileZone.js +26 -12
- package/dist/components/RPPages.js +991 -58
- package/dist/components/RPProvider.js +107 -19
- package/dist/components/RPTheme.js +6 -5
- package/dist/components/icons/DualPageIcon.js +6 -6
- package/dist/components/icons/LoaderIcon.js +1 -1
- package/dist/components/icons/SinglePageIcon.js +6 -6
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/LayoutContainer.js +32 -57
- package/dist/components/layout/LayoutWrapper.js +9 -4
- package/dist/components/layout/RPDefaultLayout.js +214 -14
- package/dist/components/layout/RPLayout.js +143 -41
- package/dist/components/layout/WrapperLayout.js +22 -9
- package/dist/components/layout/sidebar/RPSidebar.js +110 -13
- package/dist/components/layout/sidebar/RPSplitter.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +129 -52
- package/dist/components/layout/sidebar/Thumbnails.js +75 -6
- package/dist/components/layout/toolbar/DarkModeTool.js +24 -13
- package/dist/components/layout/toolbar/DocumentDialog.js +311 -56
- package/dist/components/layout/toolbar/DocumentProperties.js +21 -8
- package/dist/components/layout/toolbar/FileDownloadTool.js +48 -13
- package/dist/components/layout/toolbar/FileUploadTool.js +34 -10
- package/dist/components/layout/toolbar/FullScreenTool.js +43 -28
- package/dist/components/layout/toolbar/MenuItem.js +15 -8
- package/dist/components/layout/toolbar/MenuSeparator.js +11 -4
- package/dist/components/layout/toolbar/MostPageTool.js +72 -51
- package/dist/components/layout/toolbar/OtherTool.js +188 -22
- package/dist/components/layout/toolbar/Paginate.js +136 -17
- package/dist/components/layout/toolbar/PrintTool.js +70 -13
- package/dist/components/layout/toolbar/PropertyItem.js +1 -1
- package/dist/components/layout/toolbar/RPMenuItem.js +23 -13
- package/dist/components/layout/toolbar/RPMoreOptions.js +119 -47
- package/dist/components/layout/toolbar/RPToolbar.js +148 -8
- package/dist/components/layout/toolbar/RPToolbarEnd.js +118 -7
- package/dist/components/layout/toolbar/RotateTool.js +42 -18
- package/dist/components/layout/toolbar/ScrollModeTool.js +33 -21
- package/dist/components/layout/toolbar/SearchCloseButton.js +30 -7
- package/dist/components/layout/toolbar/SearchResultNavigator.js +87 -8
- package/dist/components/layout/toolbar/SearchTool.js +236 -54
- package/dist/components/layout/toolbar/SelectionModeTool.js +22 -10
- package/dist/components/layout/toolbar/ThumbnailTool.js +32 -10
- package/dist/components/layout/toolbar/ToolbarCustom.js +52 -55
- package/dist/components/layout/toolbar/ToolbarDefault.js +144 -58
- package/dist/components/layout/toolbar/ToolbarLayout.js +149 -6
- package/dist/components/layout/toolbar/ViewModeTool.js +31 -19
- package/dist/components/layout/toolbar/ZoomTool.js +104 -84
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +38 -12
- package/dist/components/layout/toolbar/tools/DualPageTool.js +26 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +31 -9
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +29 -8
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -13
- package/dist/components/layout/toolbar/tools/InputPageTool.js +66 -26
- package/dist/components/layout/toolbar/tools/NextPageTool.js +36 -47
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +51 -11
- package/dist/components/layout/toolbar/tools/PrintTool.js +29 -7
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +31 -8
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +34 -11
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +31 -0
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +26 -0
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -6
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +35 -13
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +49 -20
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +27 -0
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +57 -23
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +47 -18
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +122 -45
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +37 -11
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +18 -5
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +36 -11
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -50
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +24 -9
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +47 -54
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +32 -7
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +36 -12
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +26 -14
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +27 -15
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +30 -18
- package/dist/components/page/AnnotationLayer.js +130 -54
- package/dist/components/page/CanvasLayer.js +62 -49
- package/dist/components/page/CustomElement.js +49 -18
- package/dist/components/page/DualPage.js +97 -4
- package/dist/components/page/RPPage.js +134 -51
- package/dist/components/page/SinglePage.js +87 -4
- package/dist/components/page/TextHighlightLayer.js +195 -57
- package/dist/components/page/TextLayer.js +193 -52
- package/dist/components/ui/Button.js +9 -8
- package/dist/components/ui/Checkbox.js +27 -25
- package/dist/components/ui/DropDown.js +21 -14
- package/dist/components/ui/Input.js +10 -9
- package/dist/components/ui/LoadingIndicator.js +45 -5
- package/dist/components/ui/PasswordModal.js +18 -15
- package/dist/components/ui/RPTooltip.js +98 -95
- package/dist/contexts/DimensionPagesContext.js +35 -17
- package/dist/contexts/DropFileZoneContext.js +32 -22
- package/dist/contexts/ElementPageContext.js +114 -51
- package/dist/contexts/EventCallbackContext.js +30 -0
- package/dist/contexts/FileInputContext.js +32 -22
- package/dist/contexts/FullScreenContext.js +17 -10
- package/dist/contexts/GlobalCurrentPage.js +13 -10
- package/dist/contexts/HighlightContext.js +24 -11
- package/dist/contexts/LicenseContext.js +1 -0
- package/dist/contexts/LoaderContext.js +10 -9
- package/dist/contexts/LocalizationContext.js +25 -29
- package/dist/contexts/PagesRotateContext.js +36 -18
- package/dist/contexts/PaginationContext.js +32 -4
- package/dist/contexts/PrintContext.js +76 -6
- package/dist/contexts/RPDocumentContext.js +48 -30
- package/dist/contexts/RenderQueueProvider.js +70 -8
- package/dist/contexts/RotationContext.js +25 -15
- package/dist/contexts/ScrollModeContext.js +7 -6
- package/dist/contexts/SearchContext.js +94 -6
- package/dist/contexts/SelectionModeContext.js +5 -4
- package/dist/contexts/ThumbnailsContext.js +41 -6
- package/dist/contexts/ViewModeContext.js +10 -9
- package/dist/contexts/ZoomContext.js +48 -38
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-4baea9b5.js +1198 -0
- package/dist/index-655864a7.js +27 -0
- package/dist/{index-35c7f4a2.js → index-c0faa594.js} +63 -86
- package/dist/index-e3ee9457.js +150 -0
- package/dist/libInjectCss.js +9 -0
- package/dist/main.js +269 -84
- package/dist/types/assets/style.d.ts +1 -0
- package/dist/types/components/icons/DualPageIcon.d.ts +1 -1
- package/dist/types/components/icons/SinglePageIcon.d.ts +1 -1
- package/dist/types/components/layout/toolbar/tools/DualPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/SelectionModeSwitcherTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/SinglePageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/ZoomLevelDisplay.d.ts +7 -0
- package/dist/types/contexts/EventCallbackContext.d.ts +5 -0
- package/dist/types/contexts/RenderQueueProvider.d.ts +2 -2
- package/dist/types/libInjectCss.d.ts +1 -0
- package/dist/types/main.d.ts +6 -6
- package/dist/types/utils/annotations.d.ts +3 -3
- package/dist/types/utils/approximateFragtion.d.ts +9 -0
- package/dist/types/utils/getElementPositionInPage.d.ts +5 -0
- package/dist/types/utils/hooks/useCopyText.d.ts +1 -0
- package/dist/types/utils/hooks/usePrint.d.ts +3 -2
- package/dist/types/utils/hooks/useSearch.d.ts +1 -2
- package/dist/types/utils/injectPrintCSS.d.ts +1 -0
- package/dist/types/utils/link_service.d.ts +11 -1
- package/dist/types/utils/renderPage.d.ts +2 -2
- package/dist/types/utils/types.d.ts +38 -5
- package/dist/types/utils/zoom.d.ts +2 -0
- package/dist/utils/annotations.js +125 -149
- package/dist/utils/approximateFragtion.js +22 -0
- package/dist/utils/getElementPositionInPage.js +84 -0
- package/dist/utils/getWordPositionInPage.js +5 -5
- package/dist/utils/getZoomLevel.js +9 -8
- package/dist/utils/highlight.js +72 -72
- package/dist/utils/hooks/useCopyText.js +36 -0
- package/dist/utils/hooks/useDarkModeProps.js +3 -2
- package/dist/utils/hooks/useFileDownload.js +29 -54
- package/dist/utils/hooks/useHighlight.js +34 -33
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +44 -36
- package/dist/utils/hooks/useLoadWorker.js +11 -8
- package/dist/utils/hooks/useLocalization.js +13 -13
- package/dist/utils/hooks/usePageRotateContext.js +33 -17
- package/dist/utils/hooks/usePaginate.js +26 -49
- package/dist/utils/hooks/usePinch.js +62 -41
- package/dist/utils/hooks/usePresentPage.js +80 -50
- package/dist/utils/hooks/usePrint.js +181 -55
- package/dist/utils/hooks/useRotate.js +21 -7
- package/dist/utils/hooks/useScrollToPage.js +26 -51
- package/dist/utils/hooks/useSearch.js +141 -55
- package/dist/utils/hooks/useThumbnail.js +55 -55
- package/dist/utils/hooks/useVirtualReactWindow.js +70 -52
- package/dist/utils/hooks/useWatermark.js +18 -15
- package/dist/utils/injectPrintCSS.js +22 -0
- package/dist/utils/link_service.js +49 -9
- package/dist/utils/renderPage.js +13 -10
- package/dist/utils/zoom.js +6 -0
- package/package.json +6 -8
- package/dist/SearchCloseButton-cbf182aa.js +0 -33
- package/dist/ToolbarLayout.module-c588d36b.js +0 -3411
- package/dist/assets/Button.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/Container.css +0 -1
- package/dist/assets/DropDown.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/LayoutWrapper.css +0 -1
- package/dist/assets/LoaderIcon.css +0 -1
- package/dist/assets/MenuItem.css +0 -1
- package/dist/assets/MenuSeparator.css +0 -1
- package/dist/assets/PasswordModal.css +0 -1
- package/dist/assets/PropertyItem.css +0 -1
- package/dist/assets/RPDropFileZone.css +0 -1
- package/dist/assets/RPSplitter.css +0 -1
- package/dist/assets/RPTooltip.css +0 -1
- package/dist/assets/RotateTool.css +0 -1
- package/dist/assets/SearchCloseButton.css +0 -1
- package/dist/assets/ToolbarLayout.css +0 -1
- package/dist/assets/WrapperLayout.css +0 -1
- package/dist/assets/ZoomTool.css +0 -1
- package/dist/floating-ui.react-dom-6b2fe0df.js +0 -1474
- package/dist/index-f563c6f0.js +0 -1889
|
@@ -1,8 +1,77 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import "../../../
|
|
5
|
-
import "../../../utils/
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as b, useImperativeHandle as _, useMemo as N, useCallback as x, useEffect as R } from "react";
|
|
3
|
+
import { Thumbnail as q } from "./Thumbnail.js";
|
|
4
|
+
import { useThumbnailContext as y } from "../../../contexts/ThumbnailsContext.js";
|
|
5
|
+
import { useInfiniteScroll as C } from "../../../utils/hooks/useInfiniteScroll.js";
|
|
6
|
+
import { u as I } from "../../../PaginationContext-9217cab4.js";
|
|
7
|
+
import { withRef as S } from "../../../utils/withRef.js";
|
|
8
|
+
import "../../../clsx-0c6e471a.js";
|
|
9
|
+
import "../../icons/LoaderIcon.js";
|
|
10
|
+
import "../../../contexts/PagesRotateContext.js";
|
|
11
|
+
import "../../../contexts/RPDocumentContext.js";
|
|
12
|
+
import "../../../utils/hooks/useLoadPdf.js";
|
|
13
|
+
import "pdfjs-dist";
|
|
14
|
+
import "../../../utils/types.js";
|
|
15
|
+
import "../../../th_TH-d627cd51.js";
|
|
16
|
+
import "../../../utils/getThumbnailViewport.js";
|
|
17
|
+
import "../../../contexts/ConfigContext.js";
|
|
18
|
+
import "../../../contexts/DocumentPasswordContext.js";
|
|
19
|
+
import "../../../utils/appConsole.js";
|
|
20
|
+
import "../../../utils/hooks/usePdfProperties.js";
|
|
21
|
+
import "../../../utils/convertPdfDate.js";
|
|
22
|
+
import "../../../utils/formatFileSize.js";
|
|
23
|
+
import "../../../contexts/RotationContext.js";
|
|
24
|
+
import "../../../contexts/InitialStateContext.js";
|
|
25
|
+
import "../../../contexts/EventCallbackContext.js";
|
|
26
|
+
import "../../../contexts/RenderQueueProvider.js";
|
|
27
|
+
import "../../../utils/Queue.js";
|
|
28
|
+
import "../../../utils/renderPage.js";
|
|
29
|
+
import "../../../contexts/ScrollModeContext.js";
|
|
30
|
+
import "../../../contexts/GlobalCurrentPage.js";
|
|
31
|
+
import "../../../contexts/ViewModeContext.js";
|
|
32
|
+
import "../../../contexts/VirtualScrollContext.js";
|
|
33
|
+
import "../../../contexts/VirtualGridContext.js";
|
|
34
|
+
import "../../../utils/smoothScrollTo.js";
|
|
35
|
+
import "../../../contexts/DimensionPagesContext.js";
|
|
36
|
+
import "../../../contexts/ZoomContext.js";
|
|
37
|
+
import "../../../utils/constants.js";
|
|
38
|
+
import "../../../utils/getZoomLevel.js";
|
|
39
|
+
import "../../../contexts/LayoutContainerContext.js";
|
|
40
|
+
import "../../../utils/hooks/useDebounce.js";
|
|
41
|
+
import "../../../contexts/SmoothScrollContext.js";
|
|
42
|
+
import "../../../utils/getScrollDistance.js";
|
|
43
|
+
import "../../../utils/calculatePage.js";
|
|
44
|
+
import "../../../utils/hooks/useThumbnail.js";
|
|
45
|
+
const d = {
|
|
46
|
+
"rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
|
|
47
|
+
"rp-thumbnails": "_rp-thumbnails_16vqr_1"
|
|
48
|
+
}, j = 16, D = (r, n) => {
|
|
49
|
+
const t = r == null ? void 0 : r.querySelector(`#page-${n}`);
|
|
50
|
+
r && (t != null && t.offsetTop) && (r.scrollTop = (t == null ? void 0 : t.offsetTop) - j);
|
|
51
|
+
}, Nt = S((r, n) => {
|
|
52
|
+
const { show: t, width: T } = r, { focusedPage: i, totalPages: a } = I(), { thumbnailPages: e, addPage: u, thumbnailLength: m, addToPage: c } = y(), p = b(null), l = b(1);
|
|
53
|
+
_(n, () => p.current);
|
|
54
|
+
const f = N(() => Object.values(e), [e]), P = x(() => {
|
|
55
|
+
const o = m + 1;
|
|
56
|
+
o <= a && u(o);
|
|
57
|
+
}, [u, a, m]);
|
|
58
|
+
return R(() => {
|
|
59
|
+
i > m && a > m ? c(i) : t && l.current !== i && (D(p.current, i), l.current = i);
|
|
60
|
+
}, [i, m, c, t, f]), C(p.current, P), /* @__PURE__ */ s("div", { ref: p, className: d["rp-thumbnails-container"], style: { width: T }, children: /* @__PURE__ */ s("div", { className: d["rp-thumbnails"], children: t ? f.map((o, v) => {
|
|
61
|
+
var g, h;
|
|
62
|
+
return /* @__PURE__ */ s(
|
|
63
|
+
q,
|
|
64
|
+
{
|
|
65
|
+
isFocused: i === ((g = o.page) == null ? void 0 : g.pageNumber),
|
|
66
|
+
pageNumber: (h = o.page) == null ? void 0 : h.pageNumber,
|
|
67
|
+
loading: o.loading,
|
|
68
|
+
viewport: o.viewport,
|
|
69
|
+
defaultRotation: o.defaultRotation
|
|
70
|
+
},
|
|
71
|
+
v
|
|
72
|
+
);
|
|
73
|
+
}) : null }) });
|
|
74
|
+
});
|
|
6
75
|
export {
|
|
7
|
-
|
|
76
|
+
Nt as Thumbnails
|
|
8
77
|
};
|
|
@@ -5,23 +5,34 @@ import { SunIcon as a } from "../../icons/SunIcon.js";
|
|
|
5
5
|
import { UIButton as s } from "../../ui/Button.js";
|
|
6
6
|
import { useDarkModeContext as I } from "../../../contexts/DarkModeContext.js";
|
|
7
7
|
import { useToolbarComponentContext as k } from "../../../contexts/ToolbarComponentContext.js";
|
|
8
|
-
import { useIconContext as
|
|
9
|
-
import
|
|
8
|
+
import { useIconContext as p } from "../../../contexts/IconContext.js";
|
|
9
|
+
import c from "../../ui/RPTooltip.js";
|
|
10
10
|
import { useLocalizationContext as C } from "../../../contexts/LocalizationContext.js";
|
|
11
|
-
import { useIconToolContext as
|
|
11
|
+
import { useIconToolContext as l } from "../../../contexts/IconToolContext.js";
|
|
12
12
|
import { useToolComponentContext as T } from "../../../contexts/ToolComponentContext.js";
|
|
13
|
+
import "../../../clsx-0c6e471a.js";
|
|
14
|
+
import "../../../utils/withRef.js";
|
|
15
|
+
import "../../../utils/hooks/useDarkMode.js";
|
|
16
|
+
import "../../../utils/appConsole.js";
|
|
17
|
+
import "../../../index-c0faa594.js";
|
|
18
|
+
import "react-dom";
|
|
19
|
+
import "../../../index-e3ee9457.js";
|
|
20
|
+
import "../../../floating-ui.react-dom-5ec29bd6.js";
|
|
21
|
+
import "../../../index-655864a7.js";
|
|
22
|
+
import "../../../utils/hooks/useLocalization.js";
|
|
23
|
+
import "../../../th_TH-d627cd51.js";
|
|
13
24
|
const M = () => {
|
|
14
|
-
const { lightModeIcon: t } =
|
|
15
|
-
return t ||
|
|
25
|
+
const { lightModeIcon: t } = p(), { lightModeIcon: r } = l();
|
|
26
|
+
return t || r || /* @__PURE__ */ o(f, {});
|
|
16
27
|
}, x = () => {
|
|
17
|
-
const { darkModeIcon: t } =
|
|
18
|
-
return t ||
|
|
19
|
-
},
|
|
20
|
-
const { darkMode: t, setDarkMode:
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
return !
|
|
28
|
+
const { darkModeIcon: t } = p(), { darkModeIcon: r } = l();
|
|
29
|
+
return t || r || /* @__PURE__ */ o(a, {});
|
|
30
|
+
}, N = () => {
|
|
31
|
+
const { darkMode: t, setDarkMode: r } = I(), { themeSwitcher: i = !0 } = k(), { themeSwitcher: m = !0 } = T(), { localeMessages: n } = C(), e = t ? n == null ? void 0 : n.themeEnableLightTooltip : n == null ? void 0 : n.themeEnableDarkTooltip, d = u(() => {
|
|
32
|
+
r((h) => !h);
|
|
33
|
+
}, [r]);
|
|
34
|
+
return !i || !m ? null : typeof i == "function" ? /* @__PURE__ */ o(c, { content: e, children: /* @__PURE__ */ o(i, { darkMode: t, setDarkMode: r }) }) : typeof m == "function" ? /* @__PURE__ */ o(c, { content: e, children: /* @__PURE__ */ o(m, { darkMode: t, setDarkMode: r }) }) : /* @__PURE__ */ o(c, { content: e, children: /* @__PURE__ */ o(s, { onClick: d, "aria-label": e, children: t ? /* @__PURE__ */ o(x, {}) : /* @__PURE__ */ o(M, {}) }) });
|
|
24
35
|
};
|
|
25
36
|
export {
|
|
26
|
-
|
|
37
|
+
N as DarkModeTool
|
|
27
38
|
};
|
|
@@ -1,59 +1,314 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import "../../../
|
|
5
|
-
import "
|
|
6
|
-
import "../../../
|
|
7
|
-
import "../../../contexts/
|
|
1
|
+
import { jsx as a, jsxs as C, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { useMemo as J } from "react";
|
|
4
|
+
import { c as Q, a as P, P as D, b as v, d as y, e as X, f as M, g as ee } from "../../../index-c0faa594.js";
|
|
5
|
+
import { D as te, u as R } from "../../../index-e3ee9457.js";
|
|
6
|
+
import { R as oe, h as re, u as ne, F as ie, P as ae } from "../../../Combination-54a77a7a.js";
|
|
7
|
+
import { useLayoutContainer as le } from "../../../contexts/LayoutContainerContext.js";
|
|
8
|
+
import { CloseIcon as ce } from "../../icons/CloseIcon.js";
|
|
9
|
+
import { dateFormatter as A } from "../../../utils/dateFormatter.js";
|
|
10
|
+
import { useDocumentContext as se } from "../../../contexts/RPDocumentContext.js";
|
|
11
|
+
import { PropertyItem as ue } from "./PropertyItem.js";
|
|
12
|
+
import { useOtherToolContext as pe } from "../../../contexts/OtherToolContext.js";
|
|
13
|
+
import { useLocalizationContext as de } from "../../../contexts/LocalizationContext.js";
|
|
14
|
+
import "react-dom";
|
|
15
|
+
import "../../../utils/hooks/useLoadPdf.js";
|
|
16
|
+
import "pdfjs-dist";
|
|
17
|
+
import "../../../utils/types.js";
|
|
18
|
+
import "../../../th_TH-d627cd51.js";
|
|
19
|
+
import "../../../utils/getThumbnailViewport.js";
|
|
20
|
+
import "../../../contexts/ConfigContext.js";
|
|
8
21
|
import "../../../contexts/DocumentPasswordContext.js";
|
|
9
|
-
import "../../../
|
|
10
|
-
import "../../../
|
|
11
|
-
import "../../../
|
|
12
|
-
import "../../../
|
|
13
|
-
import "../../../
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
22
|
+
import "../../../utils/appConsole.js";
|
|
23
|
+
import "../../../utils/hooks/usePdfProperties.js";
|
|
24
|
+
import "../../../utils/convertPdfDate.js";
|
|
25
|
+
import "../../../utils/formatFileSize.js";
|
|
26
|
+
import "../../../utils/hooks/useLocalization.js";
|
|
27
|
+
var h = "Dialog", [T, tt] = Q(h), [fe, u] = T(h), L = (t) => {
|
|
28
|
+
const {
|
|
29
|
+
__scopeDialog: r,
|
|
30
|
+
children: n,
|
|
31
|
+
open: i,
|
|
32
|
+
defaultOpen: e,
|
|
33
|
+
onOpenChange: o,
|
|
34
|
+
modal: l = !0
|
|
35
|
+
} = t, s = c.useRef(null), p = c.useRef(null), [d, g] = M({
|
|
36
|
+
prop: i,
|
|
37
|
+
defaultProp: e ?? !1,
|
|
38
|
+
onChange: o,
|
|
39
|
+
caller: h
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
|
+
fe,
|
|
43
|
+
{
|
|
44
|
+
scope: r,
|
|
45
|
+
triggerRef: s,
|
|
46
|
+
contentRef: p,
|
|
47
|
+
contentId: R(),
|
|
48
|
+
titleId: R(),
|
|
49
|
+
descriptionId: R(),
|
|
50
|
+
open: d,
|
|
51
|
+
onOpenChange: g,
|
|
52
|
+
onOpenToggle: c.useCallback(() => g((_) => !_), [g]),
|
|
53
|
+
modal: l,
|
|
54
|
+
children: n
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
L.displayName = h;
|
|
59
|
+
var w = "DialogTrigger", me = c.forwardRef(
|
|
60
|
+
(t, r) => {
|
|
61
|
+
const { __scopeDialog: n, ...i } = t, e = u(w, n), o = P(r, e.triggerRef);
|
|
62
|
+
return /* @__PURE__ */ a(
|
|
63
|
+
D.button,
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
"aria-haspopup": "dialog",
|
|
67
|
+
"aria-expanded": e.open,
|
|
68
|
+
"aria-controls": e.contentId,
|
|
69
|
+
"data-state": E(e.open),
|
|
70
|
+
...i,
|
|
71
|
+
ref: o,
|
|
72
|
+
onClick: v(t.onClick, e.onOpenToggle)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
me.displayName = w;
|
|
78
|
+
var N = "DialogPortal", [ge, F] = T(N, {
|
|
79
|
+
forceMount: void 0
|
|
80
|
+
}), S = (t) => {
|
|
81
|
+
const { __scopeDialog: r, forceMount: n, children: i, container: e } = t, o = u(N, r);
|
|
82
|
+
return /* @__PURE__ */ a(ge, { scope: r, forceMount: n, children: c.Children.map(i, (l) => /* @__PURE__ */ a(y, { present: n || o.open, children: /* @__PURE__ */ a(ae, { asChild: !0, container: e, children: l }) })) });
|
|
83
|
+
};
|
|
84
|
+
S.displayName = N;
|
|
85
|
+
var b = "DialogOverlay", W = c.forwardRef(
|
|
86
|
+
(t, r) => {
|
|
87
|
+
const n = F(b, t.__scopeDialog), { forceMount: i = n.forceMount, ...e } = t, o = u(b, t.__scopeDialog);
|
|
88
|
+
return o.modal ? /* @__PURE__ */ a(y, { present: i || o.open, children: /* @__PURE__ */ a(De, { ...e, ref: r }) }) : null;
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
W.displayName = b;
|
|
92
|
+
var ve = ee("DialogOverlay.RemoveScroll"), De = c.forwardRef(
|
|
93
|
+
(t, r) => {
|
|
94
|
+
const { __scopeDialog: n, ...i } = t, e = u(b, n);
|
|
95
|
+
return (
|
|
96
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
97
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
98
|
+
/* @__PURE__ */ a(oe, { as: ve, allowPinchZoom: !0, shards: [e.contentRef], children: /* @__PURE__ */ a(
|
|
99
|
+
D.div,
|
|
100
|
+
{
|
|
101
|
+
"data-state": E(e.open),
|
|
102
|
+
...i,
|
|
103
|
+
ref: r,
|
|
104
|
+
style: { pointerEvents: "auto", ...i.style }
|
|
105
|
+
}
|
|
106
|
+
) })
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
), m = "DialogContent", k = c.forwardRef(
|
|
110
|
+
(t, r) => {
|
|
111
|
+
const n = F(m, t.__scopeDialog), { forceMount: i = n.forceMount, ...e } = t, o = u(m, t.__scopeDialog);
|
|
112
|
+
return /* @__PURE__ */ a(y, { present: i || o.open, children: o.modal ? /* @__PURE__ */ a(_e, { ...e, ref: r }) : /* @__PURE__ */ a(Ce, { ...e, ref: r }) });
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
k.displayName = m;
|
|
116
|
+
var _e = c.forwardRef(
|
|
117
|
+
(t, r) => {
|
|
118
|
+
const n = u(m, t.__scopeDialog), i = c.useRef(null), e = P(r, n.contentRef, i);
|
|
119
|
+
return c.useEffect(() => {
|
|
120
|
+
const o = i.current;
|
|
121
|
+
if (o)
|
|
122
|
+
return re(o);
|
|
123
|
+
}, []), /* @__PURE__ */ a(
|
|
124
|
+
q,
|
|
125
|
+
{
|
|
126
|
+
...t,
|
|
127
|
+
ref: e,
|
|
128
|
+
trapFocus: n.open,
|
|
129
|
+
disableOutsidePointerEvents: !0,
|
|
130
|
+
onCloseAutoFocus: v(t.onCloseAutoFocus, (o) => {
|
|
131
|
+
var l;
|
|
132
|
+
o.preventDefault(), (l = n.triggerRef.current) == null || l.focus();
|
|
133
|
+
}),
|
|
134
|
+
onPointerDownOutside: v(t.onPointerDownOutside, (o) => {
|
|
135
|
+
const l = o.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
|
|
136
|
+
(l.button === 2 || s) && o.preventDefault();
|
|
137
|
+
}),
|
|
138
|
+
onFocusOutside: v(
|
|
139
|
+
t.onFocusOutside,
|
|
140
|
+
(o) => o.preventDefault()
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
), Ce = c.forwardRef(
|
|
146
|
+
(t, r) => {
|
|
147
|
+
const n = u(m, t.__scopeDialog), i = c.useRef(!1), e = c.useRef(!1);
|
|
148
|
+
return /* @__PURE__ */ a(
|
|
149
|
+
q,
|
|
150
|
+
{
|
|
151
|
+
...t,
|
|
152
|
+
ref: r,
|
|
153
|
+
trapFocus: !1,
|
|
154
|
+
disableOutsidePointerEvents: !1,
|
|
155
|
+
onCloseAutoFocus: (o) => {
|
|
156
|
+
var l, s;
|
|
157
|
+
(l = t.onCloseAutoFocus) == null || l.call(t, o), o.defaultPrevented || (i.current || (s = n.triggerRef.current) == null || s.focus(), o.preventDefault()), i.current = !1, e.current = !1;
|
|
158
|
+
},
|
|
159
|
+
onInteractOutside: (o) => {
|
|
160
|
+
var p, d;
|
|
161
|
+
(p = t.onInteractOutside) == null || p.call(t, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (e.current = !0));
|
|
162
|
+
const l = o.target;
|
|
163
|
+
((d = n.triggerRef.current) == null ? void 0 : d.contains(l)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && e.current && o.preventDefault();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
), q = c.forwardRef(
|
|
169
|
+
(t, r) => {
|
|
170
|
+
const { __scopeDialog: n, trapFocus: i, onOpenAutoFocus: e, onCloseAutoFocus: o, ...l } = t, s = u(m, n), p = c.useRef(null), d = P(r, p);
|
|
171
|
+
return ne(), /* @__PURE__ */ C(x, { children: [
|
|
172
|
+
/* @__PURE__ */ a(
|
|
173
|
+
ie,
|
|
174
|
+
{
|
|
175
|
+
asChild: !0,
|
|
176
|
+
loop: !0,
|
|
177
|
+
trapped: i,
|
|
178
|
+
onMountAutoFocus: e,
|
|
179
|
+
onUnmountAutoFocus: o,
|
|
180
|
+
children: /* @__PURE__ */ a(
|
|
181
|
+
te,
|
|
182
|
+
{
|
|
183
|
+
role: "dialog",
|
|
184
|
+
id: s.contentId,
|
|
185
|
+
"aria-describedby": s.descriptionId,
|
|
186
|
+
"aria-labelledby": s.titleId,
|
|
187
|
+
"data-state": E(s.open),
|
|
188
|
+
...l,
|
|
189
|
+
ref: d,
|
|
190
|
+
onDismiss: () => s.onOpenChange(!1)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ C(x, { children: [
|
|
196
|
+
/* @__PURE__ */ a(he, { titleId: s.titleId }),
|
|
197
|
+
/* @__PURE__ */ a(Pe, { contentRef: p, descriptionId: s.descriptionId })
|
|
198
|
+
] })
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
), O = "DialogTitle", G = c.forwardRef(
|
|
202
|
+
(t, r) => {
|
|
203
|
+
const { __scopeDialog: n, ...i } = t, e = u(O, n);
|
|
204
|
+
return /* @__PURE__ */ a(D.h2, { id: e.titleId, ...i, ref: r });
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
G.displayName = O;
|
|
208
|
+
var $ = "DialogDescription", be = c.forwardRef(
|
|
209
|
+
(t, r) => {
|
|
210
|
+
const { __scopeDialog: n, ...i } = t, e = u($, n);
|
|
211
|
+
return /* @__PURE__ */ a(D.p, { id: e.descriptionId, ...i, ref: r });
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
be.displayName = $;
|
|
215
|
+
var j = "DialogClose", V = c.forwardRef(
|
|
216
|
+
(t, r) => {
|
|
217
|
+
const { __scopeDialog: n, ...i } = t, e = u(j, n);
|
|
218
|
+
return /* @__PURE__ */ a(
|
|
219
|
+
D.button,
|
|
220
|
+
{
|
|
221
|
+
type: "button",
|
|
222
|
+
...i,
|
|
223
|
+
ref: r,
|
|
224
|
+
onClick: v(t.onClick, () => e.onOpenChange(!1))
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
V.displayName = j;
|
|
230
|
+
function E(t) {
|
|
231
|
+
return t ? "open" : "closed";
|
|
232
|
+
}
|
|
233
|
+
var z = "DialogTitleWarning", [ot, B] = X(z, {
|
|
234
|
+
contentName: m,
|
|
235
|
+
titleName: O,
|
|
236
|
+
docsSlug: "dialog"
|
|
237
|
+
}), he = ({ titleId: t }) => {
|
|
238
|
+
const r = B(z), n = `\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
239
|
+
|
|
240
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
241
|
+
|
|
242
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;
|
|
243
|
+
return c.useEffect(() => {
|
|
244
|
+
t && (document.getElementById(t) || console.error(n));
|
|
245
|
+
}, [n, t]), null;
|
|
246
|
+
}, Re = "DialogDescriptionWarning", Pe = ({ contentRef: t, descriptionId: r }) => {
|
|
247
|
+
const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(Re).contentName}}.`;
|
|
248
|
+
return c.useEffect(() => {
|
|
249
|
+
var o;
|
|
250
|
+
const e = (o = t.current) == null ? void 0 : o.getAttribute("aria-describedby");
|
|
251
|
+
r && e && (document.getElementById(r) || console.warn(i));
|
|
252
|
+
}, [i, t, r]), null;
|
|
253
|
+
}, ye = L, Ne = S, Oe = W, Ee = k, Ie = G, xe = V;
|
|
254
|
+
const f = {
|
|
255
|
+
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
256
|
+
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
257
|
+
"rp-document-dialog": "_rp-document-dialog_slqo7_13",
|
|
258
|
+
"rp-document-properties": "_rp-document-properties_slqo7_35",
|
|
259
|
+
"rp-dialog-title": "_rp-dialog-title_slqo7_39",
|
|
260
|
+
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
261
|
+
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
262
|
+
}, rt = () => {
|
|
263
|
+
const { pdfProperties: t } = se(), { container: r } = le(), { activeDocumentProperties: n, setActiveDocumentProperties: i } = pe(), { localeMessages: e } = de(), o = J(() => {
|
|
264
|
+
if (!t)
|
|
265
|
+
return [];
|
|
266
|
+
const {
|
|
267
|
+
fileSize: l,
|
|
268
|
+
filename: s,
|
|
269
|
+
title: p,
|
|
270
|
+
author: d,
|
|
271
|
+
subject: g,
|
|
272
|
+
createdOn: _,
|
|
273
|
+
creator: H,
|
|
274
|
+
keywords: K,
|
|
275
|
+
modifiedOn: I,
|
|
276
|
+
pdfProducer: U,
|
|
277
|
+
pdfVersion: Y,
|
|
278
|
+
pageCount: Z
|
|
279
|
+
} = t;
|
|
280
|
+
return [
|
|
281
|
+
{ label: e == null ? void 0 : e.propertiesFilenameLabel, value: s },
|
|
282
|
+
{ label: e == null ? void 0 : e.propertiesFileSizeLabel, value: l },
|
|
283
|
+
{ separate: !0 },
|
|
284
|
+
{ label: e == null ? void 0 : e.propertiesTitleLabel, value: p },
|
|
285
|
+
{ label: e == null ? void 0 : e.propertiesAuthorLabel, value: d },
|
|
286
|
+
{ label: e == null ? void 0 : e.propertiesSubjectLabel, value: g },
|
|
287
|
+
{ label: e == null ? void 0 : e.propertiesKeywordLabel, value: K },
|
|
288
|
+
{ label: e == null ? void 0 : e.propertiesCreatorLabel, value: H },
|
|
289
|
+
{
|
|
290
|
+
label: e == null ? void 0 : e.propertiesCreateOnLabel,
|
|
291
|
+
value: _ ? A(_) : ""
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: e == null ? void 0 : e.propertiesModifiedOnLabel,
|
|
295
|
+
value: I ? A(I) : ""
|
|
296
|
+
},
|
|
297
|
+
{ separate: !0 },
|
|
298
|
+
{ label: e == null ? void 0 : e.propertiesPDFProducerLabel, value: U },
|
|
299
|
+
{ label: e == null ? void 0 : e.propertiesPDFVersionLabel, value: Y },
|
|
300
|
+
{ label: e == null ? void 0 : e.propertiesPageCountLabel, value: Z }
|
|
301
|
+
];
|
|
302
|
+
}, [t, e]);
|
|
303
|
+
return /* @__PURE__ */ a(ye, { open: n, onOpenChange: i, children: /* @__PURE__ */ a(Ne, { container: r, children: /* @__PURE__ */ C("div", { className: f["rp-dialog-wrapper"], children: [
|
|
304
|
+
/* @__PURE__ */ a(Oe, { className: f["rp-dialog-overlay"] }),
|
|
305
|
+
/* @__PURE__ */ C(Ee, { className: f["rp-document-dialog"], children: [
|
|
306
|
+
/* @__PURE__ */ a(Ie, { className: f["rp-dialog-title"], children: e == null ? void 0 : e.documentPropertiesLabel }),
|
|
307
|
+
/* @__PURE__ */ a("div", { className: f["rp-document-properties"], children: o.map((l, s) => /* @__PURE__ */ a("div", { children: l.separate ? /* @__PURE__ */ a("div", { className: f["rp-properties-divider"] }) : /* @__PURE__ */ a(ue, { label: l.label, value: l.value }) }, s)) }),
|
|
308
|
+
/* @__PURE__ */ a(xe, { asChild: !0, className: f["rp-dialog-close"], children: /* @__PURE__ */ a(ce, {}) })
|
|
309
|
+
] })
|
|
310
|
+
] }) }) });
|
|
311
|
+
};
|
|
57
312
|
export {
|
|
58
|
-
|
|
313
|
+
rt as DocumentDialog
|
|
59
314
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, Fragment as c, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { MenuItem as u } from "./MenuItem.js";
|
|
3
3
|
import { InfoIcon as s } from "../../icons/InfoIcon.js";
|
|
4
4
|
import { useOtherToolContext as l } from "../../../contexts/OtherToolContext.js";
|
|
@@ -9,19 +9,32 @@ import { useLocalizationContext as x } from "../../../contexts/LocalizationConte
|
|
|
9
9
|
import { useIconToolContext as C } from "../../../contexts/IconToolContext.js";
|
|
10
10
|
import { useToolComponentContext as I } from "../../../contexts/ToolComponentContext.js";
|
|
11
11
|
import { MenuSeparator as T } from "./MenuSeparator.js";
|
|
12
|
+
import "../../../index-4baea9b5.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "../../../index-c0faa594.js";
|
|
15
|
+
import "react-dom";
|
|
16
|
+
import "../../../index-e3ee9457.js";
|
|
17
|
+
import "../../../Combination-54a77a7a.js";
|
|
18
|
+
import "../../../floating-ui.react-dom-5ec29bd6.js";
|
|
19
|
+
import "../../../index-655864a7.js";
|
|
20
|
+
import "../../../clsx-0c6e471a.js";
|
|
21
|
+
import "../../../utils/withRef.js";
|
|
22
|
+
import "../../../utils/appConsole.js";
|
|
23
|
+
import "../../../utils/hooks/useLocalization.js";
|
|
24
|
+
import "../../../th_TH-d627cd51.js";
|
|
12
25
|
const a = () => {
|
|
13
|
-
const { documentPropertiesIcon:
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
const { setActiveDocumentProperties:
|
|
17
|
-
return !
|
|
26
|
+
const { documentPropertiesIcon: r } = f(), { documentPropertiesIcon: e } = C();
|
|
27
|
+
return r || e || /* @__PURE__ */ t(s, {});
|
|
28
|
+
}, Q = () => {
|
|
29
|
+
const { setActiveDocumentProperties: r } = l(), { documentProperties: e = !0 } = d(), { documentProperties: n = !0, scrollModeTool: i } = I(), { localeMessages: o } = x();
|
|
30
|
+
return !e || !n ? null : /* @__PURE__ */ m(c, { children: [
|
|
18
31
|
i && /* @__PURE__ */ t(T, {}),
|
|
19
|
-
/* @__PURE__ */ t(u, { onClick: () =>
|
|
32
|
+
/* @__PURE__ */ t(u, { onClick: () => r((p) => !p), children: /* @__PURE__ */ m(P, { className: "rp-menu-item", content: o == null ? void 0 : o.documentPropertiesTooltip, children: [
|
|
20
33
|
/* @__PURE__ */ t("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ t(a, {}) }),
|
|
21
34
|
o == null ? void 0 : o.documentPropertiesLabel
|
|
22
35
|
] }) })
|
|
23
36
|
] });
|
|
24
37
|
};
|
|
25
38
|
export {
|
|
26
|
-
|
|
39
|
+
Q as DocumentProperties
|
|
27
40
|
};
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "../../icons/FileDownloadDefaultIcon.js";
|
|
3
|
-
import "../../../contexts/ToolbarComponentContext.js";
|
|
4
|
-
import "../../../contexts/IconContext.js";
|
|
5
|
-
import "../../ui/Button.js";
|
|
6
|
-
import {
|
|
7
|
-
import "./MenuItem.js";
|
|
8
|
-
import "../../../contexts/ViewportContext.js";
|
|
9
|
-
import "../../ui/RPTooltip.js";
|
|
10
|
-
import "../../../contexts/LocalizationContext.js";
|
|
11
|
-
import "../../../contexts/IconToolContext.js";
|
|
12
|
-
import "../../../contexts/ToolComponentContext.js";
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { FileDownloadDefaultIcon as f } from "../../icons/FileDownloadDefaultIcon.js";
|
|
3
|
+
import { useToolbarComponentContext as w } from "../../../contexts/ToolbarComponentContext.js";
|
|
4
|
+
import { useIconContext as e } from "../../../contexts/IconContext.js";
|
|
5
|
+
import { UIButton as T } from "../../ui/Button.js";
|
|
6
|
+
import { useFileDownload as D } from "../../../utils/hooks/useFileDownload.js";
|
|
7
|
+
import { MenuItem as C } from "./MenuItem.js";
|
|
8
|
+
import { useViewportContext as x } from "../../../contexts/ViewportContext.js";
|
|
9
|
+
import m from "../../ui/RPTooltip.js";
|
|
10
|
+
import { useLocalizationContext as F } from "../../../contexts/LocalizationContext.js";
|
|
11
|
+
import { useIconToolContext as I } from "../../../contexts/IconToolContext.js";
|
|
12
|
+
import { useToolComponentContext as h } from "../../../contexts/ToolComponentContext.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "../../../clsx-0c6e471a.js";
|
|
15
|
+
import "../../../utils/withRef.js";
|
|
16
|
+
import "../../../contexts/RPDocumentContext.js";
|
|
17
|
+
import "../../../utils/hooks/useLoadPdf.js";
|
|
18
|
+
import "pdfjs-dist";
|
|
19
|
+
import "../../../utils/types.js";
|
|
20
|
+
import "../../../th_TH-d627cd51.js";
|
|
21
|
+
import "../../../utils/getThumbnailViewport.js";
|
|
22
|
+
import "../../../contexts/ConfigContext.js";
|
|
23
|
+
import "../../../contexts/DocumentPasswordContext.js";
|
|
24
|
+
import "../../../utils/appConsole.js";
|
|
25
|
+
import "../../../utils/hooks/usePdfProperties.js";
|
|
26
|
+
import "../../../utils/convertPdfDate.js";
|
|
27
|
+
import "../../../utils/formatFileSize.js";
|
|
28
|
+
import "../../../contexts/DownloadContext.js";
|
|
29
|
+
import "../../../index-4baea9b5.js";
|
|
30
|
+
import "../../../index-c0faa594.js";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "../../../index-e3ee9457.js";
|
|
33
|
+
import "../../../Combination-54a77a7a.js";
|
|
34
|
+
import "../../../floating-ui.react-dom-5ec29bd6.js";
|
|
35
|
+
import "../../../index-655864a7.js";
|
|
36
|
+
import "../../../contexts/LayoutContainerContext.js";
|
|
37
|
+
import "../../../utils/hooks/useLocalization.js";
|
|
38
|
+
const d = () => {
|
|
39
|
+
const { downloadIcon: n } = e(), { downloadIcon: o } = I();
|
|
40
|
+
return n || o || /* @__PURE__ */ t(f, {});
|
|
41
|
+
}, l = ({ children: n, className: o, localeMessages: r }) => /* @__PURE__ */ t(m, { className: o, content: r == null ? void 0 : r.downloadFileTooltip, children: n }), b = ({ download: n, localeMessages: o }) => /* @__PURE__ */ t(l, { localeMessages: o, children: /* @__PURE__ */ t(T, { onClick: n, "aria-label": o == null ? void 0 : o.downloadFileTooltip, children: /* @__PURE__ */ t(d, {}) }) }), a = ({ download: n, localeMessages: o }) => /* @__PURE__ */ t(C, { onClick: n, children: /* @__PURE__ */ u(l, { className: "rp-menu-item", localeMessages: o, children: [
|
|
42
|
+
/* @__PURE__ */ t("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ t(d, {}) }),
|
|
43
|
+
o == null ? void 0 : o.downloadFileLabel
|
|
44
|
+
] }) }), po = () => {
|
|
45
|
+
const { download: n } = D(), { downloadTool: o = !0 } = w(), { downloadTool: r = !0 } = h(), { isSmallScreen: c } = x(), { localeMessages: i } = F(), p = i == null ? void 0 : i.downloadFileTooltip;
|
|
46
|
+
return !o || !r ? null : c ? /* @__PURE__ */ t(a, { download: n, localeMessages: i }) : typeof o == "function" ? /* @__PURE__ */ t(m, { content: p, children: /* @__PURE__ */ t(o, { download: n }) }) : typeof r == "function" ? /* @__PURE__ */ t(m, { content: p, children: /* @__PURE__ */ t(r, { download: n }) }) : /* @__PURE__ */ t(b, { download: n, localeMessages: i });
|
|
47
|
+
};
|
|
13
48
|
export {
|
|
14
|
-
|
|
49
|
+
po as FileDownloadTool
|
|
15
50
|
};
|