@monkvision/common 5.2.4 → 5.3.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 (60) hide show
  1. package/lib/PreventExit/hooks.js +1 -2
  2. package/lib/PreventExit/store.js +1 -2
  3. package/lib/apps/analytics.js +1 -2
  4. package/lib/apps/appStateProvider.d.ts +1 -1
  5. package/lib/apps/appStateProvider.js +4 -15
  6. package/lib/apps/monitoring.js +1 -2
  7. package/lib/apps/searchParams.js +4 -4
  8. package/lib/hooks/useAsyncEffect.js +1 -2
  9. package/lib/hooks/useAsyncInterval.js +1 -2
  10. package/lib/hooks/useDeviceOrientation.js +3 -4
  11. package/lib/hooks/useForm.js +1 -2
  12. package/lib/hooks/useInteractiveStatus.js +1 -2
  13. package/lib/hooks/useInterval.js +1 -2
  14. package/lib/hooks/useIsMounted.js +1 -2
  15. package/lib/hooks/useLoadingState.js +1 -2
  16. package/lib/hooks/useObjectMemo.js +1 -2
  17. package/lib/hooks/useObjectTranslation.js +1 -2
  18. package/lib/hooks/useQueue.js +4 -5
  19. package/lib/hooks/useResponsiveStyle.js +1 -2
  20. package/lib/hooks/useSafeTimeout.js +1 -2
  21. package/lib/hooks/useSearchParams.js +1 -2
  22. package/lib/hooks/useSightLabel.js +1 -2
  23. package/lib/hooks/useWindowDimensions.js +1 -2
  24. package/lib/i18n/utils.js +5 -6
  25. package/lib/state/actions/createdOneDamage.js +2 -3
  26. package/lib/state/actions/createdOneImage.js +2 -3
  27. package/lib/state/actions/createdOnePricing.js +2 -3
  28. package/lib/state/actions/deletedOneDamage.js +2 -3
  29. package/lib/state/actions/deletedOneImage.js +2 -3
  30. package/lib/state/actions/deletedOnePricing.js +2 -3
  31. package/lib/state/actions/gotOneInspection.js +2 -3
  32. package/lib/state/actions/gotOneInspectionPdf.js +2 -3
  33. package/lib/state/actions/monkAction.js +1 -1
  34. package/lib/state/actions/resetState.js +2 -3
  35. package/lib/state/actions/updatedManyTasks.js +2 -3
  36. package/lib/state/actions/updatedOneInspectionAdditionalData.js +2 -3
  37. package/lib/state/actions/updatedOnePricing.js +2 -3
  38. package/lib/state/actions/updatedVehicle.js +2 -3
  39. package/lib/state/hooks.js +1 -2
  40. package/lib/state/provider.d.ts +1 -1
  41. package/lib/state/provider.js +2 -3
  42. package/lib/state/reducer.js +1 -2
  43. package/lib/state/state.js +1 -2
  44. package/lib/theme/hooks.js +1 -2
  45. package/lib/theme/provider.d.ts +1 -1
  46. package/lib/theme/provider.js +2 -14
  47. package/lib/theme/theme.js +1 -2
  48. package/lib/utils/array.utils.js +4 -5
  49. package/lib/utils/browser.utils.js +2 -3
  50. package/lib/utils/color.utils.js +8 -8
  51. package/lib/utils/config.utils.js +1 -2
  52. package/lib/utils/env.utils.js +1 -2
  53. package/lib/utils/formValidation.utils.js +5 -5
  54. package/lib/utils/mimetype.utils.js +3 -3
  55. package/lib/utils/promise.utils.js +1 -2
  56. package/lib/utils/state.utils.js +1 -2
  57. package/lib/utils/string.utils.js +5 -6
  58. package/lib/utils/vehicle.utils.js +1 -2
  59. package/lib/utils/zlib.utils.js +2 -3
  60. package/package.json +22 -23
@@ -20,7 +20,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  return to.concat(ar || Array.prototype.slice.call(from));
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.updatedManyTasks = exports.isUpdatedManyTasksAction = void 0;
23
+ exports.isUpdatedManyTasksAction = isUpdatedManyTasksAction;
24
+ exports.updatedManyTasks = updatedManyTasks;
24
25
  var monkAction_1 = require("./monkAction");
