@pdf-viewer/react 1.8.0-beta.0 → 1.8.0-beta.1
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 → Popover-1faa77f6.js} +80 -80
- package/dist/RPDefaultLayout-129bfdfc.js +3262 -0
- package/dist/assets/DropDown.css +1 -1
- package/dist/assets/Popover.css +1 -1
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +26 -19
- package/dist/components/RPPages.js +3 -2
- package/dist/components/RPProvider.js +9 -23
- package/dist/components/layout/LayoutContainer.js +3 -2
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +4 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -2
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- 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/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +4 -3
- package/dist/components/layout/toolbar/ZoomTool.js +3 -2
- package/dist/components/page/AnnotationLayer.js +3 -2
- package/dist/components/page/CanvasLayer.js +3 -2
- 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 +3 -2
- package/dist/components/page/TextLayer.js +3 -2
- package/dist/components/ui/DropDown.js +10 -10
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/contexts/DimensionPagesContext.js +27 -26
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +3 -3
- package/dist/contexts/RotationContext.js +21 -16
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/SinglePageRotateContext.js +21 -0
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +18 -16
- package/dist/{th_TH-4af60d36.js → th_TH-f515b3ad.js} +1 -1
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +1 -0
- package/dist/types/contexts/SinglePageRotateContext.d.ts +13 -0
- package/dist/types/locales/zh_CN.json.d.ts +2 -2
- package/dist/types/main.d.ts +2 -1
- package/dist/types/utils/hooks/useSinglePageRotate.d.ts +4 -0
- package/dist/types/utils/types.d.ts +5 -0
- package/dist/utils/getWordPositionInPage.js +21 -14
- package/dist/utils/hooks/useFileDownload.js +3 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +3 -2
- package/dist/utils/hooks/usePresentPage.js +3 -2
- package/dist/utils/hooks/usePrint.js +3 -2
- package/dist/utils/hooks/useScrollToPage.js +3 -2
- package/dist/utils/hooks/useSearch.js +3 -2
- package/dist/utils/hooks/useSinglePageRotate.js +18 -0
- package/dist/utils/hooks/useThumbnail.js +3 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
- package/dist/utils/hooks/useWatermark.js +1 -1
- package/dist/utils/types.js +11 -10
- package/package.json +1 -1
- package/dist/RPDefaultLayout-f02500c9.js +0 -3205
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as _t, jsx as ie } from "react/jsx-runtime";
|
|
2
2
|
import * as P from "react";
|
|
3
|
-
import { useCallback as L, createContext as Y, useMemo as D, createElement as h, useContext as
|
|
3
|
+
import { useCallback as L, createContext as Y, useMemo as D, createElement as h, useContext as be, forwardRef as A, Children as _, isValidElement as k, cloneElement as V, Fragment as Be, useEffect as S, useRef as O, useState as N, useLayoutEffect as me, useReducer as Nt } from "react";
|
|
4
4
|
import Tt, { flushSync as Ue } from "react-dom";
|
|
5
5
|
import { u as Dt, a as Ft, o as Rt, s as It, l as Lt, f as kt, b as Mt, c as Bt, h as Ut } from "./floating-ui.react-dom-15b9b819.js";
|
|
6
|
-
import { c as Wt, _ as
|
|
6
|
+
import { c as Wt, _ as zt, u as Ht, a as K, f as Kt, z as Xt, s as Yt, b as jt, R as Vt, e as Zt, h as Gt } from "./component-1da194e8.js";
|
|
7
7
|
import { c as qt } from "./clsx-0c6e471a.js";
|
|
8
8
|
import './assets/Popover.css';function x() {
|
|
9
9
|
return x = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -50,7 +50,7 @@ function Jt(e, t = []) {
|
|
|
50
50
|
}, f);
|
|
51
51
|
}
|
|
52
52
|
function v(d, $) {
|
|
53
|
-
const f = ($ == null ? void 0 : $[e][s]) || c, y =
|
|
53
|
+
const f = ($ == null ? void 0 : $[e][s]) || c, y = be(f);
|
|
54
54
|
if (y)
|
|
55
55
|
return y;
|
|
56
56
|
if (i !== void 0)
|
|
@@ -230,12 +230,12 @@ const un = /* @__PURE__ */ Y({
|
|
|
230
230
|
branches: /* @__PURE__ */ new Set()
|
|
231
231
|
}), dn = /* @__PURE__ */ A((e, t) => {
|
|
232
232
|
var n;
|
|
233
|
-
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: r, onPointerDownOutside: a, onFocusOutside: i, onInteractOutside: c, onDismiss: s, ...u } = e, v =
|
|
233
|
+
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: r, onPointerDownOutside: a, onFocusOutside: i, onInteractOutside: c, onDismiss: s, ...u } = e, v = be(un), [d, $] = N(null), f = (n = d == null ? void 0 : d.ownerDocument) !== null && n !== void 0 ? n : globalThis == null ? void 0 : globalThis.document, [, y] = N({}), l = Z(
|
|
234
234
|
t,
|
|
235
235
|
(w) => $(w)
|
|
236
|
-
), p = Array.from(v.layers), [
|
|
236
|
+
), p = Array.from(v.layers), [b] = [
|
|
237
237
|
...v.layersWithOutsidePointerEventsDisabled
|
|
238
|
-
].slice(-1), E = p.indexOf(
|
|
238
|
+
].slice(-1), E = p.indexOf(b), g = d ? p.indexOf(d) : -1, m = v.layersWithOutsidePointerEventsDisabled.size > 0, C = g >= E, R = fn((w) => {
|
|
239
239
|
const F = w.target, G = [
|
|
240
240
|
...v.branches
|
|
241
241
|
].some(
|
|
@@ -273,7 +273,7 @@ const un = /* @__PURE__ */ Y({
|
|
|
273
273
|
}, []), /* @__PURE__ */ h(oe.div, x({}, u, {
|
|
274
274
|
ref: l,
|
|
275
275
|
style: {
|
|
276
|
-
pointerEvents:
|
|
276
|
+
pointerEvents: m ? C ? "auto" : "none" : void 0,
|
|
277
277
|
...e.style
|
|
278
278
|
},
|
|
279
279
|
onFocusCapture: B(e.onFocusCapture, T.onFocusCapture),
|
|
@@ -288,7 +288,7 @@ function fn(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
288
288
|
const a = (c) => {
|
|
289
289
|
if (c.target && !o.current) {
|
|
290
290
|
let u = function() {
|
|
291
|
-
|
|
291
|
+
ze(sn, n, s, {
|
|
292
292
|
discrete: !0
|
|
293
293
|
});
|
|
294
294
|
};
|
|
@@ -318,7 +318,7 @@ function vn(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
318
318
|
const n = Pe(e), o = O(!1);
|
|
319
319
|
return S(() => {
|
|
320
320
|
const r = (a) => {
|
|
321
|
-
a.target && !o.current &&
|
|
321
|
+
a.target && !o.current && ze(ln, n, {
|
|
322
322
|
originalEvent: a
|
|
323
323
|
}, {
|
|
324
324
|
discrete: !1
|
|
@@ -337,7 +337,7 @@ function Ae() {
|
|
|
337
337
|
const e = new CustomEvent(ve);
|
|
338
338
|
document.dispatchEvent(e);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ze(e, t, n, { discrete: o }) {
|
|
341
341
|
const r = n.originalEvent.target, a = new CustomEvent(e, {
|
|
342
342
|
bubbles: !1,
|
|
343
343
|
cancelable: !0,
|
|
@@ -396,24 +396,24 @@ const le = "focusScope.autoFocusOnMount", ue = "focusScope.autoFocusOnUnmount",
|
|
|
396
396
|
let l = function(g) {
|
|
397
397
|
if (f.paused || !c)
|
|
398
398
|
return;
|
|
399
|
-
const
|
|
400
|
-
c.contains(
|
|
399
|
+
const m = g.target;
|
|
400
|
+
c.contains(m) ? d.current = m : I(d.current, {
|
|
401
401
|
select: !0
|
|
402
402
|
});
|
|
403
403
|
}, p = function(g) {
|
|
404
404
|
if (f.paused || !c)
|
|
405
405
|
return;
|
|
406
|
-
const
|
|
407
|
-
|
|
406
|
+
const m = g.relatedTarget;
|
|
407
|
+
m !== null && (c.contains(m) || I(d.current, {
|
|
408
408
|
select: !0
|
|
409
409
|
}));
|
|
410
|
-
},
|
|
411
|
-
const
|
|
410
|
+
}, b = function(g) {
|
|
411
|
+
const m = document.activeElement;
|
|
412
412
|
for (const C of g)
|
|
413
|
-
C.removedNodes.length > 0 && (c != null && c.contains(
|
|
413
|
+
C.removedNodes.length > 0 && (c != null && c.contains(m) || I(c));
|
|
414
414
|
};
|
|
415
415
|
document.addEventListener("focusin", l), document.addEventListener("focusout", p);
|
|
416
|
-
const E = new MutationObserver(
|
|
416
|
+
const E = new MutationObserver(b);
|
|
417
417
|
return c && E.observe(c, {
|
|
418
418
|
childList: !0,
|
|
419
419
|
subtree: !0
|
|
@@ -430,15 +430,15 @@ const le = "focusScope.autoFocusOnMount", ue = "focusScope.autoFocusOnUnmount",
|
|
|
430
430
|
Fe.add(f);
|
|
431
431
|
const l = document.activeElement;
|
|
432
432
|
if (!c.contains(l)) {
|
|
433
|
-
const
|
|
434
|
-
c.addEventListener(le, u), c.dispatchEvent(
|
|
433
|
+
const b = new CustomEvent(le, Te);
|
|
434
|
+
c.addEventListener(le, u), c.dispatchEvent(b), b.defaultPrevented || (hn(yn(He(c)), {
|
|
435
435
|
select: !0
|
|
436
436
|
}), document.activeElement === l && I(c));
|
|
437
437
|
}
|
|
438
438
|
return () => {
|
|
439
439
|
c.removeEventListener(le, u), setTimeout(() => {
|
|
440
|
-
const
|
|
441
|
-
c.addEventListener(ue, v), c.dispatchEvent(
|
|
440
|
+
const b = new CustomEvent(ue, Te);
|
|
441
|
+
c.addEventListener(ue, v), c.dispatchEvent(b), b.defaultPrevented || I(l ?? document.body, {
|
|
442
442
|
select: !0
|
|
443
443
|
}), c.removeEventListener(ue, v), Fe.remove(f);
|
|
444
444
|
}, 0);
|
|
@@ -453,14 +453,14 @@ const le = "focusScope.autoFocusOnMount", ue = "focusScope.autoFocusOnUnmount",
|
|
|
453
453
|
const y = L((l) => {
|
|
454
454
|
if (!n && !o || f.paused)
|
|
455
455
|
return;
|
|
456
|
-
const p = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey,
|
|
457
|
-
if (p &&
|
|
458
|
-
const E = l.currentTarget, [g,
|
|
459
|
-
g &&
|
|
456
|
+
const p = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, b = document.activeElement;
|
|
457
|
+
if (p && b) {
|
|
458
|
+
const E = l.currentTarget, [g, m] = bn(E);
|
|
459
|
+
g && m ? !l.shiftKey && b === m ? (l.preventDefault(), n && I(g, {
|
|
460
460
|
select: !0
|
|
461
|
-
})) : l.shiftKey &&
|
|
461
|
+
})) : l.shiftKey && b === g && (l.preventDefault(), n && I(m, {
|
|
462
462
|
select: !0
|
|
463
|
-
})) :
|
|
463
|
+
})) : b === E && l.preventDefault();
|
|
464
464
|
}
|
|
465
465
|
}, [
|
|
466
466
|
n,
|
|
@@ -482,14 +482,14 @@ function hn(e, { select: t = !1 } = {}) {
|
|
|
482
482
|
}), document.activeElement !== n)
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
const t =
|
|
485
|
+
function bn(e) {
|
|
486
|
+
const t = He(e), n = De(t, e), o = De(t.reverse(), e);
|
|
487
487
|
return [
|
|
488
488
|
n,
|
|
489
489
|
o
|
|
490
490
|
];
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function He(e) {
|
|
493
493
|
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
494
494
|
acceptNode: (o) => {
|
|
495
495
|
const r = o.tagName === "INPUT" && o.type === "hidden";
|
|
@@ -502,12 +502,12 @@ function ze(e) {
|
|
|
502
502
|
}
|
|
503
503
|
function De(e, t) {
|
|
504
504
|
for (const n of e)
|
|
505
|
-
if (!
|
|
505
|
+
if (!mn(n, {
|
|
506
506
|
upTo: t
|
|
507
507
|
}))
|
|
508
508
|
return n;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function mn(e, { upTo: t }) {
|
|
511
511
|
if (getComputedStyle(e).visibility === "hidden")
|
|
512
512
|
return !0;
|
|
513
513
|
for (; e; ) {
|
|
@@ -555,7 +555,7 @@ function yn(e) {
|
|
|
555
555
|
(t) => t.tagName !== "A"
|
|
556
556
|
);
|
|
557
557
|
}
|
|
558
|
-
const wn = globalThis != null && globalThis.document ?
|
|
558
|
+
const wn = globalThis != null && globalThis.document ? me : () => {
|
|
559
559
|
}, En = P["useId".toString()] || (() => {
|
|
560
560
|
});
|
|
561
561
|
let Cn = 0;
|
|
@@ -598,7 +598,7 @@ function On(e, t = []) {
|
|
|
598
598
|
}, f);
|
|
599
599
|
}
|
|
600
600
|
function v(d, $) {
|
|
601
|
-
const f = ($ == null ? void 0 : $[e][s]) || c, y =
|
|
601
|
+
const f = ($ == null ? void 0 : $[e][s]) || c, y = be(f);
|
|
602
602
|
if (y)
|
|
603
603
|
return y;
|
|
604
604
|
if (i !== void 0)
|
|
@@ -753,7 +753,7 @@ function Fn(e) {
|
|
|
753
753
|
[]
|
|
754
754
|
);
|
|
755
755
|
}
|
|
756
|
-
const $e = globalThis != null && globalThis.document ?
|
|
756
|
+
const $e = globalThis != null && globalThis.document ? me : () => {
|
|
757
757
|
};
|
|
758
758
|
function Rn(e) {
|
|
759
759
|
const [t, n] = N(void 0);
|
|
@@ -803,15 +803,15 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
803
803
|
}));
|
|
804
804
|
}), Qe = "PopperContent", [Bn, Lo] = Ze(Qe), Un = /* @__PURE__ */ A((e, t) => {
|
|
805
805
|
var n, o, r, a, i, c, s, u;
|
|
806
|
-
const { __scopePopper: v, side: d = "bottom", sideOffset: $ = 0, align: f = "center", alignOffset: y = 0, arrowPadding: l = 0, collisionBoundary: p = [], collisionPadding:
|
|
806
|
+
const { __scopePopper: v, side: d = "bottom", sideOffset: $ = 0, align: f = "center", alignOffset: y = 0, arrowPadding: l = 0, collisionBoundary: p = [], collisionPadding: b = 0, sticky: E = "partial", hideWhenDetached: g = !1, avoidCollisions: m = !0, onPlaced: C, ...R } = e, T = qe(Qe, v), [w, F] = N(null), G = Xe(
|
|
807
807
|
t,
|
|
808
808
|
(ae) => F(ae)
|
|
809
|
-
), [M, dt] = N(null), U = Rn(M), ft = (n = U == null ? void 0 : U.width) !== null && n !== void 0 ? n : 0, Ee = (o = U == null ? void 0 : U.height) !== null && o !== void 0 ? o : 0, vt = d + (f !== "center" ? "-" + f : ""), pt = typeof
|
|
809
|
+
), [M, dt] = N(null), U = Rn(M), ft = (n = U == null ? void 0 : U.width) !== null && n !== void 0 ? n : 0, Ee = (o = U == null ? void 0 : U.height) !== null && o !== void 0 ? o : 0, vt = d + (f !== "center" ? "-" + f : ""), pt = typeof b == "number" ? b : {
|
|
810
810
|
top: 0,
|
|
811
811
|
right: 0,
|
|
812
812
|
bottom: 0,
|
|
813
813
|
left: 0,
|
|
814
|
-
...
|
|
814
|
+
...b
|
|
815
815
|
}, Ce = Array.isArray(p) ? p : [
|
|
816
816
|
p
|
|
817
817
|
], $t = Ce.length > 0, ce = {
|
|
@@ -819,7 +819,7 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
819
819
|
boundary: Ce.filter(Wn),
|
|
820
820
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
821
821
|
altBoundary: $t
|
|
822
|
-
}, { refs: ht, floatingStyles: xe, placement:
|
|
822
|
+
}, { refs: ht, floatingStyles: xe, placement: bt, isPositioned: q, middlewareData: W } = Dt({
|
|
823
823
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
824
824
|
strategy: "fixed",
|
|
825
825
|
placement: vt,
|
|
@@ -832,13 +832,13 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
832
832
|
mainAxis: $ + Ee,
|
|
833
833
|
alignmentAxis: y
|
|
834
834
|
}),
|
|
835
|
-
|
|
835
|
+
m && It({
|
|
836
836
|
mainAxis: !0,
|
|
837
837
|
crossAxis: !1,
|
|
838
838
|
limiter: E === "partial" ? Lt() : void 0,
|
|
839
839
|
...ce
|
|
840
840
|
}),
|
|
841
|
-
|
|
841
|
+
m && kt({
|
|
842
842
|
...ce
|
|
843
843
|
}),
|
|
844
844
|
Mt({
|
|
@@ -852,7 +852,7 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
852
852
|
element: M,
|
|
853
853
|
padding: l
|
|
854
854
|
}),
|
|
855
|
-
|
|
855
|
+
zn({
|
|
856
856
|
arrowWidth: ft,
|
|
857
857
|
arrowHeight: Ee
|
|
858
858
|
}),
|
|
@@ -860,7 +860,7 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
860
860
|
strategy: "referenceHidden"
|
|
861
861
|
})
|
|
862
862
|
]
|
|
863
|
-
}), [Se,
|
|
863
|
+
}), [Se, mt] = Je(bt), Q = Fn(C);
|
|
864
864
|
$e(() => {
|
|
865
865
|
q && (Q == null || Q());
|
|
866
866
|
}, [
|
|
@@ -896,7 +896,7 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
896
896
|
shouldHideArrow: yt
|
|
897
897
|
}, /* @__PURE__ */ h(je.div, x({
|
|
898
898
|
"data-side": Se,
|
|
899
|
-
"data-align":
|
|
899
|
+
"data-align": mt
|
|
900
900
|
}, R, {
|
|
901
901
|
ref: G,
|
|
902
902
|
style: {
|
|
@@ -912,7 +912,7 @@ const Ve = "Popper", [Ze, Ge] = On(Ve), [In, qe] = Ze(Ve), Ln = (e) => {
|
|
|
912
912
|
function Wn(e) {
|
|
913
913
|
return e !== null;
|
|
914
914
|
}
|
|
915
|
-
const
|
|
915
|
+
const zn = (e) => ({
|
|
916
916
|
name: "transformOrigin",
|
|
917
917
|
options: e,
|
|
918
918
|
fn(t) {
|
|
@@ -921,12 +921,12 @@ const Hn = (e) => ({
|
|
|
921
921
|
start: "0%",
|
|
922
922
|
center: "50%",
|
|
923
923
|
end: "100%"
|
|
924
|
-
}[l],
|
|
925
|
-
let g = "",
|
|
926
|
-
return y === "bottom" ? (g = d ? p : `${
|
|
924
|
+
}[l], b = ((o = (r = u.arrow) === null || r === void 0 ? void 0 : r.x) !== null && o !== void 0 ? o : 0) + $ / 2, E = ((a = (i = u.arrow) === null || i === void 0 ? void 0 : i.y) !== null && a !== void 0 ? a : 0) + f / 2;
|
|
925
|
+
let g = "", m = "";
|
|
926
|
+
return y === "bottom" ? (g = d ? p : `${b}px`, m = `${-f}px`) : y === "top" ? (g = d ? p : `${b}px`, m = `${s.floating.height + f}px`) : y === "right" ? (g = `${-f}px`, m = d ? p : `${E}px`) : y === "left" && (g = `${s.floating.width + f}px`, m = d ? p : `${E}px`), {
|
|
927
927
|
data: {
|
|
928
928
|
x: g,
|
|
929
|
-
y:
|
|
929
|
+
y: m
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
}
|
|
@@ -938,13 +938,13 @@ function Je(e) {
|
|
|
938
938
|
n
|
|
939
939
|
];
|
|
940
940
|
}
|
|
941
|
-
const
|
|
941
|
+
const Hn = Ln, Kn = Mn, Xn = Un, Yn = /* @__PURE__ */ A((e, t) => {
|
|
942
942
|
var n;
|
|
943
943
|
const { container: o = globalThis == null || (n = globalThis.document) === null || n === void 0 ? void 0 : n.body, ...r } = e;
|
|
944
944
|
return o ? /* @__PURE__ */ Tt.createPortal(/* @__PURE__ */ h(oe.div, x({}, r, {
|
|
945
945
|
ref: t
|
|
946
946
|
})), o) : null;
|
|
947
|
-
}), Ie = globalThis != null && globalThis.document ?
|
|
947
|
+
}), Ie = globalThis != null && globalThis.document ? me : () => {
|
|
948
948
|
};
|
|
949
949
|
function jn(e, t) {
|
|
950
950
|
return Nt((n, o) => {
|
|
@@ -1070,12 +1070,12 @@ var tt = Wt(), de = function() {
|
|
|
1070
1070
|
onScrollCapture: de,
|
|
1071
1071
|
onWheelCapture: de,
|
|
1072
1072
|
onTouchMoveCapture: de
|
|
1073
|
-
}), r = o[0], a = o[1], i = e.forwardProps, c = e.children, s = e.className, u = e.removeScrollBar, v = e.enabled, d = e.shards, $ = e.sideCar, f = e.noIsolation, y = e.inert, l = e.allowPinchZoom, p = e.as,
|
|
1073
|
+
}), r = o[0], a = o[1], i = e.forwardProps, c = e.children, s = e.className, u = e.removeScrollBar, v = e.enabled, d = e.shards, $ = e.sideCar, f = e.noIsolation, y = e.inert, l = e.allowPinchZoom, p = e.as, b = p === void 0 ? "div" : p, E = zt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), g = $, m = Ht([n, t]), C = K(K({}, E), r);
|
|
1074
1074
|
return P.createElement(
|
|
1075
1075
|
P.Fragment,
|
|
1076
1076
|
null,
|
|
1077
1077
|
v && P.createElement(g, { sideCar: tt, removeScrollBar: u, shards: d, noIsolation: f, inert: y, setCallbacks: a, allowPinchZoom: !!l, lockRef: n }),
|
|
1078
|
-
i ? P.cloneElement(P.Children.only(c), K(K({}, C), { ref:
|
|
1078
|
+
i ? P.cloneElement(P.Children.only(c), K(K({}, C), { ref: m })) : P.createElement(b, K({}, C, { className: s, ref: m }), c)
|
|
1079
1079
|
);
|
|
1080
1080
|
});
|
|
1081
1081
|
re.defaultProps = {
|
|
@@ -1099,7 +1099,7 @@ if (typeof window < "u")
|
|
|
1099
1099
|
} catch {
|
|
1100
1100
|
he = !1;
|
|
1101
1101
|
}
|
|
1102
|
-
var
|
|
1102
|
+
var z = he ? { passive: !1 } : !1, qn = function(e) {
|
|
1103
1103
|
return e.tagName === "TEXTAREA";
|
|
1104
1104
|
}, nt = function(e, t) {
|
|
1105
1105
|
var n = window.getComputedStyle(e);
|
|
@@ -1148,8 +1148,8 @@ var H = he ? { passive: !1 } : !1, qn = function(e) {
|
|
|
1148
1148
|
}, oo = function(e, t, n, o, r) {
|
|
1149
1149
|
var a = no(e, window.getComputedStyle(t).direction), i = a * o, c = n.target, s = t.contains(c), u = !1, v = i > 0, d = 0, $ = 0;
|
|
1150
1150
|
do {
|
|
1151
|
-
var f = rt(e, c), y = f[0], l = f[1], p = f[2],
|
|
1152
|
-
(y ||
|
|
1151
|
+
var f = rt(e, c), y = f[0], l = f[1], p = f[2], b = l - p - a * y;
|
|
1152
|
+
(y || b) && ot(e, c) && (d += b, $ += y), c = c.parentNode;
|
|
1153
1153
|
} while (
|
|
1154
1154
|
// portaled content
|
|
1155
1155
|
!s && c !== document.body || // self content
|
|
@@ -1169,7 +1169,7 @@ var H = he ? { passive: !1 } : !1, qn = function(e) {
|
|
|
1169
1169
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1170
1170
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1171
1171
|
`);
|
|
1172
|
-
}, ao = 0,
|
|
1172
|
+
}, ao = 0, H = [];
|
|
1173
1173
|
function io(e) {
|
|
1174
1174
|
var t = P.useRef([]), n = P.useRef([0, 0]), o = P.useRef(), r = P.useState(ao++)[0], a = P.useState(function() {
|
|
1175
1175
|
return Yt();
|
|
@@ -1192,7 +1192,7 @@ function io(e) {
|
|
|
1192
1192
|
var c = P.useCallback(function(l, p) {
|
|
1193
1193
|
if ("touches" in l && l.touches.length === 2)
|
|
1194
1194
|
return !i.current.allowPinchZoom;
|
|
1195
|
-
var
|
|
1195
|
+
var b = ne(l), E = n.current, g = "deltaX" in l ? l.deltaX : E[0] - b[0], m = "deltaY" in l ? l.deltaY : E[1] - b[1], C, R = l.target, T = Math.abs(g) > Math.abs(m) ? "h" : "v";
|
|
1196
1196
|
if ("touches" in l && T === "h" && R.type === "range")
|
|
1197
1197
|
return !1;
|
|
1198
1198
|
var w = Le(T, R);
|
|
@@ -1200,15 +1200,15 @@ function io(e) {
|
|
|
1200
1200
|
return !0;
|
|
1201
1201
|
if (w ? C = T : (C = T === "v" ? "h" : "v", w = Le(T, R)), !w)
|
|
1202
1202
|
return !1;
|
|
1203
|
-
if (!o.current && "changedTouches" in l && (g ||
|
|
1203
|
+
if (!o.current && "changedTouches" in l && (g || m) && (o.current = C), !C)
|
|
1204
1204
|
return !0;
|
|
1205
1205
|
var F = o.current || C;
|
|
1206
|
-
return oo(F, p, l, F === "h" ? g :
|
|
1206
|
+
return oo(F, p, l, F === "h" ? g : m, !0);
|
|
1207
1207
|
}, []), s = P.useCallback(function(l) {
|
|
1208
1208
|
var p = l;
|
|
1209
|
-
if (!(!
|
|
1210
|
-
var
|
|
1211
|
-
return C.name === p.type && C.target === p.target && ro(C.delta,
|
|
1209
|
+
if (!(!H.length || H[H.length - 1] !== a)) {
|
|
1210
|
+
var b = "deltaY" in p ? ke(p) : ne(p), E = t.current.filter(function(C) {
|
|
1211
|
+
return C.name === p.type && C.target === p.target && ro(C.delta, b);
|
|
1212
1212
|
})[0];
|
|
1213
1213
|
if (E && E.should) {
|
|
1214
1214
|
p.cancelable && p.preventDefault();
|
|
@@ -1217,15 +1217,15 @@ function io(e) {
|
|
|
1217
1217
|
if (!E) {
|
|
1218
1218
|
var g = (i.current.shards || []).map(Me).filter(Boolean).filter(function(C) {
|
|
1219
1219
|
return C.contains(p.target);
|
|
1220
|
-
}),
|
|
1221
|
-
|
|
1220
|
+
}), m = g.length > 0 ? c(p, g[0]) : !i.current.noIsolation;
|
|
1221
|
+
m && p.cancelable && p.preventDefault();
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
}, []), u = P.useCallback(function(l, p,
|
|
1225
|
-
var g = { name: l, delta: p, target:
|
|
1224
|
+
}, []), u = P.useCallback(function(l, p, b, E) {
|
|
1225
|
+
var g = { name: l, delta: p, target: b, should: E };
|
|
1226
1226
|
t.current.push(g), setTimeout(function() {
|
|
1227
|
-
t.current = t.current.filter(function(
|
|
1228
|
-
return
|
|
1227
|
+
t.current = t.current.filter(function(m) {
|
|
1228
|
+
return m !== g;
|
|
1229
1229
|
});
|
|
1230
1230
|
}, 1);
|
|
1231
1231
|
}, []), v = P.useCallback(function(l) {
|
|
@@ -1236,14 +1236,14 @@ function io(e) {
|
|
|
1236
1236
|
u(l.type, ne(l), l.target, c(l, e.lockRef.current));
|
|
1237
1237
|
}, []);
|
|
1238
1238
|
P.useEffect(function() {
|
|
1239
|
-
return
|
|
1239
|
+
return H.push(a), e.setCallbacks({
|
|
1240
1240
|
onScrollCapture: d,
|
|
1241
1241
|
onWheelCapture: d,
|
|
1242
1242
|
onTouchMoveCapture: $
|
|
1243
|
-
}), document.addEventListener("wheel", s,
|
|
1244
|
-
|
|
1243
|
+
}), document.addEventListener("wheel", s, z), document.addEventListener("touchmove", s, z), document.addEventListener("touchstart", v, z), function() {
|
|
1244
|
+
H = H.filter(function(l) {
|
|
1245
1245
|
return l !== a;
|
|
1246
|
-
}), document.removeEventListener("wheel", s,
|
|
1246
|
+
}), document.removeEventListener("wheel", s, z), document.removeEventListener("touchmove", s, z), document.removeEventListener("touchstart", v, z);
|
|
1247
1247
|
};
|
|
1248
1248
|
}, []);
|
|
1249
1249
|
var f = e.removeScrollBar, y = e.inert;
|
|
@@ -1267,7 +1267,7 @@ const lo = ct, at = "Popover", [it, ko] = Jt(at, [
|
|
|
1267
1267
|
defaultProp: r,
|
|
1268
1268
|
onChange: a
|
|
1269
1269
|
});
|
|
1270
|
-
return /* @__PURE__ */ h(
|
|
1270
|
+
return /* @__PURE__ */ h(Hn, c, /* @__PURE__ */ h(uo, {
|
|
1271
1271
|
scope: t,
|
|
1272
1272
|
contentId: xn(),
|
|
1273
1273
|
triggerRef: s,
|
|
@@ -1308,7 +1308,7 @@ const lo = ct, at = "Popover", [it, ko] = Jt(at, [
|
|
|
1308
1308
|
}, a), c);
|
|
1309
1309
|
}), st = "PopoverPortal", [$o, ho] = it(st, {
|
|
1310
1310
|
forceMount: void 0
|
|
1311
|
-
}),
|
|
1311
|
+
}), bo = (e) => {
|
|
1312
1312
|
const { __scopePopover: t, forceMount: n, children: o, container: r } = e, a = X(st, t);
|
|
1313
1313
|
return /* @__PURE__ */ h($o, {
|
|
1314
1314
|
scope: t,
|
|
@@ -1319,7 +1319,7 @@ const lo = ct, at = "Popover", [it, ko] = Jt(at, [
|
|
|
1319
1319
|
asChild: !0,
|
|
1320
1320
|
container: r
|
|
1321
1321
|
}, o)));
|
|
1322
|
-
}, j = "PopoverContent",
|
|
1322
|
+
}, j = "PopoverContent", mo = /* @__PURE__ */ A((e, t) => {
|
|
1323
1323
|
const n = ho(j, e.__scopePopover), { forceMount: o = n.forceMount, ...r } = e, a = X(j, e.__scopePopover);
|
|
1324
1324
|
return /* @__PURE__ */ h(ye, {
|
|
1325
1325
|
present: o || a.open
|
|
@@ -1415,13 +1415,13 @@ const lo = ct, at = "Popover", [it, ko] = Jt(at, [
|
|
|
1415
1415
|
function ut(e) {
|
|
1416
1416
|
return e ? "open" : "closed";
|
|
1417
1417
|
}
|
|
1418
|
-
const yo = fo, wo = po, Eo =
|
|
1419
|
-
"rp-popover-content": "_rp-popover-
|
|
1418
|
+
const yo = fo, wo = po, Eo = bo, Co = mo, xo = "_slideDownAndFade_v492z_1", So = "_slideLeftAndFade_v492z_1", Oo = "_slideUpAndFade_v492z_1", Ao = "_slideRightAndFade_v492z_1", _o = {
|
|
1419
|
+
"rp-popover-content": "_rp-popover-content_v492z_1",
|
|
1420
1420
|
slideDownAndFade: xo,
|
|
1421
1421
|
slideLeftAndFade: So,
|
|
1422
1422
|
slideUpAndFade: Oo,
|
|
1423
1423
|
slideRightAndFade: Ao,
|
|
1424
|
-
"rp-popover-arrow": "_rp-popover-
|
|
1424
|
+
"rp-popover-arrow": "_rp-popover-arrow_v492z_31"
|
|
1425
1425
|
}, Mo = (e) => {
|
|
1426
1426
|
const { triggerComponent: t, children: n, container: o, className: r, open: a, ...i } = e;
|
|
1427
1427
|
return /* @__PURE__ */ _t(yo, { modal: !1, open: a, children: [
|