✨ 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
66 lines
1.7 KiB
JavaScript
66 lines
1.7 KiB
JavaScript
/**
|
|
* @author Toru Nagashima <https://github.com/mysticatea>
|
|
* See LICENSE file in root directory for full license.
|
|
*/
|
|
import KEYS from "./visitor-keys.js";
|
|
|
|
/**
|
|
* @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
|
|
*/
|
|
|
|
// List to ignore keys.
|
|
const KEY_BLACKLIST = new Set([
|
|
"parent",
|
|
"leadingComments",
|
|
"trailingComments"
|
|
]);
|
|
|
|
/**
|
|
* Check whether a given key should be used or not.
|
|
* @param {string} key The key to check.
|
|
* @returns {boolean} `true` if the key should be used.
|
|
*/
|
|
function filterKey(key) {
|
|
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
|
|
}
|
|
|
|
/**
|
|
* Get visitor keys of a given node.
|
|
* @param {object} node The AST node to get keys.
|
|
* @returns {readonly string[]} Visitor keys of the node.
|
|
*/
|
|
export function getKeys(node) {
|
|
return Object.keys(node).filter(filterKey);
|
|
}
|
|
|
|
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
|
|
// eslint-disable-next-line valid-jsdoc
|
|
/**
|
|
* Make the union set with `KEYS` and given keys.
|
|
* @param {VisitorKeys} additionalKeys The additional keys.
|
|
* @returns {VisitorKeys} The union set.
|
|
*/
|
|
export function unionWith(additionalKeys) {
|
|
const retv = /** @type {{
|
|
[type: string]: ReadonlyArray<string>
|
|
}} */ (Object.assign({}, KEYS));
|
|
|
|
for (const type of Object.keys(additionalKeys)) {
|
|
if (Object.prototype.hasOwnProperty.call(retv, type)) {
|
|
const keys = new Set(additionalKeys[type]);
|
|
|
|
for (const key of retv[type]) {
|
|
keys.add(key);
|
|
}
|
|
|
|
retv[type] = Object.freeze(Array.from(keys));
|
|
} else {
|
|
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
|
|
}
|
|
}
|
|
|
|
return Object.freeze(retv);
|
|
}
|
|
|
|
export { KEYS };
|