@pdf-viewer/react 0.4.0-beta.1 → 0.4.0-beta.2

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 (68) hide show
  1. package/dist/Container-cea98fc1.js +37 -0
  2. package/dist/RPLayout-608b83dd.js +2756 -0
  3. package/dist/components/RPController.js +16 -47
  4. package/dist/components/RPDocument.js +13 -4
  5. package/dist/components/RPDropFileZone.js +18 -17
  6. package/dist/components/RPViewer.js +12 -22
  7. package/dist/components/layout/Container.js +6 -26
  8. package/dist/components/layout/RPLayout.js +14 -57
  9. package/dist/components/layout/WrapperLayout.js +9 -8
  10. package/dist/components/layout/sidebar/RPSidebar.js +9 -32
  11. package/dist/components/layout/sidebar/RPSplitter.js +9 -7
  12. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  13. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  14. package/dist/components/layout/toolbar/DocumentDialog.js +7 -21
  15. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  16. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  17. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  18. package/dist/components/layout/toolbar/MostPageTool.js +9 -23
  19. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  20. package/dist/components/layout/toolbar/Paginate.js +1 -1
  21. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  22. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  23. package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
  24. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  25. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/SearchTool.js +7 -19
  27. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  28. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  29. package/dist/components/layout/toolbar/ZoomTool.js +8 -19
  30. package/dist/components/page/AnnotationLayer.js +9 -23
  31. package/dist/components/page/CanvasLayer.js +7 -22
  32. package/dist/components/page/DualPage.js +1 -1
  33. package/dist/components/page/RPPage.js +8 -22
  34. package/dist/components/page/SinglePage.js +1 -1
  35. package/dist/components/page/TextLayer.js +7 -22
  36. package/dist/components/ui/Checkbox.js +242 -130
  37. package/dist/components/ui/DropDown.js +1 -1
  38. package/dist/components/ui/LoadingIndicator.js +1 -1
  39. package/dist/contexts/PaginateContext.js +3 -3
  40. package/dist/contexts/PrintContext.js +2 -2
  41. package/dist/contexts/RPDocumentContext.js +33 -25
  42. package/dist/contexts/SearchContext.js +3 -3
  43. package/dist/contexts/ThumbnailsContext.js +4 -4
  44. package/dist/{index-3459164c.js → index-8049287f.js} +982 -952
  45. package/dist/main.js +31 -32
  46. package/dist/types/components/layout/RPLayout.d.ts +1 -2
  47. package/dist/types/contexts/RPDocumentContext.d.ts +4 -2
  48. package/dist/types/main.d.ts +1 -0
  49. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
  50. package/dist/types/utils/types.d.ts +9 -2
  51. package/dist/utils/hooks/useFileDownload.js +7 -22
  52. package/dist/utils/hooks/useLicense.js +15 -23
  53. package/dist/utils/hooks/useLoadPdf.js +27 -27
  54. package/dist/utils/hooks/usePaginate.js +8 -21
  55. package/dist/utils/hooks/usePrint.js +7 -22
  56. package/dist/utils/hooks/useScrollToPage.js +9 -21
  57. package/dist/utils/hooks/useSearch.js +9 -22
  58. package/dist/utils/hooks/useThumbnail.js +7 -22
  59. package/dist/utils/hooks/useVirtualReactWindow.js +9 -21
  60. package/package.json +1 -1
  61. package/dist/Container.module-cb7b45b9.js +0 -14
  62. package/dist/RPSplitter.module-13d612c4.js +0 -7
  63. package/dist/RPTheme.module-f756e5cd.js +0 -7
  64. package/dist/Thumbnails-06fa1aa5.js +0 -2657
  65. package/dist/WrapperLayout.module-147bc943.js +0 -6
  66. package/dist/index-743c36f0.js +0 -139
  67. /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
  68. /package/dist/assets/{Thumbnails.css → RPLayout.css} +0 -0
@@ -1,6 +0,0 @@
1
- import './assets/WrapperLayout.css';const p = {
2
- "rp-wrapper-layout": "_rp-wrapper-layout_2cghq_1"
3
- };
4
- export {
5
- p as c
6
- };
@@ -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
- function $({
82
- prop: e,
83
- defaultProp: n,
84
- onChange: t = () => {
85
- }
86
- }) {
87
- const [r, u] = g({ defaultProp: n, onChange: t }), s = e !== void 0, o = s ? e : r, c = y(t), a = i.useCallback(
88
- (f) => {
89
- if (s) {
90
- const d = typeof f == "function" ? f(e) : f;
91
- d !== e && c(d);
92
- } else
93
- u(f);
94
- },
95
- [s, e, u, c]
96
- );
97
- return [o, a];
98
- }
99
- function g({
100
- defaultProp: e,
101
- onChange: n
102
- }) {
103
- const t = i.useState(e), [r] = t, u = i.useRef(r), s = y(n);
104
- return i.useEffect(() => {
105
- u.current !== r && (s(r), u.current = r);
106
- }, [r, u, s]), t;
107
- }
108
- var p = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
109
- };
110
- function _(e) {
111
- const [n, t] = i.useState(void 0);
112
- return p(() => {
113
- if (e) {
114
- t({ width: e.offsetWidth, height: e.offsetHeight });
115
- const r = new ResizeObserver((u) => {
116
- if (!Array.isArray(u) || !u.length)
117
- return;
118
- const s = u[0];
119
- let o, c;
120
- if ("borderBoxSize" in s) {
121
- const a = s.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
122
- o = f.inlineSize, c = f.blockSize;
123
- } else
124
- o = e.offsetWidth, c = e.offsetHeight;
125
- t({ width: o, height: c });
126
- });
127
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
128
- } else
129
- t(void 0);
130
- }, [e]), n;
131
- }
132
- export {
133
- $ as a,
134
- _ as b,
135
- E as c,
136
- y as d,
137
- m as e,
138
- p as u
139
- };
File without changes
File without changes