25
26
  /**
26
27
  * Matcher function that matches a UpdatedManyTasksAction while also inferring its type using TypeScript's type
@@ -29,7 +30,6 @@ var monkAction_1 = require("./monkAction");
29
30
  function isUpdatedManyTasksAction(action) {
30
31
  return action.type === monkAction_1.MonkActionType.UPDATED_MANY_TASKS;
31
32
  }
32
- exports.isUpdatedManyTasksAction = isUpdatedManyTasksAction;
33
33
  /**
34
34
  * Reducer function for an UpdatedManyTasks action.
35
35
  */
@@ -43,4 +43,3 @@ function updatedManyTasks(state, action) {
43
43
  });
44
44
  return __assign(__assign({}, state), { tasks: __spreadArray([], tasks, true) });
45
45
  }
46
- exports.updatedManyTasks = updatedManyTasks;
@@ -20,7 +20,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  return to.concat(ar || Array.prototype.slice.call(from));
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.updatedOneInspectionAdditionalData = exports.isUpdatedOneInspectionAdditionalDataAction = void 0;
23
+ exports.isUpdatedOneInspectionAdditionalDataAction = isUpdatedOneInspectionAdditionalDataAction;
24
+ exports.updatedOneInspectionAdditionalData = updatedOneInspectionAdditionalData;
24
25
  var monkAction_1 = require("./monkAction");
25
26
  /**
26
27
  * Matcher function that matches a UpdatedOneInspection while also inferring its type using TypeScript's type predicate
@@ -29,7 +30,6 @@ var monkAction_1 = require("./monkAction");
29
30
  function isUpdatedOneInspectionAdditionalDataAction(action) {
30
31
  return action.type === monkAction_1.MonkActionType.UPDATED_ONE_INSPECTION_ADDITIONAL_DATA;
31
32
  }
32
- exports.isUpdatedOneInspectionAdditionalDataAction = isUpdatedOneInspectionAdditionalDataAction;
33
33
  /**
34
34
  * Reducer function for a UpdatedOneInspection action.
35
35
  */
@@ -42,4 +42,3 @@ function updatedOneInspectionAdditionalData(state, action) {
42
42
  }
43
43
  return __assign(__assign({}, state), { inspections: __spreadArray([], inspections, true) });
44
44
  }
45
- exports.updatedOneInspectionAdditionalData = updatedOneInspectionAdditionalData;
@@ -11,7 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.updatedOnePricing = exports.isUpdatedOnePricingAction = void 0;
14
+ exports.isUpdatedOnePricingAction = isUpdatedOnePricingAction;
15
+ exports.updatedOnePricing = updatedOnePricing;
15
16
  var monkAction_1 = require("./monkAction");
16
17
  /**
17
18
  * Matcher function that matches a updatedOnePricing while also inferring its type using TypeScript's type predicate
@@ -20,7 +21,6 @@ var monkAction_1 = require("./monkAction");
20
21
  function isUpdatedOnePricingAction(action) {
21
22
  return action.type === monkAction_1.MonkActionType.UPDATED_ONE_PRICING;
22
23
  }
23
- exports.isUpdatedOnePricingAction = isUpdatedOnePricingAction;
24
24
  /**
25
25
  * Reducer function for a updatedOnePricing action.
26
26
  */
@@ -32,4 +32,3 @@ function updatedOnePricing(state, action) {
32
32
  });
33
33
  return __assign(__assign({}, state), { pricings: updatedPricings });
34
34
  }
35
- exports.updatedOnePricing = updatedOnePricing;
@@ -20,7 +20,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  return to.concat(ar || Array.prototype.slice.call(from));
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.updatedVehicle = exports.isUpdatedVehicleAction = void 0;
23
+ exports.isUpdatedVehicleAction = isUpdatedVehicleAction;
24
+ exports.updatedVehicle = updatedVehicle;
24
25
  var monkAction_1 = require("./monkAction");
