@react-text-game/ui 0.3.1 → 0.3.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.
- package/dist/components/InteractiveMapComponent/Hotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/Hotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/Hotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.js +2 -7
- package/dist/components/InteractiveMapComponent/HotspotMenu.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts +6 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js +13 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js.map +1 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts +6 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.js +36 -14
- package/dist/components/InteractiveMapComponent/ImageHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts +4 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.js +6 -4
- package/dist/components/InteractiveMapComponent/LabelHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/SideHotspot.js.map +1 -1
- package/dist/components/StoryComponent/components/Actions.d.ts.map +1 -1
- package/dist/components/StoryComponent/components/Actions.js +7 -2
- package/dist/components/StoryComponent/components/Actions.js.map +1 -1
- package/dist/components/common/Tooltip.d.ts +3 -3
- package/dist/components/common/Tooltip.d.ts.map +1 -1
- package/dist/components/common/Tooltip.js +124 -23
- package/dist/components/common/Tooltip.js.map +1 -1
- package/dist/styles/index.css +4 -45
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.d.ts +2 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.d.ts.map +1 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.js +460 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.js.map +1 -0
- package/dist/tests/common/Tooltip.test.d.ts +2 -0
- package/dist/tests/common/Tooltip.test.d.ts.map +1 -0
- package/dist/tests/common/Tooltip.test.js +400 -0
- package/dist/tests/common/Tooltip.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,eAAe,EAClB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Hotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,YAAY,GAAG;IAChB,OAAO,EAAE,eAAe,GAAG,eAAe,CAAC;IAC3C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,gCAAgC,YAAY,4CAgDnE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
|
-
import { Tooltip } from "../../components/common/Tooltip";
|
|
5
4
|
import { callIfFunction } from "./helpers";
|
|
6
5
|
import { ImageHotspot } from "./ImageHotspot";
|
|
7
6
|
import { LabelHotspot } from "./LabelHotspot";
|
|
@@ -25,6 +24,6 @@ export const Hotspot = ({ hotspot, imagePositionInfo }) => {
|
|
|
25
24
|
hotspotRef.current.style.transform = "translate(-50%, -50%)";
|
|
26
25
|
}
|
|
27
26
|
}, [hotspot.position, imagePositionInfo]);
|
|
28
|
-
return (_jsx("div", { ref: hotspotRef, className: "absolute z-10", children: _jsx(
|
|
27
|
+
return (_jsx("div", { ref: hotspotRef, className: "absolute z-10", children: hotspot.type === "image" ? (_jsx(ImageHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position, ...(imagePositionInfo && { imagePositionInfo }) })) : hotspot.type === "label" ? (_jsx(LabelHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : (_jsx("div", { children: "Unknown Hotspot Type" })) }));
|
|
29
28
|
};
|
|
30
29
|
//# sourceMappingURL=Hotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Hotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/Hotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAgB,EAAE,EAAE;IACpE,MAAM,UAAU,GAAG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AAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,KACvC,CAAC,iBAAiB,IAAI,EAAE,iBAAiB,EAAE,CAAC,GAClD,CACL,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAC3B,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,iDAA+B,CAClC,GACC,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotspotMenu.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"HotspotMenu.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,KAAK,GAAG,QAAQ,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,6BAA6B,KAAK,mDAiD7D,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
-
import { Button, Tooltip } from "../../components/common";
|
|
6
5
|
import { callIfFunction } from "./helpers";
|
|
6
|
+
import { HotspotMenuItem } from "./HotspotMenuItem";
|
|
7
7
|
export const HotspotMenu = ({ menu, imagePositionInfo }) => {
|
|
8
8
|
const menuRef = useRef(null);
|
|
9
9
|
const items = useMemo(() => menu.items
|
|
@@ -27,11 +27,6 @@ export const HotspotMenu = ({ menu, imagePositionInfo }) => {
|
|
|
27
27
|
if (items.length === 0) {
|
|
28
28
|
return null; // Don't render the menu if there are no items
|
|
29
29
|
}
|
|
30
|
-
return (_jsx("div", { ref: menuRef, className: twMerge("absolute z-10 flex gap-2 p-2 bg-popover/95 border border-border rounded-lg shadow-md", menu.direction === "horizontal" ? "flex-row" : "flex-col"), children: items.map((item, index) => {
|
|
31
|
-
const tooltipContent = callIfFunction(item.tooltip?.content);
|
|
32
|
-
const isDisabled = callIfFunction(item.isDisabled) || false;
|
|
33
|
-
const content = callIfFunction(item.content);
|
|
34
|
-
return (_jsx(Tooltip, { content: tooltipContent, placement: item.tooltip?.position || "top", disabled: !tooltipContent, children: _jsx("div", { children: _jsx(Button, { className: item?.props?.classNames?.button, variant: item?.props?.variant, color: item?.props?.color, disabled: isDisabled, onClick: item.action, children: content }) }) }, index));
|
|
35
|
-
}) }));
|
|
30
|
+
return (_jsx("div", { ref: menuRef, className: twMerge("absolute z-10 flex gap-2 p-2 bg-popover/95 border ", "border-border rounded-lg shadow-md", menu.direction === "horizontal" ? "flex-row" : "flex-col"), children: items.map((item, index) => (_jsx(HotspotMenuItem, { item: item }, index))) }));
|
|
36
31
|
};
|
|
37
32
|
//# sourceMappingURL=HotspotMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotspotMenu.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,
|
|
1
|
+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,IAAI,GACN,SAAS;gBACT,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC;YAE7D,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;YACzC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC;YACxC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,uBAAuB,CAAC;QAC9D,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAErD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC,CAAC,8CAA8C;IAC/D,CAAC;IAED,OAAO,CACH,cACI,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,OAAO,CACd,oDAAoD,EACpD,oCAAoC,EACpC,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAC5D,YAEA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,IAAO,KAAK,CAAI,CAC9C,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LabelHotspot } from "@react-text-game/core";
|
|
2
|
+
export type HotspotMenuItemProps = {
|
|
3
|
+
item: LabelHotspot;
|
|
4
|
+
};
|
|
5
|
+
export declare const HotspotMenuItem: ({ item }: HotspotMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=HotspotMenuItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenuItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,oBAAoB,4CA2B7D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Button, Tooltip } from "../../components";
|
|
5
|
+
import { callIfFunction } from "../../components/InteractiveMapComponent/helpers";
|
|
6
|
+
export const HotspotMenuItem = ({ item }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const tooltipContent = callIfFunction(item.tooltip?.content);
|
|
9
|
+
const isDisabled = callIfFunction(item.isDisabled) || false;
|
|
10
|
+
const content = callIfFunction(item.content);
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { className: item.props?.classNames?.button, variant: item.props?.variant, color: item.props?.color, disabled: isDisabled, onClick: item.action, children: content }) }), _jsx(Tooltip, { targetRef: ref, content: tooltipContent, placement: item.tooltip?.position || "top", disabled: !tooltipContent })] }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=HotspotMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotMenuItem.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/HotspotMenuItem.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAM7E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,EAAwB,EAAE,EAAE;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;IAC5D,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE7C,OAAO,CACH,8BACI,cAAK,GAAG,EAAE,GAAG,YACT,KAAC,MAAM,IACH,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EACzC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAC5B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EACxB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,IAAI,CAAC,MAAM,YAEnB,OAAO,GACH,GACP,EACN,KAAC,OAAO,IACJ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAC1C,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { ImageHotspot as ImageHotspotType, MapImageHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
import { Placement } from "../../components";
|
|
3
|
+
import { ImagePositionInfo } from "./types";
|
|
2
4
|
type ImageHotspotProps = {
|
|
3
5
|
hotspot: MapImageHotspot | ImageHotspotType;
|
|
6
|
+
imagePositionInfo?: ImagePositionInfo;
|
|
7
|
+
tooltipContent?: string | undefined;
|
|
8
|
+
tooltipPlacement?: Placement | undefined;
|
|
4
9
|
};
|
|
5
|
-
export declare const ImageHotspot: ({ hotspot }: ImageHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ImageHotspot: ({ hotspot, imagePositionInfo, tooltipContent, tooltipPlacement, }: ImageHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
export {};
|
|
7
12
|
//# sourceMappingURL=ImageHotspot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAEhC,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAW,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,mEAK1B,iBAAiB,4CAwFnB,CAAC"}
|
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useRef, useState } from "react";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { Tooltip } from "../../components";
|
|
5
6
|
import { callIfFunction } from "./helpers";
|
|
6
|
-
export const ImageHotspot = ({ hotspot }) => {
|
|
7
|
+
export const ImageHotspot = ({ hotspot, imagePositionInfo, tooltipContent, tooltipPlacement = "top", }) => {
|
|
8
|
+
const ref = useRef(null);
|
|
7
9
|
const [isHovering, setIsHovering] = useState(false);
|
|
8
10
|
const [isActive, setIsActive] = useState(false);
|
|
9
11
|
const classNames = hotspot.props?.classNames || {};
|
|
10
12
|
const isDisabled = callIfFunction(hotspot.isDisabled);
|
|
11
|
-
const content = useMemo(() =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const content = useMemo(() => {
|
|
14
|
+
const isObject = typeof hotspot.content === "object";
|
|
15
|
+
if (!isObject) {
|
|
16
|
+
const stringContent = hotspot.content;
|
|
17
|
+
return {
|
|
18
|
+
idle: callIfFunction(stringContent), hover: undefined, active: undefined, disabled: undefined
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const content = hotspot.content;
|
|
22
|
+
return {
|
|
23
|
+
idle: callIfFunction(content.idle),
|
|
24
|
+
hover: callIfFunction(content.hover),
|
|
25
|
+
active: callIfFunction(content.active),
|
|
26
|
+
disabled: callIfFunction(content.disabled),
|
|
27
|
+
};
|
|
28
|
+
}, [hotspot.content]);
|
|
29
|
+
// Calculate the combined scale factor from both the map scaling and custom zoom
|
|
30
|
+
const combinedScale = useMemo(() => {
|
|
31
|
+
const scaleFactor = imagePositionInfo?.scaleFactor ?? 1;
|
|
32
|
+
const customZoom = hotspot.props?.zoom || "100%";
|
|
33
|
+
const zoomValue = parseFloat(customZoom) / 100;
|
|
34
|
+
return scaleFactor * zoomValue;
|
|
35
|
+
}, [imagePositionInfo?.scaleFactor, hotspot.props?.zoom]);
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: ref, className: twMerge("cursor-pointer disabled:cursor-not-allowed relative", classNames.container), style: {
|
|
37
|
+
transform: `scale(${combinedScale})`,
|
|
38
|
+
transformOrigin: "center center",
|
|
39
|
+
}, disabled: isDisabled, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), onClick: () => {
|
|
40
|
+
setIsActive(true);
|
|
41
|
+
hotspot.action();
|
|
42
|
+
setTimeout(() => setIsActive(false), 100);
|
|
43
|
+
}, children: isActive && content.active ? (_jsx("img", { className: classNames.active, src: content.active, alt: "hotspot active" })) : isHovering && content.hover ? (_jsx("img", { className: classNames.hover, src: content.hover, alt: "hotspot hover" })) : isDisabled && content.disabled ? (_jsx("img", { className: classNames.disabled, src: content.disabled, alt: "hotspot disabled" })) : (_jsx("img", { className: classNames.idle, src: content.idle, alt: hotspot.id || "hotspot" })) }), _jsx(Tooltip, { content: tooltipContent, placement: tooltipPlacement, targetRef: ref, disabled: !tooltipContent })] }));
|
|
22
44
|
};
|
|
23
45
|
//# sourceMappingURL=ImageHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"ImageHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/ImageHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAQb,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAa,OAAO,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAU3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EACzB,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,gBA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AC,CACjC,cACI,SAAS,EAAE,UAAU,CAAC,QAAQ,EAC9B,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,GAAG,EAAC,kBAAkB,GACxB,CACL,CAAC,CAAC,CAAC,CACA,cACI,SAAS,EAAE,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAE,OAAO,CAAC,IAAI,EACjB,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS,GAC9B,CACL,GACI,EACT,KAAC,OAAO,IACJ,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { LabelHotspot as LabelHotspotType, MapLabelHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
import { Placement } from "../../components/common";
|
|
2
3
|
type LabelHotspotProps = {
|
|
3
4
|
hotspot: MapLabelHotspot | LabelHotspotType;
|
|
5
|
+
tooltipContent?: string | undefined;
|
|
6
|
+
tooltipPlacement?: Placement | undefined;
|
|
4
7
|
};
|
|
5
|
-
export declare const LabelHotspot: ({ hotspot }: LabelHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const LabelHotspot: ({ hotspot, tooltipContent, tooltipPlacement, }: LabelHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
7
10
|
//# sourceMappingURL=LabelHotspot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAChC,eAAe,EAClB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"LabelHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,YAAY,IAAI,gBAAgB,EAChC,eAAe,EAClB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAU,SAAS,EAAW,MAAM,oBAAoB,CAAC;AAIhE,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,gDAI1B,iBAAiB,4CA0BnB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Button, Tooltip } from "../../components/common";
|
|
4
5
|
import { callIfFunction } from "./helpers";
|
|
5
|
-
export const LabelHotspot = ({ hotspot }) => {
|
|
6
|
+
export const LabelHotspot = ({ hotspot, tooltipContent, tooltipPlacement = "top", }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
6
8
|
const content = callIfFunction(hotspot.content);
|
|
7
9
|
const isDisabled = callIfFunction(hotspot.isDisabled);
|
|
8
|
-
return (_jsx("div", { children: _jsx(Button, { onClick: () => hotspot.action(), disabled: isDisabled, className: hotspot.props?.classNames?.button, variant: hotspot.props?.variant, color: hotspot.props?.color, children: content }) }));
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { onClick: () => hotspot.action(), disabled: isDisabled, className: hotspot.props?.classNames?.button, variant: hotspot.props?.variant, color: hotspot.props?.color, children: content }) }), _jsx(Tooltip, { content: tooltipContent, placement: tooltipPlacement, targetRef: ref, disabled: !tooltipContent })] }));
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=LabelHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"LabelHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAa,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAQ3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EACzB,OAAO,EACP,cAAc,EACd,gBAAgB,GAAG,KAAK,GACR,EAAE,EAAE;IACpB,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtD,OAAO,CACH,8BACI,cAAK,GAAG,EAAE,GAAG,YACT,KAAC,MAAM,IACH,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAC/B,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAC5C,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,EAC/B,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,YAE1B,OAAO,GACH,GACP,EACN,KAAC,OAAO,IACJ,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,CAAC,cAAc,GAC3B,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"SideHotspot.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;AAMxC,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,aAAa,KAAK,4CAsB7C,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Tooltip } from "../../components/common";
|
|
4
3
|
import { callIfFunction } from "./helpers";
|
|
5
4
|
import { ImageHotspot } from "./ImageHotspot";
|
|
6
5
|
import { LabelHotspot } from "./LabelHotspot";
|
|
7
6
|
export const SideHotspot = ({ hotspot }) => {
|
|
8
7
|
const tooltipContent = callIfFunction(hotspot.tooltip?.content);
|
|
9
|
-
return (_jsx(
|
|
8
|
+
return (_jsx("div", { children: hotspot.type === "image" ? (_jsx(ImageHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : hotspot.type === "label" ? (_jsx(LabelHotspot, { hotspot: hotspot, tooltipContent: tooltipContent, tooltipPlacement: hotspot.tooltip?.position })) : (_jsx("div", { children: "Unknown Hotspot Type" })) }));
|
|
10
9
|
};
|
|
11
10
|
//# sourceMappingURL=SideHotspot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SideHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE;IAC9C,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEhE,OAAO,CACH,wBACK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CACxB,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAC3B,KAAC,YAAY,IACT,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,iDAA+B,CAClC,GACC,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gCAAgC,CAAC;AAO9E,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;CAC/B,CAAC,CAAC;AA6BH,eAAO,MAAM,OAAO,GAAI,eAAe,YAAY,4CAYlD,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
2
3
|
import { twMerge } from "tailwind-merge";
|
|
3
4
|
import { Button } from "../../../components/common/Button";
|
|
4
5
|
import { Tooltip } from "../../../components/common/Tooltip";
|
|
5
|
-
|
|
6
|
+
const Action = ({ action }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref, children: _jsx(Button, { color: action.color, variant: action.variant, className: action.className, disabled: action.isDisabled, onClick: action.action, children: action.label }) }), _jsx(Tooltip, { targetRef: ref, content: action.tooltip?.content, placement: action.tooltip?.position, disabled: !action.tooltip?.content, className: action.tooltip?.className })] }));
|
|
9
|
+
};
|
|
10
|
+
export const Actions = ({ component }) => (_jsx("div", { className: twMerge("flex flex-wrap gap-2 justify-center items-center", component.props?.direction === "vertical" ? "flex-col" : "flex-row", component.props?.className), children: component.content.map((action, index) => (_jsx(Action, { action: action }, index))) }));
|
|
6
11
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMrD,MAAM,
|
|
1
|
+
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../src/components/StoryComponent/components/Actions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMrD,MAAM,MAAM,GAAG,CAAC,EAAE,MAAM,EAA0B,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,OAAO,CACH,8BACI,cAAK,GAAG,EAAE,GAAG,YACT,KAAC,MAAM,IACH,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,QAAQ,EAAE,MAAM,CAAC,UAAU,EAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,YAErB,MAAM,CAAC,KAAK,GACR,GACP,EACN,KAAC,OAAO,IACJ,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAChC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EACnC,QAAQ,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAClC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,GACtC,IACH,CACN,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAgB,EAAE,EAAE,CAAC,CACpD,cACI,SAAS,EAAE,OAAO,CACd,kDAAkD,EAClD,SAAS,CAAC,KAAK,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACnE,SAAS,CAAC,KAAK,EAAE,SAAS,CAC7B,YAEA,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACtC,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,IAAO,KAAK,CAAI,CACzC,CAAC,GACA,CACT,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "top-right" | "top-left" | "bottom" | "bottom-right" | "bottom-left" | "right" | "left";
|
|
3
3
|
export type TooltipProps = Readonly<{
|
|
4
|
-
|
|
4
|
+
targetRef: RefObject<HTMLElement | HTMLDivElement | HTMLButtonElement | null>;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
6
|
content: ReactNode;
|
|
7
7
|
className?: string | undefined;
|
|
8
8
|
placement?: Placement | undefined;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const Tooltip: ({
|
|
10
|
+
export declare const Tooltip: ({ targetRef, disabled, content, className, placement, }: TooltipProps) => import("react").ReactPortal | null;
|
|
11
11
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,SAAS,GACf,KAAK,GACL,WAAW,GACX,UAAU,GACV,QAAQ,GACR,cAAc,GACd,aAAa,GACb,OAAO,GACP,MAAM,CAAC;AAEb,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACrC,CAAC,CAAC;AAgFH,eAAO,MAAM,OAAO,GAAI,yDAMrB,YAAY,uCAsFd,CAAC"}
|
|
@@ -1,28 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
const ARROW_SIZE = 4;
|
|
6
|
+
const TOOLTIP_OFFSET = 8;
|
|
7
|
+
const getArrowRotation = (placement) => {
|
|
8
|
+
if (placement.startsWith("top"))
|
|
9
|
+
return "rotate-45";
|
|
10
|
+
if (placement.startsWith("bottom"))
|
|
11
|
+
return "rotate-45";
|
|
12
|
+
if (placement === "right")
|
|
13
|
+
return "rotate-45";
|
|
14
|
+
if (placement === "left")
|
|
15
|
+
return "rotate-45";
|
|
16
|
+
return "rotate-45";
|
|
11
17
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const calculatePosition = (targetRect, tooltipRect, placement) => {
|
|
19
|
+
let top = 0;
|
|
20
|
+
let left = 0;
|
|
21
|
+
let arrowTop = 0;
|
|
22
|
+
let arrowLeft = 0;
|
|
23
|
+
const targetCenterX = targetRect.left + targetRect.width / 2;
|
|
24
|
+
const targetCenterY = targetRect.top + targetRect.height / 2;
|
|
25
|
+
switch (placement) {
|
|
26
|
+
case "top":
|
|
27
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
28
|
+
left = targetCenterX - tooltipRect.width / 2;
|
|
29
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
30
|
+
arrowLeft = tooltipRect.width / 2 - ARROW_SIZE;
|
|
31
|
+
break;
|
|
32
|
+
case "top-right":
|
|
33
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
34
|
+
left = targetRect.right - tooltipRect.width;
|
|
35
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
36
|
+
arrowLeft = tooltipRect.width - 16;
|
|
37
|
+
break;
|
|
38
|
+
case "top-left":
|
|
39
|
+
top = targetRect.top - tooltipRect.height - TOOLTIP_OFFSET;
|
|
40
|
+
left = targetRect.left;
|
|
41
|
+
arrowTop = tooltipRect.height - ARROW_SIZE;
|
|
42
|
+
arrowLeft = 12;
|
|
43
|
+
break;
|
|
44
|
+
case "bottom":
|
|
45
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
46
|
+
left = targetCenterX - tooltipRect.width / 2;
|
|
47
|
+
arrowTop = -ARROW_SIZE;
|
|
48
|
+
arrowLeft = tooltipRect.width / 2 - ARROW_SIZE;
|
|
49
|
+
break;
|
|
50
|
+
case "bottom-right":
|
|
51
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
52
|
+
left = targetRect.right - tooltipRect.width;
|
|
53
|
+
arrowTop = -ARROW_SIZE;
|
|
54
|
+
arrowLeft = tooltipRect.width - 16;
|
|
55
|
+
break;
|
|
56
|
+
case "bottom-left":
|
|
57
|
+
top = targetRect.bottom + TOOLTIP_OFFSET;
|
|
58
|
+
left = targetRect.left;
|
|
59
|
+
arrowTop = -ARROW_SIZE;
|
|
60
|
+
arrowLeft = 12;
|
|
61
|
+
break;
|
|
62
|
+
case "right":
|
|
63
|
+
top = targetCenterY - tooltipRect.height / 2;
|
|
64
|
+
left = targetRect.right + TOOLTIP_OFFSET;
|
|
65
|
+
arrowTop = tooltipRect.height / 2 - ARROW_SIZE;
|
|
66
|
+
arrowLeft = -ARROW_SIZE;
|
|
67
|
+
break;
|
|
68
|
+
case "left":
|
|
69
|
+
top = targetCenterY - tooltipRect.height / 2;
|
|
70
|
+
left = targetRect.left - tooltipRect.width - TOOLTIP_OFFSET;
|
|
71
|
+
arrowTop = tooltipRect.height / 2 - ARROW_SIZE;
|
|
72
|
+
arrowLeft = tooltipRect.width - ARROW_SIZE;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return { top, left, arrowTop, arrowLeft };
|
|
21
76
|
};
|
|
22
|
-
export const Tooltip = ({
|
|
23
|
-
|
|
24
|
-
|
|
77
|
+
export const Tooltip = ({ targetRef, disabled = false, content, className = "", placement = "top", }) => {
|
|
78
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
79
|
+
const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
80
|
+
const [arrowPosition, setArrowPosition] = useState({ top: 0, left: 0 });
|
|
81
|
+
const [tooltipElement, setTooltipElement] = useState(null);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const target = targetRef.current;
|
|
84
|
+
if (!target || disabled)
|
|
85
|
+
return;
|
|
86
|
+
const handleMouseEnter = () => {
|
|
87
|
+
setIsVisible(true);
|
|
88
|
+
};
|
|
89
|
+
const handleMouseLeave = () => {
|
|
90
|
+
setIsVisible(false);
|
|
91
|
+
};
|
|
92
|
+
target.addEventListener("mouseenter", handleMouseEnter);
|
|
93
|
+
target.addEventListener("mouseleave", handleMouseLeave);
|
|
94
|
+
return () => {
|
|
95
|
+
target.removeEventListener("mouseenter", handleMouseEnter);
|
|
96
|
+
target.removeEventListener("mouseleave", handleMouseLeave);
|
|
97
|
+
};
|
|
98
|
+
}, [targetRef, disabled]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!isVisible || !tooltipElement || !targetRef.current)
|
|
101
|
+
return;
|
|
102
|
+
const updatePosition = () => {
|
|
103
|
+
const targetRect = targetRef.current.getBoundingClientRect();
|
|
104
|
+
const tooltipRect = tooltipElement.getBoundingClientRect();
|
|
105
|
+
const { top, left, arrowTop, arrowLeft } = calculatePosition(targetRect, tooltipRect, placement);
|
|
106
|
+
setPosition({ top, left });
|
|
107
|
+
setArrowPosition({ top: arrowTop, left: arrowLeft });
|
|
108
|
+
};
|
|
109
|
+
updatePosition();
|
|
110
|
+
// Update position on scroll or resize
|
|
111
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
112
|
+
window.addEventListener("resize", updatePosition);
|
|
113
|
+
return () => {
|
|
114
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
115
|
+
window.removeEventListener("resize", updatePosition);
|
|
116
|
+
};
|
|
117
|
+
}, [isVisible, tooltipElement, targetRef, placement]);
|
|
118
|
+
if (disabled || !isVisible) {
|
|
119
|
+
return null;
|
|
25
120
|
}
|
|
26
|
-
return (_jsxs("div", {
|
|
121
|
+
return createPortal(_jsxs("div", { ref: setTooltipElement, className: `fixed z-50 px-3 py-2 text-sm font-medium text-popover-foreground bg-popover border border-border rounded-lg shadow-lg whitespace-nowrap transition-opacity duration-200 ${isVisible ? "opacity-100" : "opacity-0"} ${className}`, style: {
|
|
122
|
+
top: `${position.top}px`,
|
|
123
|
+
left: `${position.left}px`,
|
|
124
|
+
}, role: "tooltip", "data-testid": "tooltip-content", children: [content, _jsx("div", { className: `absolute w-2 h-2 bg-popover border-border ${getArrowRotation(placement)}`, style: {
|
|
125
|
+
top: `${arrowPosition.top}px`,
|
|
126
|
+
left: `${arrowPosition.left}px`,
|
|
127
|
+
} })] }), document.body);
|
|
27
128
|
};
|
|
28
129
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/common/Tooltip.tsx"],"names":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