@maptiler/geocoding-control 0.0.61 → 0.0.73

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 (35) hide show
  1. package/{dist/lib/leafletMapController.d.ts → leaflet-controller.d.ts} +0 -0
  2. package/leaflet-controller.js +15021 -0
  3. package/leaflet-controller.umd.js +25 -0
  4. package/{dist/lib/LeafletGeocodingControl.d.ts → leaflet.d.ts} +0 -0
  5. package/{dist/leaflet.js → leaflet.js} +1085 -1083
  6. package/{dist/leaflet.umd.js → leaflet.umd.js} +4 -4
  7. package/{dist/lib/MaplibreglGeocodingControl.d.ts → maplibre.d.ts} +0 -0
  8. package/{dist/lib/maplibreglMapController.d.ts → maplibregl-controller.d.ts} +1 -1
  9. package/maplibregl-controller.js +15041 -0
  10. package/maplibregl-controller.umd.js +25 -0
  11. package/{dist/maplibregl.js → maplibregl.js} +1144 -1142
  12. package/{dist/maplibregl.umd.js → maplibregl.umd.js} +4 -4
  13. package/{dist/lib/mask.d.ts → mask.d.ts} +2 -1
  14. package/package.json +50 -18
  15. package/react.d.ts +26 -0
  16. package/react.js +1327 -0
  17. package/react.umd.js +1 -0
  18. package/src/AppLeaflet.svelte +55 -0
  19. package/src/AppMaplibregl.svelte +45 -0
  20. package/src/lib/GeocodingControl.svelte +32 -28
  21. package/src/lib/ReactGeocodingControl.ts +158 -0
  22. package/src/lib/leafletMapController.ts +5 -6
  23. package/src/lib/maplibreglMapController.ts +4 -3
  24. package/src/lib/mask.ts +2 -1
  25. package/src/lib/types.ts +3 -1
  26. package/src/main-copy.ts +59 -0
  27. package/src/main.ts +65 -0
  28. package/src/vite-env.d.ts +2 -0
  29. package/style.css +1 -0
  30. package/{dist/lib/types.d.ts → types.d.ts} +2 -1
  31. package/LICENSE +0 -29
  32. package/README.md +0 -194
  33. package/dist/index.d.ts +0 -0
  34. package/dist/main.d.ts +0 -3
  35. package/dist/style.css +0 -1
@@ -1,2 +1,3 @@
1
1
  import type { Polygon, MultiPolygon, Feature as TurfFeature } from "@turf/helpers";
2
- export declare function setMask(picked: TurfFeature<Polygon | MultiPolygon>, setData: (data: GeoJSON.GeoJSON) => void): void;
2
+ import type { GeoJSON } from "geojson";
3
+ export declare function setMask(picked: TurfFeature<Polygon | MultiPolygon>, setData: (data: GeoJSON) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.61",
3
+ "version": "0.0.73",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Martin Ždila",
@@ -25,39 +25,60 @@
25
25
  "search",
26
26
  "leaflet-control",
27
27
  "maplibre-control",
28
- "control"
28
+ "control",
29
+ "react",
30
+ "svelte"
29
31
  ],
30
32
  "scripts": {
31
33
  "dev": "vite",
32
- "build": "vite build && mv dist/maplibregl.umd.cjs dist/maplibregl.umd.js && FLAVOUR=leaflet vite build && mv dist/leaflet.umd.cjs dist/leaflet.umd.js && tsc --outDir dist --declaration --emitDeclarationOnly",
34
+ "build": "concurrently --names \"MAPLIBRE,MAPLIB-C,LEAFLET ,LEAFLE-C,REACT ,TYPES \" \"npm run build-maplibre\" \"npm run build-maplibre-controller\" \"npm run build-leaflet\" \"npm run build-leaflet-controller\" \"npm run build-react\" \"npm run build-types\"",
35
+ "build-maplibre": "FLAVOUR=maplibre vite build && mv dist/maplibregl.umd.cjs dist/maplibregl.umd.js",
36
+ "build-maplibre-controller": "FLAVOUR=maplibregl-controller vite build && mv dist/maplibregl-controller.umd.cjs dist/maplibregl-controller.umd.js",
37
+ "build-leaflet": "FLAVOUR=leaflet vite build && mv dist/leaflet.umd.cjs dist/leaflet.umd.js",
38
+ "build-leaflet-controller": "FLAVOUR=leaflet-controller vite build && mv dist/leaflet-controller.umd.cjs dist/leaflet-controller.umd.js",
39
+ "build-react": "FLAVOUR=react vite build && mv dist/react.umd.cjs dist/react.umd.js",
40
+ "build-types": "tsc --outDir dist --declaration --emitDeclarationOnly",
41
+ "clean": "rm -rf dist",
42
+ "order-dist-files": "mv dist/ReactGeocodingControl.d.ts dist/react.d.ts && mv dist/MaplibreglGeocodingControl.d.ts dist/maplibre.d.ts && mv dist/maplibreglMapController.d.ts dist/maplibregl-controller.d.ts && mv dist/LeafletGeocodingControl.d.ts dist/leaflet.d.ts && mv dist/leafletMapController.d.ts dist/leaflet-controller.d.ts && cp -r package.json src dist",
43
+ "build-and-order-dist-files": "npm run clean && npm run build && npm run order-dist-files",
44
+ "pack": "npm run build-and-order-dist-files && cd dist && npm pack",
45
+ "pub": "npm run build-and-order-dist-files && cd dist && npm publish",
33
46
  "preview": "vite preview",
34
47
  "check": "svelte-check --tsconfig ./tsconfig.json"
35
48
  },
