@pdf-viewer/react 1.2.0-rc.1 → 1.2.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 (59) hide show
  1. package/dist/{RPDefaultLayout-7ebbc6e0.js → RPDefaultLayout-8ee7a95b.js} +352 -344
  2. package/dist/components/RPController.js +1 -1
  3. package/dist/components/RPPages.js +1 -1
  4. package/dist/components/RPProvider.js +1 -1
  5. package/dist/components/layout/RPDefaultLayout.js +1 -1
  6. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  7. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  9. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  10. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  11. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  12. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  13. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  14. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  15. package/dist/components/layout/toolbar/Paginate.js +1 -1
  16. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  17. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  19. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  20. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  21. package/dist/components/layout/toolbar/SearchTool.js +2 -2
  22. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  25. package/dist/components/page/AnnotationLayer.js +1 -1
  26. package/dist/components/page/CanvasLayer.js +1 -1
  27. package/dist/components/page/DualPage.js +1 -1
  28. package/dist/components/page/RPPage.js +1 -1
  29. package/dist/components/page/SinglePage.js +1 -1
  30. package/dist/components/page/TextLayer.js +1 -1
  31. package/dist/components/ui/Checkbox.js +13 -14
  32. package/dist/components/ui/DropDown.js +1 -1
  33. package/dist/components/ui/LoadingIndicator.js +1 -1
  34. package/dist/components/ui/Popover.js +3058 -4
  35. package/dist/components/ui/RPTooltip.js +328 -687
  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/floating-ui.react-dom-88a86594.js +1447 -0
  41. package/dist/index-48ca3f30.js +307 -0
  42. package/dist/index-4ba3ab9a.js +1877 -0
  43. package/dist/main.js +1 -1
  44. package/dist/utils/hooks/useFileDownload.js +1 -1
  45. package/dist/utils/hooks/useLicense.js +32 -40
  46. package/dist/utils/hooks/usePaginate.js +1 -1
  47. package/dist/utils/hooks/usePrint.js +1 -1
  48. package/dist/utils/hooks/useScrollToPage.js +1 -1
  49. package/dist/utils/hooks/useSearch.js +1 -1
  50. package/dist/utils/hooks/useThumbnail.js +1 -1
  51. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/Popover-aaa4344e.js +0 -1445
  54. package/dist/component-1da194e8.js +0 -337
  55. package/dist/floating-ui.react-dom-15b9b819.js +0 -1310
  56. package/dist/index-2e540713.js +0 -23
  57. package/dist/index-353ec0a6.js +0 -172
  58. package/dist/index-5ff5dbd0.js +0 -1675
  59. package/dist/index-71898eb9.js +0 -139
@@ -1,139 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as C } from "react/jsx-runtime";
3
- function m(e, n) {
4
- const t = i.createContext(n), r = (s) => {
5
- const { children: o, ...c } = s, a = i.useMemo(() => c, Object.values(c));
6
- return /* @__PURE__ */ C(t.Provider, { value: a, children: o });
7
- };
8
- r.displayName = e + "Provider";
9
- function u(s) {
10
- const o = i.useContext(t);
11
- if (o)
12
- return o;
13
- if (n !== void 0)
14
- return n;
15
- throw new Error(`\`${s}\` must be used within \`${e}\``);
16
- }
17
- return [r, u];
18
- }
19
- function E(e, n = []) {
20
- let t = [];
21
- function r(s, o) {
22
- const c = i.createContext(o), a = t.length;
23
- t = [...t, o];
24
- const f = (d) => {
25
- var b;
26
- const { scope: l, children: S, ...v } = d, h = ((b = l == null ? void 0 : l[e]) == null ? void 0 : b[a]) || c, z = i.useMemo(() => v, Object.values(v));
27
- return /* @__PURE__ */ C(h.Provider, { value: z, children: S });
28
- };
29
- f.displayName = s + "Provider";
30
- function x(d, l) {
31
- var h;
32
- const S = ((h = l == null ? void 0 : l[e]) == null ? void 0 : h[a]) || c, v = i.useContext(S);
33
- if (v)
34
- return v;
35
- if (o !== void 0)
36
- return o;
37
- throw new Error(`\`${d}\` must be used within \`${s}\``);
38
- }
39
- return [f, x];
40
- }
41
- const u = () => {
42
- const s = t.map((o) => i.createContext(o));
43
- return function(c) {
44
- const a = (c == null ? void 0 : c[e]) || s;
45
- return i.useMemo(
46
- () => ({ [`__scope${e}`]: { ...c, [e]: a } }),
47
- [c, a]
48
- );
49
- };
50
- };
51
- return u.scopeName = e, [r, P(u, ...n)];
52
- }
53
- function P(...e) {
54
- const n = e[0];
55
- if (e.length === 1)
56
- return n;
57
- const t = () => {
58
- const r = e.map((u) => ({
59
- useScope: u(),
60
- scopeName: u.scopeName
61
- }));
62
- return function(s) {
63
- const o = r.reduce((c, { useScope: a, scopeName: f }) => {
64
- const d = a(s)[`__scope${f}`];
65
- return { ...c, ...d };
66
- }, {});
67
- return i.useMemo(() => ({ [`__scope${n.scopeName}`]: o }), [o]);
68
- };
69
- };
70
- return t.scopeName = n.scopeName, t;
71
- }
72
- function y(e) {
73
- const n = i.useRef(e);
74
- return i.useEffect(() => {
75
- n.current = e;
76
- }), i.useMemo(() => (...t) => {
77
- var r;
78
- return (r = n.current) == null ? void 0 : r.call(n, ...t);
79
- }, []);
80
- }
81
- var g = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
82
- };
83
- function $(e) {
84
- const [n, t] = i.useState(void 0);
85
- return g(() => {
86
- if (e) {
87
- t({ width: e.offsetWidth, height: e.offsetHeight });
88
- const r = new ResizeObserver((u) => {
89
- if (!Array.isArray(u) || !u.length)
90
- return;
91
- const s = u[0];
92
- let o, c;
93
- if ("borderBoxSize" in s) {
94
- const a = s.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
95
- o = f.inlineSize, c = f.blockSize;
96
- } else
97
- o = e.offsetWidth, c = e.offsetHeight;
98
- t({ width: o, height: c });
99
- });
100
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
101
- } else
102
- t(void 0);
103
- }, [e]), n;
104
- }
105
- function _({
106
- prop: e,
107
- defaultProp: n,
108
- onChange: t = () => {
109
- }
110
- }) {
111
- const [r, u] = p({ defaultProp: n, onChange: t }), s = e !== void 0, o = s ? e : r, c = y(t), a = i.useCallback(
112
- (f) => {
113
- if (s) {
114
- const d = typeof f == "function" ? f(e) : f;
115
- d !== e && c(d);
116
- } else
117
- u(f);
118
- },
119
- [s, e, u, c]
120
- );
121
- return [o, a];
122
- }
123
- function p({
124
- defaultProp: e,
125
- onChange: n
126
- }) {
127
- const t = i.useState(e), [r] = t, u = i.useRef(r), s = y(n);
128
- return i.useEffect(() => {
129
- u.current !== r && (s(r), u.current = r);
130
- }, [r, u, s]), t;
131
- }
132
- export {
133
- g as a,
134
- _ as b,
135
- E as c,
136
- $ as d,
137
- m as e,
138
- y as u
139
- };