@pdf-viewer/react 1.4.3-rc.0 → 1.4.3
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.
- package/dist/{RPDefaultLayout-b9f5eccb.js → RPDefaultLayout-f9017f0e.js} +559 -554
- package/dist/components/RPConfig.js +270 -259
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Checkbox.js +109 -93
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +363 -721
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/index-0f08882b.js +1561 -0
- package/dist/index-10ac1200.js +150 -0
- package/dist/index-271658fe.js +331 -0
- package/dist/main.js +1 -1
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/package.json +2 -2
- package/dist/index-2e540713.js +0 -23
- package/dist/index-353ec0a6.js +0 -172
- package/dist/index-5ff5dbd0.js +0 -1675
- package/dist/index-71898eb9.js +0 -139
package/dist/index-71898eb9.js
DELETED
|
@@ -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
|
-
};
|