36
- "files": [
37
- "dist",
38
- "src/lib"
39
- ],
40
49
  "exports": {
41
50
  "./leaflet": {
42
- "import": "./dist/leaflet.js",
43
- "require": "./dist/leaflet.umd.js",
44
- "types": "./dist/lib/LeafletGeocodingControl.d.ts"
51
+ "import": "./leaflet.js",
52
+ "require": "./leaflet.umd.js"
53
+ },
54
+ "./leaflet-controller": {
55
+ "import": "./leaflet-controller.js",
56
+ "require": "./leaflet-controller.umd.js"
45
57
  },
46
58
  "./maplibregl": {
47
- "import": "./dist/maplibregl.js",
48
- "require": "./dist/maplibregl.umd.js",
49
- "types": "./dist/lib/MaplibreglGeocodingControl.d.ts"
59
+ "import": "./maplibregl.js",
60
+ "require": "./maplibregl.umd.js"
61
+ },
62
+ "./maplibregl-controller": {
63
+ "import": "./maplibregl-controller.js",
64
+ "require": "./maplibregl-controller.umd.js"
65
+ },
66
+ "./react": {
67
+ "import": "./react.js",
68
+ "require": "./react.umd.js"
50
69
  },
51
- "./dist/style.css": {
52
- "import": "./dist/style.css",
53
- "require": "./dist/style.css"
70
+ "./style.css": {
71
+ "import": "./style.css",
72
+ "require": "./style.css"
54
73
  },
55
74
  "./src/lib/GeocodingControl.svelte": {
56
75
  "import": "./src/lib/GeocodingControl.svelte",
57
76
  "require": "./src/lib/GeocodingControl.svelte"
58
77
  }
59
78
  },
60
- "types": "./dist/lib/index.d.ts",
79
+ "dependencies": {
80
+ "@types/geojson": "^7946.0.10"
81
+ },
61
82
  "devDependencies": {
62
83
  "@sveltejs/vite-plugin-svelte": "^2.0.2",
63
84
  "@tsconfig/svelte": "^3.0.0",
@@ -65,8 +86,15 @@
65
86
  "@turf/difference": "^6.5.0",
66
87
  "@turf/union": "^6.5.0",
67
88
  "@types/leaflet": "^1.9.0",
89
+ "@types/react": "^18.0.27",
90
+ "@types/react-dom": "^18.0.10",
91
+ "concurrently": "^7.6.0",
92
+ "leaflet": "^1.9.3",
93
+ "maplibre-gl": "^2.4.0",
68
94
  "prettier": "^2.8.3",
69
95
  "prettier-plugin-svelte": "^2.9.0",
96
+ "react": "^18.2.0",
97
+ "react-dom": "^18.2.0",
70
98
  "svelte": "^3.55.1",
71
99
  "svelte-check": "^3.0.3",
72
100
  "svelte-preprocess": "^5.0.1",
@@ -76,7 +104,8 @@
76
104
  },
77
105
  "peerDependencies": {
78
106
  "leaflet": "^1.9.3",
79
- "maplibre-gl": "^2.4.0"
107
+ "maplibre-gl": "^2.4.0",
108
+ "react": "^18.2.0"
80
109
  },
81
110
  "peerDependenciesMeta": {
82
111
  "leaflet": {
@@ -84,6 +113,9 @@
84
113
  },
85
114
  "maplibre-gl": {
86
115
  "optional": true
116
+ },
117
+ "react": {
118
+ "optional": true
87
119
  }
88
120
  }
89
121
  }
package/react.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import type { ControlOptions, Feature, MapController } from "./types";
3
+ type CallbackProperties = {
4
+ onSelect?: (feature: Feature | undefined) => void;
5
+ onPick?: (feature: Feature | undefined) => void;
6
+ onOptionsVisibilityChange?: (visible: boolean) => void;
7
+ onFeaturesListed?: (visible: Feature[] | undefined) => void;
8
+ onFeaturesMarked?: (visible: Feature[] | undefined) => void;
9
+ onResponse?: (onResponse: {
10
+ url: string;
11
+ response: Response;
12
+ }) => void;
13
+ onReversetoggle?: (reverse: boolean) => void;
14
+ onQuerychange?: (query: string) => void;
15
+ };
16
+ type MapControllerProp = {
17
+ mapController?: MapController;
18
+ };
19
+ export type Props = ControlOptions & CallbackProperties & MapControllerProp;
20
+ export type Methods = {
21
+ blur: () => void;
22
+ focus: () => void;
23
+ setQuery: (value: string, submit?: boolean) => void;
24
+ };
25
+ declare const ReactGeocodingControl: import("react").ForwardRefExoticComponent<ControlOptions & CallbackProperties & MapControllerProp & import("react").RefAttributes<Methods>>;
26
+ export { ReactGeocodingControl as GeocodingControl };