@pdf-viewer/react 1.5.0-beta.11 → 1.5.0-beta.13

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-e1e07d65.js → RPDefaultLayout-9c3c313b.js} +569 -570
  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/LayoutContainer.js +1 -1
  6. package/dist/components/layout/RPDefaultLayout.js +1 -1
  7. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  10. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  11. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  12. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  13. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  14. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  15. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  16. package/dist/components/layout/toolbar/Paginate.js +1 -1
  17. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  20. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  21. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  22. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  23. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  26. package/dist/components/page/AnnotationLayer.js +1 -1
  27. package/dist/components/page/CanvasLayer.js +1 -1
  28. package/dist/components/page/DualPage.js +1 -1
  29. package/dist/components/page/RPPage.js +1 -1
  30. package/dist/components/page/SinglePage.js +1 -1
  31. package/dist/components/page/TextHighlightLayer.js +1 -1
  32. package/dist/components/page/TextLayer.js +1 -1
  33. package/dist/components/ui/Checkbox.js +13 -14
  34. package/dist/components/ui/DropDown.js +1 -1
  35. package/dist/components/ui/LoadingIndicator.js +1 -1
  36. package/dist/components/ui/RPTooltip.js +331 -689
  37. package/dist/contexts/PaginationContext.js +1 -1
  38. package/dist/contexts/PrintContext.js +1 -1
  39. package/dist/contexts/SearchContext.js +1 -1
  40. package/dist/contexts/ThumbnailsContext.js +1 -1
  41. package/dist/index-1cb41342.js +307 -0
  42. package/dist/index-7279fb4e.js +1557 -0
  43. package/dist/index-aa2d3884.js +140 -0
  44. package/dist/main.js +1 -1
  45. package/dist/utils/hooks/useFileDownload.js +1 -1
  46. package/dist/utils/hooks/useLicense.js +1 -1
  47. package/dist/utils/hooks/useLoadWorker.js +1 -1
  48. package/dist/utils/hooks/usePaginate.js +1 -1
  49. package/dist/utils/hooks/usePresentPage.js +1 -1
  50. package/dist/utils/hooks/usePrint.js +1 -1
  51. package/dist/utils/hooks/useScrollToPage.js +1 -1
  52. package/dist/utils/hooks/useSearch.js +1 -1
  53. package/dist/utils/hooks/useThumbnail.js +1 -1
  54. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  55. package/package.json +1 -1
  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
