Files
Laca-City/frontend/node_modules/react-query/es/createWebStoragePersistor-experimental/index.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

114 lines
3.1 KiB
JavaScript

import _extends from "@babel/runtime/helpers/esm/extends";
import { noop } from '../core/utils';
export function createWebStoragePersistor(_ref) {
var storage = _ref.storage,
_ref$key = _ref.key,
key = _ref$key === void 0 ? "REACT_QUERY_OFFLINE_CACHE" : _ref$key,
_ref$throttleTime = _ref.throttleTime,
throttleTime = _ref$throttleTime === void 0 ? 1000 : _ref$throttleTime,
_ref$serialize = _ref.serialize,
serialize = _ref$serialize === void 0 ? JSON.stringify : _ref$serialize,
_ref$deserialize = _ref.deserialize,
deserialize = _ref$deserialize === void 0 ? JSON.parse : _ref$deserialize;
//try to save data to storage
function trySave(persistedClient) {
try {
storage.setItem(key, serialize(persistedClient));
} catch (_unused) {
return false;
}
return true;
}
if (typeof storage !== 'undefined') {
return {
persistClient: throttle(function (persistedClient) {
if (trySave(persistedClient) !== true) {
var mutations = [].concat(persistedClient.clientState.mutations);
var queries = [].concat(persistedClient.clientState.queries);
var _client = _extends({}, persistedClient, {
clientState: {
mutations: mutations,
queries: queries
}
}); // sort queries by dataUpdatedAt (oldest first)
var sortedQueries = [].concat(queries).sort(function (a, b) {
return a.state.dataUpdatedAt - b.state.dataUpdatedAt;
}); // clean old queries and try to save
var _loop = function _loop() {
var oldestData = sortedQueries.shift();
_client.clientState.queries = queries.filter(function (q) {
return q !== oldestData;
});
if (trySave(_client)) {
return {
v: void 0
}; // save success
}
};
while (sortedQueries.length > 0) {
var _ret = _loop();
if (typeof _ret === "object") return _ret.v;
} // clean mutations and try to save
while (mutations.shift()) {
if (trySave(_client)) {
return; // save success
}
}
}
}, throttleTime),
restoreClient: function restoreClient() {
var cacheString = storage.getItem(key);
if (!cacheString) {
return;
}
return deserialize(cacheString);
},
removeClient: function removeClient() {
storage.removeItem(key);
}
};
}
return {
persistClient: noop,
restoreClient: noop,
removeClient: noop
};
}
function throttle(func, wait) {
if (wait === void 0) {
wait = 100;
}
var timer = null;
var params;
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
params = args;
if (timer === null) {
timer = setTimeout(function () {
func.apply(void 0, params);
timer = null;
}, wait);
}
};
}