@premiate/strapi-plugin-maplibre-field 1.2.0 → 1.2.2

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 (48) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/_chunks/{index-Dzpog-Qf.mjs → index-B0Nr95wz.mjs} +2 -2
  3. package/dist/_chunks/{index-Bp7DLorc.mjs → index-CBxydRKp.mjs} +1 -1
  4. package/dist/_chunks/{index-zNvHsRuo.js → index-CDY4Awnh.js} +1 -1
  5. package/dist/_chunks/{index-DjK7O741.js → index-ysvid6md.js} +2 -2
  6. package/dist/admin/de-B0QBc7M2.js +27 -0
  7. package/dist/admin/de-BMK0skCB.mjs +27 -0
  8. package/dist/admin/en-C8iInpNv.mjs +27 -0
  9. package/dist/admin/en-CA0XtbN7.js +27 -0
  10. package/dist/admin/es-BU6JgkbZ.js +25 -0
  11. package/dist/admin/es-DZO4NHjt.mjs +25 -0
  12. package/dist/admin/fr-B8NDboqe.mjs +27 -0
  13. package/dist/admin/fr-DIBfzRbg.js +27 -0
  14. package/dist/admin/index-B-3vqPUe.mjs +1836 -0
  15. package/dist/admin/index-B0LVK-NK.js +170 -0
  16. package/dist/admin/index-BaGweGhM.js +1856 -0
  17. package/dist/admin/index-DjL4deZ6.mjs +171 -0
  18. package/dist/admin/index.js +3 -2
  19. package/dist/admin/index.mjs +1 -1
  20. package/dist/admin/it-B-lr3jhh.js +27 -0
  21. package/dist/admin/it-DFH6n6E1.mjs +27 -0
  22. package/dist/server/index.js +8 -3
  23. package/dist/server/index.mjs +6 -2
  24. package/dist/server/src/index.d.ts +9 -4
  25. package/package.json +12 -9
  26. package/dist/admin/src/components/Initializer.d.ts +0 -6
  27. package/dist/admin/src/components/MapInput/SearchBox.d.ts +0 -22
  28. package/dist/admin/src/components/MapInput/basemap-control.d.ts +0 -8
  29. package/dist/admin/src/components/MapInput/index.d.ts +0 -19
  30. package/dist/admin/src/components/MapInput/layer-control.d.ts +0 -18
  31. package/dist/admin/src/components/PluginIcon.d.ts +0 -2
  32. package/dist/admin/src/hooks/usePluginConfig.d.ts +0 -2
  33. package/dist/admin/src/mutations/mutateEditViewHook.d.ts +0 -30
  34. package/dist/admin/src/services/geocoder-service.d.ts +0 -31
  35. package/dist/admin/src/services/poi-service.d.ts +0 -160
  36. package/dist/admin/src/utils/getTrad.d.ts +0 -2
  37. package/dist/admin/src/utils/pluginId.d.ts +0 -2
  38. package/dist/admin/src/utils/prefixPluginTranslations.d.ts +0 -3
  39. package/dist/server/src/bootstrap.d.ts +0 -2
  40. package/dist/server/src/config/index.d.ts +0 -62
  41. package/dist/server/src/config/schema.d.ts +0 -53
  42. package/dist/server/src/controllers/config.d.ts +0 -9
  43. package/dist/server/src/controllers/index.d.ts +0 -10
  44. package/dist/server/src/destroy.d.ts +0 -2
  45. package/dist/server/src/register.d.ts +0 -5
  46. package/dist/server/src/routes/admin.d.ts +0 -12
  47. package/dist/server/src/routes/index.d.ts +0 -14
  48. package/dist/server/src/types/config.d.ts +0 -26
