@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,11 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as p, jsxs as Y } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { P as S, c as ae,
|
|
4
|
-
import {
|
|
3
|
+
import { P as S, c as ae, a as k, u as oe, f as Fe, b as E, d as We, i as Be } from "../../index-c0faa594.js";
|
|
4
|
+
import { a as Ge, u as Xe, D as Ve } from "../../index-e3ee9457.js";
|
|
5
|
+
import { u as Ue, a as ze, o as qe, s as Ze, f as Ke, b as Je, c as Qe, h as et, l as tt } from "../../floating-ui.react-dom-5ec29bd6.js";
|
|
6
|
+
import { u as rt } from "../../index-655864a7.js";
|
|
5
7
|
import { withRef as ot } from "../../utils/withRef.js";
|
|
6
|
-
import
|
|
8
|
+
import "react-dom";
|
|
9
|
+
var nt = "Arrow", se = a.forwardRef((e, r) => {
|
|
7
10
|
const { children: t, width: o = 10, height: n = 5, ...i } = e;
|
|
8
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ p(
|
|
9
12
|
S.svg,
|
|
10
13
|
{
|
|
11
14
|
...i,
|
|
@@ -14,26 +17,26 @@ import '../../assets/RPTooltip.css';var nt = "Arrow", se = a.forwardRef((e, r) =
|
|
|
14
17
|
height: n,
|
|
15
18
|
viewBox: "0 0 30 10",
|
|
16
19
|
preserveAspectRatio: "none",
|
|
17
|
-
children: e.asChild ? t : /* @__PURE__ */
|
|
20
|
+
children: e.asChild ? t : /* @__PURE__ */ p("polygon", { points: "0,0 30,0 15,10" })
|
|
18
21
|
}
|
|
19
22
|
);
|
|
20
23
|
});
|
|
21
24
|
se.displayName = nt;
|
|
22
|
-
var at = se, B = "Popper", [ie, le] = ae(B), [st, ce] = ie(B),
|
|
25
|
+
var at = se, B = "Popper", [ie, le] = ae(B), [st, ce] = ie(B), pe = (e) => {
|
|
23
26
|
const { __scopePopper: r, children: t } = e, [o, n] = a.useState(null);
|
|
24
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ p(st, { scope: r, anchor: o, onAnchorChange: n, children: t });
|
|
25
28
|
};
|
|
26
|
-
|
|
27
|
-
var
|
|
29
|
+
pe.displayName = B;
|
|
30
|
+
var de = "PopperAnchor", ue = a.forwardRef(
|
|
28
31
|
(e, r) => {
|
|
29
|
-
const { __scopePopper: t, virtualRef: o, ...n } = e, i = ce(
|
|
32
|
+
const { __scopePopper: t, virtualRef: o, ...n } = e, i = ce(de, t), l = a.useRef(null), h = k(r, l), s = a.useRef(null);
|
|
30
33
|
return a.useEffect(() => {
|
|
31
|
-
const
|
|
32
|
-
s.current = (o == null ? void 0 : o.current) || l.current,
|
|
33
|
-
}), o ? null : /* @__PURE__ */
|
|
34
|
+
const d = s.current;
|
|
35
|
+
s.current = (o == null ? void 0 : o.current) || l.current, d !== s.current && i.onAnchorChange(s.current);
|
|
36
|
+
}), o ? null : /* @__PURE__ */ p(S.div, { ...n, ref: h });
|
|
34
37
|
}
|
|
35
38
|
);
|
|
36
|
-
ue.displayName =
|
|
39
|
+
ue.displayName = de;
|
|
37
40
|
var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
38
41
|
(e, r) => {
|
|
39
42
|
var Z, K, J, Q, ee, te;
|
|
@@ -45,56 +48,56 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
45
48
|
alignOffset: l = 0,
|
|
46
49
|
arrowPadding: h = 0,
|
|
47
50
|
avoidCollisions: s = !0,
|
|
48
|
-
collisionBoundary:
|
|
51
|
+
collisionBoundary: d = [],
|
|
49
52
|
collisionPadding: c = 0,
|
|
50
53
|
sticky: f = "partial",
|
|
51
54
|
hideWhenDetached: g = !1,
|
|
52
55
|
updatePositionStrategy: u = "optimized",
|
|
53
56
|
onPlaced: v,
|
|
54
|
-
...
|
|
55
|
-
} = e,
|
|
57
|
+
...m
|
|
58
|
+
} = e, y = ce(G, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = rt(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (i !== "center" ? "-" + i : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(d) ? d : [d], _e = U.length > 0, D = {
|
|
56
59
|
padding: Re,
|
|
57
|
-
boundary: U.filter(
|
|
60
|
+
boundary: U.filter(pt),
|
|
58
61
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
59
62
|
altBoundary: _e
|
|
60
|
-
}, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } =
|
|
63
|
+
}, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } = Ue({
|
|
61
64
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
62
65
|
strategy: "fixed",
|
|
63
66
|
placement: Ee,
|
|
64
|
-
whileElementsMounted: (..._) =>
|
|
67
|
+
whileElementsMounted: (..._) => ze(..._, {
|
|
65
68
|
animationFrame: u === "always"
|
|
66
69
|
}),
|
|
67
70
|
elements: {
|
|
68
|
-
reference:
|
|
71
|
+
reference: y.anchor
|
|
69
72
|
},
|
|
70
73
|
middleware: [
|
|
71
|
-
|
|
72
|
-
s &&
|
|
74
|
+
qe({ mainAxis: n + V, alignmentAxis: l }),
|
|
75
|
+
s && Ze({
|
|
73
76
|
mainAxis: !0,
|
|
74
77
|
crossAxis: !1,
|
|
75
|
-
limiter: f === "partial" ?
|
|
78
|
+
limiter: f === "partial" ? tt() : void 0,
|
|
76
79
|
...D
|
|
77
80
|
}),
|
|
78
|
-
s &&
|
|
79
|
-
|
|
81
|
+
s && Ke({ ...D }),
|
|
82
|
+
Je({
|
|
80
83
|
...D,
|
|
81
84
|
apply: ({ elements: _, rects: re, availableWidth: Me, availableHeight: $e }) => {
|
|
82
85
|
const { width: je, height: Ye } = re.reference, L = _.floating.style;
|
|
83
86
|
L.setProperty("--radix-popper-available-width", `${Me}px`), L.setProperty("--radix-popper-available-height", `${$e}px`), L.setProperty("--radix-popper-anchor-width", `${je}px`), L.setProperty("--radix-popper-anchor-height", `${Ye}px`);
|
|
84
87
|
}
|
|
85
88
|
}),
|
|
86
|
-
C &&
|
|
87
|
-
|
|
88
|
-
g &&
|
|
89
|
+
C && Qe({ element: C, padding: h }),
|
|
90
|
+
dt({ arrowWidth: N, arrowHeight: V }),
|
|
91
|
+
g && et({ strategy: "referenceHidden", ...D })
|
|
89
92
|
]
|
|
90
|
-
}), [q, Ne] = ge(Se), I =
|
|
93
|
+
}), [q, Ne] = ge(Se), I = Ge(v);
|
|
91
94
|
oe(() => {
|
|
92
95
|
H && (I == null || I());
|
|
93
96
|
}, [H, I]);
|
|
94
97
|
const De = (Z = A.arrow) == null ? void 0 : Z.x, He = (K = A.arrow) == null ? void 0 : K.y, Ie = ((J = A.arrow) == null ? void 0 : J.centerOffset) !== 0, [Le, ke] = a.useState();
|
|
95
98
|
return oe(() => {
|
|
96
99
|
w && ke(window.getComputedStyle(w).zIndex);
|
|
97
|
-
}, [w]), /* @__PURE__ */
|
|
100
|
+
}, [w]), /* @__PURE__ */ p(
|
|
98
101
|
"div",
|
|
99
102
|
{
|
|
100
103
|
ref: Oe.setFloating,
|
|
@@ -118,7 +121,7 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
123
|
dir: e.dir,
|
|
121
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ p(
|
|
122
125
|
it,
|
|
123
126
|
{
|
|
124
127
|
scope: t,
|
|
@@ -127,15 +130,15 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
127
130
|
arrowX: De,
|
|
128
131
|
arrowY: He,
|
|
129
132
|
shouldHideArrow: Ie,
|
|
130
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ p(
|
|
131
134
|
S.div,
|
|
132
135
|
{
|
|
133
136
|
"data-side": q,
|
|
134
137
|
"data-align": Ne,
|
|
135
|
-
...
|
|
138
|
+
...m,
|
|
136
139
|
ref: T,
|
|
137
140
|
style: {
|
|
138
|
-
...
|
|
141
|
+
...m.style,
|
|
139
142
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
140
143
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
141
144
|
animation: H ? void 0 : "none"
|
|
@@ -160,7 +163,7 @@ var he = "PopperArrow", ct = {
|
|
|
160
163
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
161
164
|
// doesn't report size as we'd expect on SVG elements.
|
|
162
165
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
163
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ p(
|
|
164
167
|
"span",
|
|
165
168
|
{
|
|
166
169
|
ref: i.onArrowChange,
|
|
@@ -183,7 +186,7 @@ var he = "PopperArrow", ct = {
|
|
|
183
186
|
}[i.placedSide],
|
|
184
187
|
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
185
188
|
},
|
|
186
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ p(
|
|
187
190
|
at,
|
|
188
191
|
{
|
|
189
192
|
...n,
|
|
@@ -200,24 +203,24 @@ var he = "PopperArrow", ct = {
|
|
|
200
203
|
);
|
|
201
204
|
});
|
|
202
205
|
ve.displayName = he;
|
|
203
|
-
function
|
|
206
|
+
function pt(e) {
|
|
204
207
|
return e !== null;
|
|
205
208
|
}
|
|
206
|
-
var
|
|
209
|
+
var dt = (e) => ({
|
|
207
210
|
name: "transformOrigin",
|
|
208
211
|
options: e,
|
|
209
212
|
fn(r) {
|
|
210
|
-
var
|
|
211
|
-
const { placement: t, rects: o, middlewareData: n } = r, l = ((
|
|
212
|
-
let v = "",
|
|
213
|
-
return
|
|
213
|
+
var y, w, x;
|
|
214
|
+
const { placement: t, rects: o, middlewareData: n } = r, l = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = l ? 0 : e.arrowWidth, s = l ? 0 : e.arrowHeight, [d, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + s / 2;
|
|
215
|
+
let v = "", m = "";
|
|
216
|
+
return d === "bottom" ? (v = l ? f : `${g}px`, m = `${-s}px`) : d === "top" ? (v = l ? f : `${g}px`, m = `${o.floating.height + s}px`) : d === "right" ? (v = `${-s}px`, m = l ? f : `${u}px`) : d === "left" && (v = `${o.floating.width + s}px`, m = l ? f : `${u}px`), { data: { x: v, y: m } };
|
|
214
217
|
}
|
|
215
218
|
});
|
|
216
219
|
function ge(e) {
|
|
217
220
|
const [r, t = "center"] = e.split("-");
|
|
218
221
|
return [r, t];
|
|
219
222
|
}
|
|
220
|
-
var ut =
|
|
223
|
+
var ut = pe, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
|
|
221
224
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
222
225
|
position: "absolute",
|
|
223
226
|
border: 0,
|
|
@@ -229,8 +232,8 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
|
|
|
229
232
|
clip: "rect(0, 0, 0, 0)",
|
|
230
233
|
whiteSpace: "nowrap",
|
|
231
234
|
wordWrap: "normal"
|
|
232
|
-
}),
|
|
233
|
-
(e, r) => /* @__PURE__ */
|
|
235
|
+
}), mt = "VisuallyHidden", me = a.forwardRef(
|
|
236
|
+
(e, r) => /* @__PURE__ */ p(
|
|
234
237
|
S.span,
|
|
235
238
|
{
|
|
236
239
|
...e,
|
|
@@ -239,10 +242,10 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
|
|
|
239
242
|
}
|
|
240
243
|
)
|
|
241
244
|
);
|
|
242
|
-
|
|
243
|
-
var
|
|
245
|
+
me.displayName = mt;
|
|
246
|
+
var yt = me, [M, Gt] = ae("Tooltip", [
|
|
244
247
|
le
|
|
245
|
-
]), $ = le(),
|
|
248
|
+
]), $ = le(), ye = "TooltipProvider", wt = 700, F = "tooltip.open", [xt, X] = M(ye), we = (e) => {
|
|
246
249
|
const {
|
|
247
250
|
__scopeTooltip: r,
|
|
248
251
|
delayDuration: t = wt,
|
|
@@ -251,9 +254,9 @@ var mt = ye, [M, Ft] = ae("Tooltip", [
|
|
|
251
254
|
children: i
|
|
252
255
|
} = e, l = a.useRef(!0), h = a.useRef(!1), s = a.useRef(0);
|
|
253
256
|
return a.useEffect(() => {
|
|
254
|
-
const
|
|
255
|
-
return () => window.clearTimeout(
|
|
256
|
-
}, []), /* @__PURE__ */
|
|
257
|
+
const d = s.current;
|
|
258
|
+
return () => window.clearTimeout(d);
|
|
259
|
+
}, []), /* @__PURE__ */ p(
|
|
257
260
|
xt,
|
|
258
261
|
{
|
|
259
262
|
scope: r,
|
|
@@ -269,15 +272,15 @@ var mt = ye, [M, Ft] = ae("Tooltip", [
|
|
|
269
272
|
);
|
|
270
273
|
}, [o]),
|
|
271
274
|
isPointerInTransitRef: h,
|
|
272
|
-
onPointerInTransitChange: a.useCallback((
|
|
273
|
-
h.current =
|
|
275
|
+
onPointerInTransitChange: a.useCallback((d) => {
|
|
276
|
+
h.current = d;
|
|
274
277
|
}, []),
|
|
275
278
|
disableHoverableContent: n,
|
|
276
279
|
children: i
|
|
277
280
|
}
|
|
278
281
|
);
|
|
279
282
|
};
|
|
280
|
-
we.displayName =
|
|
283
|
+
we.displayName = ye;
|
|
281
284
|
var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
|
|
282
285
|
const {
|
|
283
286
|
__scopeTooltip: r,
|
|
@@ -287,25 +290,25 @@ var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
|
|
|
287
290
|
onOpenChange: i,
|
|
288
291
|
disableHoverableContent: l,
|
|
289
292
|
delayDuration: h
|
|
290
|
-
} = e, s = X(O, e.__scopeTooltip),
|
|
293
|
+
} = e, s = X(O, e.__scopeTooltip), d = $(r), [c, f] = a.useState(null), g = Xe(), u = a.useRef(0), v = l ?? s.disableHoverableContent, m = h ?? s.delayDuration, y = a.useRef(!1), [w, x] = Fe({
|
|
291
294
|
prop: o,
|
|
292
295
|
defaultProp: n ?? !1,
|
|
293
296
|
onChange: (N) => {
|
|
294
297
|
N ? (s.onOpen(), document.dispatchEvent(new CustomEvent(F))) : s.onClose(), i == null || i(N);
|
|
295
298
|
},
|
|
296
299
|
caller: O
|
|
297
|
-
}), T = a.useMemo(() => w ?
|
|
298
|
-
window.clearTimeout(u.current), u.current = 0,
|
|
300
|
+
}), T = a.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
|
|
301
|
+
window.clearTimeout(u.current), u.current = 0, y.current = !1, x(!0);
|
|
299
302
|
}, [x]), b = a.useCallback(() => {
|
|
300
303
|
window.clearTimeout(u.current), u.current = 0, x(!1);
|
|
301
304
|
}, [x]), P = a.useCallback(() => {
|
|
302
305
|
window.clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
}, [
|
|
306
|
+
y.current = !0, x(!0), u.current = 0;
|
|
307
|
+
}, m);
|
|
308
|
+
}, [m, x]);
|
|
306
309
|
return a.useEffect(() => () => {
|
|
307
310
|
u.current && (window.clearTimeout(u.current), u.current = 0);
|
|
308
|
-
}, []), /* @__PURE__ */
|
|
311
|
+
}, []), /* @__PURE__ */ p(ut, { ...d, children: /* @__PURE__ */ p(
|
|
309
312
|
Ct,
|
|
310
313
|
{
|
|
311
314
|
scope: r,
|
|
@@ -330,8 +333,8 @@ var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
|
|
|
330
333
|
xe.displayName = O;
|
|
331
334
|
var W = "TooltipTrigger", Ce = a.forwardRef(
|
|
332
335
|
(e, r) => {
|
|
333
|
-
const { __scopeTooltip: t, ...o } = e, n = j(W, t), i = X(W, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange),
|
|
334
|
-
return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */
|
|
336
|
+
const { __scopeTooltip: t, ...o } = e, n = j(W, t), i = X(W, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange), d = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => d.current = !1, []);
|
|
337
|
+
return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(ft, { asChild: !0, ...l, children: /* @__PURE__ */ p(
|
|
335
338
|
S.button,
|
|
336
339
|
{
|
|
337
340
|
"aria-describedby": n.open ? n.contentId : void 0,
|
|
@@ -345,10 +348,10 @@ var W = "TooltipTrigger", Ce = a.forwardRef(
|
|
|
345
348
|
n.onTriggerLeave(), c.current = !1;
|
|
346
349
|
}),
|
|
347
350
|
onPointerDown: E(e.onPointerDown, () => {
|
|
348
|
-
n.open && n.onClose(),
|
|
351
|
+
n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
|
|
349
352
|
}),
|
|
350
353
|
onFocus: E(e.onFocus, () => {
|
|
351
|
-
|
|
354
|
+
d.current || n.onOpen();
|
|
352
355
|
}),
|
|
353
356
|
onBlur: E(e.onBlur, n.onClose),
|
|
354
357
|
onClick: E(e.onClick, n.onClose)
|
|
@@ -357,40 +360,40 @@ var W = "TooltipTrigger", Ce = a.forwardRef(
|
|
|
357
360
|
}
|
|
358
361
|
);
|
|
359
362
|
Ce.displayName = W;
|
|
360
|
-
var Pt = "TooltipPortal", [
|
|
363
|
+
var Pt = "TooltipPortal", [Xt, Tt] = M(Pt, {
|
|
361
364
|
forceMount: void 0
|
|
362
365
|
}), R = "TooltipContent", Pe = a.forwardRef(
|
|
363
366
|
(e, r) => {
|
|
364
367
|
const t = Tt(R, e.__scopeTooltip), { forceMount: o = t.forceMount, side: n = "top", ...i } = e, l = j(R, e.__scopeTooltip);
|
|
365
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ p(We, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ p(Te, { side: n, ...i, ref: r }) : /* @__PURE__ */ p(bt, { side: n, ...i, ref: r }) });
|
|
366
369
|
}
|
|
367
370
|
), bt = a.forwardRef((e, r) => {
|
|
368
|
-
const t = j(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), i = k(r, n), [l, h] = a.useState(null), { trigger: s, onClose:
|
|
371
|
+
const t = j(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), i = k(r, n), [l, h] = a.useState(null), { trigger: s, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = o, g = a.useCallback(() => {
|
|
369
372
|
h(null), f(!1);
|
|
370
373
|
}, [f]), u = a.useCallback(
|
|
371
|
-
(v,
|
|
372
|
-
const
|
|
374
|
+
(v, m) => {
|
|
375
|
+
const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = _t(w, y.getBoundingClientRect()), T = Ot(w, x), C = St(m.getBoundingClientRect()), b = Dt([...T, ...C]);
|
|
373
376
|
h(b), f(!0);
|
|
374
377
|
},
|
|
375
378
|
[f]
|
|
376
379
|
);
|
|
377
380
|
return a.useEffect(() => () => g(), [g]), a.useEffect(() => {
|
|
378
381
|
if (s && c) {
|
|
379
|
-
const v = (
|
|
380
|
-
return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave",
|
|
381
|
-
s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave",
|
|
382
|
+
const v = (y) => u(y, c), m = (y) => u(y, s);
|
|
383
|
+
return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave", m), () => {
|
|
384
|
+
s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", m);
|
|
382
385
|
};
|
|
383
386
|
}
|
|
384
387
|
}, [s, c, u, g]), a.useEffect(() => {
|
|
385
388
|
if (l) {
|
|
386
|
-
const v = (
|
|
387
|
-
const
|
|
388
|
-
x ? g() : T && (g(),
|
|
389
|
+
const v = (m) => {
|
|
390
|
+
const y = m.target, w = { x: m.clientX, y: m.clientY }, x = (s == null ? void 0 : s.contains(y)) || (c == null ? void 0 : c.contains(y)), T = !Nt(w, l);
|
|
391
|
+
x ? g() : T && (g(), d());
|
|
389
392
|
};
|
|
390
393
|
return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
|
|
391
394
|
}
|
|
392
|
-
}, [s, c, l,
|
|
393
|
-
}), [At, Et] = M(O, { isInside: !1 }), Rt =
|
|
395
|
+
}, [s, c, l, d, g]), /* @__PURE__ */ p(Te, { ...e, ref: i });
|
|
396
|
+
}), [At, Et] = M(O, { isInside: !1 }), Rt = Be("TooltipContent"), Te = a.forwardRef(
|
|
394
397
|
(e, r) => {
|
|
395
398
|
const {
|
|
396
399
|
__scopeTooltip: t,
|
|
@@ -399,7 +402,7 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
|
|
|
399
402
|
onEscapeKeyDown: i,
|
|
400
403
|
onPointerDownOutside: l,
|
|
401
404
|
...h
|
|
402
|
-
} = e, s = j(R, t),
|
|
405
|
+
} = e, s = j(R, t), d = $(t), { onClose: c } = s;
|
|
403
406
|
return a.useEffect(() => (document.addEventListener(F, c), () => document.removeEventListener(F, c)), [c]), a.useEffect(() => {
|
|
404
407
|
if (s.trigger) {
|
|
405
408
|
const f = (g) => {
|
|
@@ -408,8 +411,8 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
|
|
|
408
411
|
};
|
|
409
412
|
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
410
413
|
}
|
|
411
|
-
}, [s.trigger, c]), /* @__PURE__ */
|
|
412
|
-
|
|
414
|
+
}, [s.trigger, c]), /* @__PURE__ */ p(
|
|
415
|
+
Ve,
|
|
413
416
|
{
|
|
414
417
|
asChild: !0,
|
|
415
418
|
disableOutsidePointerEvents: !1,
|
|
@@ -421,7 +424,7 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
|
|
|
421
424
|
ht,
|
|
422
425
|
{
|
|
423
426
|
"data-state": s.stateAttribute,
|
|
424
|
-
...
|
|
427
|
+
...d,
|
|
425
428
|
...h,
|
|
426
429
|
ref: r,
|
|
427
430
|
style: {
|
|
@@ -433,8 +436,8 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
|
|
|
433
436
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
434
437
|
},
|
|
435
438
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ p(Rt, { children: o }),
|
|
440
|
+
/* @__PURE__ */ p(At, { scope: t, isInside: !0, children: /* @__PURE__ */ p(yt, { id: s.contentId, role: "tooltip", children: n || o }) })
|
|
438
441
|
]
|
|
439
442
|
}
|
|
440
443
|
)
|
|
@@ -449,7 +452,7 @@ var be = "TooltipArrow", Ae = a.forwardRef(
|
|
|
449
452
|
return Et(
|
|
450
453
|
be,
|
|
451
454
|
t
|
|
452
|
-
).isInside ? null : /* @__PURE__ */
|
|
455
|
+
).isInside ? null : /* @__PURE__ */ p(vt, { ...n, ...o, ref: r });
|
|
453
456
|
}
|
|
454
457
|
);
|
|
455
458
|
Ae.displayName = be;
|
|
@@ -511,8 +514,8 @@ function Nt(e, r) {
|
|
|
511
514
|
const { x: t, y: o } = e;
|
|
512
515
|
let n = !1;
|
|
513
516
|
for (let i = 0, l = r.length - 1; i < r.length; l = i++) {
|
|
514
|
-
const h = r[i], s = r[l],
|
|
515
|
-
c > o != g > o && t < (f -
|
|
517
|
+
const h = r[i], s = r[l], d = h.x, c = h.y, f = s.x, g = s.y;
|
|
518
|
+
c > o != g > o && t < (f - d) * (o - c) / (g - c) + d && (n = !n);
|
|
516
519
|
}
|
|
517
520
|
return n;
|
|
518
521
|
}
|
|
@@ -554,15 +557,15 @@ const It = "_tooltipContent_12gjy_1", Lt = "_tooltipArrow_12gjy_8", kt = "_fadeI
|
|
|
554
557
|
tooltipContent: It,
|
|
555
558
|
tooltipArrow: Lt,
|
|
556
559
|
fadeIn: kt
|
|
557
|
-
},
|
|
558
|
-
({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
+
}, Vt = ot(
|
|
561
|
+
({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */ p(we, { children: /* @__PURE__ */ Y(xe, { delayDuration: 1e3, children: [
|
|
562
|
+
/* @__PURE__ */ p(Ce, { asChild: !0, children: /* @__PURE__ */ p("div", { ref: n, className: t, style: o, children: e }) }),
|
|
560
563
|
/* @__PURE__ */ Y(Pe, { className: ne.tooltipContent, sideOffset: 5, children: [
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ p(Ae, { className: ne.tooltipArrow }),
|
|
565
|
+
/* @__PURE__ */ p("span", { children: r })
|
|
563
566
|
] })
|
|
564
567
|
] }) })
|
|
565
568
|
);
|
|
566
569
|
export {
|
|
567
|
-
|
|
570
|
+
Vt as default
|
|
568
571
|
};
|
|
@@ -5,6 +5,24 @@ import { useDocumentContext as l } from "./RPDocumentContext.js";
|
|
|
5
5
|
import { useZoomContext as y } from "./ZoomContext.js";
|
|
6
6
|
import { PAGE_PADDING as f } from "../utils/constants.js";
|
|
7
7
|
import { usePagesRotateContext as D } from "./PagesRotateContext.js";
|
|
8
|
+
import "../utils/hooks/useLoadPdf.js";
|
|
9
|
+
import "pdfjs-dist";
|
|
10
|
+
import "../utils/types.js";
|
|
11
|
+
import "../th_TH-d627cd51.js";
|
|
12
|
+
import "../utils/getThumbnailViewport.js";
|
|
13
|
+
import "./ConfigContext.js";
|
|
14
|
+
import "./DocumentPasswordContext.js";
|
|
15
|
+
import "../utils/hooks/usePdfProperties.js";
|
|
16
|
+
import "../utils/convertPdfDate.js";
|
|
17
|
+
import "../utils/formatFileSize.js";
|
|
18
|
+
import "./InitialStateContext.js";
|
|
19
|
+
import "../utils/getZoomLevel.js";
|
|
20
|
+
import "./LayoutContainerContext.js";
|
|
21
|
+
import "./ViewModeContext.js";
|
|
22
|
+
import "./RotationContext.js";
|
|
23
|
+
import "./GlobalCurrentPage.js";
|
|
24
|
+
import "./EventCallbackContext.js";
|
|
25
|
+
import "../utils/hooks/useDebounce.js";
|
|
8
26
|
const g = x({
|
|
9
27
|
widths: [],
|
|
10
28
|
heights: [],
|
|
@@ -12,31 +30,31 @@ const g = x({
|
|
|
12
30
|
},
|
|
13
31
|
setHeights: () => {
|
|
14
32
|
}
|
|
15
|
-
}),
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
(!
|
|
33
|
+
}), T = () => {
|
|
34
|
+
const e = v(g), { widths: r, heights: o } = e;
|
|
35
|
+
if (r && o) {
|
|
36
|
+
const m = r.every((t) => typeof t == "number"), i = o.every((t) => typeof t == "number");
|
|
37
|
+
(!m || !i) && C.warn("Please use this hooks inside children component of RPProvider");
|
|
20
38
|
}
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
const [
|
|
39
|
+
return e;
|
|
40
|
+
}, U = ({ children: e }) => {
|
|
41
|
+
const [r, o] = u([]), [m, i] = u([]), { pages: t } = l(), { currentZoom: n } = y(), { pageRotate: p } = D();
|
|
24
42
|
return w(() => {
|
|
25
43
|
if (!t)
|
|
26
44
|
return;
|
|
27
|
-
const
|
|
28
|
-
for (const
|
|
29
|
-
const d =
|
|
30
|
-
scale:
|
|
45
|
+
const h = [], c = [];
|
|
46
|
+
for (const s of Array.from(t.values())) {
|
|
47
|
+
const d = p[s.page.pageNumber], a = s.page.getViewport({
|
|
48
|
+
scale: n,
|
|
31
49
|
rotation: d,
|
|
32
50
|
dontFlip: !0
|
|
33
51
|
});
|
|
34
|
-
|
|
52
|
+
h.push(a.width + f), c.push(a.height + f);
|
|
35
53
|
}
|
|
36
|
-
|
|
37
|
-
}, [
|
|
54
|
+
o((s) => [...h]), i((s) => [...c]);
|
|
55
|
+
}, [n, p, t]), /* @__PURE__ */ P(g.Provider, { value: { widths: r, heights: m, setWidths: o, setHeights: i }, children: e });
|
|
38
56
|
};
|
|
39
57
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
U as DimensionPagesProvider,
|
|
59
|
+
T as useDimensionPagesContext
|
|
42
60
|
};
|
|
@@ -4,7 +4,17 @@ import { useDocumentContext as h } from "./RPDocumentContext.js";
|
|
|
4
4
|
import { useToolbarComponentContext as T } from "./ToolbarComponentContext.js";
|
|
5
5
|
import { useDocumentPasswordContext as v } from "./DocumentPasswordContext.js";
|
|
6
6
|
import { useToolComponentContext as L } from "./ToolComponentContext.js";
|
|
7
|
-
|
|
7
|
+
import "../utils/hooks/useLoadPdf.js";
|
|
8
|
+
import "pdfjs-dist";
|
|
9
|
+
import "../utils/types.js";
|
|
10
|
+
import "../th_TH-d627cd51.js";
|
|
11
|
+
import "../utils/getThumbnailViewport.js";
|
|
12
|
+
import "./ConfigContext.js";
|
|
13
|
+
import "../utils/hooks/usePdfProperties.js";
|
|
14
|
+
import "../utils/convertPdfDate.js";
|
|
15
|
+
import "../utils/formatFileSize.js";
|
|
16
|
+
import "../utils/appConsole.js";
|
|
17
|
+
const l = x({
|
|
8
18
|
dragging: !1,
|
|
9
19
|
handleDragLeave: () => {
|
|
10
20
|
},
|
|
@@ -12,41 +22,41 @@ const i = x({
|
|
|
12
22
|
},
|
|
13
23
|
handleDrop: () => {
|
|
14
24
|
}
|
|
15
|
-
}),
|
|
16
|
-
const [
|
|
17
|
-
(
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
25
|
+
}), H = () => P(l), I = ({ children: m }) => {
|
|
26
|
+
const [c, e] = F(!1), { setFilename: n, setPdfSrc: a } = h(), { openFileTool: p } = T(), { openFileTool: s } = L(), { setPassword: f } = v(), u = r(
|
|
27
|
+
(o) => {
|
|
28
|
+
var i;
|
|
29
|
+
o.preventDefault(), o.stopPropagation(), e(!1);
|
|
30
|
+
const t = (i = o.dataTransfer) == null ? void 0 : i.files[0];
|
|
31
|
+
if (!t || t.type !== "application/pdf")
|
|
22
32
|
return;
|
|
23
|
-
const D = URL.createObjectURL(
|
|
24
|
-
n(
|
|
33
|
+
const D = URL.createObjectURL(t);
|
|
34
|
+
n(t.name), a(D), f("");
|
|
25
35
|
},
|
|
26
36
|
[n, a]
|
|
27
37
|
), d = r(
|
|
28
|
-
(
|
|
29
|
-
|
|
38
|
+
(o) => {
|
|
39
|
+
o.preventDefault(), o.stopPropagation(), !(!p || !s) && e(!0);
|
|
30
40
|
},
|
|
31
|
-
[
|
|
32
|
-
), g = r((
|
|
33
|
-
|
|
41
|
+
[p, s]
|
|
42
|
+
), g = r((o) => {
|
|
43
|
+
o.preventDefault(), o.stopPropagation(), e(!1);
|
|
34
44
|
}, []);
|
|
35
45
|
return /* @__PURE__ */ C(
|
|
36
|
-
|
|
46
|
+
l.Provider,
|
|
37
47
|
{
|
|
38
48
|
value: {
|
|
39
|
-
dragging:
|
|
49
|
+
dragging: c,
|
|
40
50
|
handleDragLeave: g,
|
|
41
51
|
handleDragEnter: d,
|
|
42
|
-
handleDrop:
|
|
52
|
+
handleDrop: u
|
|
43
53
|
},
|
|
44
|
-
children:
|
|
54
|
+
children: m
|
|
45
55
|
}
|
|
46
56
|
);
|
|
47
57
|
};
|
|
48
58
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
l as DropFileZoneContext,
|
|
60
|
+
I as DropFileZoneProvider,
|
|
61
|
+
H as useDropFileZoneContext
|
|
52
62
|
};
|