diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index f97707eb..2992eeba 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -83,11 +83,14 @@ if (enablePlaygrounds) { I18nPlayground = React.lazy(() => import("./components/playground/I18nPlayground")); PlaygroundChat = React.lazy(() => import("./pages/PlaygroundChat")); - Tetris = React.lazy(() => import("./apps/tetris/Tetris")); - FileBrowser = React.lazy(() => import("./apps/filebrowser/FileBrowser")); SupportChat = React.lazy(() => import("./pages/SupportChat")); } + +Tetris = React.lazy(() => import("./apps/tetris/Tetris")); +FileBrowser = React.lazy(() => import("./apps/filebrowser/FileBrowser")); + + const VersionMap = React.lazy(() => import("./pages/VersionMap")); const UserCollections = React.lazy(() => import("./pages/UserCollections")); const Collections = React.lazy(() => import("./pages/Collections")); @@ -202,8 +205,9 @@ const AppWrapper = () => { Loading...}>} /> {/* Apps */} - {enablePlaygrounds && Loading...}>} />} - {enablePlaygrounds && Loading...}>} />} + Loading...}>} /> + Loading...}>} /> + {enablePlaygrounds && Loading...}>} />} {/* Ecommerce Routes */} {(ecommerce) && ( diff --git a/packages/ui/src/modules/places/CompetitorsMapView.tsx b/packages/ui/src/modules/places/CompetitorsMapView.tsx index a1738d3a..8e8dc039 100644 --- a/packages/ui/src/modules/places/CompetitorsMapView.tsx +++ b/packages/ui/src/modules/places/CompetitorsMapView.tsx @@ -624,8 +624,8 @@ export const CompetitorsMapView: React.FC = ({ competit {/* Map Viewport */}
-
@@ -660,7 +660,7 @@ export const CompetitorsMapView: React.FC = ({ competit pickerPolygons={pickerPolygons} posterTheme={posterTheme} setPosterTheme={setPosterTheme} - onClose={onClosePosterMode || (() => {})} + onClose={onClosePosterMode || (() => { })} /> )} diff --git a/packages/ui/src/modules/places/InfoPanel.tsx b/packages/ui/src/modules/places/InfoPanel.tsx index 037604c7..4ebd11ab 100644 --- a/packages/ui/src/modules/places/InfoPanel.tsx +++ b/packages/ui/src/modules/places/InfoPanel.tsx @@ -39,7 +39,7 @@ export const InfoPanel: React.FC = ({ isOpen, onClose, lat, lng, setLoadingWiki(true); setErrorWiki(null); try { - const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:3333'; + const apiUrl = import.meta.env.VITE_SERVER_IMAGE_API_URL || ''; const res = await fetch(`${apiUrl}/api/locations/wiki?lat=${lat}&lon=${lng}&limit=20`); if (res.ok) { const json = await res.json(); @@ -67,7 +67,7 @@ export const InfoPanel: React.FC = ({ isOpen, onClose, lat, lng, setLoadingLlm(true); setLlmInfo(null); try { - const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:3333'; + const apiUrl = import.meta.env.VITE_SERVER_IMAGE_API_URL || ''; const res = await fetch(`${apiUrl}/api/locations/llm-info?location=${encodeURIComponent(locationName)}`); if (res.ok) { const json = await res.json(); diff --git a/packages/ui/src/modules/places/client-gridsearch.ts b/packages/ui/src/modules/places/client-gridsearch.ts index a76ed569..b3797f2c 100644 --- a/packages/ui/src/modules/places/client-gridsearch.ts +++ b/packages/ui/src/modules/places/client-gridsearch.ts @@ -399,7 +399,7 @@ export const fetchReverseGeocode = async (lat: number, lon: number): Promise => { return fetchWithDeduplication('ip-api-location', async () => { - const res = await fetch('http://ip-api.com/json/'); + const res = await fetch('https://ipapi.co/json/'); if (!res.ok) throw new Error(`Failed to fetch IP location: ${res.statusText}`); return await res.json(); }, 600000); // 10 minutes cache diff --git a/packages/ui/src/modules/places/components/MapPosterOverlay.tsx b/packages/ui/src/modules/places/components/MapPosterOverlay.tsx index 0fcf5298..c746025f 100644 --- a/packages/ui/src/modules/places/components/MapPosterOverlay.tsx +++ b/packages/ui/src/modules/places/components/MapPosterOverlay.tsx @@ -7,7 +7,7 @@ const XIcon = ({ className }: { className?: string }) => ( ); const PaletteIcon = ({ className }: { className?: string }) => ( - + ); interface MapPosterOverlayProps { @@ -36,25 +36,25 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe const c = map.getCenter(); setCenter({ lat: c.lat, lng: c.lng }); }; - + const fetchGeo = async () => { const c = map.getCenter(); try { - const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:3333'; + const apiUrl = import.meta.env.VITE_SERVER_IMAGE_API_URL || ''; const res = await fetch(`${apiUrl}/api/regions/reverse?lat=${c.lat}&lon=${c.lng}`); if (res.ok) { const json = await res.json(); if (json.data) { const geo = json.data; - let cty = geo.city && geo.city !== 'unknown' ? geo.city : - geo.locality && geo.locality !== 'unknown' ? geo.locality : - geo.principalSubdivision && geo.principalSubdivision !== 'unknown' ? geo.principalSubdivision : null; + let cty = geo.city && geo.city !== 'unknown' ? geo.city : + geo.locality && geo.locality !== 'unknown' ? geo.locality : + geo.principalSubdivision && geo.principalSubdivision !== 'unknown' ? geo.principalSubdivision : null; let ctry = geo.countryName || null; if (cty && cty !== "unknown") setInferredCity(cty); if (ctry && ctry !== "unknown") setInferredCountry(ctry); } } - } catch (e) {} + } catch (e) { } }; updateCenter(); @@ -62,8 +62,8 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe map.on('move', updateCenter); map.on('moveend', fetchGeo); - - return () => { + + return () => { map.off('move', updateCenter); map.off('moveend', fetchGeo); } @@ -71,7 +71,7 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe let city = "CITY NAME"; let country = "COUNTRY"; - + if (pickerRegions && pickerRegions.length > 0) { const countryRegion = pickerRegions.find(r => r.level === 0); const cityRegion = pickerRegions.slice().reverse().find(r => r.level > 0); @@ -90,7 +90,7 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe }; const displayCity = city.toUpperCase().split('').join(' '); - + const gradientTop = `linear-gradient(to bottom, ${theme.gradient_color}FF 0%, ${theme.gradient_color}00 100%)`; const gradientBottom = `linear-gradient(to top, ${theme.gradient_color}FF 30%, ${theme.gradient_color}00 100%)`; @@ -103,12 +103,12 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe const isDark = document.documentElement.classList.contains('dark'); applyPosterTheme(map, theme, isDark); }; - + if (map.isStyleLoaded()) _apply(); - + map.on('style.load', _apply); map.on('styledata', _apply); - + return () => { map.off('style.load', _apply); map.off('styledata', _apply); @@ -117,10 +117,10 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe useEffect(() => { if (!map || !pickerPolygons || pickerPolygons.length === 0) return; - + const combinedFeatures = pickerPolygons.flatMap(fc => fc.features || []); const fc = { type: 'FeatureCollection', features: combinedFeatures }; - + if (!map.getSource('poster-gadm')) { map.addSource('poster-gadm', { type: 'geojson', data: fc as any }); map.addLayer({ @@ -134,7 +134,7 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe } }); } - + if (showGadmBorders) { map.setLayoutProperty('poster-gadm-borders', 'visibility', 'visible'); map.setPaintProperty('poster-gadm-borders', 'line-color', theme.text); @@ -152,21 +152,21 @@ export function MapPosterOverlay({ map, pickerRegions, pickerPolygons, posterThe
{/* Top Gradient */}
- + {/* Controls (pointer events auto) */}
{pickerPolygons && pickerPolygons.length > 0 && ( - )} -