@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.
Files changed (58) hide show
  1. package/dist/{RPDefaultLayout-07939e60.js → RPDefaultLayout-adbb0836.js} +246 -246
  2. package/dist/components/RPConfig.js +318 -340
  3. package/dist/components/RPController.js +43 -45
  4. package/dist/components/RPPages.js +2 -3
  5. package/dist/components/RPProvider.js +1 -1
  6. package/dist/components/layout/RPDefaultLayout.js +3 -2
  7. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  10. package/dist/components/layout/toolbar/DocumentDialog.js +2 -3
  11. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  12. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  13. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  14. package/dist/components/layout/toolbar/MostPageTool.js +3 -4
  15. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  16. package/dist/components/layout/toolbar/Paginate.js +1 -1
  17. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  20. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  21. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  22. package/dist/components/layout/toolbar/SearchTool.js +2 -3
  23. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/ZoomTool.js +3 -3
  26. package/dist/components/page/AnnotationLayer.js +2 -3
  27. package/dist/components/page/CanvasLayer.js +2 -3
  28. package/dist/components/page/DualPage.js +1 -1
  29. package/dist/components/page/RPPage.js +2 -3
  30. package/dist/components/page/SinglePage.js +1 -1
  31. package/dist/components/page/TextLayer.js +2 -3
  32. package/dist/components/ui/Checkbox.js +252 -92
  33. package/dist/components/ui/DropDown.js +1 -1
  34. package/dist/components/ui/LoadingIndicator.js +1 -1
  35. package/dist/components/ui/RPTooltip.js +961 -224
  36. package/dist/contexts/PaginationContext.js +1 -1
  37. package/dist/contexts/PrintContext.js +1 -1
  38. package/dist/contexts/SearchContext.js +1 -1
  39. package/dist/contexts/ThumbnailsContext.js +1 -1
  40. package/dist/contexts/ViewportContext.js +41 -41
  41. package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
  42. package/dist/index-316854c1.js +2299 -0
  43. package/dist/index-71898eb9.js +139 -0
  44. package/dist/main.js +1 -1
  45. package/dist/types/contexts/ViewportContext.d.ts +0 -1
  46. package/dist/types/utils/types.d.ts +2 -2
  47. package/dist/utils/hooks/useFileDownload.js +2 -3
  48. package/dist/utils/hooks/useLicense.js +1 -1
  49. package/dist/utils/hooks/usePaginate.js +2 -3
  50. package/dist/utils/hooks/usePrint.js +2 -3
  51. package/dist/utils/hooks/useScrollToPage.js +2 -3
  52. package/dist/utils/hooks/useSearch.js +2 -3
  53. package/dist/utils/hooks/useThumbnail.js +2 -3
  54. package/dist/utils/hooks/useVirtualReactWindow.js +2 -3
  55. package/package.json +1 -1
  56. package/dist/index-1db49c1a.js +0 -1664
  57. package/dist/index-3dff3fa8.js +0 -307
  58. 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-07939e60.js";
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,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { j as e, a as n, d as a } from "../RPDefaultLayout-07939e60.js";
3
+ import { j as e, a as n, d as a } from "../RPDefaultLayout-adbb0836.js";
4
4
  export {
5
5
  e as PrintContext,
6
6
  n as PrintProvider,
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { o as a, S as s, e as S } from "../RPDefaultLayout-07939e60.js";
3
+ import { o as a, S as s, e as S } from "../RPDefaultLayout-adbb0836.js";
4
4
  export {
5
5
  a as SearchContext,
6
6
  s as SearchProvider,
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { l as i, T as r, m as e } from "../RPDefaultLayout-07939e60.js";
3
+ import { l as i, T as r, m as e } from "../RPDefaultLayout-adbb0836.js";
4
4
  export {
5
5
  i as ThumbnailContext,
6
6
  r as ThumbnailProvider,
@@ -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
- }, p = b(void 0), S = ({
11
- children: s,
12
- containerRef: t,
13
- mobileWidth: l = 768
11
+ }, a = b(void 0), L = ({
12
+ children: n,
13
+ mobileWidth: d = 768
14
14
  }) => {
15
- const [o, c] = v({
16
- width: (t == null ? void 0 : t.clientWidth) || window.innerWidth,
17
- height: (t == null ? void 0 : t.clientHeight) || window.innerHeight,
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
- }), n = {
21
+ }), s = {
22
22
  ...k,
23
- md: l
24
- }, w = () => o.width < n.md, u = (e) => {
25
- const r = Object.entries(n);
26
- for (let i = r.length - 1; i >= 0; i--)
27
- if (e >= r[i][1])
28
- return r[i][0];
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
- }, a = () => {
31
- const e = navigator.userAgent.toLowerCase();
32
- return ["iphone", "ipod", "ipad", "android", "mobile", "phone", "tablet"].some((i) => e.includes(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 (!t)
35
+ if (!e)
36
36
  return;
37
- const e = () => {
38
- const i = t.clientWidth, d = t.clientHeight;
39
- c({
37
+ const t = () => {
38
+ const i = e.clientWidth, c = e.clientHeight;
39
+ p({
40
40
  width: i,
41
- height: d,
42
- isMobile: a(),
41
+ height: c,
42
+ isMobile: w(),
43
43
  currentBreakpoint: u(i),
44
- orientation: d > i ? "portrait" : "landscape"
44
+ orientation: c > i ? "portrait" : "landscape"
45
45
  });
46
46
  };
47
- e();
48
- const r = new ResizeObserver(e);
49
- return r.observe(t), window.addEventListener("resize", e), () => {
50
- r.disconnect(), window.removeEventListener("resize", e);
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
- }, [t]);
52
+ }, [e]);
53
53
  const h = {
54
- ...o,
55
- breakpoints: n,
56
- isBreakpoint: (e) => o.width >= n[e],
57
- isMobileDevice: o.isMobile,
58
- isPortrait: o.orientation === "portrait",
59
- isLandscape: o.orientation === "landscape",
60
- isSmallScreen: w()
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(p.Provider, { value: h, children: s });
62
+ return /* @__PURE__ */ m(a.Provider, { value: h, children: n });
63
63
  }, P = () => {
64
- const s = g(p);
65
- if (s === void 0)
64
+ const n = g(a);
65
+ if (n === void 0)
66
66
  throw new Error("useViewportContext must be used within a ViewportProvider");
67
- return s;
67
+ return n;
68
68
  };
69
69
  export {
70
- S as ViewportProvider,
70
+ L as ViewportProvider,
71
71
  P as useViewportContext
72
72
  };