25
26
  /**
26
27
  * Matcher function that matches a UpdatedVehicle while also inferring its type using TypeScript's type predicate
@@ -29,7 +30,6 @@ var monkAction_1 = require("./monkAction");
29
30
  function isUpdatedVehicleAction(action) {
30
31
  return action.type === monkAction_1.MonkActionType.UPDATED_VEHICLE;
31
32
  }
32
- exports.isUpdatedVehicleAction = isUpdatedVehicleAction;
33
33
  /**
34
34
  * Reducer function for a UpdatedVehicle action.
35
35
  */
@@ -46,4 +46,3 @@ function updatedVehicle(state, action) {
46
46
  }
47
47
  return __assign(__assign({}, state), { vehicles: __spreadArray([], vehicles, true) });
48
48
  }
49
- exports.updatedVehicle = updatedVehicle;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMonkState = void 0;
3
+ exports.useMonkState = useMonkState;
4
4
  var react_1 = require("react");
5
5
  var context_1 = require("./context");
6
6
  /**
@@ -16,4 +16,3 @@ function useMonkState() {
16
16
  }
17
17
  return stateWithDispatch;
18
18
  }
19
- exports.useMonkState = useMonkState;
@@ -16,4 +16,4 @@ export interface MonkProviderProps {
16
16
  * ***Important Note :*** If this provider component is placed in a component which is already a child of a
17
17
  * MonkProvider, this provider will have no effect. Only the FIRST MonkProvider has any effect.
18
18
  */
19
- export declare function MonkProvider({ initialState, children }: PropsWithChildren<MonkProviderProps>): JSX.Element;
19
+ export declare function MonkProvider({ initialState, children }: PropsWithChildren<MonkProviderProps>): import("react/jsx-runtime").JSX.Element;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.MonkProvider = void 0;
14
+ exports.MonkProvider = MonkProvider;
15
15
  var jsx_runtime_1 = require("react/jsx-runtime");
16
16
  var react_1 = require("react");
17
17
  var context_1 = require("./context");
@@ -33,7 +33,6 @@ function MonkProvider(_a) {
33
33
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
34
34
  }
35
35
  catch (err) {
36
- return (0, jsx_runtime_1.jsx)(context_1.MonkContext.Provider, __assign({ value: { state: state, dispatch: dispatch } }, { children: children }));
36
+ return (0, jsx_runtime_1.jsx)(context_1.MonkContext.Provider, { value: { state: state, dispatch: dispatch }, children: children });
37
37
  }
38
38
  }
39
- exports.MonkProvider = MonkProvider;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.monkReducer = void 0;
3
+ exports.monkReducer = monkReducer;
4
4
  var actions_1 = require("./actions");
5
5
  /**
6
6
  * Main reducer function for the Monk state.
@@ -47,4 +47,3 @@ function monkReducer(state, action) {
47
47
  }
48
48
  return state;
49
49
  }
50
- exports.monkReducer = monkReducer;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createEmptyMonkState = void 0;
3
+ exports.createEmptyMonkState = createEmptyMonkState;
4
4
  /**
5
5
  * Creates an empty state that can be used to initialize the Monk state.
6
6
  */
@@ -19,4 +19,3 @@ function createEmptyMonkState() {
19
19
  pricings: [],
20
20
  };
21
21
  }
22
- exports.createEmptyMonkState = createEmptyMonkState;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMonkTheme = void 0;
3
+ exports.useMonkTheme = useMonkTheme;
4
4
  var react_1 = require("react");
5
5
  var context_1 = require("./context");
6
6
  /**
@@ -9,4 +9,3 @@ var context_1 = require("./context");
9
9
  function useMonkTheme() {
10
10
  return (0, react_1.useContext)(context_1.MonkThemeContext);
11
11
  }
12
- exports.useMonkTheme = useMonkTheme;
@@ -13,4 +13,4 @@ export interface MonkThemeProviderProps {
13
13
  * Context provider for the MonkTheme Context. Place this at the root of your application in order to initialize the
14
14
  * Monk theme in your app and get access to the theme and utility functions.
15
15
  */
