@maptiler/geocoding-control 0.0.94 → 0.0.96-alpha.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.94",
3
+ "version": "0.0.96-alpha.1",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Martin Ždila",
@@ -31,14 +31,15 @@
31
31
  ],
32
32
  "scripts": {
33
33
  "dev": "vite --host",
34
- "build": "npm run check && concurrently --names \"SVELTE ,MAPLIBRE,MAPTILER,MAPLIB-C,LEAFLET ,LEAFLE-C,REACT ,TYPES \" \"npm run build-svelte\" \"npm run build-maplibre\" \"npm run build-maptilersdk\" \"npm run build-maplibre-controller\" \"npm run build-leaflet\" \"npm run build-leaflet-controller\" \"npm run build-react\" \"npm run build-types\" && npm run cjs2js && cp dist.svelte/*.svelte* LICENSE README.md package.json dist",
35
- "build-svelte": "svelte-package -o dist.svelte",
36
- "build-maptilersdk": "VITE_FLAVOUR=maptilersdk vite build",
37
- "build-maplibre": "VITE_FLAVOUR=maplibre vite build",
38
- "build-maplibre-controller": "VITE_FLAVOUR=maplibregl-controller vite build",
39
- "build-leaflet": "VITE_FLAVOUR=leaflet vite build",
40
- "build-leaflet-controller": "VITE_FLAVOUR=leaflet-controller vite build",
41
- "build-react": "VITE_FLAVOUR=react vite build",
34
+ "build": "npm run check && concurrently --names \"SVELTE ,MAPLIBRE,MAPTILER,MAPLIB-C,LEAFLET ,LEAFLE-C,REACT ,TYPES ,VANILLA \" \"npm run build-svelte\" \"npm run build-maplibre\" \"npm run build-maptilersdk\" \"npm run build-maplibre-controller\" \"npm run build-leaflet\" \"npm run build-leaflet-controller\" \"npm run build-react\" \"npm run build-vanilla\" \"npm run build-types\" && npm run cjs2js && cp dist.svelte/*.svelte* LICENSE README.md package.json dist",
35
+ "build-svelte": "svelte-package -o dist.svelte && VITE_LIB_VERSION=$npm_package_version node replace-env-vars.js",
36
+ "build-maptilersdk": "FLAVOUR=maptilersdk vite build",
37
+ "build-maplibre": "FLAVOUR=maplibre vite build",
38
+ "build-maplibre-controller": "FLAVOUR=maplibregl-controller vite build",
39
+ "build-leaflet": "FLAVOUR=leaflet vite build",
40
+ "build-leaflet-controller": "FLAVOUR=leaflet-controller vite build",
41
+ "build-react": "FLAVOUR=react vite build",
42
+ "build-vanilla": "FLAVOUR=vanilla vite build",
42
43
  "build-types": "tsc --outDir dist --declaration --emitDeclarationOnly",
43
44
  "cjs2js": "renamer --find '/\\bcjs\\b/' --replace js dist/*cjs*",
44
45
  "clean": "rm -rf dist dist.svelte",
@@ -74,6 +75,10 @@
74
75
  "import": "./react.js",
75
76
  "require": "./react.umd.js"
76
77
  },
