@react-text-game/ui 0.1.0
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/README.md +297 -0
- package/dist/components/DevModeDrawer/CopyButton.d.ts +4 -0
- package/dist/components/DevModeDrawer/CopyButton.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/CopyButton.js +17 -0
- package/dist/components/DevModeDrawer/CopyButton.js.map +1 -0
- package/dist/components/DevModeDrawer/CurrentPassageData.d.ts +4 -0
- package/dist/components/DevModeDrawer/CurrentPassageData.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/CurrentPassageData.js +23 -0
- package/dist/components/DevModeDrawer/CurrentPassageData.js.map +1 -0
- package/dist/components/DevModeDrawer/DevModeDrawer.d.ts +7 -0
- package/dist/components/DevModeDrawer/DevModeDrawer.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/DevModeDrawer.js +29 -0
- package/dist/components/DevModeDrawer/DevModeDrawer.js.map +1 -0
- package/dist/components/DevModeDrawer/GameData.d.ts +4 -0
- package/dist/components/DevModeDrawer/GameData.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/GameData.js +22 -0
- package/dist/components/DevModeDrawer/GameData.js.map +1 -0
- package/dist/components/DevModeDrawer/JumpToPassage.d.ts +2 -0
- package/dist/components/DevModeDrawer/JumpToPassage.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/JumpToPassage.js +15 -0
- package/dist/components/DevModeDrawer/JumpToPassage.js.map +1 -0
- package/dist/components/DevModeDrawer/RefreshButton.d.ts +4 -0
- package/dist/components/DevModeDrawer/RefreshButton.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/RefreshButton.js +5 -0
- package/dist/components/DevModeDrawer/RefreshButton.js.map +1 -0
- package/dist/components/DevModeDrawer/index.d.ts +2 -0
- package/dist/components/DevModeDrawer/index.d.ts.map +1 -0
- package/dist/components/DevModeDrawer/index.js +2 -0
- package/dist/components/DevModeDrawer/index.js.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +22 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +135 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/components/ErrorBoundary/index.d.ts +2 -0
- package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/index.js +2 -0
- package/dist/components/ErrorBoundary/index.js.map +1 -0
- package/dist/components/ErrorBoundary/types.d.ts +12 -0
- package/dist/components/ErrorBoundary/types.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/types.js +2 -0
- package/dist/components/ErrorBoundary/types.js.map +1 -0
- package/dist/components/GameProvider/AppIconMenu.d.ts +8 -0
- package/dist/components/GameProvider/AppIconMenu.d.ts.map +1 -0
- package/dist/components/GameProvider/AppIconMenu.js +12 -0
- package/dist/components/GameProvider/AppIconMenu.js.map +1 -0
- package/dist/components/GameProvider/GameProvider.d.ts +12 -0
- package/dist/components/GameProvider/GameProvider.d.ts.map +1 -0
- package/dist/components/GameProvider/GameProvider.js +36 -0
- package/dist/components/GameProvider/GameProvider.js.map +1 -0
- package/dist/components/GameProvider/SaveLoadMenuContext.d.ts +11 -0
- package/dist/components/GameProvider/SaveLoadMenuContext.d.ts.map +1 -0
- package/dist/components/GameProvider/SaveLoadMenuContext.js +3 -0
- package/dist/components/GameProvider/SaveLoadMenuContext.js.map +1 -0
- package/dist/components/GameProvider/SaveLoadMenuProvider.d.ts +4 -0
- package/dist/components/GameProvider/SaveLoadMenuProvider.d.ts.map +1 -0
- package/dist/components/GameProvider/SaveLoadMenuProvider.js +32 -0
- package/dist/components/GameProvider/SaveLoadMenuProvider.js.map +1 -0
- package/dist/components/GameProvider/index.d.ts +2 -0
- package/dist/components/GameProvider/index.d.ts.map +1 -0
- package/dist/components/GameProvider/index.js +2 -0
- package/dist/components/GameProvider/index.js.map +1 -0
- package/dist/components/InteractiveMapComponent/Hotspot.d.ts +9 -0
- package/dist/components/InteractiveMapComponent/Hotspot.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/Hotspot.js +30 -0
- package/dist/components/InteractiveMapComponent/Hotspot.js.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMap.d.ts +8 -0
- package/dist/components/InteractiveMapComponent/HotspotMap.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMap.js +37 -0
- package/dist/components/InteractiveMapComponent/HotspotMap.js.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMenu.d.ts +9 -0
- package/dist/components/InteractiveMapComponent/HotspotMenu.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMenu.js +37 -0
- package/dist/components/InteractiveMapComponent/HotspotMenu.js.map +1 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts +7 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.js +23 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.js.map +1 -0
- package/dist/components/InteractiveMapComponent/InteractiveMapComponent.d.ts +7 -0
- package/dist/components/InteractiveMapComponent/InteractiveMapComponent.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/InteractiveMapComponent.js +23 -0
- package/dist/components/InteractiveMapComponent/InteractiveMapComponent.js.map +1 -0
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts +7 -0
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/LabelHotspot.js +10 -0
- package/dist/components/InteractiveMapComponent/LabelHotspot.js.map +1 -0
- package/dist/components/InteractiveMapComponent/SideHotspot.d.ts +7 -0
- package/dist/components/InteractiveMapComponent/SideHotspot.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/SideHotspot.js +11 -0
- package/dist/components/InteractiveMapComponent/SideHotspot.js.map +1 -0
- package/dist/components/InteractiveMapComponent/helpers.d.ts +11 -0
- package/dist/components/InteractiveMapComponent/helpers.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/helpers.js +34 -0
- package/dist/components/InteractiveMapComponent/helpers.js.map +1 -0
- package/dist/components/InteractiveMapComponent/index.d.ts +2 -0
- package/dist/components/InteractiveMapComponent/index.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/index.js +2 -0
- package/dist/components/InteractiveMapComponent/index.js.map +1 -0
- package/dist/components/InteractiveMapComponent/types.d.ts +19 -0
- package/dist/components/InteractiveMapComponent/types.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/types.js +2 -0
- package/dist/components/InteractiveMapComponent/types.js.map +1 -0
- package/dist/components/InteractiveMapComponent/useHotspotMapSize.d.ts +3 -0
- package/dist/components/InteractiveMapComponent/useHotspotMapSize.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/useHotspotMapSize.js +74 -0
- package/dist/components/InteractiveMapComponent/useHotspotMapSize.js.map +1 -0
- package/dist/components/InteractiveMapComponent/useSortHotspots.d.ts +16 -0
- package/dist/components/InteractiveMapComponent/useSortHotspots.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/useSortHotspots.js +13 -0
- package/dist/components/InteractiveMapComponent/useSortHotspots.js.map +1 -0
- package/dist/components/MainMenu.d.ts +2 -0
- package/dist/components/MainMenu.d.ts.map +1 -0
- package/dist/components/MainMenu.js +15 -0
- package/dist/components/MainMenu.js.map +1 -0
- package/dist/components/PassageController/PassageController.d.ts +2 -0
- package/dist/components/PassageController/PassageController.d.ts.map +1 -0
- package/dist/components/PassageController/PassageController.js +25 -0
- package/dist/components/PassageController/PassageController.js.map +1 -0
- package/dist/components/PassageController/index.d.ts +2 -0
- package/dist/components/PassageController/index.d.ts.map +1 -0
- package/dist/components/PassageController/index.js +2 -0
- package/dist/components/PassageController/index.js.map +1 -0
- package/dist/components/ReloadButton.d.ts +15 -0
- package/dist/components/ReloadButton.d.ts.map +1 -0
- package/dist/components/ReloadButton.js +10 -0
- package/dist/components/ReloadButton.js.map +1 -0
- package/dist/components/SaveButton.d.ts +21 -0
- package/dist/components/SaveButton.d.ts.map +1 -0
- package/dist/components/SaveButton.js +10 -0
- package/dist/components/SaveButton.js.map +1 -0
- package/dist/components/SaveLoadModal/SaveLoadModal.d.ts +9 -0
- package/dist/components/SaveLoadModal/SaveLoadModal.d.ts.map +1 -0
- package/dist/components/SaveLoadModal/SaveLoadModal.js +52 -0
- package/dist/components/SaveLoadModal/SaveLoadModal.js.map +1 -0
- package/dist/components/SaveLoadModal/index.d.ts +2 -0
- package/dist/components/SaveLoadModal/index.d.ts.map +1 -0
- package/dist/components/SaveLoadModal/index.js +2 -0
- package/dist/components/SaveLoadModal/index.js.map +1 -0
- package/dist/components/StoryComponent/StoryComponent.d.ts +7 -0
- package/dist/components/StoryComponent/StoryComponent.d.ts.map +1 -0
- package/dist/components/StoryComponent/StoryComponent.js +30 -0
- package/dist/components/StoryComponent/StoryComponent.js.map +1 -0
- package/dist/components/StoryComponent/components/Actions.d.ts +7 -0
- package/dist/components/StoryComponent/components/Actions.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Actions.js +6 -0
- package/dist/components/StoryComponent/components/Actions.js.map +1 -0
- package/dist/components/StoryComponent/components/Conversation.d.ts +7 -0
- package/dist/components/StoryComponent/components/Conversation.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Conversation.js +53 -0
- package/dist/components/StoryComponent/components/Conversation.js.map +1 -0
- package/dist/components/StoryComponent/components/Header.d.ts +7 -0
- package/dist/components/StoryComponent/components/Header.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Header.js +12 -0
- package/dist/components/StoryComponent/components/Header.js.map +1 -0
- package/dist/components/StoryComponent/components/Image.d.ts +5 -0
- package/dist/components/StoryComponent/components/Image.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Image.js +31 -0
- package/dist/components/StoryComponent/components/Image.js.map +1 -0
- package/dist/components/StoryComponent/components/Text.d.ts +7 -0
- package/dist/components/StoryComponent/components/Text.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Text.js +4 -0
- package/dist/components/StoryComponent/components/Text.js.map +1 -0
- package/dist/components/StoryComponent/components/Video.d.ts +7 -0
- package/dist/components/StoryComponent/components/Video.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/Video.js +4 -0
- package/dist/components/StoryComponent/components/Video.js.map +1 -0
- package/dist/components/StoryComponent/components/index.d.ts +7 -0
- package/dist/components/StoryComponent/components/index.d.ts.map +1 -0
- package/dist/components/StoryComponent/components/index.js +7 -0
- package/dist/components/StoryComponent/components/index.js.map +1 -0
- package/dist/components/StoryComponent/index.d.ts +2 -0
- package/dist/components/StoryComponent/index.d.ts.map +1 -0
- package/dist/components/StoryComponent/index.js +2 -0
- package/dist/components/StoryComponent/index.js.map +1 -0
- package/dist/components/common/Button.d.ts +8 -0
- package/dist/components/common/Button.d.ts.map +1 -0
- package/dist/components/common/Button.js +64 -0
- package/dist/components/common/Button.js.map +1 -0
- package/dist/components/common/Spinner.d.ts +2 -0
- package/dist/components/common/Spinner.d.ts.map +1 -0
- package/dist/components/common/Spinner.js +3 -0
- package/dist/components/common/Spinner.js.map +1 -0
- package/dist/components/common/Tooltip.d.ts +12 -0
- package/dist/components/common/Tooltip.d.ts.map +1 -0
- package/dist/components/common/Tooltip.js +28 -0
- package/dist/components/common/Tooltip.js.map +1 -0
- package/dist/components/common/index.d.ts +4 -0
- package/dist/components/common/index.d.ts.map +1 -0
- package/dist/components/common/index.js +4 -0
- package/dist/components/common/index.js.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +2 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +44 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useSaveLoadMenu.d.ts +2 -0
- package/dist/hooks/useSaveLoadMenu.d.ts.map +1 -0
- package/dist/hooks/useSaveLoadMenu.js +11 -0
- package/dist/hooks/useSaveLoadMenu.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +1809 -0
- package/dist/tests/ErrorBoundary.test.d.ts +2 -0
- package/dist/tests/ErrorBoundary.test.d.ts.map +1 -0
- package/dist/tests/ErrorBoundary.test.js +317 -0
- package/dist/tests/ErrorBoundary.test.js.map +1 -0
- package/dist/tests/dexie.mock.d.ts +56 -0
- package/dist/tests/dexie.mock.d.ts.map +1 -0
- package/dist/tests/dexie.mock.js +113 -0
- package/dist/tests/dexie.mock.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractiveMapComponent.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/InteractiveMapComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAUvD,KAAK,mBAAmB,GAAG;IACvB,cAAc,EAAE,cAAc,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,qBAErC,mBAAmB,4CA2GrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useRef } from "react";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { Hotspot } from "./Hotspot";
|
|
6
|
+
import { HotspotMap } from "./HotspotMap";
|
|
7
|
+
import { HotspotMenu } from "./HotspotMenu";
|
|
8
|
+
import { SideHotspot } from "./SideHotspot";
|
|
9
|
+
import { useSortHotspots } from "./useSortHotspots";
|
|
10
|
+
export const InteractiveMapComponent = ({ interactiveMap, }) => {
|
|
11
|
+
const mapContainerRef = useRef(null);
|
|
12
|
+
const displayable = useMemo(() => interactiveMap.display(), [interactiveMap]);
|
|
13
|
+
const { mapHotspots, menu, bottomHotspots, rightHotspots, topHotspots, leftHotspots, } = useSortHotspots({ hotspots: displayable.hotspots });
|
|
14
|
+
// Create a unique key for the displayable content to trigger animations
|
|
15
|
+
const displayableKey = useMemo(() => {
|
|
16
|
+
return `${displayable.image}-${displayable.bgImage}-${displayable.hotspots.length}`;
|
|
17
|
+
}, [displayable.image, displayable.bgImage, displayable.hotspots.length]);
|
|
18
|
+
return (_jsx("div", { className: "w-full h-full flex flex-col", children: _jsxs("div", { className: "flex-grow relative overflow-hidden animate-[fadeIn_0.3s_ease-in-out]", children: [displayable.bgImage && (_jsx("div", { className: "absolute inset-0 z-0 bg-cover bg-center bg-no-repeat", style: {
|
|
19
|
+
backgroundImage: `url(${displayable.bgImage})`,
|
|
20
|
+
opacity: displayable.props?.bgOpacity,
|
|
21
|
+
} })), _jsxs("div", { className: twMerge("h-full w-full flex flex-col", displayable.classNames?.container), children: [_jsx("div", { className: twMerge("w-full z-20 overflow-y-hidden overflow-x-auto scrollbar-hide max-h-100", displayable.classNames?.topHotspots), children: topHotspots.map((hotspot, index) => (_jsx(SideHotspot, { hotspot: hotspot }, index))) }), _jsxs("div", { className: "h-full w-full flex", children: [_jsx("div", { className: twMerge("h-full z-20 overflow-x-hidden overflow-y-auto scrollbar-hide max-w-100", displayable.classNames?.leftHotspots), children: leftHotspots.map((hotspot, index) => (_jsx(SideHotspot, { hotspot: hotspot }, index))) }), _jsx("div", { ref: mapContainerRef, className: "w-full h-full flex justify-center items-center relative z-10", children: _jsxs(HotspotMap, { imageUrl: displayable.image, children: [mapHotspots.map((hotspot, index) => (_jsx(Hotspot, { hotspot: hotspot }, index))), menu.map((menuItem, index) => (_jsx(HotspotMenu, { menu: menuItem }, `menu-${index}`)))] }) }), _jsx("div", { className: twMerge("h-full z-20 overflow-x-hidden overflow-y-auto scrollbar-hide max-w-100", displayable.classNames?.rightHotspots), children: rightHotspots.map((hotspot, index) => (_jsx(SideHotspot, { hotspot: hotspot }, index))) })] }), _jsx("div", { className: twMerge("w-full z-20 overflow-y-hidden overflow-x-auto scrollbar-hide max-h-100", displayable.classNames?.bottomHotspots), children: bottomHotspots.map((hotspot, index) => (_jsx(SideHotspot, { hotspot: hotspot }, index))) })] })] }, displayableKey) }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=InteractiveMapComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractiveMapComponent.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/InteractiveMapComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACpC,cAAc,GACI,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAErD,MAAM,WAAW,GAAG,OAAO,CACvB,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,EAC9B,CAAC,cAAc,CAAC,CACnB,CAAC;IACF,MAAM,EACF,WAAW,EACX,IAAI,EACJ,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,GACf,GAAG,eAAe,CAAC,EAAE,QAA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pB,SAAS,EAAC,8DAA8D,YAExE,MAAC,UAAU,IAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,aAClC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,OAAO,IAAa,OAAO,EAAE,OAAO,IAAvB,KAAK,CAAsB,CAC5C,CAAC,EACD,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,KAAC,WAAW,IAER,IAAI,EAAE,QAAQ,IADT,QAAQ,KAAK,EAAE,CAEtB,CACL,CAAC,IACO,GACX,EACN,cACI,SAAS,EAAE,OAAO,CACd,wEAAwE,EACxE,WAAW,CAAC,UAAU,EAAE,aAAa,CACxC,YAEA,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,KAAC,WAAW,IAAa,OAAO,EAAE,OAAO,IAAvB,KAAK,CAAsB,CAChD,CAAC,GACA,IACJ,EACN,cACI,SAAS,EAAE,OAAO,CACd,wEAAwE,EACxE,WAAW,CAAC,UAAU,EAAE,cAAc,CACzC,YAEA,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,WAAW,IAAa,OAAO,EAAE,OAAO,IAAvB,KAAK,CAAsB,CAChD,CAAC,GACA,IACJ,KA/ED,cAAc,CAgFjB,GACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LabelHotspot as LabelHotspotType, MapLabelHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
type LabelHotspotProps = {
|
|
3
|
+
hotspot: MapLabelHotspot | LabelHotspotType;
|
|
4
|
+
};
|
|
5
|
+
export declare const LabelHotspot: ({ hotspot }: LabelHotspotProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=LabelHotspot.d.ts.map
|
|
@@ -0,0 +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;AAMxC,KAAK,iBAAiB,GAAG;IACrB,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,aAAa,iBAAiB,4CAiB1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "../../components/common";
|
|
4
|
+
import { callIfFunction } from "./helpers";
|
|
5
|
+
export const LabelHotspot = ({ hotspot }) => {
|
|
6
|
+
const content = callIfFunction(hotspot.content);
|
|
7
|
+
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 }) }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=LabelHotspot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/LabelHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM3C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,EAAqB,EAAE,EAAE;IAC3D,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtD,OAAO,CACH,wBACI,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,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SideImageHotspot, SideLabelHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
type Props = {
|
|
3
|
+
hotspot: SideLabelHotspot | SideImageHotspot;
|
|
4
|
+
};
|
|
5
|
+
export declare const SideHotspot: ({ hotspot }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=SideHotspot.d.ts.map
|
|
@@ -0,0 +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;AAQxC,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,aAAa,KAAK,4CAoB7C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip } from "../../components/common";
|
|
4
|
+
import { callIfFunction } from "./helpers";
|
|
5
|
+
import { ImageHotspot } from "./ImageHotspot";
|
|
6
|
+
import { LabelHotspot } from "./LabelHotspot";
|
|
7
|
+
export const SideHotspot = ({ hotspot }) => {
|
|
8
|
+
const tooltipContent = callIfFunction(hotspot.tooltip?.content);
|
|
9
|
+
return (_jsx(Tooltip, { content: tooltipContent, placement: hotspot.tooltip?.position || "top", disabled: !tooltipContent, children: _jsx("div", { children: hotspot.type === "image" ? (_jsx(ImageHotspot, { hotspot: hotspot })) : hotspot.type === "label" ? (_jsx(LabelHotspot, { hotspot: hotspot })) : (_jsx("div", { children: "Unknown Hotspot Type" })) }) }));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=SideHotspot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideHotspot.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/SideHotspot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,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,KAAC,OAAO,IACJ,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAC7C,QAAQ,EAAE,CAAC,cAAc,YAEzB,wBACK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CACxB,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,GAAI,CACrC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAC3B,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,GAAI,CACrC,CAAC,CAAC,CAAC,CACA,iDAA+B,CAClC,GACC,GACA,CACb,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MouseEvent, ReactElement, ReactNode, RefObject } from "react";
|
|
2
|
+
import { ImagePositionInfo } from "./types";
|
|
3
|
+
type RenderChildrenProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
positionInfo: ImagePositionInfo;
|
|
6
|
+
};
|
|
7
|
+
export declare const renderChildren: ({ children, positionInfo, }: RenderChildrenProps) => (string | number | bigint | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>)[] | null | undefined;
|
|
8
|
+
export declare const handleMapClick: (event: MouseEvent<HTMLImageElement>, imageRef: RefObject<HTMLImageElement | null>) => void;
|
|
9
|
+
export declare const callIfFunction: <T, Props>(value: T | ((props: Props | undefined) => T), props?: Props | undefined) => T;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAIH,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,mBAAmB,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,iBAAiB,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6BAG5B,mBAAmB,yWAYhB,CAAC;AAEP,eAAO,MAAM,cAAc,GACvB,OAAO,UAAU,CAAC,gBAAgB,CAAC,EACnC,UAAU,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAkB/C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,KAAK,EACnC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,KAAK,CAAC,CAAC,EAC5C,QAAQ,KAAK,GAAG,SAAS,KAC1B,CAIF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Game } from "@react-text-game/core";
|
|
2
|
+
import { Children, cloneElement, isValidElement, } from "react";
|
|
3
|
+
export const renderChildren = ({ children, positionInfo, }) => Children.map(children, (child) => {
|
|
4
|
+
if (isValidElement(child)) {
|
|
5
|
+
// Cast to ReactElement to properly pass props
|
|
6
|
+
return cloneElement(child, {
|
|
7
|
+
imagePositionInfo: positionInfo,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return child;
|
|
11
|
+
});
|
|
12
|
+
export const handleMapClick = (event, imageRef) => {
|
|
13
|
+
// log percentage of click position relative to the image size
|
|
14
|
+
if (Game.options.isDevMode) {
|
|
15
|
+
const rect = imageRef.current?.getBoundingClientRect();
|
|
16
|
+
if (rect) {
|
|
17
|
+
const xPercent = ((event.clientX - rect.left) / rect.width) * 100;
|
|
18
|
+
const yPercent = ((event.clientY - rect.top) / rect.height) * 100;
|
|
19
|
+
console.log("Click position is copied to clipboard");
|
|
20
|
+
navigator.clipboard.writeText(`{ x: ${xPercent.toFixed(2)}, y: ${yPercent.toFixed(2)} }`).catch((e) => {
|
|
21
|
+
console.error("Failed to copy to clipboard:", e);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.error("Image reference is null or invalid.");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export const callIfFunction = (value, props) => {
|
|
30
|
+
return typeof value === "function"
|
|
31
|
+
? value(props)
|
|
32
|
+
: value;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|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AC,OAAO,CAAC,CAAC,CAAC,IAAI,CAC7D,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC,CAAA;QACN,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;IACL,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC1B,KAA4C,EAC5C,KAAyB,EACxB,EAAE;IACH,OAAO,OAAO,KAAK,KAAK,UAAU;QAC9B,CAAC,CAAE,KAAyC,CAAC,KAAK,CAAC;QACnD,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
export interface ImagePositionInfo {
|
|
3
|
+
scaleFactor: number;
|
|
4
|
+
offsetLeft: number;
|
|
5
|
+
offsetTop: number;
|
|
6
|
+
scaledWidth: number;
|
|
7
|
+
scaledHeight: number;
|
|
8
|
+
}
|
|
9
|
+
export interface UseHotspotMapSizeProps {
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
naturalWidth: number;
|
|
12
|
+
naturalHeight: number;
|
|
13
|
+
}
|
|
14
|
+
export interface UseHotspotMapSizeResult {
|
|
15
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
16
|
+
imageRef: RefObject<HTMLImageElement | null>;
|
|
17
|
+
positionInfo: ImagePositionInfo;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACpC,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,YAAY,EAAE,iBAAiB,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHotspotMapSize.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/useHotspotMapSize.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,sBAAsB,EACtB,uBAAuB,EAC1B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,iBAAiB,GAAI,6CAI/B,sBAAsB,KAAG,uBAuF3B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
export const useHotspotMapSize = ({ isLoading, naturalWidth, naturalHeight, }) => {
|
|
4
|
+
const containerRef = useRef(null);
|
|
5
|
+
const imageRef = useRef(null);
|
|
6
|
+
const resizeObserverRef = useRef(null);
|
|
7
|
+
const [positionInfo, setPositionInfo] = useState({
|
|
8
|
+
scaleFactor: 1,
|
|
9
|
+
offsetLeft: 0,
|
|
10
|
+
offsetTop: 0,
|
|
11
|
+
scaledWidth: 0,
|
|
12
|
+
scaledHeight: 0,
|
|
13
|
+
});
|
|
14
|
+
// Update dimensions whenever the container size changes
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const updateSize = () => {
|
|
17
|
+
if (!containerRef.current ||
|
|
18
|
+
!imageRef.current ||
|
|
19
|
+
naturalWidth === 0 ||
|
|
20
|
+
naturalHeight === 0)
|
|
21
|
+
return;
|
|
22
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
23
|
+
const containerWidth = containerRect.width;
|
|
24
|
+
const containerHeight = containerRect.height;
|
|
25
|
+
// Calculate scale ratios for both dimensions
|
|
26
|
+
const widthRatio = containerWidth / naturalWidth;
|
|
27
|
+
const heightRatio = containerHeight / naturalHeight;
|
|
28
|
+
// Use the smaller ratio to ensure the image fits entirely
|
|
29
|
+
const scaleFactor = Math.min(widthRatio, heightRatio);
|
|
30
|
+
const scaledWidth = naturalWidth * scaleFactor;
|
|
31
|
+
const scaledHeight = naturalHeight * scaleFactor;
|
|
32
|
+
// Calculate margins to center the image
|
|
33
|
+
const marginLeft = (containerWidth - scaledWidth) / 2;
|
|
34
|
+
const marginTop = (containerHeight - scaledHeight) / 2;
|
|
35
|
+
// Apply dimensions and position to the image
|
|
36
|
+
imageRef.current.style.width = `${scaledWidth}px`;
|
|
37
|
+
imageRef.current.style.height = `${scaledHeight}px`;
|
|
38
|
+
imageRef.current.style.marginLeft = `${marginLeft}px`;
|
|
39
|
+
imageRef.current.style.marginTop = `${marginTop}px`;
|
|
40
|
+
// Update position info for hotspots
|
|
41
|
+
setPositionInfo({
|
|
42
|
+
scaleFactor,
|
|
43
|
+
offsetLeft: marginLeft,
|
|
44
|
+
offsetTop: marginTop,
|
|
45
|
+
scaledWidth,
|
|
46
|
+
scaledHeight,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
if (!isLoading && containerRef.current && imageRef.current) {
|
|
50
|
+
// Initial size update
|
|
51
|
+
updateSize();
|
|
52
|
+
// Set up ResizeObserver to detect any size changes in the container
|
|
53
|
+
resizeObserverRef.current = new ResizeObserver(() => {
|
|
54
|
+
updateSize();
|
|
55
|
+
});
|
|
56
|
+
resizeObserverRef.current.observe(containerRef.current);
|
|
57
|
+
// Also listen for window resize as a fallback
|
|
58
|
+
window.addEventListener("resize", updateSize);
|
|
59
|
+
}
|
|
60
|
+
return () => {
|
|
61
|
+
// Clean up
|
|
62
|
+
if (resizeObserverRef.current) {
|
|
63
|
+
resizeObserverRef.current.disconnect();
|
|
64
|
+
}
|
|
65
|
+
window.removeEventListener("resize", updateSize);
|
|
66
|
+
};
|
|
67
|
+
}, [isLoading, naturalWidth, naturalHeight]);
|
|
68
|
+
return {
|
|
69
|
+
containerRef,
|
|
70
|
+
imageRef,
|
|
71
|
+
positionInfo,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=useHotspotMapSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHotspotMapSize.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/useHotspotMapSize.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAC9B,SAAS,EACT,YAAY,EACZ,aAAa,GACQ,EAA2B,EAAE;IAClD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,M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, SideLabelHotspot } from "@react-text-game/core/passages";
|
|
2
|
+
type Props = {
|
|
3
|
+
hotspots: Array<AnyHotspot>;
|
|
4
|
+
};
|
|
5
|
+
type SideHotspot = SideLabelHotspot | SideImageHotspot;
|
|
6
|
+
type ReturnType = {
|
|
7
|
+
mapHotspots: Array<MapLabelHotspot | MapImageHotspot>;
|
|
8
|
+
topHotspots: Array<SideHotspot>;
|
|
9
|
+
bottomHotspots: Array<SideHotspot>;
|
|
10
|
+
leftHotspots: Array<SideHotspot>;
|
|
11
|
+
rightHotspots: Array<SideHotspot>;
|
|
12
|
+
menu: Array<MapMenu>;
|
|
13
|
+
};
|
|
14
|
+
export declare const useSortHotspots: ({ hotspots }: Props) => ReturnType;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=useSortHotspots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSortHotspots.d.ts","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/useSortHotspots.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,UAAU,EACV,eAAe,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,gCAAgC,CAAC;AAExC,KAAK,KAAK,GAAG;IACT,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC/B,CAAC;AAEF,KAAK,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEvD,KAAK,UAAU,GAAG;IACd,WAAW,EAAE,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC;IACtD,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAChC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACjC,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,cAAc,KAAK,KAAG,UA2BrD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export const useSortHotspots = ({ hotspots }) => {
|
|
3
|
+
const sideHotspots = hotspots.filter((hotspot) => !("position" in hotspot));
|
|
4
|
+
return {
|
|
5
|
+
mapHotspots: hotspots.filter((hotspot) => "position" in hotspot && hotspot.type !== "menu"),
|
|
6
|
+
topHotspots: sideHotspots.filter((hotspot) => hotspot.position === "top"),
|
|
7
|
+
bottomHotspots: sideHotspots.filter((hotspot) => hotspot.position === "bottom"),
|
|
8
|
+
leftHotspots: sideHotspots.filter((hotspot) => hotspot.position === "left"),
|
|
9
|
+
rightHotspots: sideHotspots.filter((hotspot) => hotspot.position === "right"),
|
|
10
|
+
menu: hotspots.filter((hotspot) => hotspot.type === "menu"),
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useSortHotspots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSortHotspots.js","sourceRoot":"","sources":["../../../src/components/InteractiveMapComponent/useSortHotspots.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AA0Bb,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAc,EAAE;IAC/D,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAChC,CAAC,OAAO,EAAkD,EAAE,CACxD,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,CAC/B,CAAC;IAEF,OAAO;QACH,WAAW,EAAE,QAAQ,CAAC,MAAM,CACxB,CAAC,OAAO,EAAgD,EAAE,CACtD,UAAU,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,CACvD;QACD,WAAW,EAAE,YAAY,CAAC,MAAM,CAC5B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,KAAK,CAC1C;QACD,cAAc,EAAE,YAAY,CAAC,MAAM,CAC/B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAC7C;QACD,YAAY,EAAE,YAAY,CAAC,MAAM,CAC7B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,MAAM,CAC3C;QACD,aAAa,EAAE,YAAY,CAAC,MAAM,CAC9B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAC5C;QACD,IAAI,EAAE,QAAQ,CAAC,MAAM,CACjB,CAAC,OAAO,EAAsB,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAC3D;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainMenu.d.ts","sourceRoot":"","sources":["../../src/components/MainMenu.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,+CAyCpB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Game, SYSTEM_PASSAGE_NAMES } from "@react-text-game/core";
|
|
3
|
+
import { useLastLoadGame } from "@react-text-game/core/saves";
|
|
4
|
+
import { useSaveLoadMenu } from "../hooks";
|
|
5
|
+
import { Button } from "./common";
|
|
6
|
+
export const MainMenu = () => {
|
|
7
|
+
const { hasLastSave, loadLastGame } = useLastLoadGame();
|
|
8
|
+
const { openLoadMenu } = useSaveLoadMenu();
|
|
9
|
+
const continueCallback = async () => {
|
|
10
|
+
const result = await loadLastGame();
|
|
11
|
+
console.log(result);
|
|
12
|
+
};
|
|
13
|
+
return (_jsxs("div", { className: "mt-10 flex flex-col items-center justify-center h-full gap-8", children: [_jsxs("div", { className: "fixed top-10 left-10 flex flex-col items-start", children: [_jsxs("h2", { className: "text-2xl flex gap-2", children: [_jsx("span", { className: "text-primary-500 font-semibold", children: Game.options.gameName.toUpperCase() }), _jsxs("span", { className: "font-mono font-light text-secondary-500", children: ["v", Game.options.gameVersion] })] }), Game.options.author && (_jsxs("h3", { className: "text-md font-light text-secondary-400", children: ["by ", Game.options.author] }))] }), _jsx("h1", { className: "text-4xl font-bold text-primary-900", children: "Main Menu" }), _jsxs("div", { className: "flex flex-col w-40 gap-4", children: [_jsx(Button, { onClick: () => Game.jumpTo(Game.options.startPassage || SYSTEM_PASSAGE_NAMES.START), children: "New Game" }), _jsx(Button, { disabled: !hasLastSave, onClick: continueCallback, children: "Continue" }), _jsx(Button, { onClick: openLoadMenu, children: "Load Game" })] })] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=MainMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainMenu.js","sourceRoot":"","sources":["../../src/components/MainMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IACzB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAC;IACxD,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAC;IAE3C,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;QAEpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACH,eAAK,SAAS,EAAC,8DAA8D,aACzE,eAAK,SAAS,EAAC,gDAAgD,aAC3D,cAAI,SAAS,EAAC,qBAAqB,aAC/B,eAAM,SAAS,EAAC,gCAAgC,YAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,GACjC,EACP,gBAAM,SAAS,EAAC,yCAAyC,kBACnD,IAAI,CAAC,OAAO,CAAC,WAAW,IACvB,IACN,EACJ,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CACpB,cAAI,SAAS,EAAC,uCAAuC,oBAC7C,IAAI,CAAC,OAAO,CAAC,MAAM,IACtB,CACR,IACC,EACN,aAAI,SAAS,EAAC,qCAAqC,0BAAe,EAClE,eAAK,SAAS,EAAC,0BAA0B,aACrC,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,oBAAoB,CAAC,KAAK,CAAC,yBAElF,EACT,KAAC,MAAM,IAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,gBAAgB,yBAEhD,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,YAAY,0BAEpB,IACP,IACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PassageController.d.ts","sourceRoot":"","sources":["../../../src/components/PassageController/PassageController.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,+CAoC7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCurrentPassage, } from "@react-text-game/core";
|
|
4
|
+
import { InteractiveMapComponent } from "../../components/InteractiveMapComponent";
|
|
5
|
+
import { StoryComponent } from "../../components/StoryComponent";
|
|
6
|
+
export const PassageController = () => {
|
|
7
|
+
const currentPassage = useCurrentPassage();
|
|
8
|
+
const renderComponent = () => {
|
|
9
|
+
switch (currentPassage?.type) {
|
|
10
|
+
case "story":
|
|
11
|
+
return _jsx(StoryComponent, { story: currentPassage });
|
|
12
|
+
case "interactiveMap":
|
|
13
|
+
return (_jsx(InteractiveMapComponent, { interactiveMap: currentPassage }));
|
|
14
|
+
case "widget":
|
|
15
|
+
return currentPassage.display();
|
|
16
|
+
default:
|
|
17
|
+
return _jsxs("div", { children: ["Unknown Passage Type ", currentPassage?.type] });
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
if (!currentPassage) {
|
|
21
|
+
return (_jsx("div", { className: "flex items-center justify-center w-full h-full", children: _jsx("h1", { className: "text-2xl font-bold", children: "NO PASSAGE SELECTED" }) }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsx("div", { className: "w-full h-full animate-in fade-in duration-300", children: renderComponent() }, currentPassage.type));
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=PassageController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PassageController.js","sourceRoot":"","sources":["../../../src/components/PassageController/PassageController.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAGH,iBAAiB,GAEpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE3C,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,QAAQ,cAAc,EAAE,IAAI,EAAE,CAAC;YAC3B,KAAK,OAAO;gBACR,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,cAAuB,GAAI,CAAC;YAC9D,KAAK,gBAAgB;gBACjB,OAAO,CACH,KAAC,uBAAuB,IACpB,cAAc,EAAE,cAAgC,GAClD,CACL,CAAC;YACN,KAAK,QAAQ;gBACT,OAAQ,cAAyB,CAAC,OAAO,EAAE,CAAC;YAChD;gBACI,OAAO,mDAA2B,cAAc,EAAE,IAAI,IAAO,CAAC;QACtE,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,OAAO,CACH,cAAK,SAAS,EAAC,gDAAgD,YAC3D,aAAI,SAAS,EAAC,oBAAoB,oCAAyB,GACzD,CACT,CAAC;IACN,CAAC;IAED,OAAO,CACH,cAEI,SAAS,EAAC,+CAA+C,YAExD,eAAe,EAAE,IAHb,cAAc,CAAC,IAAI,CAItB,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PassageController/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PassageController/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonProps } from "../components/common";
|
|
2
|
+
type ReloadButtonProps = Omit<ButtonProps, "children" | "onClick"> & Readonly<{
|
|
3
|
+
/**
|
|
4
|
+
* If true, the button will display only the icon without any text.
|
|
5
|
+
*
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
isIconOnly?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const Icon: ({ className }: {
|
|
11
|
+
className?: string;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const ReloadButton: ({ isIconOnly, className, ...props }: ReloadButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=ReloadButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReloadButton.d.ts","sourceRoot":"","sources":["../../src/components/ReloadButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEzD,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,SAAS,CAAC,GAC9D,QAAQ,CAAC;IACL;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC,CAAC;AAEP,eAAO,MAAM,IAAI,GAAI,eAAe;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,4CAezD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,qCAI1B,iBAAiB,4CAanB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRestartGame } from "@react-text-game/core/saves";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { Button } from "../components/common";
|
|
5
|
+
export const Icon = ({ className }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", className: className, children: _jsxs("g", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: "1.5", children: [_jsx("path", { strokeLinejoin: "round", d: "m15.98 8.71-.44-.45c-1.96-2-5.12-2-7.08 0a5.2 5.2 0 0 0 0 7.24c1.96 2 5.12 2 7.08 0a5.18 5.18 0 0 0 1.42-4.26m-.98-2.53h-2.65m2.65 0V6" }), _jsx("path", { d: "M22 12c0 4.71 0 7.07-1.46 8.54C19.07 22 16.7 22 12 22c-4.71 0-7.07 0-8.54-1.46C2 19.07 2 16.7 2 12c0-4.71 0-7.07 1.46-8.54C4.93 2 7.3 2 12 2c4.71 0 7.07 0 8.54 1.46.97.98 1.3 2.35 1.4 4.54" })] }) }));
|
|
6
|
+
export const ReloadButton = ({ isIconOnly, className, ...props }) => {
|
|
7
|
+
const reload = useRestartGame();
|
|
8
|
+
return (_jsxs(Button, { className: twMerge("flex gap-2 items-center", className), onClick: reload, ...props, children: [_jsx(Icon, { className: "w-8 h-8" }), !isIconOnly && _jsx("span", { children: "Restart Game" })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=ReloadButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReloadButton.js","sourceRoot":"","sources":["../../src/components/ReloadButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAe,MAAM,oBAAoB,CAAC;AAYzD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,SAAS,EAA0B,EAAE,EAAE,CAAC,CAC3D,cACI,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,SAAS,YAEpB,aAAG,MAAM,EAAC,cAAc,EAAC,aAAa,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,aAC5D,eACI,cAAc,EAAC,OAAO,EACtB,CAAC,EAAC,wIAAwI,GAC5I,EACF,eAAM,CAAC,EAAC,8LAA8L,GAAG,IACzM,GACF,CACT,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EACzB,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAEhC,OAAO,CACH,MAAC,MAAM,IACH,SAAS,EAAE,OAAO,CAAC,yBAAyB,EAAE,SAAS,CAAC,EACxD,OAAO,EAAE,MAAM,KACX,KAAK,aAET,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,GAAG,EAC3B,CAAC,UAAU,IAAI,0CAAyB,IACpC,CACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ButtonProps } from "../components/common";
|
|
2
|
+
import { SaveLoadMode } from "../components/GameProvider/SaveLoadMenuProvider";
|
|
3
|
+
type SaveButtonProps = Omit<ButtonProps, "children" | "onClick"> & Readonly<{
|
|
4
|
+
/**
|
|
5
|
+
* If true, the button will display only the icon without any text.
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
isIconOnly?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Indicates the mode of operation for saving and loading functionality.
|
|
12
|
+
* The `mode` property is optional and is derived from the `SaveLoadMode` type,
|
|
13
|
+
* excluding the "load" property.
|
|
14
|
+
*
|
|
15
|
+
* @default "saveLoad"
|
|
16
|
+
*/
|
|
17
|
+
mode?: Omit<SaveLoadMode, "load">;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const SaveButton: ({ isIconOnly, className, mode, ...props }: SaveButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=SaveButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveButton.d.ts","sourceRoot":"","sources":["../../src/components/SaveButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAG7E,KAAK,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,SAAS,CAAC,GAC5D,QAAQ,CAAC;IACL;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC,CAAC;AAkBP,eAAO,MAAM,UAAU,GAAI,2CAKxB,eAAe,4CAajB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { Button } from "../components/common";
|
|
4
|
+
import { useSaveLoadMenu } from "../hooks";
|
|
5
|
+
const Icon = ({ className }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 48 48", className: className, children: _jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M35.28 4.88A3 3 0 0 0 33.16 4H7a3 3 0 0 0-3 3v34a3 3 0 0 0 3 3h34a3 3 0 0 0 3-3V14.89a3 3 0 0 0-.87-2.12l-7.85-7.89ZM7 6h6v9.95c0 1.13.92 2.05 2.05 2.05h17.9c1.13 0 2.05-.92 2.05-2.05V11.2a1 1 0 1 0-2 0v4.75c0 .03-.02.05-.05.05h-17.9a.05.05 0 0 1-.05-.05V6h18.16a1 1 0 0 1 .7.3l7.85 7.88a1 1 0 0 1 .29.7V41a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm21 24.02a4 4 0 0 0-4-4 1 1 0 0 1 0-2 6 6 0 1 1-6 6 1 1 0 0 1 2 0 4 4 0 1 0 8 0Z", clipRule: "evenodd" }) }));
|
|
6
|
+
export const SaveButton = ({ isIconOnly, className, mode, ...props }) => {
|
|
7
|
+
const { openSaveMenu, openSaveLoadMenu } = useSaveLoadMenu();
|
|
8
|
+
return (_jsxs(Button, { className: twMerge("flex gap-2 items-center", className), onClick: mode === "save" ? openSaveMenu : openSaveLoadMenu, ...props, children: [_jsx(Icon, { className: "w-8 h-8" }), !isIconOnly && _jsx("span", { children: "Save Game" })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=SaveButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveButton.js","sourceRoot":"","sources":["../../src/components/SaveButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAe,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAoBzC,MAAM,IAAI,GAAG,CAAC,EAAE,SAAS,EAA0B,EAAE,EAAE,CAAC,CACpD,cACI,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,SAAS,YAEpB,eACI,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,mbAAmb,EACrb,QAAQ,EAAC,SAAS,GACpB,GACA,CACT,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACvB,UAAU,EACV,SAAS,EACT,IAAI,EACJ,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,eAAe,EAAE,CAAC;IAE7D,OAAO,CACH,MAAC,MAAM,IACH,SAAS,EAAE,OAAO,CAAC,yBAAyB,EAAE,SAAS,CAAC,EACxD,OAAO,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,KACtD,KAAK,aAET,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,GAAG,EAC3B,CAAC,UAAU,IAAI,uCAAsB,IACjC,CACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SaveLoadMode } from "../../components/GameProvider/SaveLoadMenuProvider";
|
|
2
|
+
interface SaveLoadModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
mode?: SaveLoadMode;
|
|
6
|
+
}
|
|
7
|
+
export declare const SaveLoadModal: ({ isOpen, onClose, mode }: SaveLoadModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SaveLoadModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveLoadModal.d.ts","sourceRoot":"","sources":["../../../src/components/SaveLoadModal/SaveLoadModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,UAAU,kBAAkB;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,eAAO,MAAM,aAAa,GAAI,2BAAwC,kBAAkB,mDA2KvF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useSaveSlots } from "@react-text-game/core/saves";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
export const SaveLoadModal = ({ isOpen, onClose, mode = "saveLoad" }) => {
|
|
5
|
+
const saveSlots = useSaveSlots({ count: 9 });
|
|
6
|
+
const [loading, setLoading] = useState(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (isOpen) {
|
|
9
|
+
document.body.style.overflow = "hidden";
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
document.body.style.overflow = "";
|
|
13
|
+
}
|
|
14
|
+
return () => {
|
|
15
|
+
document.body.style.overflow = "";
|
|
16
|
+
};
|
|
17
|
+
}, [isOpen]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const handleEscape = (event) => {
|
|
20
|
+
if (event.key === "Escape") {
|
|
21
|
+
onClose();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
if (isOpen) {
|
|
25
|
+
document.addEventListener("keydown", handleEscape);
|
|
26
|
+
}
|
|
27
|
+
return () => {
|
|
28
|
+
document.removeEventListener("keydown", handleEscape);
|
|
29
|
+
};
|
|
30
|
+
}, [isOpen, onClose]);
|
|
31
|
+
if (!isOpen)
|
|
32
|
+
return null;
|
|
33
|
+
const handleAction = async (slotIndex, action) => {
|
|
34
|
+
setLoading(slotIndex);
|
|
35
|
+
try {
|
|
36
|
+
const result = await action();
|
|
37
|
+
if (!result || result.success) {
|
|
38
|
+
// Success - close modal
|
|
39
|
+
onClose();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error("Action failed:", error);
|
|
44
|
+
alert("An error occurred. Please check the console for details.");
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setLoading(null);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (_jsxs("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center", children: [_jsx("div", { className: "absolute inset-0 bg-overlay/40 backdrop-blur-sm", onClick: onClose }), _jsxs("div", { className: "relative w-full h-full md:h-auto md:max-h-[90vh] md:w-full md:max-w-4xl mx-0 md:mx-4 bg-background md:rounded-lg shadow-2xl flex flex-col overflow-hidden", children: [_jsxs("div", { className: "flex items-center justify-between p-4 md:p-6 border-b border-border", children: [_jsx("h2", { className: "text-xl md:text-2xl font-bold text-foreground", children: mode === "save" ? "Save Game" : mode === "load" ? "Load Game" : "Save / Load Game" }), _jsx("button", { onClick: onClose, className: "text-muted-foreground hover:text-foreground transition-colors p-2 hover:bg-muted rounded-lg", "aria-label": "Close", children: _jsx("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 md:p-6 bg-muted", children: _jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: saveSlots.map((slot, index) => (_jsxs("div", { className: "bg-card rounded-lg border border-border hover:border-muted-400 transition-all hover:shadow-lg overflow-hidden", children: [_jsxs("div", { className: "p-3 border-b border-border", children: [_jsxs("h3", { className: "text-lg font-semibold text-card-foreground", children: ["Slot ", index + 1] }), slot.data && (_jsx("p", { className: "text-xs text-muted-foreground mt-1", children: new Date(slot.data.timestamp).toLocaleString() }))] }), _jsx("div", { className: "p-3", children: slot.data ? (_jsxs("div", { className: "space-y-2", children: [slot.data.description && (_jsx("p", { className: "text-sm text-card-foreground line-clamp-2", children: slot.data.description })), slot.data.screenshot && (_jsx("img", { src: slot.data.screenshot, alt: "Save screenshot", className: "w-full h-32 object-cover rounded" })), _jsxs("div", { className: "flex gap-2", children: [(mode === "load" || mode === "saveLoad") && (_jsx("button", { onClick: () => handleAction(index, slot.load), disabled: loading !== null, className: "flex-1 bg-primary-600 hover:bg-primary-700 disabled:bg-muted-400 disabled:cursor-not-allowed text-primary-foreground px-4 py-2 rounded-lg transition-colors font-medium", children: loading === index ? "Loading..." : "Load" })), (mode === "save" || mode === "saveLoad") && (_jsx("button", { onClick: () => handleAction(index, slot.save), disabled: loading !== null, className: "flex-1 bg-success-600 hover:bg-success-700 disabled:bg-muted-400 disabled:cursor-not-allowed text-success-foreground px-4 py-2 rounded-lg transition-colors font-medium", children: loading === index ? "Saving..." : "Overwrite" })), _jsx("button", { onClick: () => handleAction(index, slot.delete), disabled: loading !== null, className: "bg-danger-600 hover:bg-danger-700 disabled:bg-muted-400 disabled:cursor-not-allowed text-danger-foreground px-4 py-2 rounded-lg transition-colors", "aria-label": "Delete save", children: _jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }) })] })] })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [_jsx("p", { className: "text-muted-foreground mb-4", children: "Empty Slot" }), (mode === "save" || mode === "saveLoad") && (_jsx("button", { onClick: () => handleAction(index, slot.save), disabled: loading !== null, className: "bg-success-600 hover:bg-success-700 disabled:bg-muted-400 disabled:cursor-not-allowed text-success-foreground px-4 py-2 rounded-lg transition-colors font-medium", children: loading === index ? "Saving..." : "Save Here" }))] })) })] }, index))) }) }), _jsx("div", { className: "p-4 md:p-6 border-t border-border bg-background", children: _jsx("button", { onClick: onClose, className: "w-full md:w-auto px-6 py-2 bg-muted hover:bg-muted-300 text-foreground rounded-lg transition-colors font-medium", children: "Close" }) })] })] }));
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=SaveLoadModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveLoadModal.js","sourceRoot":"","sources":["../../../src/components/SaveLoadModal/SaveLoadModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAU5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,UAAU,EAAsB,EAAE,EAAE;IACxF,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,MAAM,EAAE,CAAC;YACT,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC5C,CAAC;aAAM,CAAC;YACJ,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,GAAG,EAAE;YACR,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,YAAY,GAAG,CAAC,KAAoB,EAAE,EAAE;YAC1C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAA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