16
- export declare function MonkThemeProvider({ palette, children, }: PropsWithChildren<MonkThemeProviderProps>): JSX.Element;
16
+ export declare function MonkThemeProvider({ palette, children, }: PropsWithChildren<MonkThemeProviderProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,6 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.MonkThemeProvider = void 0;
3
+ exports.MonkThemeProvider = MonkThemeProvider;
15
4
  var jsx_runtime_1 = require("react/jsx-runtime");
16
5
  var react_1 = require("react");
17
6
  var context_1 = require("./context");
@@ -23,6 +12,5 @@ var theme_1 = require("./theme");
23
12
  function MonkThemeProvider(_a) {
24
13
  var palette = _a.palette, children = _a.children;
25
14
  var theme = (0, react_1.useMemo)(function () { return (0, theme_1.createTheme)({ palette: palette }); }, [palette]);
26
- return (0, jsx_runtime_1.jsx)(context_1.MonkThemeContext.Provider, __assign({ value: theme }, { children: children }));
15
+ return (0, jsx_runtime_1.jsx)(context_1.MonkThemeContext.Provider, { value: theme, children: children });
27
16
  }
28
- exports.MonkThemeProvider = MonkThemeProvider;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.createTheme = void 0;
14
+ exports.createTheme = createTheme;
15
15
  var default_1 = require("./default");
16
16
  function createGetColor(palette) {
17
17
  return function (prop) {
@@ -50,4 +50,3 @@ function createTheme(_a) {
50
50
  rootStyles: createRootStyles(themePalette),
51
51
  };
52
52
  }
53
- exports.createTheme = createTheme;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flatMap = exports.flatten = exports.uniq = exports.permutations = void 0;
3
+ exports.permutations = permutations;
4
+ exports.uniq = uniq;
5
+ exports.flatten = flatten;
6
+ exports.flatMap = flatMap;
4
7
  /**
5
8
  * Returns an array containing all the possible permutations of the given array.
6
9
  */
@@ -19,7 +22,6 @@ function permutations(array) {
19
22
  });
20
23
  return result;
21
24
  }
22
- exports.permutations = permutations;
23
25
  /**
24
26
  * Return a copy of the given array in which all duplicates have been removed.
25
27
  */
@@ -43,7 +45,6 @@ function uniq(array) {
43
45
  return objects.indexOf(item) >= 0 ? false : objects.push(item);
44
46
  });
45
47
  }
46
- exports.uniq = uniq;
47
48
  /**
48
49
  * Flatten the given array.
49
50
  *
@@ -62,7 +63,6 @@ function flatten(array) {
62
63
  return acc;
63
64
  }, []);
64
65
  }
65
- exports.flatten = flatten;
66
66
  /**
67
67
  * JS implementation of the
68
68
  * [Array.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap)
@@ -71,4 +71,3 @@ exports.flatten = flatten;
71
71
  function flatMap(array, map) {
72
72
  return flatten(array.map(map));
73
73
  }
74
- exports.flatMap = flatMap;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAspectRatio = exports.isMobileDevice = void 0;
3
+ exports.isMobileDevice = isMobileDevice;
4
+ exports.getAspectRatio = getAspectRatio;
4
5
  /**
5
6
  * Checks if the current device is a mobile device.
6
7
  */
@@ -12,7 +13,6 @@ function isMobileDevice() {
12
13
  userAgent.includes('ipad') ||
13
14
  userAgent.includes('windows phone'));
14
15
  }
15
- exports.isMobileDevice = isMobileDevice;
16
16
  /**
17
17
  * Returns the aspect ratio of the stream. If not a mobile device, it will return 16/9 by default.
18
18
  */
@@ -22,4 +22,3 @@ function getAspectRatio(streamDimensions) {
22
22
  }
23
23
  return '16/9';
24
24
  }
