@pdf-viewer/react 1.8.0-rc.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/{Popover-1faa77f6.js → Popover-48c8394c.js} +2 -2
  2. package/dist/{RPDefaultLayout-2cca5d34.js → RPDefaultLayout-4b330ca1.js} +571 -565
  3. package/dist/{component-1da194e8.js → component-2aa6e53b.js} +1 -1
  4. package/dist/components/RPConfig.js +691 -673
  5. package/dist/components/RPController.js +1 -1
  6. package/dist/components/RPPages.js +1 -1
  7. package/dist/components/layout/LayoutContainer.js +1 -1
  8. package/dist/components/layout/RPDefaultLayout.js +1 -1
  9. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  11. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  12. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  13. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  14. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  15. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  16. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  17. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  18. package/dist/components/layout/toolbar/Paginate.js +1 -1
  19. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  20. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  22. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  23. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  25. package/dist/components/layout/toolbar/SearchTool.js +2 -2
  26. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  28. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  29. package/dist/components/page/AnnotationLayer.js +1 -1
  30. package/dist/components/page/CanvasLayer.js +1 -1
  31. package/dist/components/page/DualPage.js +1 -1
  32. package/dist/components/page/RPPage.js +1 -1
  33. package/dist/components/page/SinglePage.js +1 -1
  34. package/dist/components/page/TextHighlightLayer.js +1 -1
  35. package/dist/components/page/TextLayer.js +1 -1
  36. package/dist/components/ui/Checkbox.js +228 -116
  37. package/dist/components/ui/DropDown.js +1 -1
  38. package/dist/components/ui/LoadingIndicator.js +1 -1
  39. package/dist/components/ui/Popover.js +1 -1
  40. package/dist/components/ui/RPTooltip.js +207 -207
  41. package/dist/contexts/ElementPageContext.js +57 -46
  42. package/dist/contexts/PaginationContext.js +1 -1
  43. package/dist/contexts/PrintContext.js +1 -1
  44. package/dist/contexts/SearchContext.js +1 -1
  45. package/dist/contexts/ThumbnailsContext.js +1 -1
  46. package/dist/{floating-ui.react-dom-15b9b819.js → floating-ui.react-dom-4b1e2e46.js} +394 -380
  47. package/dist/index-6e0e48fa.js +332 -0
  48. package/dist/{index-7279fb4e.js → index-951f0f1f.js} +464 -456
  49. package/dist/index-e3a67935.js +150 -0
  50. package/dist/main.js +1 -1
  51. package/dist/types/utils/types.d.ts +1 -0
  52. package/dist/utils/hooks/useFileDownload.js +1 -1
  53. package/dist/utils/hooks/useLicense.js +26 -24
  54. package/dist/utils/hooks/usePageRotateContext.js +17 -14
  55. package/dist/utils/hooks/usePaginate.js +1 -1
  56. package/dist/utils/hooks/usePresentPage.js +1 -1
  57. package/dist/utils/hooks/usePrint.js +1 -1
  58. package/dist/utils/hooks/useScrollToPage.js +1 -1
  59. package/dist/utils/hooks/useSearch.js +1 -1
  60. package/dist/utils/hooks/useThumbnail.js +1 -1
  61. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/index-1cb41342.js +0 -307
  64. package/dist/index-aa2d3884.js +0 -140
