Files
Laca-City/backend/node_modules/webpack/lib/library/ExportPropertyLibraryPlugin.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

126 lines
4.0 KiB
JavaScript

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource } = require("webpack-sources");
const { UsageState } = require("../ExportsInfo");
const RuntimeGlobals = require("../RuntimeGlobals");
const propertyAccess = require("../util/propertyAccess");
const { getEntryRuntime } = require("../util/runtime");
const AbstractLibraryPlugin = require("./AbstractLibraryPlugin");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
/** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../javascript/JavascriptModulesPlugin").StartupRenderContext} StartupRenderContext */
/** @template T @typedef {import("./AbstractLibraryPlugin").LibraryContext<T>} LibraryContext<T> */
/**
* @typedef {object} ExportPropertyLibraryPluginParsed
* @property {string | string[]} export
*/
/**
* @typedef {object} ExportPropertyLibraryPluginOptions
* @property {LibraryType} type
* @property {boolean} nsObjectUsed the namespace object is used
* @property {boolean} runtimeExportsUsed runtime exports are used
* @property {boolean} renderStartupUsed render startup is used
*/
/**
* @typedef {ExportPropertyLibraryPluginParsed} T
* @extends {AbstractLibraryPlugin<ExportPropertyLibraryPluginParsed>}
*/
class ExportPropertyLibraryPlugin extends AbstractLibraryPlugin {
/**
* @param {ExportPropertyLibraryPluginOptions} options options
*/
constructor({ type, nsObjectUsed, runtimeExportsUsed, renderStartupUsed }) {
super({
pluginName: "ExportPropertyLibraryPlugin",
type
});
this.nsObjectUsed = nsObjectUsed;
this.runtimeExportsUsed = runtimeExportsUsed;
this.renderStartupUsed = renderStartupUsed;
}
/**
* @param {LibraryOptions} library normalized library option
* @returns {T | false} preprocess as needed by overriding
*/
parseOptions(library) {
return {
export: /** @type {string | string[]} */ (library.export)
};
}
/**
* @param {Module} module the exporting entry module
* @param {string} entryName the name of the entrypoint
* @param {LibraryContext<T>} libraryContext context
* @returns {void}
*/
finishEntryModule(
module,
entryName,
{ options, compilation, compilation: { moduleGraph } }
) {
const runtime = getEntryRuntime(compilation, entryName);
if (options.export) {
const exportsInfo = moduleGraph.getExportInfo(
module,
Array.isArray(options.export) ? options.export[0] : options.export
);
exportsInfo.setUsed(UsageState.Used, runtime);
exportsInfo.canMangleUse = false;
} else {
const exportsInfo = moduleGraph.getExportsInfo(module);
if (this.nsObjectUsed) {
exportsInfo.setUsedInUnknownWay(runtime);
} else {
exportsInfo.setAllKnownExportsUsed(runtime);
}
}
moduleGraph.addExtraReason(module, "used as library export");
}
/**
* @param {Chunk} chunk the chunk
* @param {Set<string>} set runtime requirements
* @param {LibraryContext<T>} libraryContext context
* @returns {void}
*/
runtimeRequirements(chunk, set, libraryContext) {
if (this.runtimeExportsUsed) {
set.add(RuntimeGlobals.exports);
}
}
/**
* @param {Source} source source
* @param {Module} module module
* @param {StartupRenderContext} renderContext render context
* @param {LibraryContext<T>} libraryContext context
* @returns {Source} source with library export
*/
renderStartup(source, module, renderContext, { options }) {
if (!this.renderStartupUsed) return source;
if (!options.export) return source;
const postfix = `${RuntimeGlobals.exports} = ${
RuntimeGlobals.exports
}${propertyAccess(
Array.isArray(options.export) ? options.export : [options.export]
)};\n`;
return new ConcatSource(source, postfix);
}
}
module.exports = ExportPropertyLibraryPlugin;