@react-pdf-kit/viewer 2.7.1-rc.0 → 2.7.1-rc.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/{Button-BNlmxWrV.js → Button-DBu3SaMk.js} +1 -1
- package/dist/{Checkbox-Brta-YKG.js → Checkbox-Cl-BpoFJ.js} +4 -4
- package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
- package/dist/{Container-BxNZX82X.js → Container-BuamPhw4.js} +1 -1
- package/dist/{DocumentDialog-C9G7lVTh.js → DocumentDialog-cRr9sSSH.js} +4 -4
- package/dist/{DropDown-DikL-krI.js → DropDown-D6c4mnJL.js} +2 -2
- package/dist/{Input-DjSWOjCI.js → Input-Dpo1Xfxe.js} +1 -1
- package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
- package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-Bzzf28Xv.js} +1 -1
- package/dist/{MenuItem-BJDWfzAw.js → MenuItem-BP_RjUuW.js} +2 -2
- package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-Df2Dzzea.js} +1 -1
- package/dist/{PasswordModal-CB9Rd2zJ.js → PasswordModal-BtHVvrMg.js} +1 -1
- package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
- package/dist/{RPPages-CmXHTAqF.js → RPPages-DeA52_rv.js} +10 -10
- package/dist/RPTooltip-B4KrW-_f.js +568 -0
- package/dist/{Thumbnail-CzclS3h_.js → Thumbnail-DyRfHsAh.js} +2 -2
- package/dist/{Thumbnails-DnAsrttK.js → Thumbnails-Cbr54TOa.js} +1 -1
- package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/icons/LoaderIcon.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +3 -3
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
- package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
- package/dist/components/layout/toolbar/FullScreenTool.js +5 -4
- 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 +4 -4
- package/dist/components/layout/toolbar/OtherTool.js +6 -6
- package/dist/components/layout/toolbar/Paginate.js +3 -3
- package/dist/components/layout/toolbar/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +6 -6
- package/dist/components/layout/toolbar/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +4 -4
- package/dist/components/layout/toolbar/ZoomTool.js +7 -7
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
- package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/InputPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/Input.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +1 -1
- package/dist/components/ui/RPTooltip.js +1 -1
- package/dist/contexts/LoaderContext.js +1 -1
- package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
- package/dist/{dist-C3WNMuW2.js → dist-CHiIt8ey.js} +2 -2
- package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
- package/dist/dist-Ch2NetCM.js +1134 -0
- package/dist/floating-ui.react-dom-DWNOhDoc.js +1096 -0
- package/dist/icons.js +1 -1
- package/dist/{main-CKr9unOk.js → main-BVY8P7qz.js} +2 -2
- package/dist/main.js +4 -4
- package/dist/utils/hooks/useLicense.js +1 -1
- package/package.json +1 -1
- package/dist/RPTooltip-ZZoFqP7C.js +0 -381
- package/dist/dist-7FA4Do6I.js +0 -1286
- package/dist/dist-CKteKPPA.js +0 -947
package/dist/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./LoaderIcon-
|
|
1
|
+
import { t as e } from "./LoaderIcon-B3ddfd0D.js";
|
|
2
2
|
import { ChevronUpIcon as t } from "./components/icons/ChevronUpIcon.js";
|
|
3
3
|
import { FileUploadDefaultIcon as n } from "./components/icons/FileUploadDefaultIcon.js";
|
|
4
4
|
import { MoonIcon as r } from "./components/icons/MoonIcon.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useViewModeContext as e } from "./contexts/ViewModeContext.js";
|
|
2
2
|
import { r as t } from "./PaginationContext-Cwf8sCpK.js";
|
|
3
3
|
import { useLocalizationContext as n } from "./contexts/LocalizationContext.js";
|
|
4
|
-
import { t as r } from "./Button-
|
|
5
|
-
import { t as i } from "./RPTooltip-
|
|
4
|
+
import { t as r } from "./Button-DBu3SaMk.js";
|
|
5
|
+
import { t as i } from "./RPTooltip-B4KrW-_f.js";
|
|
6
6
|
import { DualPageWithCoverIcon as a } from "./components/icons/DualPageWithCoverIcon.js";
|
|
7
7
|
import { GoToDownIcon as o } from "./components/icons/GoToDownIcon.js";
|
|
8
8
|
import { t as s } from "./MostPageTool.module-BRVv-sGz.js";
|
package/dist/main.js
CHANGED
|
@@ -16,12 +16,12 @@ import { useHighlightContext as y } from "./contexts/HighlightContext.js";
|
|
|
16
16
|
import { useElementPageContext as b } from "./contexts/ElementPageContext.js";
|
|
17
17
|
import { useElementThumbnailContext as x } from "./contexts/ElementThumbnailContext.js";
|
|
18
18
|
import { RPProvider as S } from "./components/RPProvider.js";
|
|
19
|
-
import { t as C } from "./RPPages-
|
|
19
|
+
import { t as C } from "./RPPages-DeA52_rv.js";
|
|
20
20
|
import { useFileDownload as w } from "./utils/hooks/useFileDownload.js";
|
|
21
21
|
import { RPTheme as T } from "./components/RPTheme.js";
|
|
22
22
|
import { RPConfig as E } from "./components/RPConfig.js";
|
|
23
|
-
import { t as D } from "./Button-
|
|
24
|
-
import { t as O } from "./RPTooltip-
|
|
23
|
+
import { t as D } from "./Button-DBu3SaMk.js";
|
|
24
|
+
import { t as O } from "./RPTooltip-B4KrW-_f.js";
|
|
25
25
|
import { SearchTool as k } from "./components/layout/toolbar/SearchTool.js";
|
|
26
26
|
import { RPDefaultLayout as A } from "./components/layout/RPDefaultLayout.js";
|
|
27
27
|
import { RPVerticalBar as j } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
|
|
@@ -46,7 +46,7 @@ import { RotateCounterclockwiseTool as Y } from "./components/layout/toolbar/too
|
|
|
46
46
|
import { SelectionModeSwitcherTool as X } from "./components/layout/toolbar/tools/SelectionModeSwitcherTool.js";
|
|
47
47
|
import { SinglePageTool as Z } from "./components/layout/toolbar/tools/SinglePageTool.js";
|
|
48
48
|
import { DualPageTool as Q } from "./components/layout/toolbar/tools/DualPageTool.js";
|
|
49
|
-
import { n as $, r as ee, t as te } from "./main-
|
|
49
|
+
import { n as $, r as ee, t as te } from "./main-BVY8P7qz.js";
|
|
50
50
|
import { PageScrollingTool as ne } from "./components/layout/toolbar/tools/PageScrollingTool.js";
|
|
51
51
|
import { VerticalScrollingTool as re } from "./components/layout/toolbar/tools/VerticalScrollingTool.js";
|
|
52
52
|
import { HorizontalScrollingTool as ie } from "./components/layout/toolbar/tools/HorizontalScrollingTool.js";
|
|
@@ -3,7 +3,7 @@ import { LicenseType as t } from "../types.js";
|
|
|
3
3
|
import { appConsole as n } from "../appConsole.js";
|
|
4
4
|
import { useCallback as r, useEffect as i, useState as a } from "react";
|
|
5
5
|
//#region lib/utils/hooks/useLicense.ts
|
|
6
|
-
var o = /* @__PURE__ */ new Date("2026-06-
|
|
6
|
+
var o = /* @__PURE__ */ new Date("2026-06-15T06:45:06.920Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
|
|
7
7
|
invalidLicense: `You are currently using without a valid license. ${c}`,
|
|
8
8
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${c}`,
|
|
9
9
|
expired: `Your license key has expired. ${c}`,
|
package/package.json
CHANGED
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import { withRef as e } from "./utils/withRef.js";
|
|
2
|
-
import { d as t, f as n, i as r, l as i, n as a, s as o, t as s } from "./dist-bK-AHWLF.js";
|
|
3
|
-
import { n as c, r as l, t as u } from "./dist-BRVqFn7R.js";
|
|
4
|
-
import { a as d, i as f, n as p, r as m, t as h } from "./dist-7FA4Do6I.js";
|
|
5
|
-
import * as g from "react";
|
|
6
|
-
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
-
import './assets/RPTooltip.css';//#region node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@18.3.7_@types+react@18.3.27__@ty_a0e385f362a25de1e1388c87472ea469/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
8
|
-
var y = Object.freeze({
|
|
9
|
-
position: "absolute",
|
|
10
|
-
border: 0,
|
|
11
|
-
width: 1,
|
|
12
|
-
height: 1,
|
|
13
|
-
padding: 0,
|
|
14
|
-
margin: -1,
|
|
15
|
-
overflow: "hidden",
|
|
16
|
-
clip: "rect(0, 0, 0, 0)",
|
|
17
|
-
whiteSpace: "nowrap",
|
|
18
|
-
wordWrap: "normal"
|
|
19
|
-
}), b = "VisuallyHidden", x = g.forwardRef((e, t) => /* @__PURE__ */ _(r.span, {
|
|
20
|
-
...e,
|
|
21
|
-
ref: t,
|
|
22
|
-
style: {
|
|
23
|
-
...y,
|
|
24
|
-
...e.style
|
|
25
|
-
}
|
|
26
|
-
}));
|
|
27
|
-
x.displayName = b;
|
|
28
|
-
var S = x, [C, w] = i("Tooltip", [d]), T = d(), E = "TooltipProvider", D = 700, O = "tooltip.open", [k, A] = C(E), j = (e) => {
|
|
29
|
-
let { __scopeTooltip: t, delayDuration: n = D, skipDelayDuration: r = 300, disableHoverableContent: i = !1, children: a } = e, o = g.useRef(!0), s = g.useRef(!1), c = g.useRef(0);
|
|
30
|
-
return g.useEffect(() => {
|
|
31
|
-
let e = c.current;
|
|
32
|
-
return () => window.clearTimeout(e);
|
|
33
|
-
}, []), /* @__PURE__ */ _(k, {
|
|
34
|
-
scope: t,
|
|
35
|
-
isOpenDelayedRef: o,
|
|
36
|
-
delayDuration: n,
|
|
37
|
-
onOpen: g.useCallback(() => {
|
|
38
|
-
window.clearTimeout(c.current), o.current = !1;
|
|
39
|
-
}, []),
|
|
40
|
-
onClose: g.useCallback(() => {
|
|
41
|
-
window.clearTimeout(c.current), c.current = window.setTimeout(() => o.current = !0, r);
|
|
42
|
-
}, [r]),
|
|
43
|
-
isPointerInTransitRef: s,
|
|
44
|
-
onPointerInTransitChange: g.useCallback((e) => {
|
|
45
|
-
s.current = e;
|
|
46
|
-
}, []),
|
|
47
|
-
disableHoverableContent: i,
|
|
48
|
-
children: a
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
j.displayName = E;
|
|
52
|
-
var M = "Tooltip", [N, P] = C(M), F = (e) => {
|
|
53
|
-
let { __scopeTooltip: t, children: n, open: r, defaultOpen: i, onOpenChange: a, disableHoverableContent: o, delayDuration: l } = e, u = A(M, e.__scopeTooltip), d = T(t), [p, m] = g.useState(null), h = c(), v = g.useRef(0), y = o ?? u.disableHoverableContent, b = l ?? u.delayDuration, x = g.useRef(!1), [S, C] = s({
|
|
54
|
-
prop: r,
|
|
55
|
-
defaultProp: i ?? !1,
|
|
56
|
-
onChange: (e) => {
|
|
57
|
-
e ? (u.onOpen(), document.dispatchEvent(new CustomEvent(O))) : u.onClose(), a?.(e);
|
|
58
|
-
},
|
|
59
|
-
caller: M
|
|
60
|
-
}), w = g.useMemo(() => S ? x.current ? "delayed-open" : "instant-open" : "closed", [S]), E = g.useCallback(() => {
|
|
61
|
-
window.clearTimeout(v.current), v.current = 0, x.current = !1, C(!0);
|
|
62
|
-
}, [C]), D = g.useCallback(() => {
|
|
63
|
-
window.clearTimeout(v.current), v.current = 0, C(!1);
|
|
64
|
-
}, [C]), k = g.useCallback(() => {
|
|
65
|
-
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
66
|
-
x.current = !0, C(!0), v.current = 0;
|
|
67
|
-
}, b);
|
|
68
|
-
}, [b, C]);
|
|
69
|
-
return g.useEffect(() => () => {
|
|
70
|
-
v.current &&= (window.clearTimeout(v.current), 0);
|
|
71
|
-
}, []), /* @__PURE__ */ _(f, {
|
|
72
|
-
...d,
|
|
73
|
-
children: /* @__PURE__ */ _(N, {
|
|
74
|
-
scope: t,
|
|
75
|
-
contentId: h,
|
|
76
|
-
open: S,
|
|
77
|
-
stateAttribute: w,
|
|
78
|
-
trigger: p,
|
|
79
|
-
onTriggerChange: m,
|
|
80
|
-
onTriggerEnter: g.useCallback(() => {
|
|
81
|
-
u.isOpenDelayedRef.current ? k() : E();
|
|
82
|
-
}, [
|
|
83
|
-
u.isOpenDelayedRef,
|
|
84
|
-
k,
|
|
85
|
-
E
|
|
86
|
-
]),
|
|
87
|
-
onTriggerLeave: g.useCallback(() => {
|
|
88
|
-
y ? D() : (window.clearTimeout(v.current), v.current = 0);
|
|
89
|
-
}, [D, y]),
|
|
90
|
-
onOpen: E,
|
|
91
|
-
onClose: D,
|
|
92
|
-
disableHoverableContent: y,
|
|
93
|
-
children: n
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
F.displayName = M;
|
|
98
|
-
var I = "TooltipTrigger", L = g.forwardRef((e, i) => {
|
|
99
|
-
let { __scopeTooltip: a, ...o } = e, s = P(I, a), c = A(I, a), l = T(a), u = t(i, g.useRef(null), s.onTriggerChange), d = g.useRef(!1), f = g.useRef(!1), p = g.useCallback(() => d.current = !1, []);
|
|
100
|
-
return g.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ _(h, {
|
|
101
|
-
asChild: !0,
|
|
102
|
-
...l,
|
|
103
|
-
children: /* @__PURE__ */ _(r.button, {
|
|
104
|
-
"aria-describedby": s.open ? s.contentId : void 0,
|
|
105
|
-
"data-state": s.stateAttribute,
|
|
106
|
-
...o,
|
|
107
|
-
ref: u,
|
|
108
|
-
onPointerMove: n(e.onPointerMove, (e) => {
|
|
109
|
-
e.pointerType !== "touch" && !f.current && !c.isPointerInTransitRef.current && (s.onTriggerEnter(), f.current = !0);
|
|
110
|
-
}),
|
|
111
|
-
onPointerLeave: n(e.onPointerLeave, () => {
|
|
112
|
-
s.onTriggerLeave(), f.current = !1;
|
|
113
|
-
}),
|
|
114
|
-
onPointerDown: n(e.onPointerDown, () => {
|
|
115
|
-
s.open && s.onClose(), d.current = !0, document.addEventListener("pointerup", p, { once: !0 });
|
|
116
|
-
}),
|
|
117
|
-
onFocus: n(e.onFocus, () => {
|
|
118
|
-
d.current || s.onOpen();
|
|
119
|
-
}),
|
|
120
|
-
onBlur: n(e.onBlur, s.onClose),
|
|
121
|
-
onClick: n(e.onClick, s.onClose)
|
|
122
|
-
})
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
L.displayName = I;
|
|
126
|
-
var R = "TooltipPortal", [z, B] = C(R, { forceMount: void 0 }), V = (e) => {
|
|
127
|
-
let { __scopeTooltip: t, forceMount: n, children: r, container: i } = e, o = P(R, t);
|
|
128
|
-
return /* @__PURE__ */ _(z, {
|
|
129
|
-
scope: t,
|
|
130
|
-
forceMount: n,
|
|
131
|
-
children: /* @__PURE__ */ _(a, {
|
|
132
|
-
present: n || o.open,
|
|
133
|
-
children: /* @__PURE__ */ _(u, {
|
|
134
|
-
asChild: !0,
|
|
135
|
-
container: i,
|
|
136
|
-
children: r
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
V.displayName = R;
|
|
142
|
-
var H = "TooltipContent", U = g.forwardRef((e, t) => {
|
|
143
|
-
let n = B(H, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...o } = e, s = P(H, e.__scopeTooltip);
|
|
144
|
-
return /* @__PURE__ */ _(a, {
|
|
145
|
-
present: r || s.open,
|
|
146
|
-
children: s.disableHoverableContent ? /* @__PURE__ */ _(J, {
|
|
147
|
-
side: i,
|
|
148
|
-
...o,
|
|
149
|
-
ref: t
|
|
150
|
-
}) : /* @__PURE__ */ _(W, {
|
|
151
|
-
side: i,
|
|
152
|
-
...o,
|
|
153
|
-
ref: t
|
|
154
|
-
})
|
|
155
|
-
});
|
|
156
|
-
}), W = g.forwardRef((e, n) => {
|
|
157
|
-
let r = P(H, e.__scopeTooltip), i = A(H, e.__scopeTooltip), a = g.useRef(null), o = t(n, a), [s, c] = g.useState(null), { trigger: l, onClose: u } = r, d = a.current, { onPointerInTransitChange: f } = i, p = g.useCallback(() => {
|
|
158
|
-
c(null), f(!1);
|
|
159
|
-
}, [f]), m = g.useCallback((e, t) => {
|
|
160
|
-
let n = e.currentTarget, r = {
|
|
161
|
-
x: e.clientX,
|
|
162
|
-
y: e.clientY
|
|
163
|
-
}, i = Q(r, Z(r, n.getBoundingClientRect())), a = ee(t.getBoundingClientRect());
|
|
164
|
-
c(ne([...i, ...a])), f(!0);
|
|
165
|
-
}, [f]);
|
|
166
|
-
return g.useEffect(() => () => p(), [p]), g.useEffect(() => {
|
|
167
|
-
if (l && d) {
|
|
168
|
-
let e = (e) => m(e, d), t = (e) => m(e, l);
|
|
169
|
-
return l.addEventListener("pointerleave", e), d.addEventListener("pointerleave", t), () => {
|
|
170
|
-
l.removeEventListener("pointerleave", e), d.removeEventListener("pointerleave", t);
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}, [
|
|
174
|
-
l,
|
|
175
|
-
d,
|
|
176
|
-
m,
|
|
177
|
-
p
|
|
178
|
-
]), g.useEffect(() => {
|
|
179
|
-
if (s) {
|
|
180
|
-
let e = (e) => {
|
|
181
|
-
let t = e.target, n = {
|
|
182
|
-
x: e.clientX,
|
|
183
|
-
y: e.clientY
|
|
184
|
-
}, r = l?.contains(t) || d?.contains(t), i = !te(n, s);
|
|
185
|
-
r ? p() : i && (p(), u());
|
|
186
|
-
};
|
|
187
|
-
return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
|
|
188
|
-
}
|
|
189
|
-
}, [
|
|
190
|
-
l,
|
|
191
|
-
d,
|
|
192
|
-
s,
|
|
193
|
-
u,
|
|
194
|
-
p
|
|
195
|
-
]), /* @__PURE__ */ _(J, {
|
|
196
|
-
...e,
|
|
197
|
-
ref: o
|
|
198
|
-
});
|
|
199
|
-
}), [G, K] = C(M, { isInside: !1 }), q = o("TooltipContent"), J = g.forwardRef((e, t) => {
|
|
200
|
-
let { __scopeTooltip: n, children: r, "aria-label": i, onEscapeKeyDown: a, onPointerDownOutside: o, ...s } = e, c = P(H, n), u = T(n), { onClose: d } = c;
|
|
201
|
-
return g.useEffect(() => (document.addEventListener(O, d), () => document.removeEventListener(O, d)), [d]), g.useEffect(() => {
|
|
202
|
-
if (c.trigger) {
|
|
203
|
-
let e = (e) => {
|
|
204
|
-
e.target?.contains(c.trigger) && d();
|
|
205
|
-
};
|
|
206
|
-
return window.addEventListener("scroll", e, { capture: !0 }), () => window.removeEventListener("scroll", e, { capture: !0 });
|
|
207
|
-
}
|
|
208
|
-
}, [c.trigger, d]), /* @__PURE__ */ _(l, {
|
|
209
|
-
asChild: !0,
|
|
210
|
-
disableOutsidePointerEvents: !1,
|
|
211
|
-
onEscapeKeyDown: a,
|
|
212
|
-
onPointerDownOutside: o,
|
|
213
|
-
onFocusOutside: (e) => e.preventDefault(),
|
|
214
|
-
onDismiss: d,
|
|
215
|
-
children: /* @__PURE__ */ v(m, {
|
|
216
|
-
"data-state": c.stateAttribute,
|
|
217
|
-
...u,
|
|
218
|
-
...s,
|
|
219
|
-
ref: t,
|
|
220
|
-
style: {
|
|
221
|
-
...s.style,
|
|
222
|
-
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
223
|
-
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
224
|
-
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
225
|
-
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
226
|
-
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
227
|
-
},
|
|
228
|
-
children: [/* @__PURE__ */ _(q, { children: r }), /* @__PURE__ */ _(G, {
|
|
229
|
-
scope: n,
|
|
230
|
-
isInside: !0,
|
|
231
|
-
children: /* @__PURE__ */ _(S, {
|
|
232
|
-
id: c.contentId,
|
|
233
|
-
role: "tooltip",
|
|
234
|
-
children: i || r
|
|
235
|
-
})
|
|
236
|
-
})]
|
|
237
|
-
})
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
U.displayName = H;
|
|
241
|
-
var Y = "TooltipArrow", X = g.forwardRef((e, t) => {
|
|
242
|
-
let { __scopeTooltip: n, ...r } = e, i = T(n);
|
|
243
|
-
return K(Y, n).isInside ? null : /* @__PURE__ */ _(p, {
|
|
244
|
-
...i,
|
|
245
|
-
...r,
|
|
246
|
-
ref: t
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
X.displayName = Y;
|
|
250
|
-
function Z(e, t) {
|
|
251
|
-
let n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), i = Math.abs(t.right - e.x), a = Math.abs(t.left - e.x);
|
|
252
|
-
switch (Math.min(n, r, i, a)) {
|
|
253
|
-
case a: return "left";
|
|
254
|
-
case i: return "right";
|
|
255
|
-
case n: return "top";
|
|
256
|
-
case r: return "bottom";
|
|
257
|
-
default: throw Error("unreachable");
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function Q(e, t, n = 5) {
|
|
261
|
-
let r = [];
|
|
262
|
-
switch (t) {
|
|
263
|
-
case "top":
|
|
264
|
-
r.push({
|
|
265
|
-
x: e.x - n,
|
|
266
|
-
y: e.y + n
|
|
267
|
-
}, {
|
|
268
|
-
x: e.x + n,
|
|
269
|
-
y: e.y + n
|
|
270
|
-
});
|
|
271
|
-
break;
|
|
272
|
-
case "bottom":
|
|
273
|
-
r.push({
|
|
274
|
-
x: e.x - n,
|
|
275
|
-
y: e.y - n
|
|
276
|
-
}, {
|
|
277
|
-
x: e.x + n,
|
|
278
|
-
y: e.y - n
|
|
279
|
-
});
|
|
280
|
-
break;
|
|
281
|
-
case "left":
|
|
282
|
-
r.push({
|
|
283
|
-
x: e.x + n,
|
|
284
|
-
y: e.y - n
|
|
285
|
-
}, {
|
|
286
|
-
x: e.x + n,
|
|
287
|
-
y: e.y + n
|
|
288
|
-
});
|
|
289
|
-
break;
|
|
290
|
-
case "right":
|
|
291
|
-
r.push({
|
|
292
|
-
x: e.x - n,
|
|
293
|
-
y: e.y - n
|
|
294
|
-
}, {
|
|
295
|
-
x: e.x - n,
|
|
296
|
-
y: e.y + n
|
|
297
|
-
});
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
return r;
|
|
301
|
-
}
|
|
302
|
-
function ee(e) {
|
|
303
|
-
let { top: t, right: n, bottom: r, left: i } = e;
|
|
304
|
-
return [
|
|
305
|
-
{
|
|
306
|
-
x: i,
|
|
307
|
-
y: t
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
x: n,
|
|
311
|
-
y: t
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
x: n,
|
|
315
|
-
y: r
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
x: i,
|
|
319
|
-
y: r
|
|
320
|
-
}
|
|
321
|
-
];
|
|
322
|
-
}
|
|
323
|
-
function te(e, t) {
|
|
324
|
-
let { x: n, y: r } = e, i = !1;
|
|
325
|
-
for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
|
|
326
|
-
let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y;
|
|
327
|
-
l > r != d > r && n < (u - c) * (r - l) / (d - l) + c && (i = !i);
|
|
328
|
-
}
|
|
329
|
-
return i;
|
|
330
|
-
}
|
|
331
|
-
function ne(e) {
|
|
332
|
-
let t = e.slice();
|
|
333
|
-
return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : +(e.y > t.y)), re(t);
|
|
334
|
-
}
|
|
335
|
-
function re(e) {
|
|
336
|
-
if (e.length <= 1) return e.slice();
|
|
337
|
-
let t = [];
|
|
338
|
-
for (let n = 0; n < e.length; n++) {
|
|
339
|
-
let r = e[n];
|
|
340
|
-
for (; t.length >= 2;) {
|
|
341
|
-
let e = t[t.length - 1], n = t[t.length - 2];
|
|
342
|
-
if ((e.x - n.x) * (r.y - n.y) >= (e.y - n.y) * (r.x - n.x)) t.pop();
|
|
343
|
-
else break;
|
|
344
|
-
}
|
|
345
|
-
t.push(r);
|
|
346
|
-
}
|
|
347
|
-
t.pop();
|
|
348
|
-
let n = [];
|
|
349
|
-
for (let t = e.length - 1; t >= 0; t--) {
|
|
350
|
-
let r = e[t];
|
|
351
|
-
for (; n.length >= 2;) {
|
|
352
|
-
let e = n[n.length - 1], t = n[n.length - 2];
|
|
353
|
-
if ((e.x - t.x) * (r.y - t.y) >= (e.y - t.y) * (r.x - t.x)) n.pop();
|
|
354
|
-
else break;
|
|
355
|
-
}
|
|
356
|
-
n.push(r);
|
|
357
|
-
}
|
|
358
|
-
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
359
|
-
}
|
|
360
|
-
var $ = {
|
|
361
|
-
tooltipContent: "_tooltipContent_12gjy_1",
|
|
362
|
-
tooltipArrow: "_tooltipArrow_12gjy_8",
|
|
363
|
-
fadeIn: "_fadeIn_12gjy_1"
|
|
364
|
-
}, ie = e(({ children: e, content: t, className: n, style: r }, i) => /* @__PURE__ */ _(j, { children: /* @__PURE__ */ v(F, {
|
|
365
|
-
delayDuration: 1e3,
|
|
366
|
-
children: [/* @__PURE__ */ _(L, {
|
|
367
|
-
asChild: !0,
|
|
368
|
-
children: /* @__PURE__ */ _("div", {
|
|
369
|
-
ref: i,
|
|
370
|
-
className: n,
|
|
371
|
-
style: r,
|
|
372
|
-
children: e
|
|
373
|
-
})
|
|
374
|
-
}), /* @__PURE__ */ v(U, {
|
|
375
|
-
className: $.tooltipContent,
|
|
376
|
-
sideOffset: 5,
|
|
377
|
-
children: [/* @__PURE__ */ _(X, { className: $.tooltipArrow }), /* @__PURE__ */ _("span", { children: t })]
|
|
378
|
-
})]
|
|
379
|
-
}) }));
|
|
380
|
-
//#endregion
|
|
381
|
-
export { ie as t };
|