@pdf-viewer/react 1.3.0-rc.2 → 1.3.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-19259aa7.js → RPDefaultLayout-6fe6be3d.js} +327 -319
  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 +1 -1
  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,23 +0,0 @@
1
- import * as o from "react";
2
- import { u as n, a as r } from "./index-71898eb9.js";
3
- function i(a, e = globalThis == null ? void 0 : globalThis.document) {
4
- const t = n(a);
5
- o.useEffect(() => {
6
- const s = (u) => {
7
- u.key === "Escape" && t(u);
8
- };
9
- return e.addEventListener("keydown", s, { capture: !0 }), () => e.removeEventListener("keydown", s, { capture: !0 });
10
- }, [t, e]);
11
- }
12
- var c = o["useId".toString()] || (() => {
13
- }), f = 0;
14
- function p(a) {
15
- const [e, t] = o.useState(c());
16
- return r(() => {
17
- a || t((s) => s ?? String(f++));
18
- }, [a]), a || (e ? `radix-${e}` : "");
19
- }
20
- export {
21
- p as a,
22
- i as u
23
- };
@@ -1,172 +0,0 @@
1
- import * as s from "react";
2
- import * as C from "react-dom";
3
- import { jsx as h, Fragment as M } from "react/jsx-runtime";
4
- import { a as g } from "./index-71898eb9.js";
5
- function x(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
6
- return function(r) {
7
- if (e == null || e(r), t === !1 || !r.defaultPrevented)
8
- return n == null ? void 0 : n(r);
9
- };
10
- }
11
- function A(e, n) {
12
- if (typeof e == "function")
13
- return e(n);
14
- e != null && (e.current = n);
15
- }
16
- function R(...e) {
17
- return (n) => {
18
- let t = !1;
19
- const i = e.map((r) => {
20
- const o = A(r, n);
21
- return !t && typeof o == "function" && (t = !0), o;
22
- });
23
- if (t)
24
- return () => {
25
- for (let r = 0; r < i.length; r++) {
26
- const o = i[r];
27
- typeof o == "function" ? o() : A(e[r], null);
28
- }
29
- };
30
- };
31
- }
32
- function S(...e) {
33
- return s.useCallback(R(...e), e);
34
- }
35
- var O = s.forwardRef((e, n) => {
36
- const { children: t, ...i } = e, r = s.Children.toArray(t), o = r.find(T);
37
- if (o) {
38
- const c = o.props.children, l = r.map((u) => u === o ? s.Children.count(c) > 1 ? s.Children.only(null) : s.isValidElement(c) ? c.props.children : null : u);
39
- return /* @__PURE__ */ h(y, { ...i, ref: n, children: s.isValidElement(c) ? s.cloneElement(c, void 0, l) : null });
40
- }
41
- return /* @__PURE__ */ h(y, { ...i, ref: n, children: t });
42
- });
43
- O.displayName = "Slot";
44
- var y = s.forwardRef((e, n) => {
45
- const { children: t, ...i } = e;
46
- if (s.isValidElement(t)) {
47
- const r = D(t), o = b(i, t.props);
48
- return t.type !== s.Fragment && (o.ref = n ? R(n, r) : r), s.cloneElement(t, o);
49
- }
50
- return s.Children.count(t) > 1 ? s.Children.only(null) : null;
51
- });
52
- y.displayName = "SlotClone";
53
- var E = ({ children: e }) => /* @__PURE__ */ h(M, { children: e });
54
- function T(e) {
55
- return s.isValidElement(e) && e.type === E;
56
- }
57
- function b(e, n) {
58
- const t = { ...n };
59
- for (const i in n) {
60
- const r = e[i], o = n[i];
61
- /^on[A-Z]/.test(i) ? r && o ? t[i] = (...l) => {
62
- o(...l), r(...l);
63
- } : r && (t[i] = r) : i === "style" ? t[i] = { ...r, ...o } : i === "className" && (t[i] = [r, o].filter(Boolean).join(" "));
64
- }
65
- return { ...e, ...t };
66
- }
67
- function D(e) {
68
- var i, r;
69
- let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
70
- return t ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
71
- }
72
- var I = [
73
- "a",
74
- "button",
75
- "div",
76
- "form",
77
- "h2",
78
- "h3",
79
- "img",
80
- "input",
81
- "label",
82
- "li",
83
- "nav",
84
- "ol",
85
- "p",
86
- "span",
87
- "svg",
88
- "ul"
89
- ], _ = I.reduce((e, n) => {
90
- const t = s.forwardRef((i, r) => {
91
- const { asChild: o, ...c } = i, l = o ? O : n;
92
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(l, { ...c, ref: r });
93
- });
94
- return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
95
- }, {});
96
- function k(e, n) {
97
- e && C.flushSync(() => e.dispatchEvent(n));
98
- }
99
- function U(e, n) {
100
- return s.useReducer((t, i) => n[t][i] ?? t, e);
101
- }
102
- var W = (e) => {
103
- const { present: n, children: t } = e, i = F(n), r = typeof t == "function" ? t({ present: i.isPresent }) : s.Children.only(t), o = S(i.ref, L(r));
104
- return typeof t == "function" || i.isPresent ? s.cloneElement(r, { ref: o }) : null;
105
- };
106
- W.displayName = "Presence";
107
- function F(e) {
108
- const [n, t] = s.useState(), i = s.useRef({}), r = s.useRef(e), o = s.useRef("none"), c = e ? "mounted" : "unmounted", [l, u] = U(c, {
109
- mounted: {
110
- UNMOUNT: "unmounted",
111
- ANIMATION_OUT: "unmountSuspended"
112
- },
113
- unmountSuspended: {
114
- MOUNT: "mounted",
115
- ANIMATION_END: "unmounted"
116
- },
117
- unmounted: {
118
- MOUNT: "mounted"
119
- }
120
- });
121
- return s.useEffect(() => {
122
- const a = N(i.current);
123
- o.current = l === "mounted" ? a : "none";
124
- }, [l]), g(() => {
125
- const a = i.current, m = r.current;
126
- if (m !== e) {
127
- const p = o.current, f = N(a);
128
- e ? u("MOUNT") : f === "none" || (a == null ? void 0 : a.display) === "none" ? u("UNMOUNT") : u(m && p !== f ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
129
- }
130
- }, [e, u]), g(() => {
131
- if (n) {
132
- let a;
133
- const m = n.ownerDocument.defaultView ?? window, d = (f) => {
134
- const v = N(i.current).includes(f.animationName);
135
- if (f.target === n && v && (u("ANIMATION_END"), !r.current)) {
136
- const w = n.style.animationFillMode;
137
- n.style.animationFillMode = "forwards", a = m.setTimeout(() => {
138
- n.style.animationFillMode === "forwards" && (n.style.animationFillMode = w);
139
- });
140
- }
141
- }, p = (f) => {
142
- f.target === n && (o.current = N(i.current));
143
- };
144
- return n.addEventListener("animationstart", p), n.addEventListener("animationcancel", d), n.addEventListener("animationend", d), () => {
145
- m.clearTimeout(a), n.removeEventListener("animationstart", p), n.removeEventListener("animationcancel", d), n.removeEventListener("animationend", d);
146
- };
147
- } else
148
- u("ANIMATION_END");
149
- }, [n, u]), {
150
- isPresent: ["mounted", "unmountSuspended"].includes(l),
151
- ref: s.useCallback((a) => {
152
- a && (i.current = getComputedStyle(a)), t(a);
153
- }, [])
154
- };
155
- }
156
- function N(e) {
157
- return (e == null ? void 0 : e.animationName) || "none";
158
- }
159
- function L(e) {
160
- var i, r;
161
- let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
162
- return t ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
163
- }
164
- export {
165
- _ as P,
166
- O as S,
167
- W as a,
168
- R as b,
169
- x as c,
170
- k as d,
171
- S as u
172
- };