@pdf-viewer/react 1.9.0-beta.5 → 1.9.0-beta.7

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 (104) hide show
  1. package/dist/SearchCloseButton-cbf182aa.js +33 -0
  2. package/dist/ToolbarLayout.module-201969d2.js +3453 -0
  3. package/dist/assets/ToolbarLayout.css +1 -1
  4. package/dist/components/RPController.js +36 -36
  5. package/dist/components/RPDropFileZone.js +23 -21
  6. package/dist/components/RPPages.js +17 -18
  7. package/dist/components/RPProvider.js +14 -15
  8. package/dist/components/layout/Container.js +11 -10
  9. package/dist/components/layout/LayoutContainer.js +15 -16
  10. package/dist/components/layout/RPDefaultLayout.js +14 -76
  11. package/dist/components/layout/RPLayout.js +22 -22
  12. package/dist/components/layout/WrapperLayout.js +8 -7
  13. package/dist/components/layout/sidebar/RPSidebar.js +12 -51
  14. package/dist/components/layout/sidebar/RPSplitter.js +9 -7
  15. package/dist/components/layout/sidebar/Thumbnail.js +48 -2
  16. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  17. package/dist/components/layout/toolbar/DocumentDialog.js +24 -305
  18. package/dist/components/layout/toolbar/FileDownloadTool.js +13 -23
  19. package/dist/components/layout/toolbar/MenuItem.js +7 -6
  20. package/dist/components/layout/toolbar/MenuSeparator.js +5 -4
  21. package/dist/components/layout/toolbar/MostPageTool.js +25 -50
  22. package/dist/components/layout/toolbar/OtherTool.js +22 -115
  23. package/dist/components/layout/toolbar/Paginate.js +17 -99
  24. package/dist/components/layout/toolbar/PrintTool.js +13 -43
  25. package/dist/components/layout/toolbar/PropertyItem.js +8 -5
  26. package/dist/components/layout/toolbar/RPToolbar.js +7 -28
  27. package/dist/components/layout/toolbar/RPToolbarEnd.js +7 -22
  28. package/dist/components/layout/toolbar/RotateTool.js +21 -20
  29. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  30. package/dist/components/layout/toolbar/SearchCloseButton.js +7 -19
  31. package/dist/components/layout/toolbar/SearchResultNavigator.js +8 -42
  32. package/dist/components/layout/toolbar/SearchTool.js +30 -197
  33. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  34. package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
  35. package/dist/components/layout/toolbar/ToolbarCustom.js +22 -24
  36. package/dist/components/layout/toolbar/ToolbarDefault.js +20 -25
  37. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  38. package/dist/components/layout/toolbar/ZoomTool.js +28 -140
  39. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
  40. package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
  41. package/dist/components/layout/toolbar/tools/NextPageTool.js +17 -18
  42. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  43. package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
  44. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  45. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +11 -11
  46. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +20 -26
  47. package/dist/components/page/AnnotationLayer.js +16 -17
  48. package/dist/components/page/CanvasLayer.js +16 -18
  49. package/dist/components/page/DualPage.js +1 -1
  50. package/dist/components/page/RPPage.js +16 -17
  51. package/dist/components/page/SinglePage.js +1 -1
  52. package/dist/components/page/TextHighlightLayer.js +16 -17
  53. package/dist/components/page/TextLayer.js +16 -17
  54. package/dist/components/ui/Checkbox.js +51 -49
  55. package/dist/components/ui/DropDown.js +19 -13
  56. package/dist/components/ui/LoadingIndicator.js +5 -22
  57. package/dist/components/ui/RPTooltip.js +192 -405
  58. package/dist/contexts/ElementPageContext.js +37 -37
  59. package/dist/contexts/FileInputContext.js +18 -20
  60. package/dist/contexts/PaginationContext.js +1 -1
  61. package/dist/contexts/PrintContext.js +2 -2
  62. package/dist/contexts/RenderQueueProvider.js +10 -0
  63. package/dist/contexts/SearchContext.js +3 -3
  64. package/dist/contexts/ThumbnailsContext.js +1 -1
  65. package/dist/index-18b0454c.js +1657 -0
  66. package/dist/{index-8547fbc6.js → index-5908484b.js} +9 -9
  67. package/dist/index-f4a9ae4d.js +1664 -0
  68. package/dist/main.js +48 -50
  69. package/dist/types/components/layout/RPDefaultLayout.d.ts +1 -2
  70. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
  71. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -2
  72. package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
  73. package/dist/types/utils/Queue.d.ts +18 -0
  74. package/dist/types/utils/renderPage.d.ts +1 -6
  75. package/dist/types/utils/types.d.ts +5 -0
  76. package/dist/utils/Queue.js +47 -0
  77. package/dist/utils/hooks/useFileDownload.js +16 -17
  78. package/dist/utils/hooks/useLicense.js +1 -1
  79. package/dist/utils/hooks/usePageRotateContext.js +14 -14
  80. package/dist/utils/hooks/usePaginate.js +16 -17
  81. package/dist/utils/hooks/usePresentPage.js +16 -17
  82. package/dist/utils/hooks/usePrint.js +16 -17
  83. package/dist/utils/hooks/useScrollToPage.js +16 -17
  84. package/dist/utils/hooks/useSearch.js +16 -17
  85. package/dist/utils/hooks/useThumbnail.js +16 -18
  86. package/dist/utils/hooks/useVirtualReactWindow.js +16 -17
  87. package/package.json +1 -1
  88. package/dist/Checkbox.module-3edaacbb.js +0 -7
  89. package/dist/Combination-da8647d4.js +0 -693
  90. package/dist/Container.module-f8b5c306.js +0 -6
  91. package/dist/DropDown.module-a78567cb.js +0 -11
  92. package/dist/MenuItem.module-bc11d0d3.js +0 -6
  93. package/dist/MenuSeparator.module-89b2ff7f.js +0 -6
  94. package/dist/PropertyItem.module-db0150cc.js +0 -8
  95. package/dist/RPSplitter.module-13d612c4.js +0 -7
  96. package/dist/RPTheme.module-bd9038da.js +0 -8
  97. package/dist/RotateTool.module-03987eba.js +0 -6
  98. package/dist/SearchTool.module-016f3a8d.js +0 -16
  99. package/dist/ToolbarLayout.module-60c3d6e8.js +0 -2434
  100. package/dist/WrapperLayout.module-147bc943.js +0 -6
  101. package/dist/floating-ui.react-dom-f3f380e0.js +0 -1447
  102. package/dist/index-473557b1.js +0 -1191
  103. /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
  104. /package/dist/assets/{SearchTool.css → SearchCloseButton.css} +0 -0
