@pdf-viewer/react 1.9.0-beta.3 → 1.9.0-beta.4

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 (94) hide show
  1. package/dist/RPLayout-5892502c.js +3494 -0
  2. package/dist/{SearchCloseButton-ddb9877e.js → SearchCloseButton-cbf182aa.js} +7 -6
  3. package/dist/assets/Checkbox.css +1 -1
  4. package/dist/assets/RPLayout.css +1 -1
  5. package/dist/components/RPConfig.js +691 -673
  6. package/dist/components/RPController.js +1 -1
  7. package/dist/components/RPPages.js +4 -5
  8. package/dist/components/layout/LayoutContainer.js +5 -5
  9. package/dist/components/layout/RPDefaultLayout.js +1 -1
  10. package/dist/components/layout/RPLayout.js +4 -5
  11. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  12. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  13. package/dist/components/layout/sidebar/Thumbnails.js +3 -2
  14. package/dist/components/layout/toolbar/DocumentDialog.js +4 -5
  15. package/dist/components/layout/toolbar/DocumentProperties.js +23 -19
  16. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  17. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  18. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  19. package/dist/components/layout/toolbar/MostPageTool.js +5 -6
  20. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  21. package/dist/components/layout/toolbar/Paginate.js +1 -1
  22. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  23. package/dist/components/layout/toolbar/RPToolbar.js +2 -2
  24. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  25. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  26. package/dist/components/layout/toolbar/ScrollModeTool.js +35 -37
  27. package/dist/components/layout/toolbar/SearchCloseButton.js +1 -1
  28. package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
  29. package/dist/components/layout/toolbar/SearchTool.js +3 -4
  30. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  31. package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
  32. package/dist/components/layout/toolbar/ToolbarCustom.js +4 -5
  33. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  34. package/dist/components/layout/toolbar/ZoomTool.js +4 -3
  35. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
  36. package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
  37. package/dist/components/layout/toolbar/tools/NextPageTool.js +5 -6
  38. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  39. package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
  40. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  41. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
  42. package/dist/components/layout/toolbar/tools/defaults/TopbarDefaultTools.js +1 -1
  43. package/dist/components/page/AnnotationLayer.js +4 -5
  44. package/dist/components/page/CanvasLayer.js +4 -5
  45. package/dist/components/page/DualPage.js +1 -1
  46. package/dist/components/page/RPPage.js +4 -4
  47. package/dist/components/page/SinglePage.js +1 -1
  48. package/dist/components/page/TextHighlightLayer.js +4 -5
  49. package/dist/components/page/TextLayer.js +4 -5
  50. package/dist/components/ui/Button.js +8 -8
  51. package/dist/components/ui/Checkbox.js +243 -120
  52. package/dist/components/ui/DropDown.js +16 -16
  53. package/dist/components/ui/Input.js +11 -11
  54. package/dist/components/ui/LoadingIndicator.js +1 -1
  55. package/dist/components/ui/RPTooltip.js +211 -426
  56. package/dist/contexts/PaginationContext.js +1 -1
  57. package/dist/contexts/PrintContext.js +1 -1
  58. package/dist/contexts/SearchContext.js +1 -1
  59. package/dist/contexts/ThumbnailsContext.js +1 -1
  60. package/dist/index-00f8683a.js +1672 -0
  61. package/dist/index-5f66a29f.js +1681 -0
  62. package/dist/index-6b37f504.js +332 -0
  63. package/dist/main.js +1 -1
  64. package/dist/types/components/layout/LayoutContainer.d.ts +5 -1
  65. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +3 -1
  66. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -1
  67. package/dist/types/components/page/RPPage.d.ts +3 -1
  68. package/dist/types/components/ui/Button.d.ts +3 -1
  69. package/dist/types/components/ui/Checkbox.d.ts +1 -0
  70. package/dist/types/components/ui/DropDown.d.ts +2 -1
  71. package/dist/types/components/ui/Input.d.ts +3 -1
  72. package/dist/types/components/ui/RPTooltip.d.ts +3 -1
  73. package/dist/types/utils/withRef.d.ts +4 -0
  74. package/dist/utils/hooks/useFileDownload.js +4 -5
  75. package/dist/utils/hooks/useLicense.js +1 -1
  76. package/dist/utils/hooks/usePaginate.js +4 -5
  77. package/dist/utils/hooks/usePresentPage.js +4 -5
  78. package/dist/utils/hooks/usePrint.js +4 -5
  79. package/dist/utils/hooks/useScrollToPage.js +4 -5
  80. package/dist/utils/hooks/useSearch.js +4 -5
  81. package/dist/utils/hooks/useThumbnail.js +4 -5
  82. package/dist/utils/hooks/useVirtualReactWindow.js +4 -5
  83. package/dist/utils/withRef.js +8 -0
  84. package/package.json +1 -1
  85. package/dist/Popover-1faa77f6.js +0 -1445
  86. package/dist/RPLayout-897cb09d.js +0 -3393
  87. package/dist/assets/Popover.css +0 -1
  88. package/dist/component-1da194e8.js +0 -337
  89. package/dist/components/ui/Popover.js +0 -6
  90. package/dist/floating-ui.react-dom-15b9b819.js +0 -1310
  91. package/dist/index-1cb41342.js +0 -307
  92. package/dist/index-7279fb4e.js +0 -1557
  93. package/dist/index-aa2d3884.js +0 -140
  94. package/dist/types/components/ui/Popover.d.ts +0 -9
@@ -1,140 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface Props extends PropsWithChildren {
3
- triggerComponent: React.ReactElement;
4
- container: HTMLDivElement | null;
5
- open?: boolean;
6
- className?: any;
7
- }
8
- export declare const UIPopOver: FC<Props>;
9
- export {};