@pdf-viewer/react 1.1.0 → 1.1.1-beta.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.
- package/dist/Container-44b8ad45.js +38 -0
- package/dist/RPDefaultLayout-79c7577a.js +2907 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Container.css +1 -1
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPConfig.js +344 -322
- package/dist/components/RPController.js +38 -35
- package/dist/components/RPDropFileZone.js +23 -22
- package/dist/components/RPPages.js +3 -2
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +3 -2
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +22 -21
- package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
- package/dist/components/layout/toolbar/DocumentProperties.js +15 -14
- package/dist/components/layout/toolbar/FileDownloadTool.js +3 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +20 -22
- package/dist/components/layout/toolbar/FullScreenTool.js +40 -34
- package/dist/components/layout/toolbar/MenuItem.js +7 -7
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +4 -3
- package/dist/components/layout/toolbar/OtherTool.js +4 -3
- package/dist/components/layout/toolbar/Paginate.js +3 -2
- package/dist/components/layout/toolbar/PrintTool.js +3 -2
- 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 +27 -26
- package/dist/components/layout/toolbar/ScrollModeTool.js +43 -42
- package/dist/components/layout/toolbar/SearchTool.js +5 -3
- package/dist/components/layout/toolbar/SelectionModeTool.js +31 -30
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +4 -3
- package/dist/components/page/AnnotationLayer.js +3 -2
- package/dist/components/page/CanvasLayer.js +3 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +3 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +3 -2
- package/dist/components/ui/Button.js +10 -10
- package/dist/components/ui/Checkbox.js +92 -252
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +3 -2
- package/dist/components/ui/Popover.js +3060 -0
- package/dist/components/ui/RPTooltip.js +331 -855
- package/dist/contexts/LocalizationContext.js +38 -0
- package/dist/contexts/PaginationContext.js +3 -3
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/floating-ui.react-dom-88a86594.js +1447 -0
- package/dist/index-48ca3f30.js +307 -0
- package/dist/index-4ba3ab9a.js +1877 -0
- package/dist/main.js +14 -13
- package/dist/th_TH-2fba4a89.js +388 -0
- package/dist/types/components/ui/Popover.d.ts +9 -0
- package/dist/types/components/ui/RPTooltip.d.ts +3 -2
- package/dist/types/contexts/LocalizationContext.d.ts +5 -0
- package/dist/types/contexts/PaginationContext.d.ts +2 -2
- package/dist/types/locales/en_US.json.d.ts +80 -0
- package/dist/types/locales/it_IT.json.d.ts +80 -0
- package/dist/types/locales/pt_PT.json.d.ts +80 -0
- package/dist/types/locales/th_TH.json.d.ts +80 -0
- package/dist/types/locales/zh_CN.json.d.ts +80 -0
- package/dist/types/main.d.ts +1 -1
- package/dist/types/utils/hooks/useLocalization.d.ts +10 -0
- package/dist/types/utils/hooks/useScrollToPage.d.ts +1 -1
- package/dist/types/utils/smoothScrollTo.d.ts +2 -0
- package/dist/types/utils/types.d.ts +92 -77
- package/dist/utils/hooks/useFileDownload.js +3 -2
- package/dist/utils/hooks/useLicense.js +32 -40
- package/dist/utils/hooks/useLocalization.js +25 -0
- package/dist/utils/hooks/usePaginate.js +3 -2
- package/dist/utils/hooks/usePrint.js +3 -2
- package/dist/utils/hooks/useScrollToPage.js +4 -2
- package/dist/utils/hooks/useSearch.js +3 -2
- package/dist/utils/hooks/useThumbnail.js +3 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
- package/dist/utils/smoothScrollTo.js +18 -0
- package/dist/utils/types.js +17 -8
- package/package.json +2 -1
- package/dist/Container-fdb0a71f.js +0 -38
- package/dist/RPDefaultLayout-651c2426.js +0 -2832
- package/dist/floating-ui.react-dom-e6d5fe8f.js +0 -1327
- package/dist/index-316854c1.js +0 -2299
- 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
|
-
};
|