@ornikar/kitt-universal 25.8.0 → 25.9.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/countryCodes.d.ts +2 -0
  3. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/countryCodes.d.ts.map +1 -0
  4. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/languages.d.ts +2 -0
  5. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/languages.d.ts.map +1 -0
  6. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/types.d.ts +2 -0
  7. package/dist/definitions/GoogleMapsAutocompleteProvider/constants/types.d.ts.map +1 -0
  8. package/dist/definitions/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.d.ts.map +1 -1
  9. package/dist/definitions/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.web.d.ts.map +1 -1
  10. package/dist/definitions/GoogleMapsAutocompleteProvider/utils/makeMapsApiUrl.d.ts +10 -1
  11. package/dist/definitions/GoogleMapsAutocompleteProvider/utils/makeMapsApiUrl.d.ts.map +1 -1
  12. package/dist/index-metro.es.android.js +48 -4
  13. package/dist/index-metro.es.android.js.map +1 -1
  14. package/dist/index-metro.es.ios.js +48 -4
  15. package/dist/index-metro.es.ios.js.map +1 -1
  16. package/dist/index-node-20.10.cjs.js +48 -4
  17. package/dist/index-node-20.10.cjs.js.map +1 -1
  18. package/dist/index-node-20.10.cjs.web.js +19 -2
  19. package/dist/index-node-20.10.cjs.web.js.map +1 -1
  20. package/dist/index-node-20.10.es.mjs +48 -4
  21. package/dist/index-node-20.10.es.mjs.map +1 -1
  22. package/dist/index-node-20.10.es.web.mjs +19 -2
  23. package/dist/index-node-20.10.es.web.mjs.map +1 -1
  24. package/dist/index.es.js +49 -4
  25. package/dist/index.es.js.map +1 -1
  26. package/dist/index.es.web.js +19 -2
  27. package/dist/index.es.web.js.map +1 -1
  28. package/dist/tsbuildinfo +1 -1
  29. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.9.1](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.9.0...@ornikar/kitt-universal@25.9.1) (2024-07-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * inputAddress only suggests addresses OSE-10872 ([#2430](https://github.com/ornikar/kitt/issues/2430)) ([123310f](https://github.com/ornikar/kitt/commit/123310f66ae3067b6cb77c557678be4dece2b236))
12
+
13
+
14
+
15
+ ## [25.9.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.8.0...@ornikar/kitt-universal@25.9.0) (2024-07-10)
16
+
17
+
18
+ ### Features
19
+
20
+ * add icons to kitt-icons OSE-10480 ([#2432](https://github.com/ornikar/kitt/issues/2432)) ([2d1f54d](https://github.com/ornikar/kitt/commit/2d1f54ddf82ad4c5140e89e8d84ac9f351da1387))
21
+
22
+
23
+
6
24
  ## [25.8.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.7.0...@ornikar/kitt-universal@25.8.0) (2024-07-09)
7
25
 
8
26
 
@@ -0,0 +1,2 @@
1
+ export declare const countryCodes: string[];
2
+ //# sourceMappingURL=countryCodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countryCodes.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/constants/countryCodes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,UAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const defaultLanguageSearch = "fr";
2
+ //# sourceMappingURL=languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/constants/languages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const autocompletePredictionTypes: string[];
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/constants/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,UAA0C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGoogleMapsApi.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAChD;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE;QACZ,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACtE,CAAC;IACF,aAAa,EAAE;QACb,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;KAC9D,CAAC;CACH;AAED,wBAAgB,gBAAgB,IAAI,uBAAuB,CAwD1D"}
1
+ {"version":3,"file":"useGoogleMapsApi.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.ts"],"names":[],"mappings":";;AAOA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAChD;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE;QACZ,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACtE,CAAC;IACF,aAAa,EAAE;QACb,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;KAC9D,CAAC;CACH;AAED,wBAAgB,gBAAgB,IAAI,uBAAuB,CA8D1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGoogleMapsApi.web.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.web.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA2C,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE3G,wBAAgB,gBAAgB,IAAI,uBAAuB,CAmE1D"}
1
+ {"version":3,"file":"useGoogleMapsApi.web.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/hooks/useGoogleMapsApi.web.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA2C,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE3G,wBAAgB,gBAAgB,IAAI,uBAAuB,CA2E1D"}
@@ -1,2 +1,11 @@
1
- export declare function makeMapsApiUrl(resource: string, paramName: string, value: string, apiKey: string): string;
1
+ export type MapsApiUrlSearchParamsName = 'input' | 'language' | 'types' | 'components' | 'key' | 'place_id';
2
+ export interface MapsApiUrlSearchParams {
3
+ paramsName: MapsApiUrlSearchParamsName;
4
+ value: string;
5
+ }
6
+ export interface MapsApiUrlParams {
7
+ resource: string;
8
+ params: MapsApiUrlSearchParams[];
9
+ }
10
+ export declare function makeMapsApiUrl({ resource, params }: MapsApiUrlParams): string;
2
11
  //# sourceMappingURL=makeMapsApiUrl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeMapsApiUrl.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/utils/makeMapsApiUrl.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIzG"}
1
+ {"version":3,"file":"makeMapsApiUrl.d.ts","sourceRoot":"","sources":["../../../../src/GoogleMapsAutocompleteProvider/utils/makeMapsApiUrl.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC;AAE5G,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,0BAA0B,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAY7E"}
@@ -6261,14 +6261,58 @@ function useGoogleMapApiKey() {
6261
6261
  return context;
6262
6262
  }
6263
6263
 
6264
- function makeMapsApiUrl(resource, paramName, value, apiKey) {
6265
- return `https://maps.googleapis.com/maps/api/${resource}/json?${paramName}=${encodeURIComponent(value)}&key=${apiKey}`;
6264
+ // Countries where we can have instructors and students
6265
+ // Restricting the search of the InputAddress component
6266
+ // France, Guyane Française, Guadeloupe, Martinique, Réunion
6267
+ // As of today, Google restrict this array to 5 country codes
6268
+ const countryCodes = ['FR', 'GF', 'GP', 'MQ', 'RE'];
6269
+
6270
+ const defaultLanguageSearch = 'fr';
6271
+
6272
+ // types of result we want to allow as suggestions from the Autocomplete search
6273
+ // See https://developers.google.com/maps/documentation/places/web-service/supported_types#table2 for all supported types
6274
+ const autocompletePredictionTypes = ['street_address', 'point_of_interest'];
6275
+
6276
+ function makeMapsApiUrl({
6277
+ resource,
6278
+ params
6279
+ }) {
6280
+ const queryParams = params.map(({
6281
+ paramsName,
6282
+ value
6283
+ }) => {
6284
+ let encodedValue = value;
6285
+ if (paramsName === 'input') {
6286
+ encodedValue = encodeURIComponent(value);
6287
+ }
6288
+ return `${paramsName}=${encodedValue}`;
6289
+ });
6290
+ return `https://maps.googleapis.com/maps/api/${resource}/json?` + queryParams.join('&');
6266
6291
  }
6267
6292
 
6268
6293
  function useGoogleMapsApi() {
6269
6294
  const apiKey = useGoogleMapApiKey();
6270
- const makeApiUrl = (resource, paramName, value) => {
6271
- return makeMapsApiUrl(resource, paramName, value, apiKey);
6295
+ const defaultSearchParams = [{
6296
+ paramsName: 'key',
6297
+ value: apiKey
6298
+ }, {
6299
+ paramsName: 'language',
6300
+ value: defaultLanguageSearch
6301
+ }, {
6302
+ paramsName: 'types',
6303
+ value: autocompletePredictionTypes.join('|')
6304
+ }, {
6305
+ paramsName: 'components',
6306
+ value: countryCodes.map(code => `country:${code}`).join('|')
6307
+ }];
6308
+ const makeApiUrl = (resource, paramsName, param) => {
6309
+ return makeMapsApiUrl({
6310
+ resource,
6311
+ params: [...defaultSearchParams, {
6312
+ paramsName,
6313
+ value: param
6314
+ }]
6315
+ });
6272
6316
  };
6273
6317
  const sharedFetchOptions = {
6274
6318
  method: 'GET',