@@ -1,60 +1,71 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { createContext as h, useState as L, useCallback as i, useContext as v } from "react";
3
- import { LicenseType as w } from "../utils/types.js";
4
- import { useDimensionPagesContext as g } from "./DimensionPagesContext.js";
5
- import { usePagesRotateContext as A } from "./PagesRotateContext.js";
6
- import { useLicenseContext as O } from "./LicenseContext.js";
7
- import { useZoomContext as R } from "./ZoomContext.js";
8
- import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as l } from "../utils/const.js";
9
- const x = h(void 0), j = ({ children: r }) => {
10
- const [s, m] = L({}), { widths: c, heights: E } = g(), { pageRotate: a } = A(), { zoomLevel: u } = R(), d = i(
11
- (e, o) => {
12
- m((t) => {
13
- const n = { width: c[e], height: E[e] };
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { createContext as L, useState as g, useCallback as l, useContext as h, useRef as w, useMemo as R } from "react";
3
+ import { LicenseType as A } from "../utils/types.js";
4
+ import { useDimensionPagesContext as y } from "./DimensionPagesContext.js";
5
+ import { usePagesRotateContext as O } from "./PagesRotateContext.js";
6
+ import { useLicenseContext as S } from "./LicenseContext.js";
7
+ import { useZoomContext as T } from "./ZoomContext.js";
8
+ import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as u } from "../utils/const.js";
9
+ const d = L(void 0), k = ({ children: i }) => {
10
+ const [m, o] = g({}), { widths: t, heights: c } = y(), { pageRotate: a } = O(), { zoomLevel: f } = T(), x = l(
11
+ (e, r) => {
12
+ o((n) => {
13
+ const s = { width: t[e], height: c[e] };
14
14
  return {
15
- ...t,
16
- [e]: o(t[e], n, a[e], u)
15
+ ...n,
16
+ [e]: r(n[e], s, a[e], f)
17
17
  };
18
18
  });
19
19
  },
20
- [c, E, u, a]
21
- ), f = i((e) => {
22
- m((o) => {
23
- const t = { ...o };
24
- return delete t[e], t;
20
+ [t, c, f, a]
21
+ ), p = l((e) => {
22
+ o((r) => {
23
+ const n = { ...r };
24
+ return delete n[e], n;
25
25
  });
26
- }, []), C = i((e, o) => {
27
- m((t) => {
28
- const n = { ...t };
29
- return n[e] = n[e].filter((S, P) => P !== o), n;
26
+ }, []), C = l((e, r) => {
27
+ o((n) => {
28
+ const s = { ...n };
29
+ return s[e] = s[e].filter((_, P) => P !== r), s;
30
30
  });
31
31
  }, []);
32
- return /* @__PURE__ */ p(
33
- x.Provider,
32
+ return /* @__PURE__ */ v(
33
+ d.Provider,
34
34
  {
35
- value: { updateElement: d, clearElements: f, removeElement: C, elementList: s },
36
- children: r
35
+ value: { updateElement: x, clearElements: p, removeElement: C, elementList: m },
36
+ children: i
37
37
  }
38
38
  );
39
- }, k = () => {
40
- const r = v(x), { type: s } = O();
41
- if (!r)
39
+ }, E = () => {
40
+ }, U = () => {
41
+ const i = h(d), { type: m, validating: o } = S(), t = w(0), c = R(() => {
42
+ if (o !== !1)
43
+ return {
44
+ updateElement: E,
45
+ clearElements: E,
46
+ removeElement: E,
47
+ elementList: {}
48
+ };
49
+ if (m !== A.Organization)
50
+ return {
51
+ updateElement: () => {
52
+ t.current === 0 && (console.error(u), t.current++);
53
+ },
54
+ clearElements: () => {
55
+ t.current === 0 && (console.error(u), t.current++);
56
+ },
57
+ removeElement: () => {
58
+ t.current === 0 && (console.error(u), t.current++);
59
+ },
60
+ elementList: {}
61
+ };
62
+ }, [m, o]);
63
+ if (!i)
42
64
  throw new Error("useElementPageContext must be used within a ElementPageProvider");
43
- return s !== w.Organization ? {
44
- updateElement: () => {
45
- console.error(l);
46
- },
47
- clearElements: () => {
48
- console.error(l);
49
- },
50
- removeElement: () => {
51
- console.error(l);
52
- },
53
- elementList: {}
54
- } : r;
65
+ return c || i;
55
66
  };
56
67
  export {
57
- x as ElementPageContext,
58
- j as ElementPageProvider,
59
- k as useElementPageContext
68
+ d as ElementPageContext,
69
+ k as ElementPageProvider,
70
+ U as useElementPageContext
60
71
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { h as e, P as m, u as p } from "../RPDefaultLayout-2cca5d34.js";
3
+ import { h as e, P as m, u as p } from "../RPDefaultLayout-4b330ca1.js";
4
4
  import "./RPDocumentContext.js";
5
5
  import "../utils/appConsole.js";
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { j as i, e as n, c as s } from "../RPDefaultLayout-2cca5d34.js";
3
+ import { j as i, e as n, c as s } from "../RPDefaultLayout-4b330ca1.js";
4
4
  export {
5
5
  i 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, d as S } from "../RPDefaultLayout-2cca5d34.js";
3
+ import { o as a, S as s, d as S } from "../RPDefaultLayout-4b330ca1.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-2cca5d34.js";
3
+ import { l as i, T as r, m as e } from "../RPDefaultLayout-4b330ca1.js";
4
4
  export {
5
5
  i as ThumbnailContext,
6
6
  r as ThumbnailProvider,