78
+ "./vanilla": {
79
+ "types": "./vanilla.js",
80
+ "svelte": "./vanilla.umd.js"
81
+ },
77
82
  "./style.css": {
78
83
  "import": "./style.css",
79
84
  "require": "./style.css"
@@ -96,6 +101,7 @@
96
101
  "@types/react": "^18.2.14",
97
102
  "@types/react-dom": "^18.2.6",
98
103
  "concurrently": "^8.2.0",
104
+ "dotenv": "^16.3.1",
99
105
  "esm-env": "^1.0.0",
100
106
  "leaflet": "^1.9.4",
101
107
  "maplibre-gl": "^3.1.0",
@@ -105,6 +111,7 @@
105
111
  "react": "^18.2.0",
106
112
  "react-dom": "^18.2.0",
107
113
  "renamer": "^4.0.0",
114
+ "replace-in-file": "^7.0.1",
108
115
  "sass": "^1.63.6",
109
116
  "svelte": "^4.0.0",
110
117
  "svelte-check": "^3.4.4",
package/react.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- /// <reference types="svelte" />
2
1
  /// <reference types="react" />
3
- import GeocodingControl from "./GeocodingControl.svelte";
4
2
  import type { ControlOptions, DispatcherType, MapController } from "./types";
5
3
  type EventNames = keyof DispatcherType;
6
4
  type EventHandlerFnName<T extends EventNames> = `on${Capitalize<T>}`;
@@ -11,9 +9,10 @@ type MapControllerProp = {
11
9
  mapController?: MapController;
12
10
  };
13
11
  export type Props = ControlOptions & CallbackProperties<DispatcherType> & MapControllerProp;
14
- type MethodNames = "blur" | "focus" | "setQuery";
15
12
  export type Methods = {
16
- [T in MethodNames]: GeocodingControl[T];
13
+ blur(): void;
14
+ focus(): void;
15
+ setQuery(value: string, submit?: boolean): void;
17
16
  };
18
17
  declare const ReactGeocodingControl: import("react").ForwardRefExoticComponent<ControlOptions & CallbackProperties<DispatcherType> & MapControllerProp & import("react").RefAttributes<Methods>>;
19
18
  export { ReactGeocodingControl as GeocodingControl };
package/react.js CHANGED
@@ -1412,9 +1412,7 @@ function at(n) {
1412
1412
  return e[2] < e[0] && (e[2] += 360), e;
1413
1413
  }
1414
1414
  function Wn(n, e, t) {
1415
- let r, { $$slots: l = {}, $$scope: u } = e, { class: s = void 0 } = e, { apiKey: f } = e, { bbox: d = void 0 } = e, { clearButtonTitle: o = "clear" } = e, { clearOnBlur: m = !1 } = e, { collapsed: v = !1 } = e, { country: g = void 0 } = e, { debounceSearch: B = 200 } = e, { enableReverse: I = !1 } = e, { errorMessage: T = "Something went wrong…" } = e, { filter: M = () => !0 } = e, { flyTo: A = !0 } = e, { fuzzyMatch: y = !0 } = e, { language: O = void 0 } = e, { limit: F = void 0 } = e, { mapController: h = void 0 } = e, { minLength: b = 2 } = e, { noResultsMessage: C = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: R = "Search" } = e, { proximity: _ = void 0 } = e, { reverseActive: w = I === "always" } = e, { reverseButtonTitle: Q = "toggle reverse geocoding" } = e, { searchValue: a = "" } = e, { showFullGeometry: z = !0 } = e, { showPlaceType: x = "ifNeeded" } = e, { showResultsWhileTyping: oe = !0 } = e, { trackProximity: Ce = !0 } = e, { types: fe = void 0 } = e, { zoom: Re = 16 } = e, { maxZoom: pe = 18 } = e, { apiUrl: Ue = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Ae = {} } = e, {
1416
- iconsBaseUrl: Qe = "https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.92/icons/"
1417
- } = e;
1415
+ let r, { $$slots: l = {}, $$scope: u } = e, { class: s = void 0 } = e, { apiKey: f } = e, { bbox: d = void 0 } = e, { clearButtonTitle: o = "clear" } = e, { clearOnBlur: m = !1 } = e, { collapsed: v = !1 } = e, { country: g = void 0 } = e, { debounceSearch: B = 200 } = e, { enableReverse: I = !1 } = e, { errorMessage: T = "Something went wrong…" } = e, { filter: M = () => !0 } = e, { flyTo: A = !0 } = e, { fuzzyMatch: y = !0 } = e, { language: O = void 0 } = e, { limit: F = void 0 } = e, { mapController: h = void 0 } = e, { minLength: b = 2 } = e, { noResultsMessage: C = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: R = "Search" } = e, { proximity: _ = void 0 } = e, { reverseActive: w = I === "always" } = e, { reverseButtonTitle: Q = "toggle reverse geocoding" } = e, { searchValue: a = "" } = e, { showFullGeometry: z = !0 } = e, { showPlaceType: x = "ifNeeded" } = e, { showResultsWhileTyping: oe = !0 } = e, { trackProximity: Ce = !0 } = e, { types: fe = void 0 } = e, { zoom: Re = 16 } = e, { maxZoom: pe = 18 } = e, { apiUrl: Ue = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Ae = {} } = e, { iconsBaseUrl: Qe = "https://cdn.maptiler.com/maptiler-geocoding-control/v0.0.96-alpha.1/icons/" } = e;
1418
1416
  function kt() {
1419
1417
  J.focus();
1420
1418
  }
@@ -1724,6 +1722,7 @@ const dt = [
1724
1722
  "country",
1725
1723
  "debounceSearch",
1726
1724
  "enableReverse",
1725
+ "reverseActive",
1727
1726
  "errorMessage",
1728
1727
  "filter",
1729
1728
  "fuzzyMatch",