@pdf-viewer/react 1.8.1-rc.0 → 1.8.1-rc.2
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/{RPDefaultLayout-c0c44afa.js → RPDefaultLayout-29ba8270.js} +802 -798
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +4 -3
- package/dist/components/layout/RPDefaultLayout.js +3 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +3 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +2 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- 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/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/Button.js +8 -8
- package/dist/components/ui/Checkbox.js +116 -228
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/Input.js +11 -11
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +204 -206
- package/dist/contexts/PaginationContext.js +1 -1
- 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 +1 -1
- package/dist/types/components/layout/LayoutContainer.d.ts +5 -1
- package/dist/types/components/layout/RPDefaultLayout.d.ts +3 -1
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +3 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -1
- package/dist/types/components/page/RPPage.d.ts +3 -1
- package/dist/types/components/ui/Button.d.ts +3 -1
- package/dist/types/components/ui/Input.d.ts +3 -1
- package/dist/types/components/ui/RPTooltip.d.ts +3 -1
- package/dist/types/utils/withRef.d.ts +4 -0
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/dist/utils/withRef.js +8 -0
- package/package.json +1 -3
- package/dist/Popover-48c8394c.js +0 -1445
- package/dist/assets/Popover.css +0 -1
- package/dist/component-2aa6e53b.js +0 -337
- package/dist/components/ui/Popover.js +0 -6
- package/dist/floating-ui.react-dom-4b1e2e46.js +0 -1324
- package/dist/index-6e0e48fa.js +0 -332
- package/dist/index-951f0f1f.js +0 -1565
- package/dist/index-e3a67935.js +0 -150
- package/dist/types/components/ui/Popover.d.ts +0 -9
package/dist/index-e3a67935.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import { u as R, P as w, a as h, f as _, g as U } from "./index-6e0e48fa.js";
|
|
3
|
-
import { jsx as T } from "react/jsx-runtime";
|
|
4
|
-
function b(t) {
|
|
5
|
-
const e = r.useRef(t);
|
|
6
|
-
return r.useEffect(() => {
|
|
7
|
-
e.current = t;
|
|
8
|
-
}), r.useMemo(() => (...n) => {
|
|
9
|
-
var s;
|
|
10
|
-
return (s = e.current) == null ? void 0 : s.call(e, ...n);
|
|
11
|
-
}, []);
|
|
12
|
-
}
|
|
13
|
-
function z(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
14
|
-
const n = b(t);
|
|
15
|
-
r.useEffect(() => {
|
|
16
|
-
const s = (i) => {
|
|
17
|
-
i.key === "Escape" && n(i);
|
|
18
|
-
};
|
|
19
|
-
return e.addEventListener("keydown", s, { capture: !0 }), () => e.removeEventListener("keydown", s, { capture: !0 });
|
|
20
|
-
}, [n, e]);
|
|
21
|
-
}
|
|
22
|
-
var H = "DismissableLayer", p = "dismissableLayer.update", M = "dismissableLayer.pointerDownOutside", K = "dismissableLayer.focusOutside", g, S = r.createContext({
|
|
23
|
-
layers: /* @__PURE__ */ new Set(),
|
|
24
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
25
|
-
branches: /* @__PURE__ */ new Set()
|
|
26
|
-
}), j = r.forwardRef(
|
|
27
|
-
(t, e) => {
|
|
28
|
-
const {
|
|
29
|
-
disableOutsidePointerEvents: n = !1,
|
|
30
|
-
onEscapeKeyDown: s,
|
|
31
|
-
onPointerDownOutside: i,
|
|
32
|
-
onFocusOutside: a,
|
|
33
|
-
onInteractOutside: l,
|
|
34
|
-
onDismiss: d,
|
|
35
|
-
...E
|
|
36
|
-
} = t, u = r.useContext(S), [c, B] = r.useState(null), f = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = r.useState({}), I = R(e, (o) => B(o)), m = Array.from(u.layers), [W] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), A = m.indexOf(W), P = c ? m.indexOf(c) : -1, N = u.layersWithOutsidePointerEventsDisabled.size > 0, D = P >= A, k = $((o) => {
|
|
37
|
-
const v = o.target, C = [...u.branches].some((y) => y.contains(v));
|
|
38
|
-
!D || C || (i == null || i(o), l == null || l(o), o.defaultPrevented || d == null || d());
|
|
39
|
-
}, f), L = q((o) => {
|
|
40
|
-
const v = o.target;
|
|
41
|
-
[...u.branches].some((y) => y.contains(v)) || (a == null || a(o), l == null || l(o), o.defaultPrevented || d == null || d());
|
|
42
|
-
}, f);
|
|
43
|
-
return z((o) => {
|
|
44
|
-
P === u.layers.size - 1 && (s == null || s(o), !o.defaultPrevented && d && (o.preventDefault(), d()));
|
|
45
|
-
}, f), r.useEffect(() => {
|
|
46
|
-
if (c)
|
|
47
|
-
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (g = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(c)), u.layers.add(c), O(), () => {
|
|
48
|
-
n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = g);
|
|
49
|
-
};
|
|
50
|
-
}, [c, f, n, u]), r.useEffect(() => () => {
|
|
51
|
-
c && (u.layers.delete(c), u.layersWithOutsidePointerEventsDisabled.delete(c), O());
|
|
52
|
-
}, [c, u]), r.useEffect(() => {
|
|
53
|
-
const o = () => F({});
|
|
54
|
-
return document.addEventListener(p, o), () => document.removeEventListener(p, o);
|
|
55
|
-
}, []), /* @__PURE__ */ T(
|
|
56
|
-
w.div,
|
|
57
|
-
{
|
|
58
|
-
...E,
|
|
59
|
-
ref: I,
|
|
60
|
-
style: {
|
|
61
|
-
pointerEvents: N ? D ? "auto" : "none" : void 0,
|
|
62
|
-
...t.style
|
|
63
|
-
},
|
|
64
|
-
onFocusCapture: h(t.onFocusCapture, L.onFocusCapture),
|
|
65
|
-
onBlurCapture: h(t.onBlurCapture, L.onBlurCapture),
|
|
66
|
-
onPointerDownCapture: h(
|
|
67
|
-
t.onPointerDownCapture,
|
|
68
|
-
k.onPointerDownCapture
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
j.displayName = H;
|
|
75
|
-
var X = "DismissableLayerBranch", Y = r.forwardRef((t, e) => {
|
|
76
|
-
const n = r.useContext(S), s = r.useRef(null), i = R(e, s);
|
|
77
|
-
return r.useEffect(() => {
|
|
78
|
-
const a = s.current;
|
|
79
|
-
if (a)
|
|
80
|
-
return n.branches.add(a), () => {
|
|
81
|
-
n.branches.delete(a);
|
|
82
|
-
};
|
|
83
|
-
}, [n.branches]), /* @__PURE__ */ T(w.div, { ...t, ref: i });
|
|
84
|
-
});
|
|
85
|
-
Y.displayName = X;
|
|
86
|
-
function $(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
87
|
-
const n = b(t), s = r.useRef(!1), i = r.useRef(() => {
|
|
88
|
-
});
|
|
89
|
-
return r.useEffect(() => {
|
|
90
|
-
const a = (d) => {
|
|
91
|
-
if (d.target && !s.current) {
|
|
92
|
-
let E = function() {
|
|
93
|
-
x(
|
|
94
|
-
M,
|
|
95
|
-
n,
|
|
96
|
-
u,
|
|
97
|
-
{ discrete: !0 }
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
const u = { originalEvent: d };
|
|
101
|
-
d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = E, e.addEventListener("click", i.current, { once: !0 })) : E();
|
|
102
|
-
} else
|
|
103
|
-
e.removeEventListener("click", i.current);
|
|
104
|
-
s.current = !1;
|
|
105
|
-
}, l = window.setTimeout(() => {
|
|
106
|
-
e.addEventListener("pointerdown", a);
|
|
107
|
-
}, 0);
|
|
108
|
-
return () => {
|
|
109
|
-
window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", i.current);
|
|
110
|
-
};
|
|
111
|
-
}, [e, n]), {
|
|
112
|
-
// ensures we check React component tree (not just DOM tree)
|
|
113
|
-
onPointerDownCapture: () => s.current = !0
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function q(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
117
|
-
const n = b(t), s = r.useRef(!1);
|
|
118
|
-
return r.useEffect(() => {
|
|
119
|
-
const i = (a) => {
|
|
120
|
-
a.target && !s.current && x(K, n, { originalEvent: a }, {
|
|
121
|
-
discrete: !1
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
|
|
125
|
-
}, [e, n]), {
|
|
126
|
-
onFocusCapture: () => s.current = !0,
|
|
127
|
-
onBlurCapture: () => s.current = !1
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function O() {
|
|
131
|
-
const t = new CustomEvent(p);
|
|
132
|
-
document.dispatchEvent(t);
|
|
133
|
-
}
|
|
134
|
-
function x(t, e, n, { discrete: s }) {
|
|
135
|
-
const i = n.originalEvent.target, a = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: n });
|
|
136
|
-
e && i.addEventListener(t, e, { once: !0 }), s ? _(i, a) : i.dispatchEvent(a);
|
|
137
|
-
}
|
|
138
|
-
var G = r[" useId ".trim().toString()] || (() => {
|
|
139
|
-
}), J = 0;
|
|
140
|
-
function Z(t) {
|
|
141
|
-
const [e, n] = r.useState(G());
|
|
142
|
-
return U(() => {
|
|
143
|
-
t || n((s) => s ?? String(J++));
|
|
144
|
-
}, [t]), t || (e ? `radix-${e}` : "");
|
|
145
|
-
}
|
|
146
|
-
export {
|
|
147
|
-
j as D,
|
|
148
|
-
Z as a,
|
|
149
|
-
b as u
|
|
150
|
-
};
|
|
@@ -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 {};
|