Files
Laca-City/frontend/node_modules/react-query/lib/react/QueryClientProvider.js
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

65 lines
2.0 KiB
JavaScript

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.QueryClientProvider = exports.useQueryClient = void 0;
var _react = _interopRequireDefault(require("react"));
var defaultContext = /*#__PURE__*/_react.default.createContext(undefined);
var QueryClientSharingContext = /*#__PURE__*/_react.default.createContext(false); // if contextSharing is on, we share the first and at least one
// instance of the context across the window
// to ensure that if React Query is used across
// different bundles or microfrontends they will
// all use the same **instance** of context, regardless
// of module scoping.
function getQueryClientContext(contextSharing) {
if (contextSharing && typeof window !== 'undefined') {
if (!window.ReactQueryClientContext) {
window.ReactQueryClientContext = defaultContext;
}
return window.ReactQueryClientContext;
}
return defaultContext;
}
var useQueryClient = function useQueryClient() {
var queryClient = _react.default.useContext(getQueryClientContext(_react.default.useContext(QueryClientSharingContext)));
if (!queryClient) {
throw new Error('No QueryClient set, use QueryClientProvider to set one');
}
return queryClient;
};
exports.useQueryClient = useQueryClient;
var QueryClientProvider = function QueryClientProvider(_ref) {
var client = _ref.client,
_ref$contextSharing = _ref.contextSharing,
contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing,
children = _ref.children;
_react.default.useEffect(function () {
client.mount();
return function () {
client.unmount();
};
}, [client]);
var Context = getQueryClientContext(contextSharing);
return /*#__PURE__*/_react.default.createElement(QueryClientSharingContext.Provider, {
value: contextSharing
}, /*#__PURE__*/_react.default.createElement(Context.Provider, {
value: client
}, children));
};
exports.QueryClientProvider = QueryClientProvider;