@milemaker/milemaker-js 1.1.0-alpha.1 → 2.0.0-alpha.0

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 (54) hide show
  1. package/dist/actions/constants/actions.constants.d.ts +3 -2
  2. package/dist/actions/index.d.ts +4 -1
  3. package/dist/actions/layer/baseLayerActions.factory.d.ts +1 -1
  4. package/dist/actions/layer/index.d.ts +5 -2
  5. package/dist/actions/layer/types/layerActions.types.d.ts +34 -10
  6. package/dist/actions/layer/weatherLayerActions.factory.d.ts +8 -0
  7. package/dist/actions/marker/types/markerActions.types.d.ts +1 -1
  8. package/dist/actions/popup/types/popupActions.types.d.ts +1 -1
  9. package/dist/components/Popper/Popper.d.ts +1 -1
  10. package/dist/components/Popper/Popper.types.d.ts +3 -0
  11. package/dist/components/WeatherLegend/RainSnowIceLegend/RainSnowIceLegend.d.ts +3 -0
  12. package/dist/components/WeatherLegend/RainSnowIceLegend/RainSnowIceLegend.types.d.ts +18 -0
  13. package/dist/components/WeatherLegend/RainSnowIceLegend/index.d.ts +2 -0
  14. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.constants.d.ts +2 -0
  15. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.d.ts +3 -0
  16. package/dist/components/WeatherLegend/WeatherAlertsLegend/WeatherAlertsLegend.types.d.ts +12 -0
  17. package/dist/components/WeatherLegend/WeatherAlertsLegend/index.d.ts +2 -0
  18. package/dist/components/WeatherLegend/WeatherLegend.d.ts +3 -0
  19. package/dist/components/WeatherLegend/WeatherLegend.types.d.ts +19 -0
  20. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.constants.d.ts +2 -0
  21. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.d.ts +3 -0
  22. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/WeatherTemperaturesLegend.types.d.ts +15 -0
  23. package/dist/components/WeatherLegend/WeatherTemperaturesLegend/index.d.ts +2 -0
  24. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.constants.d.ts +6 -0
  25. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.d.ts +3 -0
  26. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/WeatherWindSpeedsLegend.types.d.ts +15 -0
  27. package/dist/components/WeatherLegend/WeatherWindSpeedsLegend/index.d.ts +2 -0
  28. package/dist/components/WeatherLegend/index.d.ts +6 -0
  29. package/dist/components/index.d.ts +1 -0
  30. package/dist/controls/createWeatherLayerControl.factory.d.ts +3 -0
  31. package/dist/controls/index.d.ts +1 -0
  32. package/dist/controls/types/controls.types.d.ts +14 -1
  33. package/dist/controls/utils/index.d.ts +4 -0
  34. package/dist/controls/utils/weatherLayers.constants.d.ts +5 -0
  35. package/dist/controls/utils/weatherLayers.helpers.d.ts +12 -0
  36. package/dist/controls/utils/weatherLayers.rendering.d.ts +2 -0
  37. package/dist/controls/utils/weatherLayers.types.d.ts +1 -0
  38. package/dist/createMap/errorMap/createMap.error.d.ts +3 -2
  39. package/dist/createMap/types/createMap.types.d.ts +7 -2
  40. package/dist/helpers/parseStringAsJson.d.ts +1 -1
  41. package/dist/index.cjs +309 -241
  42. package/dist/index.js +23909 -23037
  43. package/dist/types/common.enums.d.ts +23 -0
  44. package/dist/types/common.types.d.ts +13 -0
  45. package/dist/utils/constants.d.ts +28 -0
  46. package/dist/utils/helpers/getBrowserInfo.helper.d.ts +2 -0
  47. package/dist/utils/helpers/getMailToSupportHrefLink.helper.d.ts +8 -0
  48. package/dist/utils/helpers/limitEmailLength.helper.d.ts +2 -0
  49. package/dist/utils/helpers/prepareAppErrorMailToData.helper.d.ts +7 -0
  50. package/dist/utils/helpers/prepareContactSupportMandatoryFields.helper.d.ts +4 -0
  51. package/dist/utils/types.d.ts +13 -0
  52. package/dist/utils/version.d.ts +1 -0
  53. package/package.json +5 -4
  54. package/dist/helpers/getMailToSupportHrefLink.helper.d.ts +0 -13
@@ -9,3 +9,26 @@ export declare enum MapBaseLayer {
9
9
  DARK = "Dark",
10
10
  SATELLITE = "Satellite"
11
11
  }
12
+ /**
13
+ * Available weather layers
14
+ * @group Common
15
+ * @category Enums
16
+ */
17
+ export declare enum WeatherLayer {
18
+ RADAR_GLOBAL = "radar-global",
19
+ TEMPERATURES = "temperatures",
20
+ WEATHER_WIND_SPEEDS = "wind-speeds",
21
+ SATELLITE_GEOCOLOR = "satellite-geocolor",
22
+ SATELLITE_INFRARED = "satellite-infrared-color",
23
+ ROAD_CONDITIONS = "road-conditions",
24
+ ALERTS = "alerts-severe"
25
+ }
26
+ /**
27
+ * Available units formats
28
+ * @group Common
29
+ * @category Enums
30
+ */
31
+ export declare enum UnitsFormat {
32
+ IMPERIAL = "imperial",
33
+ METRIC = "metric"
34
+ }
@@ -1,3 +1,4 @@
1
+ import { UnitsFormat } from "./common.enums";
1
2
  /**
2
3
  * Tuple where first item is longitude and second is latitude
3
4
  * @type
@@ -57,3 +58,15 @@ export type LngLat = {
57
58
  * @category Types
58
59
  */
