@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.
Potentially problematic release.
This version of @premiate/strapi-plugin-maplibre-field might be problematic. Click here for more details.
- package/CHANGELOG.md +77 -0
- package/LICENSE +23 -0
- package/README.md +781 -0
- package/dist/_chunks/de-CGU2cyif.mjs +16 -0
- package/dist/_chunks/de-Dq_t3Z6M.js +16 -0
- package/dist/_chunks/en-BxxNWf9i.mjs +16 -0
- package/dist/_chunks/en-CgSPA-1L.js +16 -0
- package/dist/_chunks/es-B_cPv3G5.mjs +16 -0
- package/dist/_chunks/es-Sgja1XAa.js +16 -0
- package/dist/_chunks/fr-B3JIzyzo.js +16 -0
- package/dist/_chunks/fr-Dw5wEoDC.mjs +16 -0
- package/dist/_chunks/index-BF5T-kqa.mjs +171 -0
- package/dist/_chunks/index-BNnkn7JG.mjs +1778 -0
- package/dist/_chunks/index-CGJogtZr.js +1799 -0
- package/dist/_chunks/index-nbk0hg-O.js +170 -0
- package/dist/_chunks/it-BgWDIXzn.js +16 -0
- package/dist/_chunks/it-CoUEVPt6.mjs +16 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/components/Initializer.d.ts +6 -0
- package/dist/admin/src/components/MapInput/basemap-control.d.ts +8 -0
- package/dist/admin/src/components/MapInput/credits-control.d.ts +10 -0
- package/dist/admin/src/components/MapInput/geocoder-control.d.ts +20 -0
- package/dist/admin/src/components/MapInput/index.d.ts +19 -0
- package/dist/admin/src/components/MapInput/layer-control.d.ts +18 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/hooks/usePluginConfig.d.ts +2 -0
- package/dist/admin/src/index.d.ts +16 -0
- package/dist/admin/src/mutations/mutateEditViewHook.d.ts +30 -0
- package/dist/admin/src/services/poi-service.d.ts +160 -0
- package/dist/admin/src/utils/getTrad.d.ts +2 -0
- package/dist/admin/src/utils/pluginId.d.ts +2 -0
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
- package/dist/server/index.js +107 -0
- package/dist/server/index.mjs +108 -0
- package/dist/server/src/bootstrap.d.ts +2 -0
- package/dist/server/src/config/index.d.ts +61 -0
- package/dist/server/src/config/schema.d.ts +58 -0
- package/dist/server/src/controllers/config.d.ts +7 -0
- package/dist/server/src/controllers/index.d.ts +8 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +85 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +9 -0
- package/dist/server/src/types/config.d.ts +26 -0
- package/logo.png +0 -0
- package/package.json +99 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const register = ({ strapi }) => {
|
|
2
|
+
strapi.customFields.register({
|
|
3
|
+
name: "map",
|
|
4
|
+
plugin: "maplibre-field",
|
|
5
|
+
type: "json"
|
|
6
|
+
// Icon will be loaded from admin side via intlLabel
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
const bootstrap = () => {
|
|
10
|
+
};
|
|
11
|
+
const destroy = ({ strapi }) => {
|
|
12
|
+
};
|
|
13
|
+
const schema = {
|
|
14
|
+
mapStyles: {
|
|
15
|
+
type: "array",
|
|
16
|
+
default: [
|
|
17
|
+
{
|
|
18
|
+
id: "satellite",
|
|
19
|
+
name: "Satellite",
|
|
20
|
+
url: "https://api.maptiler.com/maps/satellite-v4/style.json?key=sOr6q24xbu24UhKuyK8a",
|
|
21
|
+
isDefault: true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "osm",
|
|
25
|
+
name: "OpenStreetMap",
|
|
26
|
+
url: "https://api.maptiler.com/maps/openstreetmap/style.json?key=sOr6q24xbu24UhKuyK8a"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
defaultZoom: {
|
|
31
|
+
type: "number",
|
|
32
|
+
default: 4.5
|
|
33
|
+
},
|
|
34
|
+
defaultCenter: {
|
|
35
|
+
type: "array",
|
|
36
|
+
default: [0, 0]
|
|
37
|
+
},
|
|
38
|
+
geocodingProvider: {
|
|
39
|
+
type: "string",
|
|
40
|
+
default: "nominatim"
|
|
41
|
+
},
|
|
42
|
+
nominatimUrl: {
|
|
43
|
+
type: "string",
|
|
44
|
+
default: "https://nominatim.openstreetmap.org"
|
|
45
|
+
},
|
|
46
|
+
poiDisplayEnabled: {
|
|
47
|
+
type: "boolean",
|
|
48
|
+
default: true,
|
|
49
|
+
description: "Display POI markers on map"
|
|
50
|
+
},
|
|
51
|
+
poiMinZoom: {
|
|
52
|
+
type: "number",
|
|
53
|
+
default: 10,
|
|
54
|
+
description: "Minimum zoom level to display POI markers"
|
|
55
|
+
},
|
|
56
|
+
poiMaxDisplay: {
|
|
57
|
+
type: "number",
|
|
58
|
+
default: 100,
|
|
59
|
+
description: "Maximum number of POIs to display on map"
|
|
60
|
+
},
|
|
61
|
+
poiSearchEnabled: {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
default: true,
|
|
64
|
+
description: "Include custom API results in search field"
|
|
65
|
+
},
|
|
66
|
+
poiSnapRadius: {
|
|
67
|
+
type: "number",
|
|
68
|
+
default: 5,
|
|
69
|
+
description: "Snap radius in meters for double-click POI detection (default: 5m)"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const config$1 = {
|
|
73
|
+
default: schema,
|
|
74
|
+
validator() {
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const config = ({ strapi }) => ({
|
|
78
|
+
getConfig(ctx) {
|
|
79
|
+
const config2 = strapi.config.get("plugin::maplibre-field");
|
|
80
|
+
console.log("[MapLibre Controller] Returning config:", JSON.stringify(config2, null, 2));
|
|
81
|
+
ctx.body = config2;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const controllers = {
|
|
85
|
+
config
|
|
86
|
+
};
|
|
87
|
+
const routes = [
|
|
88
|
+
{
|
|
89
|
+
method: "GET",
|
|
90
|
+
path: "/config",
|
|
91
|
+
handler: "config.getConfig",
|
|
92
|
+
config: {
|
|
93
|
+
auth: false
|
|
94
|
+
// No authentication needed - config is public
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
const index = {
|
|
99
|
+
register,
|
|
100
|
+
bootstrap,
|
|
101
|
+
destroy,
|
|
102
|
+
config: config$1,
|
|
103
|
+
controllers,
|
|
104
|
+
routes
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
index as default
|
|
108
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
default: {
|
|
3
|
+
mapStyles: {
|
|
4
|
+
type: string;
|
|
5
|
+
default: ({
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
url: string;
|
|
9
|
+
isDefault: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
url: string;
|
|
14
|
+
isDefault?: undefined;
|
|
15
|
+
})[];
|
|
16
|
+
};
|
|
17
|
+
defaultZoom: {
|
|
18
|
+
type: string;
|
|
19
|
+
default: number;
|
|
20
|
+
};
|
|
21
|
+
defaultCenter: {
|
|
22
|
+
type: string;
|
|
23
|
+
default: number[];
|
|
24
|
+
};
|
|
25
|
+
geocodingProvider: {
|
|
26
|
+
type: string;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
nominatimUrl: {
|
|
30
|
+
type: string;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
poiDisplayEnabled: {
|
|
34
|
+
type: string;
|
|
35
|
+
default: boolean;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
poiMinZoom: {
|
|
39
|
+
type: string;
|
|
40
|
+
default: number;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
poiMaxDisplay: {
|
|
44
|
+
type: string;
|
|
45
|
+
default: number;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
poiSearchEnabled: {
|
|
49
|
+
type: string;
|
|
50
|
+
default: boolean;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
poiSnapRadius: {
|
|
54
|
+
type: string;
|
|
55
|
+
default: number;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
validator(): void;
|
|
60
|
+
};
|
|
61
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
url: string;
|
|
13
|
+
isDefault?: undefined;
|
|
14
|
+
})[];
|
|
15
|
+
};
|
|
16
|
+
defaultZoom: {
|
|
17
|
+
type: string;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
defaultCenter: {
|
|
21
|
+
type: string;
|
|
22
|
+
default: number[];
|
|
23
|
+
};
|
|
24
|
+
geocodingProvider: {
|
|
25
|
+
type: string;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
nominatimUrl: {
|
|
29
|
+
type: string;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
poiDisplayEnabled: {
|
|
33
|
+
type: string;
|
|
34
|
+
default: boolean;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
poiMinZoom: {
|
|
38
|
+
type: string;
|
|
39
|
+
default: number;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
poiMaxDisplay: {
|
|
43
|
+
type: string;
|
|
44
|
+
default: number;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
poiSearchEnabled: {
|
|
48
|
+
type: string;
|
|
49
|
+
default: boolean;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
poiSnapRadius: {
|
|
53
|
+
type: string;
|
|
54
|
+
default: number;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => void;
|
|
5
|
+
bootstrap: () => void;
|
|
6
|
+
destroy: ({ strapi }: {
|
|
7
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
8
|
+
}) => void;
|
|
9
|
+
config: {
|
|
10
|
+
default: {
|
|
11
|
+
mapStyles: {
|
|
12
|
+
type: string;
|
|
13
|
+
default: ({
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
isDefault: boolean;
|
|
18
|
+
} | {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
url: string;
|
|
22
|
+
isDefault?: undefined;
|
|
23
|
+
})[];
|
|
24
|
+
};
|
|
25
|
+
defaultZoom: {
|
|
26
|
+
type: string;
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
defaultCenter: {
|
|
30
|
+
type: string;
|
|
31
|
+
default: number[];
|
|
32
|
+
};
|
|
33
|
+
geocodingProvider: {
|
|
34
|
+
type: string;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
nominatimUrl: {
|
|
38
|
+
type: string;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
poiDisplayEnabled: {
|
|
42
|
+
type: string;
|
|
43
|
+
default: boolean;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
poiMinZoom: {
|
|
47
|
+
type: string;
|
|
48
|
+
default: number;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
poiMaxDisplay: {
|
|
52
|
+
type: string;
|
|
53
|
+
default: number;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
poiSearchEnabled: {
|
|
57
|
+
type: string;
|
|
58
|
+
default: boolean;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
poiSnapRadius: {
|
|
62
|
+
type: string;
|
|
63
|
+
default: number;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
validator(): void;
|
|
68
|
+
};
|
|
69
|
+
controllers: {
|
|
70
|
+
config: ({ strapi }: {
|
|
71
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
72
|
+
}) => {
|
|
73
|
+
getConfig(ctx: any): void;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
routes: {
|
|
77
|
+
method: string;
|
|
78
|
+
path: string;
|
|
79
|
+
handler: string;
|
|
80
|
+
config: {
|
|
81
|
+
auth: boolean;
|
|
82
|
+
};
|
|
83
|
+
}[];
|
|
84
|
+
};
|
|
85
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
package/logo.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@premiate/strapi-plugin-maplibre-field",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "Strapi plugin that provides a MapLibre custom field",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://codeberg.org/premiate-edizioni/strapi-plugin-maplibre-field.git"
|
|
8
|
+
},
|
|
9
|
+
"strapi": {
|
|
10
|
+
"name": "maplibre-field",
|
|
11
|
+
"description": "Add a MapLibre custom field to your Strapi content types",
|
|
12
|
+
"kind": "plugin",
|
|
13
|
+
"displayName": "MapLibre Field"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md",
|
|
19
|
+
"CHANGELOG.md",
|
|
20
|
+
"logo.png"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./package.json": "./package.json",
|
|
24
|
+
"./strapi-admin": {
|
|
25
|
+
"types": "./dist/admin/src/index.d.ts",
|
|
26
|
+
"source": "./admin/src/index.tsx",
|
|
27
|
+
"import": "./dist/admin/index.mjs",
|
|
28
|
+
"require": "./dist/admin/index.js",
|
|
29
|
+
"default": "./dist/admin/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./strapi-server": {
|
|
32
|
+
"types": "./dist/server/src/index.d.ts",
|
|
33
|
+
"source": "./server/src/index.ts",
|
|
34
|
+
"import": "./dist/server/index.mjs",
|
|
35
|
+
"require": "./dist/server/index.js",
|
|
36
|
+
"default": "./dist/server/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "strapi-plugin build",
|
|
41
|
+
"watch": "tsc --watch --preserveWatchOutput",
|
|
42
|
+
"verify": "strapi-plugin verify",
|
|
43
|
+
"test": "jest",
|
|
44
|
+
"prepublishOnly": "npm run build && npm run verify && npm test"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
|
|
48
|
+
"maplibre-gl": "^5.16.0",
|
|
49
|
+
"pmtiles": "^4.3.2",
|
|
50
|
+
"react-map-gl": "^8.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@strapi/sdk-plugin": "^5.4.0",
|
|
54
|
+
"@strapi/typescript-utils": "^5.0.0",
|
|
55
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
56
|
+
"@testing-library/react": "^14.0.0",
|
|
57
|
+
"@types/jest": "^30.0.0",
|
|
58
|
+
"@types/react": "^18.0.0",
|
|
59
|
+
"@types/react-dom": "^18.0.0",
|
|
60
|
+
"identity-obj-proxy": "^3.0.0",
|
|
61
|
+
"jest": "^30.2.0",
|
|
62
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
63
|
+
"ts-jest": "^29.0.0",
|
|
64
|
+
"typescript": "^5.0.0"
|
|
65
|
+
},
|
|
66
|
+
"author": {
|
|
67
|
+
"name": "Claudio Bernardini",
|
|
68
|
+
"email": "claudiob@premiate.org",
|
|
69
|
+
"url": "https://premiate.org"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@strapi/design-system": "^2.0.0",
|
|
73
|
+
"@strapi/icons": "^2.0.0",
|
|
74
|
+
"@strapi/strapi": "^5.0.0",
|
|
75
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
76
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
77
|
+
"react-router-dom": "^6.0.0",
|
|
78
|
+
"styled-components": "^6.0.0"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public",
|
|
82
|
+
"registry": "https://registry.npmjs.org/"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=20.0.0 <=24.x.x",
|
|
86
|
+
"npm": ">=6.0.0"
|
|
87
|
+
},
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"keywords": [
|
|
90
|
+
"strapi",
|
|
91
|
+
"strapi-plugin",
|
|
92
|
+
"plugin",
|
|
93
|
+
"maplibre",
|
|
94
|
+
"nominatim",
|
|
95
|
+
"protomaps",
|
|
96
|
+
"pmtiles",
|
|
97
|
+
"strapi5"
|
|
98
|
+
]
|
|
99
|
+
}
|