@@ -1,71 +1,71 @@
1
- import { jsx as w } from "react/jsx-runtime";
2
- import { createContext as P, useState as h, useCallback as u, useContext as g, useRef as A, useMemo as R } from "react";
3
- import { LicenseType as d } from "../utils/types.js";
4
- import { useDimensionPagesContext as T } from "./DimensionPagesContext.js";
5
- import { usePagesRotateContext as y } from "./PagesRotateContext.js";
6
- import { useLicenseContext as O } from "./LicenseContext.js";
7
- import { useZoomContext as S } from "./ZoomContext.js";
8
- import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as a } from "../utils/const.js";
9
- const x = P(void 0), k = ({ children: l }) => {
10
- const [r, o] = h({}), { widths: t, heights: c } = T(), { pageRotate: m } = y(), { zoomLevel: f } = S(), p = u(
11
- (e, s) => {
1
+ import { jsx as L } from "react/jsx-runtime";
2
+ import { createContext as w, useState as P, useCallback as u, useContext as h, useRef as g, useMemo as A } from "react";
3
+ import { LicenseType as R } from "../utils/types.js";
4
+ import { useDimensionPagesContext as y } from "./DimensionPagesContext.js";
5
+ import { usePagesRotateContext as S } from "./PagesRotateContext.js";
6
+ import { useLicenseContext as T } from "./LicenseContext.js";
7
+ import { useZoomContext as _ } from "./ZoomContext.js";
8
+ import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as E } from "../utils/const.js";
9
+ const d = w(void 0), z = ({ children: i }) => {
10
+ const [l, o] = P({}), { widths: t, heights: c } = y(), { pageRotate: m } = S(), { zoomLevel: f } = _(), x = u(
11
+ (e, r) => {
12
12
  o((n) => {
13
- const i = { width: t[e], height: c[e] };
13
+ const s = { width: t[e], height: c[e] };
14
14
  return {
15
15
  ...n,
16
- [e]: s(n[e], i, m[e], f)
16
+ [e]: r(n[e], s, m[e], f)
17
17
  };
18
18
  });
19
19
  },
20
20
  [t, c, f, m]
21
- ), C = u((e) => {
22
- o((s) => {
23
- const n = { ...s };
21
+ ), p = u((e) => {
22
+ o((r) => {
23
+ const n = { ...r };
24
24
  return delete n[e], n;
25
25
  });
26
- }, []), L = u((e, s) => {
26
+ }, []), v = u((e, r) => {
27
27
  o((n) => {
28
- const i = { ...n };
29
- return i[e] = i[e].filter((_, v) => v !== s), i;
28
+ const s = { ...n };
29
+ return s[e] = s[e].filter((D, C) => C !== r), s;
30
30
  });
31
31
  }, []);
32
- return /* @__PURE__ */ w(
33
- x.Provider,
32
+ return /* @__PURE__ */ L(
33
+ d.Provider,
34
34
  {
35
- value: { updateElement: p, clearElements: C, removeElement: L, elementList: r },
36
- children: l
35
+ value: { updateElement: x, clearElements: p, removeElement: v, elementList: l },
36
+ children: i
37
37
  }
38
38
  );
39
- }, E = () => {
39
+ }, a = () => {
40
40
  }, U = () => {
41
- const l = g(x), { type: r, validating: o } = O(), t = A(0), c = R(() => {
41
+ const i = h(d), { type: l, validating: o } = T(), t = g(0), c = A(() => {
42
42
  if (o !== !1)
43
43
  return {
44
- updateElement: E,
45
- clearElements: E,
46
- removeElement: E,
44
+ updateElement: a,
45
+ clearElements: a,
46
+ removeElement: a,
47
47
  elementList: {}
48
48
  };
49
- if (!(r ? [d.Organization, d.FreeTrial].includes(r) : !1))
49
+ if (!(l !== R.Developer))
50
50
  return {
51
51
  updateElement: () => {
52
- t.current === 0 && (console.error(a), t.current++);
52
+ t.current === 0 && (console.error(E), t.current++);
53
53
  },
54
54
  clearElements: () => {
55
- t.current === 0 && (console.error(a), t.current++);
55
+ t.current === 0 && (console.error(E), t.current++);
56
56
  },
57
57
  removeElement: () => {
58
- t.current === 0 && (console.error(a), t.current++);
58
+ t.current === 0 && (console.error(E), t.current++);
59
59
  },
60
60
  elementList: {}
61
61
  };
62
- }, [r, o]);
63
- if (!l)
62
+ }, [l, o]);
63
+ if (!i)
64
64
  throw new Error("useElementPageContext must be used within a ElementPageProvider");
65
- return c || l;
65
+ return c || i;
66
66
  };
67
67
  export {
68
- x as ElementPageContext,
69
- k as ElementPageProvider,
68
+ d as ElementPageContext,
69
+ z as ElementPageProvider,
70
70
  U as useElementPageContext
71
71
  };
@@ -1,41 +1,39 @@
1
- import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
- import { createContext as d, useRef as x, useContext as C } from "react";
3
- import { useDocumentContext as F } from "./RPDocumentContext.js";
4
- import { useDocumentPasswordContext as h } from "./DocumentPasswordContext.js";
5
- const s = d(null), y = ({ children: t }) => {
6
- const { setFilename: i, setPdfSrc: c } = F(), o = x(null), {
7
- setPassword: l
8
- } = h(), u = () => {
1
+ import { jsxs as m, jsx as x } from "react/jsx-runtime";
2
+ import { createContext as C, useRef as c, useContext as F } from "react";
3
+ import { useDocumentContext as h } from "./RPDocumentContext.js";
4
+ import { useDocumentPasswordContext as P } from "./DocumentPasswordContext.js";
5
+ const l = C(null), g = ({ children: t }) => {
6
+ const { setFilename: u, setPdfSrc: p } = h(), r = c(), o = c(null), { setPassword: a } = P(), f = () => {
9
7
  var e;
10
8
  (e = o.current) == null || e.click();
11
- }, p = (e) => {
12
- var r;
13
- const n = (r = e.target.files) == null ? void 0 : r[0];
9
+ }, d = (e) => {
10
+ var i;
11
+ const n = (i = e.target.files) == null ? void 0 : i[0];
14
12
  if (!n || n.type !== "application/pdf")
15
13
  return;
16
- const a = URL.createObjectURL(n);
17
- i(n.name), c(a), e.target.value = "", l("");
14
+ const s = URL.createObjectURL(n);
15
+ r.current && URL.revokeObjectURL(r.current), r.current = s, u(n.name), p(s), e.target.value = "", a("");
18
16
  };
19
- return /* @__PURE__ */ f(s.Provider, { value: { openFile: u }, children: [
17
+ return /* @__PURE__ */ m(l.Provider, { value: { openFile: f }, children: [
20
18
  t,
21
- /* @__PURE__ */ m(
19
+ /* @__PURE__ */ x(
22
20
  "input",
23
21
  {
24
22
  accept: "application/pdf",
25
23
  type: "file",
26
24
  ref: o,
27
25
  style: { display: "none" },
28
- onChange: p
26
+ onChange: d
29
27
  }
30
28
  )
31
29
  ] });
32
- }, I = () => {
33
- const t = C(s);
30
+ }, j = () => {
31
+ const t = F(l);
34
32
  if (!t)
35
33
  throw new Error("useOpenFileContext must be used within FileInputProvider");
36
34
  return t;
37
35
  };
38
36
  export {
39
- y as FileInputProvider,
40
- I as useOpenFileContext
37
+ g as FileInputProvider,
38
+ j as useOpenFileContext
41
39
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { s as e, P as m, u as p } from "../ToolbarLayout.module-60c3d6e8.js";
3
+ import { t as e, P as m, u as p } from "../ToolbarLayout.module-201969d2.js";
4
4
  import "./RPDocumentContext.js";
5
5
  import "../utils/appConsole.js";
6
6
  export {
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { v as i, e as n, b as s } from "../ToolbarLayout.module-60c3d6e8.js";
3
+ import { w as e, h as n, c as s } from "../ToolbarLayout.module-201969d2.js";
4
4
  export {
5
- i as PrintContext,
5
+ e as PrintContext,
6
6
  n as PrintProvider,
7
7
  s as usePrintContext
8
8
  };
@@ -0,0 +1,10 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../utils/Queue.js";
4
+ import "../utils/renderPage.js";
5
+ import { B as m, g as p, C as d } from "../ToolbarLayout.module-201969d2.js";
6
+ export {
7
+ m as RenderQueueContext,
8
+ p as RenderQueueProvider,
9
+ d as useRenderQueue
10
+ };
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { z as a, S as c, c as s } from "../ToolbarLayout.module-60c3d6e8.js";
3
+ import { A as a, f as s, d as c } from "../ToolbarLayout.module-201969d2.js";
4
4
  export {
5
5
  a as SearchContext,
6
- c as SearchProvider,
7
- s as useSearchContext
6
+ s as SearchProvider,
7
+ c as useSearchContext
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { x as m, T as r, f as e } from "../ToolbarLayout.module-60c3d6e8.js";
3
+ import { y as m, T as r, i as e } from "../ToolbarLayout.module-201969d2.js";
4
4
  export {
5
5
  m as ThumbnailContext,
6
6
  r as ThumbnailProvider,