25
- exports.getAspectRatio = getAspectRatio;
@@ -22,7 +22,13 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  return t;
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.fullyColorSVG = exports.getInteractiveVariants = exports.InteractiveVariation = exports.changeAlpha = exports.shadeColor = exports.getHexFromRGBA = exports.getRGBAFromString = void 0;
25
+ exports.InteractiveVariation = void 0;
26
+ exports.getRGBAFromString = getRGBAFromString;
27
+ exports.getHexFromRGBA = getHexFromRGBA;
28
+ exports.shadeColor = shadeColor;
29
+ exports.changeAlpha = changeAlpha;
30
+ exports.getInteractiveVariants = getInteractiveVariants;
31
+ exports.fullyColorSVG = fullyColorSVG;
26
32
  var types_1 = require("@monkvision/types");
27
33
  var RGBA_REGEXP = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)$/i;
28
34
  var HEX_REGEXP = /^#(?:(?:[0-9a-f]{3}){1,2}|(?:[0-9a-f]{4}){1,2})$/i;
@@ -81,7 +87,6 @@ function getRGBAFromString(str) {
81
87
  }
82
88
  return result;
83
89
  }
84
- exports.getRGBAFromString = getRGBAFromString;
85
90
  /**
86
91
  * Converts RGBA values to their hexadecimal representation.
87
92
  */
@@ -92,7 +97,6 @@ function getHexFromRGBA(rgba) {
92
97
  var a = convertColorToHexCode(rgba.a * 255);
93
98
  return "#".concat(r).concat(g).concat(b).concat(a);
94
99
  }
95
- exports.getHexFromRGBA = getHexFromRGBA;
96
100
  /**
97
101
  * Apply a shade of black or white over the given color.
98
102
  *
@@ -111,7 +115,6 @@ function shadeColor(color, amount) {
111
115
  });
112
116
  return getHexFromRGBA(__assign({ a: a }, rgb));
113
117
  }
114
- exports.shadeColor = shadeColor;
115
118
  /**
116
119
  * Returns a new color equal to the given color but with a different alpha value.
117
120
  *
@@ -122,7 +125,6 @@ function changeAlpha(color, amount) {
122
125
  var _a = getRGBAFromString(color), _ = _a.a, rgb = __rest(_a, ["a"]);
123
126
  return getHexFromRGBA(__assign({ a: amount }, rgb));
124
127
  }
125
- exports.changeAlpha = changeAlpha;
126
128
  /**
127
129
  * The different ways an interactive element's style is altered when the user interacts with it.
128
130
  */
@@ -136,7 +138,7 @@ var InteractiveVariation;
136
138
  * The element will lighten when the user interacts with it (used for dark elements).
137
139
  */
138
140
  InteractiveVariation["LIGHTEN"] = "lighten";
139
- })(InteractiveVariation = exports.InteractiveVariation || (exports.InteractiveVariation = {}));
141
+ })(InteractiveVariation || (exports.InteractiveVariation = InteractiveVariation = {}));
140
142
  /**
141
143
  * Create interactive variants (hovered, active...) for the given color.
142
144
  */
@@ -151,7 +153,6 @@ function getInteractiveVariants(color, variant) {
151
153
  _a[types_1.InteractiveStatus.DISABLED] = color,
152
154
  _a;
153
155
  }
154
- exports.getInteractiveVariants = getInteractiveVariants;
155
156
  var COLOR_ATTRIBUTES = ['fill', 'stroke'];
