✨ 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
115 lines
3.6 KiB
JavaScript
115 lines
3.6 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const DelegatedModule = require("./DelegatedModule");
|
|
|
|
/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions} DllReferencePluginOptions */
|
|
/** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptionsContent} DllReferencePluginOptionsContent */
|
|
/** @typedef {import("./DelegatedModule").DelegatedModuleSourceRequest} DelegatedModuleSourceRequest */
|
|
/** @typedef {import("./DelegatedModule").DelegatedModuleType} DelegatedModuleType */
|
|
/** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */
|
|
/** @typedef {import("./util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
|
|
|
|
/**
|
|
* @typedef {object} Options
|
|
* @property {DelegatedModuleSourceRequest} source source
|
|
* @property {NonNullable<DllReferencePluginOptions["context"]>} context absolute context path to which lib ident is relative to
|
|
* @property {DllReferencePluginOptionsContent} content content
|
|
* @property {DllReferencePluginOptions["type"]} type type
|
|
* @property {DllReferencePluginOptions["extensions"]} extensions extensions
|
|
* @property {DllReferencePluginOptions["scope"]} scope scope
|
|
* @property {AssociatedObjectForCache=} associatedObjectForCache object for caching
|
|
*/
|
|
|
|
const PLUGIN_NAME = "DelegatedModuleFactoryPlugin";
|
|
|
|
class DelegatedModuleFactoryPlugin {
|
|
/**
|
|
* @param {Options} options options
|
|
*/
|
|
constructor(options) {
|
|
this.options = options;
|
|
options.type = options.type || "require";
|
|
options.extensions = options.extensions || ["", ".js", ".json", ".wasm"];
|
|
}
|
|
|
|
/**
|
|
* @param {NormalModuleFactory} normalModuleFactory the normal module factory
|
|
* @returns {void}
|
|
*/
|
|
apply(normalModuleFactory) {
|
|
const scope = this.options.scope;
|
|
if (scope) {
|
|
normalModuleFactory.hooks.factorize.tapAsync(
|
|
PLUGIN_NAME,
|
|
(data, callback) => {
|
|
const [dependency] = data.dependencies;
|
|
const { request } = dependency;
|
|
if (request && request.startsWith(`${scope}/`)) {
|
|
const innerRequest = `.${request.slice(scope.length)}`;
|
|
let resolved;
|
|
if (innerRequest in this.options.content) {
|
|
resolved = this.options.content[innerRequest];
|
|
return callback(
|
|
null,
|
|
new DelegatedModule(
|
|
this.options.source,
|
|
resolved,
|
|
/** @type {DelegatedModuleType} */
|
|
(this.options.type),
|
|
innerRequest,
|
|
request
|
|
)
|
|
);
|
|
}
|
|
const extensions =
|
|
/** @type {string[]} */
|
|
(this.options.extensions);
|
|
for (let i = 0; i < extensions.length; i++) {
|
|
const extension = extensions[i];
|
|
const requestPlusExt = innerRequest + extension;
|
|
if (requestPlusExt in this.options.content) {
|
|
resolved = this.options.content[requestPlusExt];
|
|
return callback(
|
|
null,
|
|
new DelegatedModule(
|
|
this.options.source,
|
|
resolved,
|
|
/** @type {DelegatedModuleType} */
|
|
(this.options.type),
|
|
requestPlusExt,
|
|
request + extension
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
return callback();
|
|
}
|
|
);
|
|
} else {
|
|
normalModuleFactory.hooks.module.tap(PLUGIN_NAME, module => {
|
|
const request = module.libIdent(this.options);
|
|
if (request && request in this.options.content) {
|
|
const resolved = this.options.content[request];
|
|
return new DelegatedModule(
|
|
this.options.source,
|
|
resolved,
|
|
/** @type {DelegatedModuleType} */
|
|
(this.options.type),
|
|
request,
|
|
module
|
|
);
|
|
}
|
|
return module;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = DelegatedModuleFactoryPlugin;
|