@@ -0,0 +1,140 @@
1
+ import * as i from "react";
2
+ import { u as p, a as R, P as w, c as h, d as _, b as U } from "./index-1cb41342.js";
3
+ import { jsx as T } from "react/jsx-runtime";
4
+ function z(t, e = globalThis == null ? void 0 : globalThis.document) {
5
+ const s = p(t);
6
+ i.useEffect(() => {
7
+ const n = (r) => {
8
+ r.key === "Escape" && s(r);
9
+ };
10
+ return e.addEventListener("keydown", n, { capture: !0 }), () => e.removeEventListener("keydown", n, { capture: !0 });
11
+ }, [s, e]);
12
+ }
13
+ var H = "DismissableLayer", b = "dismissableLayer.update", M = "dismissableLayer.pointerDownOutside", K = "dismissableLayer.focusOutside", O, S = i.createContext({
14
+ layers: /* @__PURE__ */ new Set(),
15
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
16
+ branches: /* @__PURE__ */ new Set()
17
+ }), j = i.forwardRef(
18
+ (t, e) => {
19
+ const {
20
+ disableOutsidePointerEvents: s = !1,
21
+ onEscapeKeyDown: n,
22
+ onPointerDownOutside: r,
23
+ onFocusOutside: o,
24
+ onInteractOutside: l,
25
+ onDismiss: d,
26
+ ...v
27
+ } = t, u = i.useContext(S), [c, B] = i.useState(null), f = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = i.useState({}), I = R(e, (a) => B(a)), m = Array.from(u.layers), [W] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), k = m.indexOf(W), P = c ? m.indexOf(c) : -1, A = u.layersWithOutsidePointerEventsDisabled.size > 0, D = P >= k, N = $((a) => {
28
+ const E = a.target, C = [...u.branches].some((y) => y.contains(E));
29
+ !D || C || (r == null || r(a), l == null || l(a), a.defaultPrevented || d == null || d());
30
+ }, f), L = q((a) => {
31
+ const E = a.target;
32
+ [...u.branches].some((y) => y.contains(E)) || (o == null || o(a), l == null || l(a), a.defaultPrevented || d == null || d());
33
+ }, f);
34
+ return z((a) => {
35
+ P === u.layers.size - 1 && (n == null || n(a), !a.defaultPrevented && d && (a.preventDefault(), d()));
36
+ }, f), i.useEffect(() => {
37
+ if (c)
38
+ return s && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (O = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(c)), u.layers.add(c), g(), () => {
39
+ s && u.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = O);
40
+ };
41
+ }, [c, f, s, u]), i.useEffect(() => () => {
42
+ c && (u.layers.delete(c), u.layersWithOutsidePointerEventsDisabled.delete(c), g());
43
+ }, [c, u]), i.useEffect(() => {
44
+ const a = () => F({});
45
+ return document.addEventListener(b, a), () => document.removeEventListener(b, a);
46
+ }, []), /* @__PURE__ */ T(
47
+ w.div,
48
+ {
49
+ ...v,
50
+ ref: I,
51
+ style: {
52
+ pointerEvents: A ? D ? "auto" : "none" : void 0,
53
+ ...t.style
54
+ },
55
+ onFocusCapture: h(t.onFocusCapture, L.onFocusCapture),
56
+ onBlurCapture: h(t.onBlurCapture, L.onBlurCapture),
57
+ onPointerDownCapture: h(
58
+ t.onPointerDownCapture,
59
+ N.onPointerDownCapture
60
+ )
61
+ }
62
+ );
63
+ }
64
+ );
65
+ j.displayName = H;
66
+ var X = "DismissableLayerBranch", Y = i.forwardRef((t, e) => {
67
+ const s = i.useContext(S), n = i.useRef(null), r = R(e, n);
68
+ return i.useEffect(() => {
69
+ const o = n.current;
70
+ if (o)
71
+ return s.branches.add(o), () => {
72
+ s.branches.delete(o);
73
+ };
74
+ }, [s.branches]), /* @__PURE__ */ T(w.div, { ...t, ref: r });
75
+ });
76
+ Y.displayName = X;
77
+ function $(t, e = globalThis == null ? void 0 : globalThis.document) {
78
+ const s = p(t), n = i.useRef(!1), r = i.useRef(() => {
79
+ });
80
+ return i.useEffect(() => {
81
+ const o = (d) => {
82
+ if (d.target && !n.current) {
83
+ let v = function() {
84
+ x(
85
+ M,
86
+ s,
87
+ u,
88
+ { discrete: !0 }
89
+ );
90
+ };
91
+ const u = { originalEvent: d };
92
+ d.pointerType === "touch" ? (e.removeEventListener("click", r.current), r.current = v, e.addEventListener("click", r.current, { once: !0 })) : v();
93
+ } else
94
+ e.removeEventListener("click", r.current);
95
+ n.current = !1;
96
+ }, l = window.setTimeout(() => {
97
+ e.addEventListener("pointerdown", o);
98
+ }, 0);
99
+ return () => {
100
+ window.clearTimeout(l), e.removeEventListener("pointerdown", o), e.removeEventListener("click", r.current);
101
+ };
102
+ }, [e, s]), {
103
+ // ensures we check React component tree (not just DOM tree)
104
+ onPointerDownCapture: () => n.current = !0
105
+ };
106
+ }
107
+ function q(t, e = globalThis == null ? void 0 : globalThis.document) {
108
+ const s = p(t), n = i.useRef(!1);
109
+ return i.useEffect(() => {
110
+ const r = (o) => {
111
+ o.target && !n.current && x(K, s, { originalEvent: o }, {
112
+ discrete: !1
113
+ });
114
+ };
115
+ return e.addEventListener("focusin", r), () => e.removeEventListener("focusin", r);
116
+ }, [e, s]), {
117
+ onFocusCapture: () => n.current = !0,
118
+ onBlurCapture: () => n.current = !1
119
+ };
120
+ }
121
+ function g() {
122
+ const t = new CustomEvent(b);
123
+ document.dispatchEvent(t);
124
+ }
125
+ function x(t, e, s, { discrete: n }) {
126
+ const r = s.originalEvent.target, o = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: s });
127
+ e && r.addEventListener(t, e, { once: !0 }), n ? _(r, o) : r.dispatchEvent(o);
128
+ }
129
+ var G = i["useId".toString()] || (() => {
130
+ }), J = 0;
131
+ function Z(t) {
132
+ const [e, s] = i.useState(G());
133
+ return U(() => {
134
+ t || s((n) => n ?? String(J++));
135
+ }, [t]), t || (e ? `radix-${e}` : "");
136
+ }
137
+ export {
138
+ j as D,
139
+ Z as u
140
+ };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RPProvider as t } from "./components/RPProvider.js";
2
- import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-e1e07d65.js";
2
+ import { b as x, R as n, c as s, u as m, d as p, e as f } from "./RPDefaultLayout-9c3c313b.js";
3
3
  import { RPConfig as a } from "./components/RPConfig.js";
4
4
  import { RPController as l } from "./components/RPController.js";
5
5
  import { RPTheme as P } from "./components/RPTheme.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../contexts/RPDocumentContext.js";
4
- import { c as C } from "../../RPDefaultLayout-e1e07d65.js";
4
+ import { c as C } from "../../RPDefaultLayout-9c3c313b.js";
5
5
  import "../../contexts/DarkModeContext.js";
6
6
  import "../../contexts/RotationContext.js";
7
7
  import "../../contexts/LayerContext.js";
@@ -1,6 +1,6 @@
1
1
  import { useState as E, useCallback as h, useEffect as A } from "react";
2
2
  import { appConsole as c } from "../appConsole.js";
3
- const b = /* @__PURE__ */ new Date("2025-05-06T03:28:01.043Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", o = {
3
+ const b = /* @__PURE__ */ new Date("2025-05-06T18:33:37.220Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", o = {
4
4
  invalidLicense: `You are currently using without a valid license. ${l}`,
5
5
  mismatchedDomain: `Your license key is not valid for the current domain / IP. ${l}`,
6
6
  expired: `Your license key has expired. ${l}`,