@@ -1,160 +0,0 @@
1
- /**
2
- * POI Service Layer
3
- *
4
- * Handles POI queries from multiple sources (Nominatim, Custom GeoJSON APIs)
5
- * Provides distance calculations, viewport filtering, and data transformation
6
- */
7
- /**
8
- * Properties for a LocationFeature (all optional, omitted if not available)
9
- */
10
- export interface LocationProperties {
11
- /** POI name or short location name */
12
- name?: string;
13
- /** Full formatted address */
14
- address?: string;
15
- /** Source identifier: "nominatim" or custom source ID like "fotta-skatespots" */
16
- source?: string;
17
- /** Original ID from the source */
18
- sourceId?: string;
19
- /** Display name of the source layer, e.g., "Fotta Skatespots" */
20
- sourceLayer?: string;
21
- /** POI category/type: "skating_spot", "bus_stop", etc. */
22
- category?: string;
23
- /** How the location was created: "search" | "poi_click" | "map_click" */
24
- inputMethod?: 'search' | 'poi_click' | 'map_click';
25
- /** Original metadata preserved from the source */
26
- metadata?: Record<string, unknown>;
27
- }
28
- /**
29
- * GeoJSON Feature for storing location data (RFC 7946 compliant)
30
- * This is the canonical format for storing locations in the database.
31
- */
32
- export interface LocationFeature {
33
- type: 'Feature';
34
- geometry: {
35
- type: 'Point';
36
- coordinates: [number, number];
37
- };
38
- properties: LocationProperties;
39
- }
40
- /**
41
- * Create a LocationFeature with clean properties (no null/empty values)
42
- * @param coordinates [lng, lat] coordinates
43
- * @param properties Optional properties to include
44
- * @returns LocationFeature with only defined, non-empty properties
45
- */
46
- export declare function createLocationFeature(coordinates: [number, number], properties?: Partial<LocationProperties>): LocationFeature;
47
- export interface POI {
48
- id: string;
49
- name: string;
50
- type: string;
51
- coordinates: [number, number];
52
- address: string;
53
- distance?: number;
54
- metadata?: Record<string, unknown>;
55
- source: 'nominatim' | 'custom';
56
- mapName?: string;
57
- layerId?: string;
58
- }
59
- export interface GeoJSONFeature {
60
- id?: string;
61
- type: 'Feature';
62
- geometry: {
63
- type: 'Point';
64
- coordinates: [number, number];
65
- };
66
- properties: {
67
- name?: string | null;
68
- [key: string]: unknown;
69
- };
70
- }
71
- export interface GeoJSONFeatureCollection {
72
- type: 'FeatureCollection';
73
- features: GeoJSONFeature[];
74
- }
75
- export interface POIServiceConfig {
76
- nominatimUrl: string;
77
- customApiUrl?: string | null;
78
- mapName?: string;
79
- layerId?: string;
80
- radius: number;
81
- categories: string[];
82
- }
83
- /**
84
- * Calculate distance between two coordinates using Haversine formula
85
- * @param coord1 First coordinate [lng, lat]
86
- * @param coord2 Second coordinate [lng, lat]
87
- * @returns Distance in meters
88
- */
89
- export declare function calculateDistance(coord1: [number, number], coord2: [number, number]): number;
90
- /**
91
- * Query POIs from custom GeoJSON API
92
- * @param apiUrl Custom API endpoint URL
93
- * @param searchQuery Optional search query for filtering
94
- * @returns Array of GeoJSON features
95
- */
96
- export declare function queryCustomAPI(apiUrl: string, searchQuery?: string): Promise<GeoJSONFeature[]>;
97
- /**
98
- * Query POIs near coordinates from Nominatim
99
- * Uses /reverse endpoint with high zoom level to get specific POIs
100
- * @param lat Latitude
101
- * @param lng Longitude
102
- * @param radius Search radius in meters
103
- * @param nominatimUrl Nominatim API base URL
104
- * @returns Array of POIs
105
- */
106
- export declare function queryNominatim(lat: number, lng: number, radius: number, nominatimUrl: string): Promise<POI[]>;
107
- /**
108
- * Convert GeoJSON feature to POI interface
109
- * @param feature GeoJSON feature
110
- * @param clickCoords Optional reference coordinates for distance calculation
111
- * @param mapName Optional display name for the custom map source
112
- * @param layerId Optional ID of the layer this POI belongs to
113
- * @returns POI object or null if invalid
114
- */
115
- export declare function geoJSONFeatureToPOI(feature: GeoJSONFeature, clickCoords?: [number, number], mapName?: string, layerId?: string): POI | null;
116
- /**
117
- * Filter GeoJSON features by distance from click point
118
- * @param features Array of GeoJSON features
119
- * @param clickCoords Click coordinates [lng, lat]
120
- * @param radius Maximum distance in meters
121
- * @returns Filtered features within radius
122
- */
123
- export declare function filterByDistance(features: GeoJSONFeature[], clickCoords: [number, number], radius: number): GeoJSONFeature[];
124
- /**
125
- * Find nearest POI to click coordinates
126
- * @param clickCoordinates Click coordinates [lng, lat]
127
- * @param pois Array of POIs
128
- * @returns Nearest POI or null if none found
129
- */
130
- export declare function findNearestPOI(clickCoordinates: [number, number], pois: POI[]): POI | null;
131
- /**
132
- * Search POIs for geocoder (queries custom POI sources only)
133
- * Note: Nominatim search is handled directly by geocoder-control.tsx
134
- * @param query Search query string
135
- * @param config POI service configuration
136
- * @returns Array of custom POIs only
137
- */
138
- export declare function searchPOIsForGeocoder(query: string, config: POIServiceConfig): Promise<POI[]>;
139
- /**
140
- * Search nearby POIs for snap (double-click) - queries BOTH sources
141
- * @param lat Latitude
142
- * @param lng Longitude
143
- * @param config POI service configuration
144
- * @returns Array of POIs from both Nominatim and Custom API
145
- */
146
- export declare function searchNearbyPOIsForSnap(lat: number, lng: number, config: POIServiceConfig): Promise<POI[]>;
147
- /**
148
- * Query POIs for viewport display
149
- * @param bounds Map bounds {north, south, east, west}
150
- * @param center Map center [lng, lat]
151
- * @param maxDisplay Maximum number of POIs to display
152
- * @param config POI service configuration
153
- * @returns Array of POIs sorted by distance from center
154
- */
155
- export declare function queryPOIsForViewport(bounds: {
156
- north: number;
157
- south: number;
158
- east: number;
159
- west: number;
160
- }, center: [number, number], maxDisplay: number, config: POIServiceConfig): Promise<POI[]>;
@@ -1,2 +0,0 @@
1
- declare const getTrad: (id: string) => string;
2
- export default getTrad;
@@ -1,2 +0,0 @@
1
- declare const pluginId: string;
2
- export default pluginId;
@@ -1,3 +0,0 @@
1
- type TradOptions = Record<string, string>;
2
- export declare const prefixPluginTranslations: (trad: TradOptions, pluginId: string) => TradOptions;
3
- export {};
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;
@@ -1,62 +0,0 @@
1
- import type { MapLibreConfig } from '../types/config';
2
- /**
3
- * Validates the plugin configuration at boot time.
4
- * Throws an error if required fields are missing or invalid.
5
- */
6
- declare function validator(config: MapLibreConfig): void;
7
- declare const _default: {
8
- default: {
9
- mapStyles: {
10
- type: string;
11
- default: {
12
- id: string;
13
- name: string;
14
- url: string;
15
- isDefault: boolean;
16
- }[];
17
- };
18
- defaultZoom: {
19
- type: string;
20
- default: number;
21
- };
22
- defaultCenter: {
23
- type: string;
24
- default: number[];
25
- };
26
- geocodingProvider: {
27
- type: string;
28
- default: string;
29
- };
30
- nominatimUrl: {
31
- type: string;
32
- default: string;
33
- };
34
- poiDisplayEnabled: {
35
- type: string;
36
- default: boolean;
37
- description: string;
38
- };
39
- poiMinZoom: {
40
- type: string;
41
- default: number;
42
- description: string;
43
- };
44
- poiMaxDisplay: {
45
- type: string;
46
- default: number;
47
- description: string;
48
- };
49
- poiSearchEnabled: {
50
- type: string;
51
- default: boolean;
52
- description: string;
53
- };
54
- poiSnapRadius: {
55
- type: string;
56
- default: number;
57
- description: string;
58
- };
59
- };
60
- validator: typeof validator;
61
- };
62
- export default _default;
@@ -1,53 +0,0 @@
1
- declare const _default: {
2
- mapStyles: {
3
- type: string;
4
- default: {
5
- id: string;
6
- name: string;
7
- url: string;
8
- isDefault: boolean;
9
- }[];
10
- };
11
- defaultZoom: {
12
- type: string;
13
- default: number;
14
- };
15
- defaultCenter: {
16
- type: string;
17
- default: number[];
18
- };
19
- geocodingProvider: {
20
- type: string;
21
- default: string;
22
- };
23
- nominatimUrl: {
24
- type: string;
25
- default: string;
26
- };
27
- poiDisplayEnabled: {
28
- type: string;
29
- default: boolean;
30
- description: string;
31
- };
32
- poiMinZoom: {
33
- type: string;
34
- default: number;
35
- description: string;
36
- };
37
- poiMaxDisplay: {
38
- type: string;
39
- default: number;
40
- description: string;
41
- };
42
- poiSearchEnabled: {
43
- type: string;
44
- default: boolean;
45
- description: string;
46
- };
47
- poiSnapRadius: {
48
- type: string;
49
- default: number;
50
- description: string;
51
- };
52
- };
53
- export default _default;
@@ -1,9 +0,0 @@
1
- import type { Core } from '@strapi/strapi';
2
- declare const _default: ({ strapi }: {
3
- strapi: Core.Strapi;
4
- }) => {
5
- getConfig(ctx: {
6
- body: unknown;
7
- }): void;
8
- };
9
- export default _default;
@@ -1,10 +0,0 @@
1
- declare const _default: {
2
- config: ({ strapi }: {
3
- strapi: import("@strapi/types/dist/core").Strapi;
4
- }) => {
5
- getConfig(ctx: {
6
- body: unknown;
7
- }): void;
8
- };
9
- };
10
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { Core } from '@strapi/strapi';
2
- declare const _default: ({ strapi }: {
3
- strapi: Core.Strapi;
4
- }) => void;
5
- export default _default;
@@ -1,12 +0,0 @@
1
- declare const _default: {
2
- type: string;
3
- routes: {
4
- method: string;
5
- path: string;
6
- handler: string;
7
- config: {
8
- auth: boolean;
9
- };
10
- }[];
11
- };
12
- export default _default;
@@ -1,14 +0,0 @@
1
- declare const _default: {
2
- admin: {
3
- type: string;
4
- routes: {
5
- method: string;
6
- path: string;
7
- handler: string;
8
- config: {
9
- auth: boolean;
10
- };
11
- }[];
12
- };
13
- };
14
- export default _default;
@@ -1,26 +0,0 @@
1
- export interface MapStyle {
2
- id: string;
3
- name: string;
4
- url: string;
5
- isDefault?: boolean;
6
- }
7
- export interface POISource {
8
- id: string;
9
- name: string;
10
- apiUrl: string;
11
- enabled?: boolean;
12
- color?: string;
13
- }
14
- export interface MapLibreConfig {
15
- mapStyles: MapStyle[];
16
- defaultZoom?: number;
17
- defaultCenter?: [number, number];
18
- geocodingProvider?: 'nominatim';
19
- nominatimUrl?: string;
20
- poiSources?: POISource[];
21
- poiDisplayEnabled?: boolean;
22
- poiMinZoom?: number;
23
- poiMaxDisplay?: number;
24
- poiSearchEnabled?: boolean;
25
- poiSnapRadius?: number;
26
- }