59
60
  export type LonLatLike = LonLatTuple | Coordinates | LngLat;
61
+ /**
62
+ * General application settings configuration
63
+ * @interface
64
+ * @group Common
65
+ * @category Interfaces
66
+ */
67
+ export type GeneralAppSettings = {
68
+ /**
69
+ * Units
70
+ */
71
+ units: UnitsFormat;
72
+ };
@@ -20,3 +20,31 @@ export declare const MILE_MAKER_PAGE_PATH: {
20
20
  export declare const FULL_MILE_MAKER_PAGE_PATH: {
21
21
  terms: string;
22
22
  };
23
+ export declare const MEASURE_UNITS_LABELS: {
24
+ imperial: {
25
+ shortDistance: string;
26
+ speed: string;
27
+ distance: string;
28
+ distance_one: string;
29
+ distance_other: string;
30
+ volume: string;
31
+ volume_one: string;
32
+ volume_other: string;
33
+ shortTemperature: string;
34
+ temperature: string;
35
+ };
36
+ metric: {
37
+ shortDistance: string;
38
+ speed: string;
39
+ distance: string;
40
+ distance_one: string;
41
+ distance_other: string;
42
+ volume: string;
43
+ volume_one: string;
44
+ volume_other: string;
45
+ shortTemperature: string;
46
+ temperature: string;
47
+ };
48
+ };
49
+ export declare const EMAIL_SUBJECT_LENGTH_LIMITATION = 255;
50
+ export declare const EMAIL_BODY_LENGTH_LIMITATION = 2000;
@@ -0,0 +1,2 @@
1
+ import { detect as browserDetect } from "detect-browser";
2
+ export declare const getBrowserInfo: () => ReturnType<typeof browserDetect> | undefined;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This helper is used to receive the HrefLink to support
3
+ */
4
+ export declare const getMailToSupportHrefLink: (props?: {
5
+ subject?: string | number | boolean;
6
+ body?: string | number | boolean;
7
+ email?: string;
8
+ }) => string;
@@ -0,0 +1,2 @@
1
+ export declare const limitEmailSubjectLength: (subject?: string) => string;
2
+ export declare const limitEmailBodyLength: (body?: string) => string;
@@ -0,0 +1,7 @@
1
+ export declare const prepareAppErrorMailToData: ({ appError, accessToken }: {
2
+ appError: Error;
3
+ accessToken: string;
4
+ }) => {
5
+ subject: string;
6
+ body: string;
7
+ };
@@ -0,0 +1,4 @@
1
+ import { ContactSupportMandatoryField } from "../types";
2
+ export declare const prepareContactSupportMandatoryFields: ({ accessToken }: {
3
+ accessToken: string;
4
+ }) => Record<ContactSupportMandatoryField, unknown>;
@@ -3,3 +3,16 @@ export declare enum Env {
3
3
  STG = "STG",
4
4
  PRD = "PRD"
5
5
  }
6
+ export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
7
+ export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
8
+ export declare enum ContactSupportMandatoryField {
9
+ MAP_SDK_KEY = "mapSdkKey",
10
+ BROWSER_INFO = "browserInfo",
11
+ TIMESTAMP = "timestamp",
12
+ APP_VERSION = "appVersion",
13
+ SCOPE = "scope"
14
+ }
15
+ export declare enum Mail {
16
+ SUPPORT = "support@milemaker.com",
17
+ SALES = "mmsales@milemaker.com"
18
+ }
@@ -0,0 +1 @@
1
+ export declare const APP_VERSION = "2.0.0-alpha.0";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@milemaker/milemaker-js",
3
3
  "private": false,
4
- "version": "1.1.0-alpha.1",
4
+ "version": "2.0.0-alpha.0",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",
7
7
  "files": [
@@ -21,15 +21,16 @@
21
21
  "registry": "https://registry.npmjs.org"
22
22
  },
23
23
  "scripts": {
24
+ "prebuild": "sh ./scripts/generate-version.sh",
24
25
  "build": "tsc -p ./tsconfig.json && vite build --mode production",
25
26
  "postbuild": "sh ./scripts/postbuild.sh",
26
- "build:publish": "yarn build && npm publish"
27
+ "build:publish": "yarn build && sh ./scripts/publish.sh"
27
28
  },
28
29
  "dependencies": {
29
30
  "@googlemaps/polyline-codec": "^1.0.28",
31
+ "detect-browser": "^5.3.0",
30
32
  "lodash": "^4.17.21",
31
- "uuid": "^9.0.0",
32
- "vite-plugin-package-version": "^1.1.0"
33
+ "uuid": "^9.0.0"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@milemaker/nmaps-gl": "^1.6.10",
@@ -1,13 +0,0 @@
1
- export declare enum Mail {
2
- SUPPORT = "support@milemaker.com"
3
- }
4
- /**
5
- * This helper is used to receive the HrefLink to support
6
- * @param {string} subject - Email subject
7
- * @param {string} body - Email body
8
- * @returns {string} - Support Href Link
9
- */
10
- export declare const getMailToSupportHrefLink: ({ subject, body }?: {
11
- subject?: string | undefined;
12
- body?: string | undefined;
13
- }) => string;