@pdf-viewer/react 1.9.0-beta.4 → 1.9.0-beta.5
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/Checkbox.module-3edaacbb.js +7 -0
- package/dist/Combination-da8647d4.js +693 -0
- package/dist/Container.module-f8b5c306.js +6 -0
- package/dist/DropDown.module-a78567cb.js +11 -0
- package/dist/MenuItem.module-bc11d0d3.js +6 -0
- package/dist/MenuSeparator.module-89b2ff7f.js +6 -0
- package/dist/PropertyItem.module-db0150cc.js +8 -0
- package/dist/RPSplitter.module-13d612c4.js +7 -0
- package/dist/RPTheme.module-bd9038da.js +8 -0
- package/dist/RotateTool.module-03987eba.js +6 -0
- package/dist/SearchTool.module-016f3a8d.js +16 -0
- package/dist/ToolbarLayout.module-60c3d6e8.js +2434 -0
- package/dist/WrapperLayout.module-147bc943.js +6 -0
- package/dist/assets/ToolbarLayout.css +1 -0
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +9 -9
- package/dist/components/RPDropFileZone.js +21 -23
- package/dist/components/RPPages.js +21 -18
- package/dist/components/RPProvider.js +19 -15
- package/dist/components/layout/Container.js +10 -11
- package/dist/components/layout/LayoutContainer.js +19 -16
- package/dist/components/layout/RPDefaultLayout.js +76 -14
- package/dist/components/layout/RPLayout.js +74 -24
- package/dist/components/layout/WrapperLayout.js +7 -8
- package/dist/components/layout/sidebar/RPSidebar.js +51 -12
- package/dist/components/layout/sidebar/RPSplitter.js +7 -9
- 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 +307 -24
- package/dist/components/layout/toolbar/FileDownloadTool.js +23 -13
- package/dist/components/layout/toolbar/MenuItem.js +6 -7
- package/dist/components/layout/toolbar/MenuSeparator.js +4 -5
- package/dist/components/layout/toolbar/MostPageTool.js +50 -23
- package/dist/components/layout/toolbar/OtherTool.js +115 -22
- package/dist/components/layout/toolbar/Paginate.js +99 -17
- package/dist/components/layout/toolbar/PrintTool.js +43 -13
- package/dist/components/layout/toolbar/PropertyItem.js +5 -8
- package/dist/components/layout/toolbar/RPToolbar.js +28 -7
- package/dist/components/layout/toolbar/RPToolbarEnd.js +22 -7
- package/dist/components/layout/toolbar/RotateTool.js +20 -21
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchCloseButton.js +19 -7
- package/dist/components/layout/toolbar/SearchResultNavigator.js +42 -8
- package/dist/components/layout/toolbar/SearchTool.js +198 -29
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +4 -4
- package/dist/components/layout/toolbar/ToolbarCustom.js +48 -20
- package/dist/components/layout/toolbar/ToolbarDefault.js +82 -0
- package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +140 -28
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -3
- package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -7
- package/dist/components/layout/toolbar/tools/NextPageTool.js +21 -18
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +14 -14
- package/dist/components/layout/toolbar/tools/defaults/{TopbarDefaultTools.js → RPHorizontalBar.js} +29 -20
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
- package/dist/components/page/AnnotationLayer.js +20 -17
- package/dist/components/page/CanvasLayer.js +20 -17
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +20 -17
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +20 -17
- package/dist/components/page/TextLayer.js +20 -17
- package/dist/components/ui/Checkbox.js +125 -239
- package/dist/components/ui/DropDown.js +13 -19
- package/dist/components/ui/LoadingIndicator.js +22 -5
- package/dist/components/ui/RPTooltip.js +424 -211
- package/dist/contexts/PaginationContext.js +4 -4
- package/dist/contexts/PrintContext.js +2 -2
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ViewportContext.js +42 -35
- package/dist/floating-ui.react-dom-f3f380e0.js +1447 -0
- package/dist/index-473557b1.js +1191 -0
- package/dist/index-8547fbc6.js +307 -0
- package/dist/main.js +76 -73
- package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -1
- package/dist/types/components/layout/RPLayout.d.ts +2 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +2 -3
- package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +2 -2
- package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
- package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
- package/dist/types/main.d.ts +3 -3
- package/dist/types/utils/types.d.ts +17 -17
- package/dist/utils/hooks/useFileDownload.js +20 -17
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +20 -17
- package/dist/utils/hooks/usePresentPage.js +20 -17
- package/dist/utils/hooks/usePrint.js +20 -17
- package/dist/utils/hooks/useScrollToPage.js +20 -17
- package/dist/utils/hooks/useSearch.js +20 -17
- package/dist/utils/hooks/useThumbnail.js +20 -17
- package/dist/utils/hooks/useVirtualReactWindow.js +20 -17
- package/package.json +1 -1
- package/dist/RPLayout-5892502c.js +0 -3494
- package/dist/SearchCloseButton-cbf182aa.js +0 -33
- package/dist/assets/RPLayout.css +0 -1
- package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +0 -16
- package/dist/index-00f8683a.js +0 -1672
- package/dist/index-5f66a29f.js +0 -1681
- package/dist/index-6b37f504.js +0 -332
- package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +0 -3
- package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +0 -3
- /package/dist/assets/{RPDropFileZone.css → RPTheme.css} +0 -0
- /package/dist/assets/{SearchCloseButton.css → SearchTool.css} +0 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { jsx as S, Fragment as O } from "react/jsx-runtime";
|
|
3
|
+
import * as x from "react-dom";
|
|
4
|
+
function V(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
5
|
+
return function(o) {
|
|
6
|
+
if (e == null || e(o), n === !1 || !o.defaultPrevented)
|
|
7
|
+
return t == null ? void 0 : t(o);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function P(e, t) {
|
|
11
|
+
if (typeof e == "function")
|
|
12
|
+
return e(t);
|
|
13
|
+
e != null && (e.current = t);
|
|
14
|
+
}
|
|
15
|
+
function w(...e) {
|
|
16
|
+
return (t) => {
|
|
17
|
+
let n = !1;
|
|
18
|
+
const r = e.map((o) => {
|
|
19
|
+
const i = P(o, t);
|
|
20
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
21
|
+
});
|
|
22
|
+
if (n)
|
|
23
|
+
return () => {
|
|
24
|
+
for (let o = 0; o < r.length; o++) {
|
|
25
|
+
const i = r[o];
|
|
26
|
+
typeof i == "function" ? i() : P(e[o], null);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function E(...e) {
|
|
32
|
+
return s.useCallback(w(...e), e);
|
|
33
|
+
}
|
|
34
|
+
function k(e, t) {
|
|
35
|
+
const n = s.createContext(t), r = (i) => {
|
|
36
|
+
const { children: c, ...u } = i, a = s.useMemo(() => u, Object.values(u));
|
|
37
|
+
return /* @__PURE__ */ S(n.Provider, { value: a, children: c });
|
|
38
|
+
};
|
|
39
|
+
r.displayName = e + "Provider";
|
|
40
|
+
function o(i) {
|
|
41
|
+
const c = s.useContext(n);
|
|
42
|
+
if (c)
|
|
43
|
+
return c;
|
|
44
|
+
if (t !== void 0)
|
|
45
|
+
return t;
|
|
46
|
+
throw new Error(`\`${i}\` must be used within \`${e}\``);
|
|
47
|
+
}
|
|
48
|
+
return [r, o];
|
|
49
|
+
}
|
|
50
|
+
function B(e, t = []) {
|
|
51
|
+
let n = [];
|
|
52
|
+
function r(i, c) {
|
|
53
|
+
const u = s.createContext(c), a = n.length;
|
|
54
|
+
n = [...n, c];
|
|
55
|
+
const f = (l) => {
|
|
56
|
+
var b;
|
|
57
|
+
const { scope: d, children: m, ...h } = l, v = ((b = d == null ? void 0 : d[e]) == null ? void 0 : b[a]) || u, y = s.useMemo(() => h, Object.values(h));
|
|
58
|
+
return /* @__PURE__ */ S(v.Provider, { value: y, children: m });
|
|
59
|
+
};
|
|
60
|
+
f.displayName = i + "Provider";
|
|
61
|
+
function p(l, d) {
|
|
62
|
+
var v;
|
|
63
|
+
const m = ((v = d == null ? void 0 : d[e]) == null ? void 0 : v[a]) || u, h = s.useContext(m);
|
|
64
|
+
if (h)
|
|
65
|
+
return h;
|
|
66
|
+
if (c !== void 0)
|
|
67
|
+
return c;
|
|
68
|
+
throw new Error(`\`${l}\` must be used within \`${i}\``);
|
|
69
|
+
}
|
|
70
|
+
return [f, p];
|
|
71
|
+
}
|
|
72
|
+
const o = () => {
|
|
73
|
+
const i = n.map((c) => s.createContext(c));
|
|
74
|
+
return function(u) {
|
|
75
|
+
const a = (u == null ? void 0 : u[e]) || i;
|
|
76
|
+
return s.useMemo(
|
|
77
|
+
() => ({ [`__scope${e}`]: { ...u, [e]: a } }),
|
|
78
|
+
[u, a]
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
return o.scopeName = e, [r, M(o, ...t)];
|
|
83
|
+
}
|
|
84
|
+
function M(...e) {
|
|
85
|
+
const t = e[0];
|
|
86
|
+
if (e.length === 1)
|
|
87
|
+
return t;
|
|
88
|
+
const n = () => {
|
|
89
|
+
const r = e.map((o) => ({
|
|
90
|
+
useScope: o(),
|
|
91
|
+
scopeName: o.scopeName
|
|
92
|
+
}));
|
|
93
|
+
return function(i) {
|
|
94
|
+
const c = r.reduce((u, { useScope: a, scopeName: f }) => {
|
|
95
|
+
const l = a(i)[`__scope${f}`];
|
|
96
|
+
return { ...u, ...l };
|
|
97
|
+
}, {});
|
|
98
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
return n.scopeName = t.scopeName, n;
|
|
102
|
+
}
|
|
103
|
+
var A = s.forwardRef((e, t) => {
|
|
104
|
+
const { children: n, ...r } = e, o = s.Children.toArray(n), i = o.find(U);
|
|
105
|
+
if (i) {
|
|
106
|
+
const c = i.props.children, u = o.map((a) => a === i ? s.Children.count(c) > 1 ? s.Children.only(null) : s.isValidElement(c) ? c.props.children : null : a);
|
|
107
|
+
return /* @__PURE__ */ S(g, { ...r, ref: t, children: s.isValidElement(c) ? s.cloneElement(c, void 0, u) : null });
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ S(g, { ...r, ref: t, children: n });
|
|
110
|
+
});
|
|
111
|
+
A.displayName = "Slot";
|
|
112
|
+
var g = s.forwardRef((e, t) => {
|
|
113
|
+
const { children: n, ...r } = e;
|
|
114
|
+
if (s.isValidElement(n)) {
|
|
115
|
+
const o = z(n), i = W(r, n.props);
|
|
116
|
+
return n.type !== s.Fragment && (i.ref = t ? w(t, o) : o), s.cloneElement(n, i);
|
|
117
|
+
}
|
|
118
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
119
|
+
});
|
|
120
|
+
g.displayName = "SlotClone";
|
|
121
|
+
var T = ({ children: e }) => /* @__PURE__ */ S(O, { children: e });
|
|
122
|
+
function U(e) {
|
|
123
|
+
return s.isValidElement(e) && e.type === T;
|
|
124
|
+
}
|
|
125
|
+
function W(e, t) {
|
|
126
|
+
const n = { ...t };
|
|
127
|
+
for (const r in t) {
|
|
128
|
+
const o = e[r], i = t[r];
|
|
129
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...u) => {
|
|
130
|
+
i(...u), o(...u);
|
|
131
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
132
|
+
}
|
|
133
|
+
return { ...e, ...n };
|
|
134
|
+
}
|
|
135
|
+
function z(e) {
|
|
136
|
+
var r, o;
|
|
137
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
138
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
139
|
+
}
|
|
140
|
+
var D = [
|
|
141
|
+
"a",
|
|
142
|
+
"button",
|
|
143
|
+
"div",
|
|
144
|
+
"form",
|
|
145
|
+
"h2",
|
|
146
|
+
"h3",
|
|
147
|
+
"img",
|
|
148
|
+
"input",
|
|
149
|
+
"label",
|
|
150
|
+
"li",
|
|
151
|
+
"nav",
|
|
152
|
+
"ol",
|
|
153
|
+
"p",
|
|
154
|
+
"span",
|
|
155
|
+
"svg",
|
|
156
|
+
"ul"
|
|
157
|
+
], Z = D.reduce((e, t) => {
|
|
158
|
+
const n = s.forwardRef((r, o) => {
|
|
159
|
+
const { asChild: i, ...c } = r, u = i ? A : t;
|
|
160
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ S(u, { ...c, ref: o });
|
|
161
|
+
});
|
|
162
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
163
|
+
}, {});
|
|
164
|
+
function q(e, t) {
|
|
165
|
+
e && x.flushSync(() => e.dispatchEvent(t));
|
|
166
|
+
}
|
|
167
|
+
function R(e) {
|
|
168
|
+
const t = s.useRef(e);
|
|
169
|
+
return s.useEffect(() => {
|
|
170
|
+
t.current = e;
|
|
171
|
+
}), s.useMemo(() => (...n) => {
|
|
172
|
+
var r;
|
|
173
|
+
return (r = t.current) == null ? void 0 : r.call(t, ...n);
|
|
174
|
+
}, []);
|
|
175
|
+
}
|
|
176
|
+
var C = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
|
|
177
|
+
};
|
|
178
|
+
function G(e) {
|
|
179
|
+
const [t, n] = s.useState(void 0);
|
|
180
|
+
return C(() => {
|
|
181
|
+
if (e) {
|
|
182
|
+
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
183
|
+
const r = new ResizeObserver((o) => {
|
|
184
|
+
if (!Array.isArray(o) || !o.length)
|
|
185
|
+
return;
|
|
186
|
+
const i = o[0];
|
|
187
|
+
let c, u;
|
|
188
|
+
if ("borderBoxSize" in i) {
|
|
189
|
+
const a = i.borderBoxSize, f = Array.isArray(a) ? a[0] : a;
|
|
190
|
+
c = f.inlineSize, u = f.blockSize;
|
|
191
|
+
} else
|
|
192
|
+
c = e.offsetWidth, u = e.offsetHeight;
|
|
193
|
+
n({ width: c, height: u });
|
|
194
|
+
});
|
|
195
|
+
return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
|
|
196
|
+
} else
|
|
197
|
+
n(void 0);
|
|
198
|
+
}, [e]), t;
|
|
199
|
+
}
|
|
200
|
+
function I(e, t) {
|
|
201
|
+
return s.useReducer((n, r) => t[n][r] ?? n, e);
|
|
202
|
+
}
|
|
203
|
+
var _ = (e) => {
|
|
204
|
+
const { present: t, children: n } = e, r = j(t), o = typeof n == "function" ? n({ present: r.isPresent }) : s.Children.only(n), i = E(r.ref, $(o));
|
|
205
|
+
return typeof n == "function" || r.isPresent ? s.cloneElement(o, { ref: i }) : null;
|
|
206
|
+
};
|
|
207
|
+
_.displayName = "Presence";
|
|
208
|
+
function j(e) {
|
|
209
|
+
const [t, n] = s.useState(), r = s.useRef({}), o = s.useRef(e), i = s.useRef("none"), c = e ? "mounted" : "unmounted", [u, a] = I(c, {
|
|
210
|
+
mounted: {
|
|
211
|
+
UNMOUNT: "unmounted",
|
|
212
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
213
|
+
},
|
|
214
|
+
unmountSuspended: {
|
|
215
|
+
MOUNT: "mounted",
|
|
216
|
+
ANIMATION_END: "unmounted"
|
|
217
|
+
},
|
|
218
|
+
unmounted: {
|
|
219
|
+
MOUNT: "mounted"
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return s.useEffect(() => {
|
|
223
|
+
const f = N(r.current);
|
|
224
|
+
i.current = u === "mounted" ? f : "none";
|
|
225
|
+
}, [u]), C(() => {
|
|
226
|
+
const f = r.current, p = o.current;
|
|
227
|
+
if (p !== e) {
|
|
228
|
+
const d = i.current, m = N(f);
|
|
229
|
+
e ? a("MOUNT") : m === "none" || (f == null ? void 0 : f.display) === "none" ? a("UNMOUNT") : a(p && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
230
|
+
}
|
|
231
|
+
}, [e, a]), C(() => {
|
|
232
|
+
if (t) {
|
|
233
|
+
let f;
|
|
234
|
+
const p = t.ownerDocument.defaultView ?? window, l = (m) => {
|
|
235
|
+
const v = N(r.current).includes(m.animationName);
|
|
236
|
+
if (m.target === t && v && (a("ANIMATION_END"), !o.current)) {
|
|
237
|
+
const y = t.style.animationFillMode;
|
|
238
|
+
t.style.animationFillMode = "forwards", f = p.setTimeout(() => {
|
|
239
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}, d = (m) => {
|
|
243
|
+
m.target === t && (i.current = N(r.current));
|
|
244
|
+
};
|
|
245
|
+
return t.addEventListener("animationstart", d), t.addEventListener("animationcancel", l), t.addEventListener("animationend", l), () => {
|
|
246
|
+
p.clearTimeout(f), t.removeEventListener("animationstart", d), t.removeEventListener("animationcancel", l), t.removeEventListener("animationend", l);
|
|
247
|
+
};
|
|
248
|
+
} else
|
|
249
|
+
a("ANIMATION_END");
|
|
250
|
+
}, [t, a]), {
|
|
251
|
+
isPresent: ["mounted", "unmountSuspended"].includes(u),
|
|
252
|
+
ref: s.useCallback((f) => {
|
|
253
|
+
f && (r.current = getComputedStyle(f)), n(f);
|
|
254
|
+
}, [])
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function N(e) {
|
|
258
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
259
|
+
}
|
|
260
|
+
function $(e) {
|
|
261
|
+
var r, o;
|
|
262
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
263
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
264
|
+
}
|
|
265
|
+
function J({
|
|
266
|
+
prop: e,
|
|
267
|
+
defaultProp: t,
|
|
268
|
+
onChange: n = () => {
|
|
269
|
+
}
|
|
270
|
+
}) {
|
|
271
|
+
const [r, o] = L({ defaultProp: t, onChange: n }), i = e !== void 0, c = i ? e : r, u = R(n), a = s.useCallback(
|
|
272
|
+
(f) => {
|
|
273
|
+
if (i) {
|
|
274
|
+
const l = typeof f == "function" ? f(e) : f;
|
|
275
|
+
l !== e && u(l);
|
|
276
|
+
} else
|
|
277
|
+
o(f);
|
|
278
|
+
},
|
|
279
|
+
[i, e, o, u]
|
|
280
|
+
);
|
|
281
|
+
return [c, a];
|
|
282
|
+
}
|
|
283
|
+
function L({
|
|
284
|
+
defaultProp: e,
|
|
285
|
+
onChange: t
|
|
286
|
+
}) {
|
|
287
|
+
const n = s.useState(e), [r] = n, o = s.useRef(r), i = R(t);
|
|
288
|
+
return s.useEffect(() => {
|
|
289
|
+
o.current !== r && (i(r), o.current = r);
|
|
290
|
+
}, [r, o, i]), n;
|
|
291
|
+
}
|
|
292
|
+
export {
|
|
293
|
+
Z as P,
|
|
294
|
+
A as S,
|
|
295
|
+
V as a,
|
|
296
|
+
_ as b,
|
|
297
|
+
B as c,
|
|
298
|
+
k as d,
|
|
299
|
+
J as e,
|
|
300
|
+
G as f,
|
|
301
|
+
R as g,
|
|
302
|
+
C as h,
|
|
303
|
+
T as i,
|
|
304
|
+
w as j,
|
|
305
|
+
q as k,
|
|
306
|
+
E as u
|
|
307
|
+
};
|
package/dist/main.js
CHANGED
|
@@ -1,79 +1,82 @@
|
|
|
1
1
|
import { RPProvider as r } from "./components/RPProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import { RPConfig as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
2
|
+
import { R as x, a as m, u as p, b as l, c as f } from "./ToolbarLayout.module-60c3d6e8.js";
|
|
3
|
+
import { RPConfig as a } from "./components/RPConfig.js";
|
|
4
|
+
import { RPDefaultLayout as s } from "./components/layout/RPDefaultLayout.js";
|
|
5
|
+
import { RPLayout as P } from "./components/layout/RPLayout.js";
|
|
6
|
+
import { RPController as C } from "./components/RPController.js";
|
|
7
|
+
import { RPTheme as c } from "./components/RPTheme.js";
|
|
8
|
+
import { RPDropFileZone as d } from "./components/RPDropFileZone.js";
|
|
9
|
+
import { useDarkModeContext as F } from "./contexts/DarkModeContext.js";
|
|
10
|
+
import { useDocumentContext as Z } from "./contexts/RPDocumentContext.js";
|
|
11
|
+
import { useRotationContext as w } from "./contexts/RotationContext.js";
|
|
12
|
+
import { useViewModeContext as v } from "./contexts/ViewModeContext.js";
|
|
13
|
+
import { useDropFileZoneContext as V } from "./contexts/DropFileZoneContext.js";
|
|
14
|
+
import { useOpenFileContext as y } from "./contexts/FileInputContext.js";
|
|
15
|
+
import { useZoomContext as H } from "./contexts/ZoomContext.js";
|
|
16
|
+
import { useHighlightContext as O } from "./contexts/HighlightContext.js";
|
|
17
|
+
import { usePdfProperties as z } from "./utils/hooks/usePdfProperties.js";
|
|
18
|
+
import { useFullScreenContext as N } from "./contexts/FullScreenContext.js";
|
|
19
|
+
import { usePageRotateContext as j } from "./utils/hooks/usePageRotateContext.js";
|
|
18
20
|
import { useElementPageContext as A } from "./contexts/ElementPageContext.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
21
|
+
import { SearchTool as J } from "./components/layout/toolbar/SearchTool.js";
|
|
22
|
+
import { ThemeSwitcherTool as Q } from "./components/layout/toolbar/tools/ThemeSwitcherTool.js";
|
|
23
|
+
import { ThumbnailTool as X } from "./components/layout/toolbar/tools/ThumbnailTool.js";
|
|
24
|
+
import { FileUploadTool as _ } from "./components/layout/toolbar/tools/FileUploadTool.js";
|
|
25
|
+
import { FileDownloadTool as oo } from "./components/layout/toolbar/tools/FileDownloadTool.js";
|
|
26
|
+
import { PrintTool as ro } from "./components/layout/toolbar/tools/PrintTool.js";
|
|
27
|
+
import { FullScreenTool as xo } from "./components/layout/toolbar/tools/FullScreenTool.js";
|
|
28
|
+
import { PreviousPageTool as po } from "./components/layout/toolbar/tools/PreviousPageTool.js";
|
|
29
|
+
import { NextPageTool as fo } from "./components/layout/toolbar/tools/NextPageTool.js";
|
|
30
|
+
import { InputPageTool as ao } from "./components/layout/toolbar/tools/InputPageTool.js";
|
|
31
|
+
import { ZoomInTool as so } from "./components/layout/toolbar/tools/ZoomInTool.js";
|
|
32
|
+
import { ZoomOutTool as Po } from "./components/layout/toolbar/tools/ZoomOutTool.js";
|
|
33
|
+
import { ZoomLevelTool as Co } from "./components/layout/toolbar/tools/ZoomLevelTool.js";
|
|
34
|
+
import { RPHorizontalBar as co } from "./components/layout/toolbar/tools/defaults/RPHorizontalBar.js";
|
|
35
|
+
import { RPVerticalBar as ho } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
|
|
36
|
+
import { Locales as Do, ScrollMode as Zo, ThemeVariables as So, ViewMode as wo, ZoomLevel as Lo } from "./utils/types.js";
|
|
34
37
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
oo as FileDownloadTool,
|
|
39
|
+
_ as FileUploadTool,
|
|
40
|
+
xo as FullScreenTool,
|
|
41
|
+
ao as InputPageTool,
|
|
42
|
+
Do as Locales,
|
|
43
|
+
fo as NextPageTool,
|
|
44
|
+
po as PreviousPageTool,
|
|
45
|
+
ro as PrintTool,
|
|
46
|
+
a as RPConfig,
|
|
47
|
+
C as RPController,
|
|
48
|
+
s as RPDefaultLayout,
|
|
49
|
+
d as RPDropFileZone,
|
|
50
|
+
co as RPHorizontalBar,
|
|
51
|
+
P as RPLayout,
|
|
52
|
+
x as RPPages,
|
|
50
53
|
r as RPProvider,
|
|
51
|
-
|
|
52
|
-
ho as
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
c as RPTheme,
|
|
55
|
+
ho as RPVerticalBar,
|
|
56
|
+
Zo as ScrollMode,
|
|
57
|
+
J as SearchTool,
|
|
58
|
+
Q as ThemeSwitcherTool,
|
|
59
|
+
So as ThemeVariables,
|
|
60
|
+
X as ThumbnailTool,
|
|
61
|
+
wo as ViewMode,
|
|
62
|
+
so as ZoomInTool,
|
|
63
|
+
Lo as ZoomLevel,
|
|
64
|
+
Co as ZoomLevelTool,
|
|
65
|
+
Po as ZoomOutTool,
|
|
66
|
+
F as useDarkModeContext,
|
|
67
|
+
Z as useDocumentContext,
|
|
68
|
+
V as useDropFileZoneContext,
|
|
66
69
|
A as useElementPageContext,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
m as useFileDownload,
|
|
71
|
+
N as useFullScreenContext,
|
|
72
|
+
O as useHighlightContext,
|
|
73
|
+
y as useOpenFileContext,
|
|
74
|
+
j as usePageRotateContext,
|
|
75
|
+
p as usePaginationContext,
|
|
76
|
+
z as usePdfProperties,
|
|
77
|
+
l as usePrintContext,
|
|
78
|
+
w as useRotationContext,
|
|
79
|
+
f as useSearchContext,
|
|
80
|
+
v as useViewModeContext,
|
|
81
|
+
H as useZoomContext
|
|
79
82
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { RPDefaultLayoutProps } from '../../utils/types';
|
|
2
|
-
export declare const RPDefaultLayout:
|
|
3
|
+
export declare const RPDefaultLayout: FC<RPDefaultLayoutProps>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}) => import('react').ReactNode);
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const RPToolbar: FC;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const ToolbarCustom: FC<
|
|
2
|
+
import { ToolbarLayoutProps } from '../../../utils/types';
|
|
3
|
+
export declare const ToolbarCustom: FC<ToolbarLayoutProps>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export { InputPageTool } from './components/layout/toolbar/tools/InputPageTool';
|
|
|
36
36
|
export { ZoomInTool } from './components/layout/toolbar/tools/ZoomInTool';
|
|
37
37
|
export { ZoomOutTool } from './components/layout/toolbar/tools/ZoomOutTool';
|
|
38
38
|
export { ZoomLevelTool } from './components/layout/toolbar/tools/ZoomLevelTool';
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPDefaultLayoutProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeProps, ThumbnailToolProps, ViewModeProps, ZoomProps,
|
|
39
|
+
export { RPHorizontalBar } from './components/layout/toolbar/tools/defaults/RPHorizontalBar';
|
|
40
|
+
export { RPVerticalBar } from './components/layout/toolbar/tools/defaults/RPVerticalBar';
|
|
41
|
+
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPDefaultLayoutProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeProps, ThumbnailToolProps, ViewModeProps, ZoomProps, RPHorizontalBarProps, RPHorizontalBarSlots, RPHorizontalBarIcons, RPVerticalBarProps, RPVerticalBarSlots, RPVerticalBarIcons } from './utils/types';
|
|
42
42
|
export { ViewMode, ScrollMode, ZoomLevel, Locales, ThemeVariables } from './utils/types';
|
|
@@ -324,10 +324,10 @@ export interface ThumbnailToolProps {
|
|
|
324
324
|
onClick: () => void;
|
|
325
325
|
active: boolean;
|
|
326
326
|
}
|
|
327
|
-
export interface RPSlots extends
|
|
327
|
+
export interface RPSlots extends RPHorizontalBarSlots, RPVerticalBarSlots {
|
|
328
328
|
sidebarEnable?: boolean;
|
|
329
329
|
}
|
|
330
|
-
export interface RPIcons extends
|
|
330
|
+
export interface RPIcons extends RPHorizontalBarIcons, RPVerticalBarIcons {
|
|
331
331
|
}
|
|
332
332
|
export interface PdfProperties {
|
|
333
333
|
filename: string;
|
|
@@ -473,7 +473,7 @@ export interface RPDefaultLayoutProps extends PropsWithChildren, ViewportProps {
|
|
|
473
473
|
cleanupOnLoaded?: () => void;
|
|
474
474
|
}
|
|
475
475
|
export interface RPLayoutProps extends PropsWithChildren, ViewportProps {
|
|
476
|
-
toolbar?: Partial<ToolbarProps>;
|
|
476
|
+
toolbar?: boolean | Partial<ToolbarProps>;
|
|
477
477
|
style?: React.CSSProperties;
|
|
478
478
|
className?: string;
|
|
479
479
|
onLoaded?: () => void;
|
|
@@ -687,9 +687,9 @@ export interface CharacterIndex {
|
|
|
687
687
|
charIdxInSpan: number;
|
|
688
688
|
spanIdx: number;
|
|
689
689
|
}
|
|
690
|
-
export interface
|
|
690
|
+
export interface ToolbarLayoutProps {
|
|
691
691
|
children: React.ReactNode;
|
|
692
|
-
toolbar?: Partial<ToolbarProps>;
|
|
692
|
+
toolbar?: boolean | Partial<ToolbarProps>;
|
|
693
693
|
}
|
|
694
694
|
export interface ToolProps {
|
|
695
695
|
icon?: React.ReactNode;
|
|
@@ -704,10 +704,10 @@ export interface ToolbarSection {
|
|
|
704
704
|
component: React.ReactNode;
|
|
705
705
|
}
|
|
706
706
|
export interface ToolbarProps {
|
|
707
|
-
topbar: Partial<ToolbarSection>;
|
|
708
|
-
leftSidebar: Partial<ToolbarSection>;
|
|
707
|
+
topbar: boolean | Partial<ToolbarSection>;
|
|
708
|
+
leftSidebar: boolean | Partial<ToolbarSection>;
|
|
709
709
|
}
|
|
710
|
-
export interface
|
|
710
|
+
export interface RPHorizontalBarSlots {
|
|
711
711
|
themeSwitcher?: boolean | FC<Omit<DarkModeProps, 'onDarkModeChange'>>;
|
|
712
712
|
documentProperties?: boolean;
|
|
713
713
|
rotateTool?: boolean;
|
|
@@ -726,7 +726,7 @@ export interface TopbarDefaultToolSlots {
|
|
|
726
726
|
searchTool?: boolean;
|
|
727
727
|
jumpNavigationTool?: boolean;
|
|
728
728
|
}
|
|
729
|
-
export interface
|
|
729
|
+
export interface RPHorizontalBarIcons {
|
|
730
730
|
goToFirstPageIcon?: React.ReactNode;
|
|
731
731
|
goToLastPageIcon?: React.ReactNode;
|
|
732
732
|
lightModeIcon?: React.ReactNode;
|
|
@@ -751,18 +751,18 @@ export interface TopbarDefaultToolIcons {
|
|
|
751
751
|
textSelectionIcon?: React.ReactNode;
|
|
752
752
|
handModeIcon?: React.ReactNode;
|
|
753
753
|
}
|
|
754
|
-
export interface
|
|
755
|
-
slots?:
|
|
756
|
-
icons?:
|
|
754
|
+
export interface RPHorizontalBarProps {
|
|
755
|
+
slots?: RPHorizontalBarSlots;
|
|
756
|
+
icons?: RPHorizontalBarIcons;
|
|
757
757
|
}
|
|
758
|
-
export interface
|
|
758
|
+
export interface RPVerticalBarSlots {
|
|
759
759
|
thumbnailTool?: boolean | FC<ThumbnailToolProps>;
|
|
760
760
|
}
|
|
761
|
-
export interface
|
|
761
|
+
export interface RPVerticalBarIcons {
|
|
762
762
|
thumbnailIcon?: React.ReactNode;
|
|
763
763
|
}
|
|
764
|
-
export interface
|
|
765
|
-
slots?:
|
|
766
|
-
icons?:
|
|
764
|
+
export interface RPVerticalBarProps {
|
|
765
|
+
slots?: RPVerticalBarSlots;
|
|
766
|
+
icons?: RPVerticalBarIcons;
|
|
767
767
|
}
|
|
768
768
|
export {};
|