@pdf-viewer/react 1.5.0-beta.4 → 1.5.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/Popover-b7402893.js +1445 -0
- package/dist/{RPDefaultLayout-6ad40e50.js → RPDefaultLayout-6f52691a.js} +146 -144
- package/dist/component-1da194e8.js +337 -0
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/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 +1 -1
- 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/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +47 -46
- 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-15b9b819.js +1310 -0
- package/dist/{index-48ca3f30.js → index-1cb41342.js} +9 -9
- package/dist/index-7279fb4e.js +1557 -0
- package/dist/index-aa2d3884.js +140 -0
- package/dist/main.js +1 -1
- 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/package.json +1 -1
- package/dist/Popover-d11ec15c.js +0 -3061
- package/dist/floating-ui.react-dom-88a86594.js +0 -1447
- package/dist/index-4ba3ab9a.js +0 -1877
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { e as j, a as A, f as B, P as S, c as _, g as H, h as K } from "../../index-1cb41342.js";
|
|
4
4
|
import { CheckIcon as L } from "../icons/CheckIcon.js";
|
|
5
5
|
import '../../assets/Checkbox.css';function q(e) {
|
|
6
6
|
const r = c.useRef({ value: e, previous: e });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { R as l, T as c, P as p, C as _ } from "../../index-
|
|
2
|
+
import { R as l, T as c, P as p, C as _ } from "../../index-7279fb4e.js";
|
|
3
3
|
import { c as m } from "../../clsx-0c6e471a.js";
|
|
4
4
|
import '../../assets/DropDown.css';const A = "_slideDownAndFade_d12em_1", F = "_slideLeftAndFade_d12em_1", w = "_slideUpAndFade_d12em_1", f = "_slideRightAndFade_d12em_1", g = {
|
|
5
5
|
"rp-dropdown-content": "_rp-dropdown-content_d12em_1",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as d, jsxs as j } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import { forwardRef as We } from "react";
|
|
4
|
-
import { P as O,
|
|
5
|
-
import { u as Ue,
|
|
4
|
+
import { P as O, e as ae, a as k, h as Ye, u as Be, b as oe, f as Ge, c as E, g as Xe, S as Ve } from "../../index-1cb41342.js";
|
|
5
|
+
import { u as Ue, D as qe } from "../../index-aa2d3884.js";
|
|
6
|
+
import { u as ze, a as Ze, o as Ke, s as Je, f as Qe, b as et, c as tt, h as rt, l as ot } from "../../floating-ui.react-dom-15b9b819.js";
|
|
6
7
|
import '../../assets/RPTooltip.css';var nt = "Arrow", se = a.forwardRef((e, r) => {
|
|
7
8
|
const { children: t, width: o = 10, height: n = 5, ...s } = e;
|
|
8
9
|
return /* @__PURE__ */ d(
|
|
@@ -47,46 +48,46 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
47
48
|
collisionBoundary: p = [],
|
|
48
49
|
collisionPadding: c = 0,
|
|
49
50
|
sticky: f = "partial",
|
|
50
|
-
hideWhenDetached:
|
|
51
|
+
hideWhenDetached: g = !1,
|
|
51
52
|
updatePositionStrategy: u = "optimized",
|
|
52
53
|
onPlaced: v,
|
|
53
|
-
...
|
|
54
|
+
...m
|
|
54
55
|
} = e, y = ce(G, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = Ye(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (s !== "center" ? "-" + s : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(p) ? p : [p], _e = U.length > 0, S = {
|
|
55
56
|
padding: Re,
|
|
56
57
|
boundary: U.filter(dt),
|
|
57
58
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
58
59
|
altBoundary: _e
|
|
59
|
-
}, { refs: Oe, floatingStyles: q, placement: Ne, isPositioned: D, middlewareData: A } =
|
|
60
|
+
}, { refs: Oe, floatingStyles: q, placement: Ne, isPositioned: D, middlewareData: A } = ze({
|
|
60
61
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
61
62
|
strategy: "fixed",
|
|
62
63
|
placement: Ee,
|
|
63
|
-
whileElementsMounted: (..._) =>
|
|
64
|
+
whileElementsMounted: (..._) => Ze(..._, {
|
|
64
65
|
animationFrame: u === "always"
|
|
65
66
|
}),
|
|
66
67
|
elements: {
|
|
67
68
|
reference: y.anchor
|
|
68
69
|
},
|
|
69
70
|
middleware: [
|
|
70
|
-
|
|
71
|
-
l &&
|
|
71
|
+
Ke({ mainAxis: n + V, alignmentAxis: i }),
|
|
72
|
+
l && Je({
|
|
72
73
|
mainAxis: !0,
|
|
73
74
|
crossAxis: !1,
|
|
74
|
-
limiter: f === "partial" ?
|
|
75
|
+
limiter: f === "partial" ? ot() : void 0,
|
|
75
76
|
...S
|
|
76
77
|
}),
|
|
77
|
-
l &&
|
|
78
|
-
|
|
78
|
+
l && Qe({ ...S }),
|
|
79
|
+
et({
|
|
79
80
|
...S,
|
|
80
81
|
apply: ({ elements: _, rects: re, availableWidth: Me, availableHeight: $e }) => {
|
|
81
82
|
const { width: Fe, height: je } = re.reference, I = _.floating.style;
|
|
82
83
|
I.setProperty("--radix-popper-available-width", `${Me}px`), I.setProperty("--radix-popper-available-height", `${$e}px`), I.setProperty("--radix-popper-anchor-width", `${Fe}px`), I.setProperty("--radix-popper-anchor-height", `${je}px`);
|
|
83
84
|
}
|
|
84
85
|
}),
|
|
85
|
-
C &&
|
|
86
|
+
C && tt({ element: C, padding: h }),
|
|
86
87
|
pt({ arrowWidth: N, arrowHeight: V }),
|
|
87
|
-
|
|
88
|
+
g && rt({ strategy: "referenceHidden", ...S })
|
|
88
89
|
]
|
|
89
|
-
}), [z, Se] =
|
|
90
|
+
}), [z, Se] = me(Ne), H = Be(v);
|
|
90
91
|
oe(() => {
|
|
91
92
|
D && (H == null || H());
|
|
92
93
|
}, [D, H]);
|
|
@@ -131,10 +132,10 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
131
132
|
{
|
|
132
133
|
"data-side": z,
|
|
133
134
|
"data-align": Se,
|
|
134
|
-
...
|
|
135
|
+
...m,
|
|
135
136
|
ref: T,
|
|
136
137
|
style: {
|
|
137
|
-
...
|
|
138
|
+
...m.style,
|
|
138
139
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
139
140
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
140
141
|
animation: D ? void 0 : "none"
|
|
@@ -207,16 +208,16 @@ var pt = (e) => ({
|
|
|
207
208
|
options: e,
|
|
208
209
|
fn(r) {
|
|
209
210
|
var y, w, x;
|
|
210
|
-
const { placement: t, rects: o, middlewareData: n } = r, i = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [p, c] =
|
|
211
|
-
let v = "",
|
|
212
|
-
return p === "bottom" ? (v = i ? f : `${
|
|
211
|
+
const { placement: t, rects: o, middlewareData: n } = r, i = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [p, c] = me(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + l / 2;
|
|
212
|
+
let v = "", m = "";
|
|
213
|
+
return p === "bottom" ? (v = i ? f : `${g}px`, m = `${-l}px`) : p === "top" ? (v = i ? f : `${g}px`, m = `${o.floating.height + l}px`) : p === "right" ? (v = `${-l}px`, m = i ? f : `${u}px`) : p === "left" && (v = `${o.floating.width + l}px`, m = i ? f : `${u}px`), { data: { x: v, y: m } };
|
|
213
214
|
}
|
|
214
215
|
});
|
|
215
|
-
function
|
|
216
|
+
function me(e) {
|
|
216
217
|
const [r, t = "center"] = e.split("-");
|
|
217
218
|
return [r, t];
|
|
218
219
|
}
|
|
219
|
-
var ut = de, ft = ue, ht = fe, vt = ve,
|
|
220
|
+
var ut = de, ft = ue, ht = fe, vt = ve, mt = "VisuallyHidden", ge = a.forwardRef(
|
|
220
221
|
(e, r) => /* @__PURE__ */ d(
|
|
221
222
|
O.span,
|
|
222
223
|
{
|
|
@@ -239,8 +240,8 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = "VisuallyHidden", me = a.forwardRef
|
|
|
239
240
|
}
|
|
240
241
|
)
|
|
241
242
|
);
|
|
242
|
-
|
|
243
|
-
var
|
|
243
|
+
ge.displayName = mt;
|
|
244
|
+
var gt = ge, [L, Wt] = ae("Tooltip", [
|
|
244
245
|
le
|
|
245
246
|
]), M = le(), ye = "TooltipProvider", yt = 700, W = "tooltip.open", [wt, X] = L(ye), we = (e) => {
|
|
246
247
|
const {
|
|
@@ -287,7 +288,7 @@ var $ = "Tooltip", [xt, F] = L($), xe = (e) => {
|
|
|
287
288
|
onOpenChange: s,
|
|
288
289
|
disableHoverableContent: i,
|
|
289
290
|
delayDuration: h
|
|
290
|
-
} = e, l = X($, e.__scopeTooltip), p = M(r), [c, f] = a.useState(null),
|
|
291
|
+
} = e, l = X($, e.__scopeTooltip), p = M(r), [c, f] = a.useState(null), g = Ue(), u = a.useRef(0), v = i ?? l.disableHoverableContent, m = h ?? l.delayDuration, y = a.useRef(!1), [w = !1, x] = Ge({
|
|
291
292
|
prop: o,
|
|
292
293
|
defaultProp: n,
|
|
293
294
|
onChange: (N) => {
|
|
@@ -300,15 +301,15 @@ var $ = "Tooltip", [xt, F] = L($), xe = (e) => {
|
|
|
300
301
|
}, [x]), P = a.useCallback(() => {
|
|
301
302
|
window.clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
302
303
|
y.current = !0, x(!0), u.current = 0;
|
|
303
|
-
},
|
|
304
|
-
}, [
|
|
304
|
+
}, m);
|
|
305
|
+
}, [m, x]);
|
|
305
306
|
return a.useEffect(() => () => {
|
|
306
307
|
u.current && (window.clearTimeout(u.current), u.current = 0);
|
|
307
308
|
}, []), /* @__PURE__ */ d(ut, { ...p, children: /* @__PURE__ */ d(
|
|
308
309
|
xt,
|
|
309
310
|
{
|
|
310
311
|
scope: r,
|
|
311
|
-
contentId:
|
|
312
|
+
contentId: g,
|
|
312
313
|
open: w,
|
|
313
314
|
stateAttribute: T,
|
|
314
315
|
trigger: c,
|
|
@@ -337,8 +338,8 @@ var Y = "TooltipTrigger", Ce = a.forwardRef(
|
|
|
337
338
|
"data-state": n.stateAttribute,
|
|
338
339
|
...o,
|
|
339
340
|
ref: l,
|
|
340
|
-
onPointerMove: E(e.onPointerMove, (
|
|
341
|
-
|
|
341
|
+
onPointerMove: E(e.onPointerMove, (g) => {
|
|
342
|
+
g.pointerType !== "touch" && !c.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
|
|
342
343
|
}),
|
|
343
344
|
onPointerLeave: E(e.onPointerLeave, () => {
|
|
344
345
|
n.onTriggerLeave(), c.current = !1;
|
|
@@ -356,7 +357,7 @@ var Y = "TooltipTrigger", Ce = a.forwardRef(
|
|
|
356
357
|
}
|
|
357
358
|
);
|
|
358
359
|
Ce.displayName = Y;
|
|
359
|
-
var Ct = "TooltipPortal", [
|
|
360
|
+
var Ct = "TooltipPortal", [Yt, Pt] = L(Ct, {
|
|
360
361
|
forceMount: void 0
|
|
361
362
|
}), R = "TooltipContent", Pe = a.forwardRef(
|
|
362
363
|
(e, r) => {
|
|
@@ -364,31 +365,31 @@ var Ct = "TooltipPortal", [Wt, Pt] = L(Ct, {
|
|
|
364
365
|
return /* @__PURE__ */ d(Xe, { present: o || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ d(Te, { side: n, ...s, ref: r }) : /* @__PURE__ */ d(Tt, { side: n, ...s, ref: r }) });
|
|
365
366
|
}
|
|
366
367
|
), Tt = a.forwardRef((e, r) => {
|
|
367
|
-
const t = F(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), s = k(r, n), [i, h] = a.useState(null), { trigger: l, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = o,
|
|
368
|
+
const t = F(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), s = k(r, n), [i, h] = a.useState(null), { trigger: l, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = o, g = a.useCallback(() => {
|
|
368
369
|
h(null), f(!1);
|
|
369
370
|
}, [f]), u = a.useCallback(
|
|
370
|
-
(v,
|
|
371
|
-
const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = Et(w, y.getBoundingClientRect()), T = Rt(w, x), C = _t(
|
|
371
|
+
(v, m) => {
|
|
372
|
+
const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = Et(w, y.getBoundingClientRect()), T = Rt(w, x), C = _t(m.getBoundingClientRect()), b = Nt([...T, ...C]);
|
|
372
373
|
h(b), f(!0);
|
|
373
374
|
},
|
|
374
375
|
[f]
|
|
375
376
|
);
|
|
376
|
-
return a.useEffect(() => () =>
|
|
377
|
+
return a.useEffect(() => () => g(), [g]), a.useEffect(() => {
|
|
377
378
|
if (l && c) {
|
|
378
|
-
const v = (y) => u(y, c),
|
|
379
|
-
return l.addEventListener("pointerleave", v), c.addEventListener("pointerleave",
|
|
380
|
-
l.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave",
|
|
379
|
+
const v = (y) => u(y, c), m = (y) => u(y, l);
|
|
380
|
+
return l.addEventListener("pointerleave", v), c.addEventListener("pointerleave", m), () => {
|
|
381
|
+
l.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", m);
|
|
381
382
|
};
|
|
382
383
|
}
|
|
383
|
-
}, [l, c, u,
|
|
384
|
+
}, [l, c, u, g]), a.useEffect(() => {
|
|
384
385
|
if (i) {
|
|
385
|
-
const v = (
|
|
386
|
-
const y =
|
|
387
|
-
x ?
|
|
386
|
+
const v = (m) => {
|
|
387
|
+
const y = m.target, w = { x: m.clientX, y: m.clientY }, x = (l == null ? void 0 : l.contains(y)) || (c == null ? void 0 : c.contains(y)), T = !Ot(w, i);
|
|
388
|
+
x ? g() : T && (g(), p());
|
|
388
389
|
};
|
|
389
390
|
return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
|
|
390
391
|
}
|
|
391
|
-
}, [l, c, i, p,
|
|
392
|
+
}, [l, c, i, p, g]), /* @__PURE__ */ d(Te, { ...e, ref: s });
|
|
392
393
|
}), [bt, At] = L($, { isInside: !1 }), Te = a.forwardRef(
|
|
393
394
|
(e, r) => {
|
|
394
395
|
const {
|
|
@@ -401,14 +402,14 @@ var Ct = "TooltipPortal", [Wt, Pt] = L(Ct, {
|
|
|
401
402
|
} = e, l = F(R, t), p = M(t), { onClose: c } = l;
|
|
402
403
|
return a.useEffect(() => (document.addEventListener(W, c), () => document.removeEventListener(W, c)), [c]), a.useEffect(() => {
|
|
403
404
|
if (l.trigger) {
|
|
404
|
-
const f = (
|
|
405
|
-
const u =
|
|
405
|
+
const f = (g) => {
|
|
406
|
+
const u = g.target;
|
|
406
407
|
u != null && u.contains(l.trigger) && c();
|
|
407
408
|
};
|
|
408
409
|
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
409
410
|
}
|
|
410
411
|
}, [l.trigger, c]), /* @__PURE__ */ d(
|
|
411
|
-
|
|
412
|
+
qe,
|
|
412
413
|
{
|
|
413
414
|
asChild: !0,
|
|
414
415
|
disableOutsidePointerEvents: !1,
|
|
@@ -433,7 +434,7 @@ var Ct = "TooltipPortal", [Wt, Pt] = L(Ct, {
|
|
|
433
434
|
},
|
|
434
435
|
children: [
|
|
435
436
|
/* @__PURE__ */ d(Ve, { children: o }),
|
|
436
|
-
/* @__PURE__ */ d(bt, { scope: t, isInside: !0, children: /* @__PURE__ */ d(
|
|
437
|
+
/* @__PURE__ */ d(bt, { scope: t, isInside: !0, children: /* @__PURE__ */ d(gt, { id: l.contentId, role: "tooltip", children: n || o }) })
|
|
437
438
|
]
|
|
438
439
|
}
|
|
439
440
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { h as e, P as m, u as p } from "../RPDefaultLayout-
|
|
3
|
+
import { h as e, P as m, u as p } from "../RPDefaultLayout-6f52691a.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
export {
|