@pdf-viewer/react 1.0.1-rc.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-07939e60.js → RPDefaultLayout-adbb0836.js} +246 -246
- package/dist/components/RPConfig.js +318 -340
- package/dist/components/RPController.js +43 -45
- package/dist/components/RPPages.js +2 -3
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +3 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -4
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -3
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +3 -3
- package/dist/components/page/AnnotationLayer.js +2 -3
- package/dist/components/page/CanvasLayer.js +2 -3
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +2 -3
- package/dist/components/ui/Checkbox.js +252 -92
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +961 -224
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ViewportContext.js +41 -41
- package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
- package/dist/index-316854c1.js +2299 -0
- package/dist/index-71898eb9.js +139 -0
- package/dist/main.js +1 -1
- package/dist/types/contexts/ViewportContext.d.ts +0 -1
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/utils/hooks/useFileDownload.js +2 -3
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -3
- package/dist/utils/hooks/usePrint.js +2 -3
- package/dist/utils/hooks/useScrollToPage.js +2 -3
- package/dist/utils/hooks/useSearch.js +2 -3
- package/dist/utils/hooks/useThumbnail.js +2 -3
- package/dist/utils/hooks/useVirtualReactWindow.js +2 -3
- package/package.json +1 -1
- package/dist/index-1db49c1a.js +0 -1664
- package/dist/index-3dff3fa8.js +0 -307
- package/dist/index-4f17fe4d.js +0 -1657
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { h as n, P as p, u as P } from "../RPDefaultLayout-
|
|
3
|
+
import { h as n, P as p, u as P } from "../RPDefaultLayout-adbb0836.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
import "./InitialStateContext.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as b, useState as v, useEffect as x, useContext as g } from "react";
|
|
3
|
+
import { useLayoutContainer as f } from "./LayoutContainerContext.js";
|
|
3
4
|
const k = {
|
|
4
5
|
xs: 320,
|
|
5
6
|
sm: 640,
|
|
@@ -7,66 +8,65 @@ const k = {
|
|
|
7
8
|
lg: 1024,
|
|
8
9
|
xl: 1280,
|
|
9
10
|
"2xl": 1536
|
|
10
|
-
},
|
|
11
|
-
children:
|
|
12
|
-
|
|
13
|
-
mobileWidth: l = 768
|
|
11
|
+
}, a = b(void 0), L = ({
|
|
12
|
+
children: n,
|
|
13
|
+
mobileWidth: d = 768
|
|
14
14
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
width: (
|
|
17
|
-
height: (
|
|
15
|
+
const { container: e } = f(), [r, p] = v({
|
|
16
|
+
width: (e == null ? void 0 : e.clientWidth) || window.innerWidth,
|
|
17
|
+
height: (e == null ? void 0 : e.clientHeight) || window.innerHeight,
|
|
18
18
|
isMobile: !1,
|
|
19
19
|
currentBreakpoint: "xs",
|
|
20
20
|
orientation: "portrait"
|
|
21
|
-
}),
|
|
21
|
+
}), s = {
|
|
22
22
|
...k,
|
|
23
|
-
md:
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
for (let i =
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
23
|
+
md: d
|
|
24
|
+
}, l = () => r.width < s.md, u = (t) => {
|
|
25
|
+
const o = Object.entries(s);
|
|
26
|
+
for (let i = o.length - 1; i >= 0; i--)
|
|
27
|
+
if (t >= o[i][1])
|
|
28
|
+
return o[i][0];
|
|
29
29
|
return "xs";
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
return ["iphone", "ipod", "ipad", "android", "mobile", "phone", "tablet"].some((i) =>
|
|
30
|
+
}, w = () => {
|
|
31
|
+
const t = navigator.userAgent.toLowerCase();
|
|
32
|
+
return ["iphone", "ipod", "ipad", "android", "mobile", "phone", "tablet"].some((i) => t.includes(i));
|
|
33
33
|
};
|
|
34
34
|
x(() => {
|
|
35
|
-
if (!
|
|
35
|
+
if (!e)
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
const i =
|
|
39
|
-
|
|
37
|
+
const t = () => {
|
|
38
|
+
const i = e.clientWidth, c = e.clientHeight;
|
|
39
|
+
p({
|
|
40
40
|
width: i,
|
|
41
|
-
height:
|
|
42
|
-
isMobile:
|
|
41
|
+
height: c,
|
|
42
|
+
isMobile: w(),
|
|
43
43
|
currentBreakpoint: u(i),
|
|
44
|
-
orientation:
|
|
44
|
+
orientation: c > i ? "portrait" : "landscape"
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
|
|
47
|
+
t();
|
|
48
|
+
const o = new ResizeObserver(t);
|
|
49
|
+
return o.observe(e), window.addEventListener("resize", t), () => {
|
|
50
|
+
o.disconnect(), window.removeEventListener("resize", t);
|
|
51
51
|
};
|
|
52
|
-
}, [
|
|
52
|
+
}, [e]);
|
|
53
53
|
const h = {
|
|
54
|
-
...
|
|
55
|
-
breakpoints:
|
|
56
|
-
isBreakpoint: (
|
|
57
|
-
isMobileDevice:
|
|
58
|
-
isPortrait:
|
|
59
|
-
isLandscape:
|
|
60
|
-
isSmallScreen:
|
|
54
|
+
...r,
|
|
55
|
+
breakpoints: s,
|
|
56
|
+
isBreakpoint: (t) => r.width >= s[t],
|
|
57
|
+
isMobileDevice: r.isMobile,
|
|
58
|
+
isPortrait: r.orientation === "portrait",
|
|
59
|
+
isLandscape: r.orientation === "landscape",
|
|
60
|
+
isSmallScreen: l()
|
|
61
61
|
};
|
|
62
|
-
return /* @__PURE__ */ m(
|
|
62
|
+
return /* @__PURE__ */ m(a.Provider, { value: h, children: n });
|
|
63
63
|
}, P = () => {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
64
|
+
const n = g(a);
|
|
65
|
+
if (n === void 0)
|
|
66
66
|
throw new Error("useViewportContext must be used within a ViewportProvider");
|
|
67
|
-
return
|
|
67
|
+
return n;
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
L as ViewportProvider,
|
|
71
71
|
P as useViewportContext
|
|
72
72
|
};
|