156
157
  /**
157
158
  * This utility function can be passed to the `DynamicSVG` component's `getAttributes` prop to completely color an SVG
@@ -175,4 +176,3 @@ function fullyColorSVG(element, color) {
175
176
  return customAttributes;
176
177
  }, {});
177
178
  }
178
- exports.fullyColorSVG = fullyColorSVG;
@@ -9,7 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getAvailableVehicleTypes = void 0;
12
+ exports.getAvailableVehicleTypes = getAvailableVehicleTypes;
13
13
  var array_utils_1 = require("./array.utils");
14
14
  /**
15
15
  * Util function used to extract the list of available vehicle types in a CaptureAppConfig object.
@@ -19,4 +19,3 @@ function getAvailableVehicleTypes(config) {
19
19
  ? (0, array_utils_1.uniq)(__spreadArray(__spreadArray([], Object.keys(config.sights.left), true), Object.keys(config.sights.right), true))
20
20
  : Object.keys(config.sights));
21
21
  }
22
- exports.getAvailableVehicleTypes = getAvailableVehicleTypes;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEnvOrThrow = void 0;
3
+ exports.getEnvOrThrow = getEnvOrThrow;
4
4
  /**
5
5
  * Utility function that returns the value of a given environment variable. If the value does not exist, it throws an
6
6
  * error.
@@ -12,4 +12,3 @@ function getEnvOrThrow(name) {
12
12
  }
13
13
  return value;
14
14
  }
15
- exports.getEnvOrThrow = getEnvOrThrow;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.email = exports.required = exports.mergeValidationFunctions = exports.BasicValidationErrors = void 0;
3
+ exports.BasicValidationErrors = void 0;
4
+ exports.mergeValidationFunctions = mergeValidationFunctions;
5
+ exports.required = required;
6
+ exports.email = email;
4
7
  var EMAIL_REGEX = /^((?!\.)[\w\-_.]*[^.])(@\w+)(\.\w+(\.\w+)?[^.\W])$/;
5
8
  /**
6
9
  * Basic form validation errors returned by avaliable validation functions in the SDK.
@@ -15,7 +18,7 @@ var BasicValidationErrors;
15
18
  * Error returned when the value is not a valid email.
16
19
  */
17
20
  BasicValidationErrors["EMAIL_NOT_VALID"] = "emailNotValid";
18
- })(BasicValidationErrors = exports.BasicValidationErrors || (exports.BasicValidationErrors = {}));
21
+ })(BasicValidationErrors || (exports.BasicValidationErrors = BasicValidationErrors = {}));
19
22
  /**
20
23
  * Util function used to merge multiple validation functions into a single one. The first error discovered will be
21
24
  * returned.
@@ -35,7 +38,6 @@ function mergeValidationFunctions() {
35
38
  return null;
36
39
  };
37
40
  }
38
- exports.mergeValidationFunctions = mergeValidationFunctions;
39
41
  /**
40
42
  * Validation function for required fields.
41
43
  */
@@ -44,7 +46,6 @@ function required(value) {
44
46
  ? null
45
47
  : BasicValidationErrors.REQUIRED;
46
48
  }
47
- exports.required = required;
48
49
  /**
49
50
  * Validation function for valid email fields.
50
51
  */
@@ -57,4 +58,3 @@ function email(value) {
57
58
  ? null
58
59
  : BasicValidationErrors.EMAIL_NOT_VALID;
59
60
  }
60
- exports.email = email;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMimetype = exports.getFileExtensions = exports.MIMETYPE_FILE_EXTENSIONS = void 0;
3
+ exports.MIMETYPE_FILE_EXTENSIONS = void 0;
4
+ exports.getFileExtensions = getFileExtensions;
5
+ exports.getMimetype = getMimetype;
4
6
  /**
5
7
  * Datamap that associates mimetypes to known file extensions corresponding to this mimetype.
6
8
  */
@@ -49,7 +51,6 @@ function getFileExtensions(mimetype) {
49
51
  }
50
52
  return extensions;
51
53
  }
52
- exports.getFileExtensions = getFileExtensions;
53
54
  /**
54
55
  * Returns the mimetype associated with the given file extension. If the file extension is unknown, this function will
55
56
  * throw an error.
@@ -65,4 +66,3 @@ function getMimetype(fileExtension) {
65
66
  }
66
67
  return mimetype;
67
68
  }
68
- exports.getMimetype = getMimetype;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timeoutPromise = void 0;
3
+ exports.timeoutPromise = timeoutPromise;
4
4
  /**
5
5
  * This function creates and returns a new Promise that will resolve to void after the given amount of milliseconds.
6
6
  */
@@ -9,4 +9,3 @@ function timeoutPromise(delayMs) {
9
9
  setTimeout(function () { return resolve(); }, delayMs);
10
10
  });
11
11
  }
