@premiate/strapi-plugin-maplibre-field 1.0.6

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 (47) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/LICENSE +23 -0
  3. package/README.md +781 -0
  4. package/dist/_chunks/de-CGU2cyif.mjs +16 -0
  5. package/dist/_chunks/de-Dq_t3Z6M.js +16 -0
  6. package/dist/_chunks/en-BxxNWf9i.mjs +16 -0
  7. package/dist/_chunks/en-CgSPA-1L.js +16 -0
  8. package/dist/_chunks/es-B_cPv3G5.mjs +16 -0
  9. package/dist/_chunks/es-Sgja1XAa.js +16 -0
  10. package/dist/_chunks/fr-B3JIzyzo.js +16 -0
  11. package/dist/_chunks/fr-Dw5wEoDC.mjs +16 -0
  12. package/dist/_chunks/index-BF5T-kqa.mjs +171 -0
  13. package/dist/_chunks/index-BNnkn7JG.mjs +1778 -0
  14. package/dist/_chunks/index-CGJogtZr.js +1799 -0
  15. package/dist/_chunks/index-nbk0hg-O.js +170 -0
  16. package/dist/_chunks/it-BgWDIXzn.js +16 -0
  17. package/dist/_chunks/it-CoUEVPt6.mjs +16 -0
  18. package/dist/admin/index.js +3 -0
  19. package/dist/admin/index.mjs +4 -0
  20. package/dist/admin/src/components/Initializer.d.ts +6 -0
  21. package/dist/admin/src/components/MapInput/basemap-control.d.ts +8 -0
  22. package/dist/admin/src/components/MapInput/credits-control.d.ts +10 -0
  23. package/dist/admin/src/components/MapInput/geocoder-control.d.ts +20 -0
  24. package/dist/admin/src/components/MapInput/index.d.ts +19 -0
  25. package/dist/admin/src/components/MapInput/layer-control.d.ts +18 -0
  26. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  27. package/dist/admin/src/hooks/usePluginConfig.d.ts +2 -0
  28. package/dist/admin/src/index.d.ts +16 -0
  29. package/dist/admin/src/mutations/mutateEditViewHook.d.ts +30 -0
  30. package/dist/admin/src/services/poi-service.d.ts +160 -0
  31. package/dist/admin/src/utils/getTrad.d.ts +2 -0
  32. package/dist/admin/src/utils/pluginId.d.ts +2 -0
  33. package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
  34. package/dist/server/index.js +107 -0
  35. package/dist/server/index.mjs +108 -0
  36. package/dist/server/src/bootstrap.d.ts +2 -0
  37. package/dist/server/src/config/index.d.ts +61 -0
  38. package/dist/server/src/config/schema.d.ts +58 -0
  39. package/dist/server/src/controllers/config.d.ts +7 -0
  40. package/dist/server/src/controllers/index.d.ts +8 -0
  41. package/dist/server/src/destroy.d.ts +5 -0
  42. package/dist/server/src/index.d.ts +85 -0
  43. package/dist/server/src/register.d.ts +5 -0
  44. package/dist/server/src/routes/index.d.ts +9 -0
  45. package/dist/server/src/types/config.d.ts +26 -0
  46. package/logo.png +0 -0
  47. package/package.json +99 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,77 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2026-01-14
9
+
10
+ ### Added
11
+
12
+ - **Strapi v5 custom field** for MapLibre-based map selection
13
+ - **GeoJSON Feature storage** (RFC 7946 compliant) for location data
14
+ - **TypeScript** support with strict typing and comprehensive type definitions
15
+ - **Plugin configuration system** with customizable map settings:
16
+ - `mapStyles`: Array of map style configurations with id, name, url, and isDefault flag
17
+ - `defaultZoom`: Initial zoom level (default: 4.5)
18
+ - `defaultCenter`: Initial map center coordinates (default: [0, 0])
19
+ - `geocodingProvider`: Geocoding service (default: 'nominatim')
20
+ - `nominatimUrl`: Custom Nominatim endpoint
21
+ - `poiSources`: Optional custom POI data sources
22
+ - **Environment variable support** for API keys with `{VARIABLE_NAME}` syntax
23
+ - **Geocoding integration** with Nominatim (OpenStreetMap)
24
+ - **Multi-language support** with translations in 5 languages (en, de, es, fr, it)
25
+ - **POI layer support** with configurable custom data sources
26
+ - **Basemap switcher** for multiple map styles
27
+ - **`inputMethod` tracking** to identify how location was created: `"search"`, `"poi_click"`, or `"map_click"`
28
+ - `usePluginConfig()` hook for accessing plugin configuration in components
29
+ - `LocationFeature` interface and `createLocationFeature()` helper function
30
+
31
+ ### Data Model
32
+
33
+ Location data is stored as standard GeoJSON Feature:
34
+
35
+ ```json
36
+ {
37
+ "type": "Feature",
38
+ "geometry": { "type": "Point", "coordinates": [9.19, 45.46] },
39
+ "properties": {
40
+ "name": "Location Name",
41
+ "address": "Full address string",
42
+ "source": "nominatim",
43
+ "inputMethod": "search"
44
+ }
45
+ }
46
+ ```
47
+
48
+ ### Configuration Example
49
+
50
+ ```typescript
51
+ // config/plugins.ts
52
+ export default {
53
+ 'maplibre-field': {
54
+ enabled: true,
55
+ config: {
56
+ mapStyles: [
57
+ {
58
+ id: 'streets',
59
+ name: 'Streets',
60
+ url: 'https://api.maptiler.com/maps/streets-v2/style.json?key={MAPTILER_API_KEY}',
61
+ isDefault: true,
62
+ },
63
+ ],
64
+ defaultZoom: 4.5,
65
+ defaultCenter: [9.19, 45.46],
66
+ nominatimUrl: 'https://nominatim.openstreetmap.org',
67
+ },
68
+ },
69
+ };
70
+ ```
71
+
72
+ ### Technical Details
73
+
74
+ - **Strapi**: v5.0.0+
75
+ - **Node.js**: 20.0.0 - 24.x
76
+ - **Build**: CJS + ESM for both admin and server
77
+ - **Dependencies**: MapLibre GL v5.16.0, React Map GL v8.1.0, PMTiles v4.3.2
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 gianlucaparadise
4
+ Copyright (c) 2024 cpontet
5
+ Copyright (c) 2026 Dipartimento di Cartografia Esistenzialista in Fotta | Premiate Edizioni
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.