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

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 (81) hide show
  1. package/dist/{Combination-da8647d4.js → Combination-9a0a3e65.js} +14 -14
  2. package/dist/ToolbarLayout.module-88476995.js +2464 -0
  3. package/dist/assets/ToolbarLayout.css +1 -1
  4. package/dist/components/RPController.js +35 -35
  5. package/dist/components/RPPages.js +1 -1
  6. package/dist/components/RPProvider.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/RPLayout.js +1 -1
  10. package/dist/components/layout/sidebar/RPSidebar.js +11 -11
  11. package/dist/components/layout/sidebar/Thumbnail.js +49 -2
  12. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  13. package/dist/components/layout/toolbar/DocumentDialog.js +11 -11
  14. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  15. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  16. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  17. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  18. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  19. package/dist/components/layout/toolbar/Paginate.js +6 -6
  20. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbar.js +3 -3
  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 +1 -1
  26. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ThumbnailTool.js +6 -6
  28. package/dist/components/layout/toolbar/ToolbarCustom.js +3 -3
  29. package/dist/components/layout/toolbar/ToolbarDefault.js +7 -7
  30. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  31. package/dist/components/layout/toolbar/ZoomTool.js +8 -8
  32. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
  33. package/dist/components/layout/toolbar/tools/InputPageTool.js +5 -5
  34. package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
  35. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  36. package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
  37. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  38. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +7 -7
  39. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
  40. package/dist/components/page/AnnotationLayer.js +1 -1
  41. package/dist/components/page/CanvasLayer.js +2 -3
  42. package/dist/components/page/DualPage.js +1 -1
  43. package/dist/components/page/RPPage.js +1 -1
  44. package/dist/components/page/SinglePage.js +1 -1
  45. package/dist/components/page/TextHighlightLayer.js +1 -1
  46. package/dist/components/page/TextLayer.js +1 -1
  47. package/dist/components/ui/Checkbox.js +1 -1
  48. package/dist/components/ui/DropDown.js +1 -1
  49. package/dist/components/ui/LoadingIndicator.js +6 -6
  50. package/dist/components/ui/RPTooltip.js +197 -410
  51. package/dist/contexts/ElementPageContext.js +37 -37
  52. package/dist/contexts/FileInputContext.js +18 -20
  53. package/dist/contexts/PaginationContext.js +1 -1
  54. package/dist/contexts/PrintContext.js +2 -2
  55. package/dist/contexts/RenderQueueProvider.js +10 -0
  56. package/dist/contexts/SearchContext.js +1 -1
  57. package/dist/contexts/ThumbnailsContext.js +1 -1
  58. package/dist/{index-8547fbc6.js → index-2160dd99.js} +5 -5
  59. package/dist/index-492f99d0.js +1657 -0
  60. package/dist/index-49b9a615.js +978 -0
  61. package/dist/main.js +1 -1
  62. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
  63. package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
  64. package/dist/types/utils/Queue.d.ts +18 -0
  65. package/dist/types/utils/renderPage.d.ts +1 -6
  66. package/dist/types/utils/types.d.ts +5 -0
  67. package/dist/utils/Queue.js +47 -0
  68. package/dist/utils/hooks/useFileDownload.js +1 -1
  69. package/dist/utils/hooks/useLicense.js +1 -1
  70. package/dist/utils/hooks/usePageRotateContext.js +14 -14
  71. package/dist/utils/hooks/usePaginate.js +2 -2
  72. package/dist/utils/hooks/usePresentPage.js +1 -1
  73. package/dist/utils/hooks/usePrint.js +1 -1
  74. package/dist/utils/hooks/useScrollToPage.js +1 -1
  75. package/dist/utils/hooks/useSearch.js +1 -1
  76. package/dist/utils/hooks/useThumbnail.js +2 -3
  77. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  78. package/package.json +1 -1
  79. package/dist/ToolbarLayout.module-60c3d6e8.js +0 -2434
  80. package/dist/floating-ui.react-dom-f3f380e0.js +0 -1447
  81. package/dist/index-473557b1.js +0 -1191
@@ -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-88476995.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, f as n, b as s } from "../ToolbarLayout.module-88476995.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, e as p, C as d } from "../ToolbarLayout.module-88476995.js";
6
+ export {
7
+ m as RenderQueueContext,
8
+ p as RenderQueueProvider,
9
+ d as useRenderQueue
10
+ };
@@ -1,6 +1,6 @@
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, S as c, c as s } from "../ToolbarLayout.module-88476995.js";
4
4
  export {
5
5
  a as SearchContext,
6
6
  c as SearchProvider,
@@ -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, g as e } from "../ToolbarLayout.module-88476995.js";
4
4
  export {
5
5
  m as ThumbnailContext,
6
6
  r as ThumbnailProvider,
@@ -298,10 +298,10 @@ export {
298
298
  k as d,
299
299
  J as e,
300
300
  G as f,
301
- R as g,
302
- C as h,
303
- T as i,
304
- w as j,
305
- q as k,
301
+ T as g,
302
+ R as h,
303
+ w as i,
304
+ q as j,
305
+ C as k,
306
306
  E as u
307
307
  };