12
- exports.timeoutPromise = timeoutPromise;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInspectionImages = void 0;
3
+ exports.getInspectionImages = getInspectionImages;
4
4
  /**
5
5
  * Utility function that extracts the images of the given inspection.
6
6
  *
@@ -33,4 +33,3 @@ function getInspectionImages(inspectionId, images, filterImageType, filterRetake
33
33
  });
34
34
  return Object.values(filteredRetakes);
35
35
  }
36
- exports.getInspectionImages = getInspectionImages;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toCamelCase = exports.uncapitalize = exports.capitalize = exports.words = exports.suffix = void 0;
3
+ exports.suffix = suffix;
4
+ exports.words = words;
5
+ exports.capitalize = capitalize;
6
+ exports.uncapitalize = uncapitalize;
7
+ exports.toCamelCase = toCamelCase;
4
8
  var WORD_PATTERN = /[A-Z][a-z]+|[A-Z]+(?=[A-Z][a-z])|[A-Z]+|[a-z]+|\d+/g;
5
9
  /**
6
10
  * Suffixes a string with the given suffixes, only if their value is `true` in the suffixes object param.
@@ -13,7 +17,6 @@ function suffix(str, suffixes, separator) {
13
17
  ? Object.keys(suffixes).reduce(function (prev, curr) { return "".concat(prev).concat(suffixes[curr] ? separator + curr : ''); }, str)
14
18
  : str;
15
19
  }
16
- exports.suffix = suffix;
17
20
  /**
18
21
  * Split the given string into its composing words.
19
22
  */
@@ -21,21 +24,18 @@ function words(str) {
21
24
  var _a;
22
25
  return (_a = str.match(WORD_PATTERN)) !== null && _a !== void 0 ? _a : [];
23
26
  }
24
- exports.words = words;
25
27
  /**
26
28
  * Capitalizes (transforms the first character to upper case) the given string.
27
29
  */
28
30
  function capitalize(str) {
29
31
  return str.charAt(0).toUpperCase() + str.slice(1);
30
32
  }
31
- exports.capitalize = capitalize;
32
33
  /**
33
34
  * Uncapitalizes (transforms the first character to lower case) the given string.
34
35
  */
35
36
  function uncapitalize(str) {
36
37
  return str.charAt(0).toLowerCase() + str.slice(1);
37
38
  }
38
- exports.uncapitalize = uncapitalize;
39
39
  /**
40
40
  * Converts a string to camel case.
41
41
  */
@@ -44,4 +44,3 @@ function toCamelCase(str) {
44
44
  .map(function (word, index) { return (index === 0 ? word.toLowerCase() : capitalize(word.toLowerCase())); })
45
45
  .join('');
46
46
  }
47
- exports.toCamelCase = toCamelCase;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVehicleModel = void 0;
3
+ exports.getVehicleModel = getVehicleModel;
4
4
  var sights_1 = require("@monkvision/sights");
5
5
  var types_1 = require("@monkvision/types");
6
6
  /**
@@ -23,4 +23,3 @@ function getVehicleModel(vehicleType) {
23
23
  }
24
24
  return detail.id;
25
25
  }
26
- exports.getVehicleModel = getVehicleModel;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.zlibDecompress = exports.zlibCompress = void 0;
6
+ exports.zlibCompress = zlibCompress;
7
+ exports.zlibDecompress = zlibDecompress;
7
8
  var pako_1 = __importDefault(require("pako"));
8
9
  /**
9
10
  * Compresses and encodes a string in base64 using the ZLib algorithm.
@@ -14,7 +15,6 @@ function zlibCompress(str) {
14
15
  var compressed = pako_1.default.deflate(binary);
15
16
  return btoa(String.fromCharCode.apply(null, Array.from(compressed)));
16
17
  }
17
- exports.zlibCompress = zlibCompress;
18
18
  /**
19
19
  * Decompresses a string that has been encoded in base64 and compressed using the Zlib algorithm.
20
20
  */
@@ -26,4 +26,3 @@ function zlibDecompress(str) {
26
26
  var binaryConverter = new TextDecoder('utf-8');
27
27
  return binaryConverter.decode(binary);
28
28
  }
