map-gl-offline 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +32 -10
  2. package/dist/index.esm.js +4274 -11248
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +4278 -11252
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.umd.js +4277 -11256
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/managers/offlineMapManager/analyticsManagement.d.ts +1 -1
  9. package/dist/managers/offlineMapManager/base.d.ts +5 -5
  10. package/dist/managers/offlineMapManager/cleanupManagement.d.ts +1 -1
  11. package/dist/managers/offlineMapManager/importExportManagement.d.ts +1 -1
  12. package/dist/managers/offlineMapManager/maintenanceManagement.d.ts +2 -2
  13. package/dist/managers/offlineMapManager/regionManagement.d.ts +1 -1
  14. package/dist/managers/offlineMapManager/resourceManagement.d.ts +1 -1
  15. package/dist/managers/offlineMapManager/styleManagement.d.ts +1 -1
  16. package/dist/services/analyticsService.d.ts +1 -1
  17. package/dist/services/cleanupService.d.ts +1 -1
  18. package/dist/services/fontService.d.ts +1 -1
  19. package/dist/services/glyphService.d.ts +1 -3
  20. package/dist/services/importExportService.d.ts +3 -3
  21. package/dist/services/maintenanceService.d.ts +2 -2
  22. package/dist/services/regionService.d.ts +1 -1
  23. package/dist/services/resourceService.d.ts +2 -2
  24. package/dist/services/spriteService.d.ts +1 -3
  25. package/dist/services/styleService.d.ts +2 -2
  26. package/dist/services/tileService.d.ts +1 -1
  27. package/dist/storage/indexedDbManager.d.ts +1 -1
  28. package/dist/types/maintenance.d.ts +1 -1
  29. package/dist/ui/components/PanelActions.d.ts +1 -1
  30. package/dist/ui/components/PanelHeader.d.ts +1 -1
  31. package/dist/ui/components/RegionList.d.ts +1 -1
  32. package/dist/ui/components/shared/LanguageSelector.d.ts +1 -1
  33. package/dist/ui/components/shared/MapControlButton.d.ts +1 -1
  34. package/dist/ui/components/shared/PanelContent.d.ts +3 -3
  35. package/dist/ui/components/shared/RegionDrawingTool.d.ts +2 -2
  36. package/dist/ui/controls/polygonControl.d.ts +1 -1
  37. package/dist/ui/controls/regionControl.d.ts +3 -3
  38. package/dist/ui/managers/ControlButtonManager.d.ts +1 -1
  39. package/dist/ui/managers/PanelManager.d.ts +3 -3
  40. package/dist/ui/managers/downloadManager.d.ts +2 -2
  41. package/dist/ui/modals/importExportModal.d.ts +1 -1
  42. package/dist/ui/modals/regionDetailsModal.d.ts +1 -1
  43. package/dist/ui/offlineManagerControl.d.ts +1 -1
  44. package/dist/utils/convertStyleForSW.d.ts +1 -1
  45. package/dist/utils/download.d.ts +1 -1
  46. package/dist/utils/importResolver.d.ts +1 -1
  47. package/dist/utils/styleProviderUtils.d.ts +1 -1
  48. package/dist/utils/styleUtils.d.ts +1 -1
  49. package/dist/utils/validation.d.ts +1 -1
  50. package/package.json +11 -13
package/README.md CHANGED
@@ -171,7 +171,8 @@ map.on('load', () => {
171
171
  theme: 'dark',
172
172
  showBbox: true,
173
173
  accessToken: mapboxgl.accessToken,
174
- mapLib: mapboxgl, // Mapbox GL lacks addProtocol, so the library auto-registers a Service Worker
174
+ // No mapLib needed - Mapbox GL JS v3 lacks addProtocol,
175
+ // so the library auto-registers a Service Worker fallback
175
176
  });
176
177
  map.addControl(control, 'top-right');
177
178
  });
@@ -489,21 +490,21 @@ git clone https://github.com/muimsd/map-gl-offline.git
489
490
  cd map-gl-offline
490
491
 
491
492
  # Install dependencies
492
- pnpm install
493
+ npm install
493
494
 
494
495
  # Run development server
495
- pnpm dev
496
+ npm run dev
496
497
 
497
498
  # Run tests
498
- pnpm test
499
+ npm test
499
500
 
500
501
  # Build library
501
- pnpm build
502
+ npm run build
502
503
 
503
- # Run example app
504
+ # Run MapLibre example app
504
505
  cd examples/maplibre
505
- pnpm install
506
- pnpm dev
506
+ npm install
507
+ npm run dev
507
508
  ```
508
509
 
509
510
  ### Project Structure
@@ -518,8 +519,11 @@ map-gl-offline/
518
519
  │ │ └── translations/ # i18n (English, Arabic)
519
520
  │ ├── utils/ # Utilities & helpers
520
521
  │ └── types/ # TypeScript definitions
522
+ ├── bin/ # CLI (map-gl-offline init) & Vite plugin
521
523
  ├── examples/
522
- └── maplibre/ # Live example app
524
+ ├── maplibre/ # MapLibre GL JS example app
525
+ │ └── mapbox-gl/ # Mapbox GL JS example app
526
+ ├── docs/ # Docusaurus documentation site
523
527
  └── tests/ # Test suites
524
528
  ```
525
529
 
@@ -534,7 +538,25 @@ map-gl-offline/
534
538
 
535
539
  ## 🔄 Recent Updates
536
540
 
537
- ### v0.5.0 (Latest)
541
+ ### v0.5.3 (Latest)
542
+
543
+ - ✅ **Bundle Size**: Reduced ESM bundle from 783 KB to 565 KB (28% reduction)
544
+ - ✅ **Turf Tree-Shaking**: Replaced `@turf/turf` monorepo with individual packages (`@turf/area`, `@turf/bbox-polygon`, `@turf/difference`, `@turf/helpers`)
545
+ - ✅ **Externalized Dependencies**: `i18next` and `@turf/*` moved to externals
546
+ - ✅ **Removed Unused Dependency**: Removed `@tabler/icons` (unused, 47 MB install)
547
+ - ✅ **Bug Fixes**: 20+ bugs resolved from comprehensive codebase audit
548
+ - ✅ **Import Atomicity**: Region imports use single IndexedDB transactions
549
+ - ✅ **Expired Region Cleanup**: `forceCleanupExpiredRegions` now uses actual expiry timestamps
550
+ - ✅ **XSS Prevention**: User data escaped in all UI templates
551
+ - ✅ **Code Quality**: Dead code removal, `@/` path alias for all imports
552
+
553
+ ### v0.5.2
554
+
555
+ - ✅ **CLI Command**: `npx map-gl-offline init` to copy the Service Worker into your project
556
+ - ✅ **Vite Plugin**: `offlineSwPlugin()` to auto-copy the Service Worker on each build
557
+ - ✅ **Mapbox GL Example**: Full React + Vite example app for Mapbox GL JS
558
+
559
+ ### v0.5.0
538
560
 
539
561
  - ✅ **Mapbox GL JS Support**: Full support for Mapbox styles, including `mapbox://` protocol URL resolution
540
562
  - ✅ **Mapbox Standard Style**: 3D models, raster-dem terrain, and import-based style resolution