29
- exports.zlibDecompress = zlibDecompress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/common",
3
- "version": "5.2.4",
3
+ "version": "5.3.0",
4
4
  "license": "BSD-3-Clause-Clear",
5
5
  "packageManager": "yarn@3.2.4",
6
6
  "description": "MonkJs common logic package",
@@ -28,10 +28,10 @@
28
28
  "lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
29
29
  },
30
30
  "dependencies": {
31
- "@monkvision/analytics": "5.2.4",
32
- "@monkvision/monitoring": "5.2.4",
33
- "@monkvision/sights": "5.2.4",
34
- "@monkvision/types": "5.2.4",
31
+ "@monkvision/analytics": "5.3.0",
32
+ "@monkvision/monitoring": "5.3.0",
33
+ "@monkvision/sights": "5.3.0",
34
+ "@monkvision/types": "5.3.0",
35
35
  "i18next": "^23.4.5",
36
36
  "jsonwebtoken": "^9.0.2",
37
37
  "jwt-decode": "^4.0.0",
@@ -41,22 +41,21 @@
41
41
  "react-i18next": "^13.2.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "^17.0.2",
45
- "react-dom": "^17.0.2",
44
+ "react": "^19.2.3",
45
+ "react-dom": "^19.2.3",
46
46
  "react-router-dom": "^6.22.3"
47
47
  },
48
48
  "devDependencies": {
49
- "@monkvision/eslint-config-base": "5.2.4",
50
- "@monkvision/eslint-config-typescript": "5.2.4",
51
- "@monkvision/eslint-config-typescript-react": "5.2.4",
52
- "@monkvision/jest-config": "5.2.4",
53
- "@monkvision/prettier-config": "5.2.4",
54
- "@monkvision/test-utils": "5.2.4",
55
- "@monkvision/typescript-config": "5.2.4",
56
- "@testing-library/react": "^12.1.5",
57
- "@testing-library/react-hooks": "^8.0.1",
58
- "@types/jest": "^29.2.2",
59
- "@types/node": "^18.11.9",
49
+ "@monkvision/eslint-config-base": "5.3.0",
50
+ "@monkvision/eslint-config-typescript": "5.3.0",
51
+ "@monkvision/eslint-config-typescript-react": "5.3.0",
52
+ "@monkvision/jest-config": "5.3.0",
53
+ "@monkvision/prettier-config": "5.3.0",
54
+ "@monkvision/test-utils": "5.3.0",
55
+ "@monkvision/typescript-config": "5.3.0",
56
+ "@testing-library/react": "^16.3.0",
57
+ "@types/jest": "^30",
58
+ "@types/node": "^24.5.2",
60
59
  "@types/pako": "^2",
61
60
  "@typescript-eslint/eslint-plugin": "^5.43.0",
62
61
  "@typescript-eslint/parser": "^5.43.0",
@@ -73,14 +72,14 @@
73
72
  "eslint-plugin-react": "^7.27.1",
74
73
  "eslint-plugin-react-hooks": "^4.3.0",
75
74
  "eslint-utils": "^3.0.0",
76
- "jest": "^29.3.1",
77
- "jest-environment-jsdom": "^29.6.2",
75
+ "jest": "^30.2",
76
+ "jest-environment-jsdom": "^30.2",
78
77
  "mkdirp": "^1.0.4",
79
78
  "prettier": "^2.7.1",
80
79
  "regexpp": "^3.2.0",
81
80
  "rimraf": "^3.0.2",
82
- "ts-jest": "^29.0.3",
83
- "typescript": "^4.8.4"
81
+ "ts-jest": "^29.4.6",
82
+ "typescript": "^5.9.2"
84
83
  },
85
84
  "prettier": "@monkvision/prettier-config",
86
85
  "publishConfig": {
@@ -94,5 +93,5 @@
94
93
  "url": "https://github.com/monkvision/monkjs/issues"
95
94
  },
96
95
  "homepage": "https://github.com/monkvision/monkjs",
97
- "gitHead": "9d5fbcb522c5d83f1285eba9b852d2b647295ba1"
96
+ "gitHead": "5e7b906951524069d0074c7142271b0568c53c47"
98
97
  }