@bigbinary/neeto-commons-frontend 2.0.30 → 2.0.32
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/cypress-commands.d.ts +54 -0
- package/cypress-utils.cjs.js +1760 -0
- package/cypress-utils.d.ts +260 -0
- package/cypress-utils.js +1729 -0
- package/initializers.cjs.js +40 -5
- package/initializers.js +41 -6
- package/package.json +10 -1
- package/react-utils.cjs.js +61 -22
- package/react-utils.d.ts +1 -1
- package/react-utils.js +61 -22
package/initializers.cjs.js
CHANGED
|
@@ -164,6 +164,19 @@ nullSafe(snakeToCamelCase);
|
|
|
164
164
|
nullSafe(camelToSnakeCase);
|
|
165
165
|
nullSafe(capitalize);
|
|
166
166
|
|
|
167
|
+
var matchesImpl = function matchesImpl(pattern, object) {
|
|
168
|
+
var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
|
|
169
|
+
if (object === pattern) return true;
|
|
170
|
+
if (typeof pattern === "function" && pattern(object, __parent)) return true;
|
|
171
|
+
if (ramda.isNil(pattern) || ramda.isNil(object)) return false;
|
|
172
|
+
if (_typeof(pattern) !== "object") return false;
|
|
173
|
+
return Object.entries(pattern).every(function (_ref) {
|
|
174
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
175
|
+
key = _ref2[0],
|
|
176
|
+
value = _ref2[1];
|
|
177
|
+
return matchesImpl(value, object[key], __parent);
|
|
178
|
+
});
|
|
179
|
+
};
|
|
167
180
|
var transformObjectDeep = function transformObjectDeep(object, keyValueTransformer) {
|
|
168
181
|
var objectPreProcessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
169
182
|
if (objectPreProcessor && typeof objectPreProcessor === "function") {
|
|
@@ -204,6 +217,9 @@ var deepFreezeObject = function deepFreezeObject(object) {
|
|
|
204
217
|
}
|
|
205
218
|
return object;
|
|
206
219
|
};
|
|
220
|
+
var matches = /*#__PURE__*/ramda.curry(function (pattern, object) {
|
|
221
|
+
return matchesImpl(pattern, object);
|
|
222
|
+
});
|
|
207
223
|
var filterNonNull = function filterNonNull(object) {
|
|
208
224
|
return Object.fromEntries(Object.entries(object).filter(function (_ref5) {
|
|
209
225
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
@@ -810,6 +826,7 @@ var shouldShowToastr = function shouldShowToastr(response) {
|
|
|
810
826
|
};
|
|
811
827
|
var setAuthHeaders = function setAuthHeaders() {
|
|
812
828
|
var _document$querySelect, _axios$defaults$heade, _globalProps$user, _globalProps$user2;
|
|
829
|
+
// @ts-ignore
|
|
813
830
|
axios__default["default"].defaults.headers = (_axios$defaults$heade = {}, _defineProperty(_axios$defaults$heade, HEADERS_KEYS.accept, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.contentType, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.xCsrfToken, (_document$querySelect = document.querySelector('[name="csrf-token"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute("content")), _axios$defaults$heade);
|
|
814
831
|
var token = (_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.authenticationToken;
|
|
815
832
|
var email = (_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.email;
|
|
@@ -849,7 +866,16 @@ var transformErrorKeysToCamelCase = function transformErrorKeysToCamelCase(error
|
|
|
849
866
|
var showSuccessToastr = function showSuccessToastr(response) {
|
|
850
867
|
var _response$config$show = response.config.showToastr,
|
|
851
868
|
showToastr = _response$config$show === void 0 ? true : _response$config$show;
|
|
852
|
-
if (showToastr
|
|
869
|
+
if (!showToastr) return response;
|
|
870
|
+
if (matches({
|
|
871
|
+
showThumbsUpToastr: true
|
|
872
|
+
}, response.data)) {
|
|
873
|
+
// @ts-ignore
|
|
874
|
+
neetoui.Toastr.success("", {
|
|
875
|
+
icon: "👍",
|
|
876
|
+
className: "w-20"
|
|
877
|
+
});
|
|
878
|
+
} else if (shouldShowToastr(response.data)) {
|
|
853
879
|
neetoui.Toastr.success(response.data);
|
|
854
880
|
}
|
|
855
881
|
return response;
|
|
@@ -888,8 +914,10 @@ var showErrorToastr = function showErrorToastr(error) {
|
|
|
888
914
|
showToastr = _ref3$showToastr === void 0 ? true : _ref3$showToastr;
|
|
889
915
|
if (!showToastr) return error;
|
|
890
916
|
if (axios__default["default"].isCancel(error)) {
|
|
917
|
+
// @ts-ignore
|
|
891
918
|
neetoui.Toastr.error(i18next__default["default"].t("neetoCommons.toastr.error.requestCanceled"));
|
|
892
919
|
} else if (error.message === "Network Error") {
|
|
920
|
+
// @ts-ignore
|
|
893
921
|
neetoui.Toastr.error(i18next__default["default"].t("neetoCommons.toastr.error.networkError"));
|
|
894
922
|
} else {
|
|
895
923
|
neetoui.Toastr.error(error);
|
|
@@ -977,14 +1005,20 @@ var resource = {
|
|
|
977
1005
|
add_one: "{{entity}} has been added successfully.",
|
|
978
1006
|
add_other: "{{entity}} have been added successfully.",
|
|
979
1007
|
save: "{{entity}} has been saved successfully.",
|
|
1008
|
+
save_one: "{{entity}} has been saved successfully.",
|
|
1009
|
+
save_other: "{{entity}} have been saved successfully.",
|
|
980
1010
|
update: "{{entity}} has been updated successfully.",
|
|
1011
|
+
update_one: "{{entity}} has been updated successfully.",
|
|
1012
|
+
update_other: "{{entity}} have been updated successfully.",
|
|
981
1013
|
delete_one: "{{entity}} has been deleted successfully.",
|
|
982
1014
|
delete_other: "{{entity}} have been deleted successfully.",
|
|
983
1015
|
clone: "{{entity}} has been cloned successfully.",
|
|
984
1016
|
notFound: "{{entity}} does not exist.",
|
|
985
|
-
remove_one: "{{entity}}
|
|
986
|
-
remove_other: "{{entity}}
|
|
987
|
-
sent: "{{entity}} sent successfully."
|
|
1017
|
+
remove_one: "{{entity}} has been removed successfully.",
|
|
1018
|
+
remove_other: "{{entity}} have been removed successfully.",
|
|
1019
|
+
sent: "{{entity}} sent successfully.",
|
|
1020
|
+
merged: "{{entity}} have been successfully merged.",
|
|
1021
|
+
disconnected: "{{entity}} has been successfully disconnected."
|
|
988
1022
|
};
|
|
989
1023
|
var otp = {
|
|
990
1024
|
sent: "OTP has been sent successfully.",
|
|
@@ -992,7 +1026,7 @@ var otp = {
|
|
|
992
1026
|
verified: "OTP has been verified successfully."
|
|
993
1027
|
};
|
|
994
1028
|
var upload = {
|
|
995
|
-
error: "An error
|
|
1029
|
+
error: "An error occurred while uploading the file"
|
|
996
1030
|
};
|
|
997
1031
|
var image = {
|
|
998
1032
|
profile: {
|
|
@@ -1039,6 +1073,7 @@ var github = {
|
|
|
1039
1073
|
var neetoCommons = {
|
|
1040
1074
|
errorPage: {
|
|
1041
1075
|
cantBeFound: "The page you're looking for <br /> can't be found.",
|
|
1076
|
+
internalServerError: "The server encountered an error and <br /> could not complete your request.",
|
|
1042
1077
|
backToHome: "Back to home"
|
|
1043
1078
|
},
|
|
1044
1079
|
fallbackComponent: {
|
package/initializers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Toastr } from '@bigbinary/neetoui';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import i18next from 'i18next';
|
|
4
|
-
import { curryN, isNil, values, prop, evolve, omit, mergeDeepLeft, either, isEmpty } from 'ramda';
|
|
4
|
+
import { curryN, isNil, curry, values, prop, evolve, omit, mergeDeepLeft, either, isEmpty } from 'ramda';
|
|
5
5
|
import require$$0, { useDebugValue } from 'react';
|
|
6
6
|
import { initReactI18next } from 'react-i18next';
|
|
7
7
|
import Logger from 'js-logger';
|
|
@@ -152,6 +152,19 @@ nullSafe(snakeToCamelCase);
|
|
|
152
152
|
nullSafe(camelToSnakeCase);
|
|
153
153
|
nullSafe(capitalize);
|
|
154
154
|
|
|
155
|
+
var matchesImpl = function matchesImpl(pattern, object) {
|
|
156
|
+
var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
|
|
157
|
+
if (object === pattern) return true;
|
|
158
|
+
if (typeof pattern === "function" && pattern(object, __parent)) return true;
|
|
159
|
+
if (isNil(pattern) || isNil(object)) return false;
|
|
160
|
+
if (_typeof(pattern) !== "object") return false;
|
|
161
|
+
return Object.entries(pattern).every(function (_ref) {
|
|
162
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
163
|
+
key = _ref2[0],
|
|
164
|
+
value = _ref2[1];
|
|
165
|
+
return matchesImpl(value, object[key], __parent);
|
|
166
|
+
});
|
|
167
|
+
};
|
|
155
168
|
var transformObjectDeep = function transformObjectDeep(object, keyValueTransformer) {
|
|
156
169
|
var objectPreProcessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
157
170
|
if (objectPreProcessor && typeof objectPreProcessor === "function") {
|
|
@@ -192,6 +205,9 @@ var deepFreezeObject = function deepFreezeObject(object) {
|
|
|
192
205
|
}
|
|
193
206
|
return object;
|
|
194
207
|
};
|
|
208
|
+
var matches = /*#__PURE__*/curry(function (pattern, object) {
|
|
209
|
+
return matchesImpl(pattern, object);
|
|
210
|
+
});
|
|
195
211
|
var filterNonNull = function filterNonNull(object) {
|
|
196
212
|
return Object.fromEntries(Object.entries(object).filter(function (_ref5) {
|
|
197
213
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
@@ -798,6 +814,7 @@ var shouldShowToastr = function shouldShowToastr(response) {
|
|
|
798
814
|
};
|
|
799
815
|
var setAuthHeaders = function setAuthHeaders() {
|
|
800
816
|
var _document$querySelect, _axios$defaults$heade, _globalProps$user, _globalProps$user2;
|
|
817
|
+
// @ts-ignore
|
|
801
818
|
axios.defaults.headers = (_axios$defaults$heade = {}, _defineProperty(_axios$defaults$heade, HEADERS_KEYS.accept, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.contentType, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.xCsrfToken, (_document$querySelect = document.querySelector('[name="csrf-token"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute("content")), _axios$defaults$heade);
|
|
802
819
|
var token = (_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.authenticationToken;
|
|
803
820
|
var email = (_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.email;
|
|
@@ -837,7 +854,16 @@ var transformErrorKeysToCamelCase = function transformErrorKeysToCamelCase(error
|
|
|
837
854
|
var showSuccessToastr = function showSuccessToastr(response) {
|
|
838
855
|
var _response$config$show = response.config.showToastr,
|
|
839
856
|
showToastr = _response$config$show === void 0 ? true : _response$config$show;
|
|
840
|
-
if (showToastr
|
|
857
|
+
if (!showToastr) return response;
|
|
858
|
+
if (matches({
|
|
859
|
+
showThumbsUpToastr: true
|
|
860
|
+
}, response.data)) {
|
|
861
|
+
// @ts-ignore
|
|
862
|
+
Toastr.success("", {
|
|
863
|
+
icon: "👍",
|
|
864
|
+
className: "w-20"
|
|
865
|
+
});
|
|
866
|
+
} else if (shouldShowToastr(response.data)) {
|
|
841
867
|
Toastr.success(response.data);
|
|
842
868
|
}
|
|
843
869
|
return response;
|
|
@@ -876,8 +902,10 @@ var showErrorToastr = function showErrorToastr(error) {
|
|
|
876
902
|
showToastr = _ref3$showToastr === void 0 ? true : _ref3$showToastr;
|
|
877
903
|
if (!showToastr) return error;
|
|
878
904
|
if (axios.isCancel(error)) {
|
|
905
|
+
// @ts-ignore
|
|
879
906
|
Toastr.error(i18next.t("neetoCommons.toastr.error.requestCanceled"));
|
|
880
907
|
} else if (error.message === "Network Error") {
|
|
908
|
+
// @ts-ignore
|
|
881
909
|
Toastr.error(i18next.t("neetoCommons.toastr.error.networkError"));
|
|
882
910
|
} else {
|
|
883
911
|
Toastr.error(error);
|
|
@@ -965,14 +993,20 @@ var resource = {
|
|
|
965
993
|
add_one: "{{entity}} has been added successfully.",
|
|
966
994
|
add_other: "{{entity}} have been added successfully.",
|
|
967
995
|
save: "{{entity}} has been saved successfully.",
|
|
996
|
+
save_one: "{{entity}} has been saved successfully.",
|
|
997
|
+
save_other: "{{entity}} have been saved successfully.",
|
|
968
998
|
update: "{{entity}} has been updated successfully.",
|
|
999
|
+
update_one: "{{entity}} has been updated successfully.",
|
|
1000
|
+
update_other: "{{entity}} have been updated successfully.",
|
|
969
1001
|
delete_one: "{{entity}} has been deleted successfully.",
|
|
970
1002
|
delete_other: "{{entity}} have been deleted successfully.",
|
|
971
1003
|
clone: "{{entity}} has been cloned successfully.",
|
|
972
1004
|
notFound: "{{entity}} does not exist.",
|
|
973
|
-
remove_one: "{{entity}}
|
|
974
|
-
remove_other: "{{entity}}
|
|
975
|
-
sent: "{{entity}} sent successfully."
|
|
1005
|
+
remove_one: "{{entity}} has been removed successfully.",
|
|
1006
|
+
remove_other: "{{entity}} have been removed successfully.",
|
|
1007
|
+
sent: "{{entity}} sent successfully.",
|
|
1008
|
+
merged: "{{entity}} have been successfully merged.",
|
|
1009
|
+
disconnected: "{{entity}} has been successfully disconnected."
|
|
976
1010
|
};
|
|
977
1011
|
var otp = {
|
|
978
1012
|
sent: "OTP has been sent successfully.",
|
|
@@ -980,7 +1014,7 @@ var otp = {
|
|
|
980
1014
|
verified: "OTP has been verified successfully."
|
|
981
1015
|
};
|
|
982
1016
|
var upload = {
|
|
983
|
-
error: "An error
|
|
1017
|
+
error: "An error occurred while uploading the file"
|
|
984
1018
|
};
|
|
985
1019
|
var image = {
|
|
986
1020
|
profile: {
|
|
@@ -1027,6 +1061,7 @@ var github = {
|
|
|
1027
1061
|
var neetoCommons = {
|
|
1028
1062
|
errorPage: {
|
|
1029
1063
|
cantBeFound: "The page you're looking for <br /> can't be found.",
|
|
1064
|
+
internalServerError: "The server encountered an error and <br /> could not complete your request.",
|
|
1030
1065
|
backToHome: "Back to home"
|
|
1031
1066
|
},
|
|
1032
1067
|
fallbackComponent: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"initializers.*",
|
|
17
17
|
"react-utils.*",
|
|
18
|
+
"cypress-utils.*",
|
|
19
|
+
"cypress-commands.*",
|
|
18
20
|
"utils.*",
|
|
19
21
|
"pure.*",
|
|
20
22
|
"configs"
|
|
@@ -29,6 +31,10 @@
|
|
|
29
31
|
"import": "./react-utils.js",
|
|
30
32
|
"require": "./react-utils.cjs.js"
|
|
31
33
|
},
|
|
34
|
+
"./cypress-utils": {
|
|
35
|
+
"import": "./cypress-utils.js",
|
|
36
|
+
"require": "./cypress-utils.cjs.js"
|
|
37
|
+
},
|
|
32
38
|
"./utils": {
|
|
33
39
|
"import": "./utils.js",
|
|
34
40
|
"require": "./utils.cjs.js"
|
|
@@ -66,9 +72,11 @@
|
|
|
66
72
|
"axios": "^0.27.2",
|
|
67
73
|
"babel-jest": "27.0.6",
|
|
68
74
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
75
|
+
"cypress": "11.2.0",
|
|
69
76
|
"dayjs": "1.11.1",
|
|
70
77
|
"eslint": "^8.15.0",
|
|
71
78
|
"eslint-config-prettier": "^8.5.0",
|
|
79
|
+
"eslint-plugin-cypress": "2.12.1",
|
|
72
80
|
"eslint-plugin-import": "^2.26.0",
|
|
73
81
|
"eslint-plugin-jam3": "^0.2.3",
|
|
74
82
|
"eslint-plugin-json": "^3.1.0",
|
|
@@ -114,6 +122,7 @@
|
|
|
114
122
|
"antd": "4.18.7",
|
|
115
123
|
"autoprefixer": "^10.4.13",
|
|
116
124
|
"axios": "^0.27.2",
|
|
125
|
+
"cypress": "11.2.0",
|
|
117
126
|
"dayjs": "1.11.1",
|
|
118
127
|
"dotenv-webpack": "^8.0.1",
|
|
119
128
|
"formik": "^2.2.9",
|
package/react-utils.cjs.js
CHANGED
|
@@ -1534,8 +1534,8 @@ var BrowserSupport = function BrowserSupport(_ref) {
|
|
|
1534
1534
|
})));
|
|
1535
1535
|
};
|
|
1536
1536
|
|
|
1537
|
-
function _extends$
|
|
1538
|
-
_extends$
|
|
1537
|
+
function _extends$3() {
|
|
1538
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1539
1539
|
for (var i = 1; i < arguments.length; i++) {
|
|
1540
1540
|
var source = arguments[i];
|
|
1541
1541
|
for (var key in source) {
|
|
@@ -1546,7 +1546,7 @@ function _extends$2() {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
return target;
|
|
1548
1548
|
};
|
|
1549
|
-
return _extends$
|
|
1549
|
+
return _extends$3.apply(this, arguments);
|
|
1550
1550
|
}
|
|
1551
1551
|
|
|
1552
1552
|
function _typeof$1(obj) {
|
|
@@ -1768,7 +1768,7 @@ var Columns = function Columns(_ref) {
|
|
|
1768
1768
|
dataIndex: ramda.includes(ramda.__, hiddenColumns)
|
|
1769
1769
|
}, columnData));
|
|
1770
1770
|
}, [columnData, hiddenColumns]);
|
|
1771
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, _extends$
|
|
1771
|
+
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, _extends$3({
|
|
1772
1772
|
buttonSize: "medium",
|
|
1773
1773
|
buttonStyle: "text",
|
|
1774
1774
|
closeOnSelect: false,
|
|
@@ -1777,7 +1777,7 @@ var Columns = function Columns(_ref) {
|
|
|
1777
1777
|
return setSearchTerm("");
|
|
1778
1778
|
},
|
|
1779
1779
|
position: "bottom-end"
|
|
1780
|
-
}, dropdownProps), /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement("div", null, isSearchable && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, _extends$
|
|
1780
|
+
}, dropdownProps), /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement("div", null, isSearchable && /*#__PURE__*/React__default["default"].createElement(neetoui.Input, _extends$3({
|
|
1781
1781
|
className: "neeto-ui-px-3 neeto-ui-py-2",
|
|
1782
1782
|
"data-cy": "neeto-ui-columns-search",
|
|
1783
1783
|
onChange: handleSearch,
|
|
@@ -1794,7 +1794,7 @@ var Columns = function Columns(_ref) {
|
|
|
1794
1794
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, {
|
|
1795
1795
|
className: "neeto-ui-w-full neeto-ui-px-3 neeto-ui-py-2 hover:neeto-ui-bg-gray-200 neeto-ui-cursor-pointer",
|
|
1796
1796
|
htmlFor: dataIndex
|
|
1797
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Checkbox, _extends$
|
|
1797
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Checkbox, _extends$3({
|
|
1798
1798
|
id: dataIndex,
|
|
1799
1799
|
name: dataIndex,
|
|
1800
1800
|
checked: !hiddenColumns.includes(dataIndex),
|
|
@@ -3991,7 +3991,7 @@ var CustomDomain = function CustomDomain(_ref) {
|
|
|
3991
3991
|
setCustomDomain(customDomain);
|
|
3992
3992
|
setIsAlertOpen(true);
|
|
3993
3993
|
};
|
|
3994
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(layouts.Container, null, /*#__PURE__*/React__default["default"].createElement(layouts.Header, _extends$
|
|
3994
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(layouts.Container, null, /*#__PURE__*/React__default["default"].createElement(layouts.Header, _extends$3({
|
|
3995
3995
|
title: t("neetoCommons.customDomain.customDomain", {
|
|
3996
3996
|
count: ENTITY_COUNT.plural
|
|
3997
3997
|
}),
|
|
@@ -4091,11 +4091,11 @@ var DateFormat = ramda.fromPairs(ramda.keys(timeFormat).map(function (key) {
|
|
|
4091
4091
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
4092
4092
|
_ref$typographyProps = _ref.typographyProps,
|
|
4093
4093
|
typographyProps = _ref$typographyProps === void 0 ? {} : _ref$typographyProps;
|
|
4094
|
-
var dateDisplay = /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, _extends$
|
|
4094
|
+
var dateDisplay = /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, _extends$3({
|
|
4095
4095
|
component: "span",
|
|
4096
4096
|
style: "body2"
|
|
4097
4097
|
}, typographyProps), timeFormat[key](date));
|
|
4098
|
-
return key === "extended" ? dateDisplay : /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends$
|
|
4098
|
+
return key === "extended" ? dateDisplay : /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends$3({
|
|
4099
4099
|
position: "top",
|
|
4100
4100
|
content: timeFormat.extended(date)
|
|
4101
4101
|
}, tooltipProps), dateDisplay);
|
|
@@ -4103,19 +4103,19 @@ var DateFormat = ramda.fromPairs(ramda.keys(timeFormat).map(function (key) {
|
|
|
4103
4103
|
}));
|
|
4104
4104
|
var TimeFormat = DateFormat;
|
|
4105
4105
|
|
|
4106
|
-
var _path$
|
|
4107
|
-
function _extends$
|
|
4106
|
+
var _path$2, _path2$2, _path3, _path4, _path5, _path6;
|
|
4107
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
4108
4108
|
var SvgFallbackComponent = function SvgFallbackComponent(props) {
|
|
4109
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
4109
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
4110
4110
|
width: 230,
|
|
4111
4111
|
height: 230,
|
|
4112
4112
|
viewBox: "0 0 317 320",
|
|
4113
4113
|
fill: "none",
|
|
4114
4114
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4115
|
-
}, props), _path$
|
|
4115
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4116
4116
|
d: "M271.071 28.008c-8.563-12.544-25.317-10.81-38.577-10.717-30.899.206-159.103.047-168.105.497-13.866.713-27.79 6.33-30.041 20.132-1.216 7.456-.14 15.427.139 22.94 1.118 30.417 1.953 68.044 5.7 95.148 1.016 7.372 2.35 14.761 6.936 20.853 7.238 9.618 21.581 12.998 33.616 13.2.141.236 110.261 2.828 150.068-.154 11.579-.87 25.682-1.74 33.488-11.652 3.913-4.971 4.246-12.136 5.028-18.171 2.816-21.653 4.695-58.296 7.156-97.59.703-11.222 1.25-24.736-5.408-34.486Zm3.044 27.34c-.082 4.493-3.429 57.629-3.648 60.853-.746 10.901-3.144 45.195-6.244 55.905-3.064 10.571-16.833 13.173-26.189 14.167-7.926.857-15.906 1.35-23.877 1.608-40.911 1.322-129.772 1.044-133.332.949-14.415-.663-30.588-4.888-36.021-19.843a81.026 81.026 0 0 1-3.298-20.918c-2.712-32.616-2.294-42.461-4.372-92.667-.293-7.188-1.76-15.638 1.536-22.356C45.898 18.356 67.727 20.417 81.1 20.27c15.73-.172 149.231-.271 157.495-.338 7.347-.06 15.278-.433 22.12 2.756 12.343 5.744 13.613 20.671 13.399 32.649v.01Z",
|
|
4117
4117
|
fill: "#2F3941"
|
|
4118
|
-
})), _path2$
|
|
4118
|
+
})), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
4119
4119
|
d: "M220.642 50.4a1.586 1.586 0 0 0-.415-1.21 1.607 1.607 0 0 0-1.177-.52c-35.537-.183-99.035-.669-135.303-.466a1.056 1.056 0 0 0-.76.238 1.044 1.044 0 0 0-.373.699c-.43 34.284-.24 68.58-.24 102.862 0 1.636.685 2.122 1.643 2.162 45.113 2.049 92.2.763 137.476.91a2.342 2.342 0 0 0 1.518-.675c.405-.403.648-.94.68-1.509-.443-33.909-1.227-68.635-3.049-102.49Zm-2.277.78c1.187 24.763 1.712 49.901 2.264 74.806-45.853 1.664-90.202.658-135.787.522 0-24.642-.313-50.868 0-76.093 43.482.375 89.992.537 133.523.764ZM91.463 151.855l16.27-22.423 18.964.294c-3.709 5.108-12.138 17.321-14.959 22.512-6.749-.114-20.275-.383-20.275-.383Zm42.769.671 15.24-22.699c6.347 0 12.699-.04 19.055-.12-3.627 6.705-10.492 16.8-14.739 22.976-6.51-.007-13.028-.059-19.556-.157Zm42.469.228c5.503-8.232 10.238-15.419 16.186-23.434 6.993-.163 13.993-.365 20.998-.605-4.761 6.22-12.597 17.04-15.361 23.986-7.274.037-14.548.054-21.823.053Z",
|
|
4120
4120
|
fill: "#2F3941"
|
|
4121
4121
|
})), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
@@ -7892,7 +7892,7 @@ function createElement(_ref) {
|
|
|
7892
7892
|
}
|
|
7893
7893
|
|
|
7894
7894
|
var children = childrenCreator(node.children);
|
|
7895
|
-
return /*#__PURE__*/React__default["default"].createElement(TagName, _extends$
|
|
7895
|
+
return /*#__PURE__*/React__default["default"].createElement(TagName, _extends$3({
|
|
7896
7896
|
key: key
|
|
7897
7897
|
}, props), children);
|
|
7898
7898
|
}
|
|
@@ -56341,7 +56341,7 @@ var createAsyncLoadingHighlighter = (function (options) {
|
|
|
56341
56341
|
}, {
|
|
56342
56342
|
key: "render",
|
|
56343
56343
|
value: function render() {
|
|
56344
|
-
return /*#__PURE__*/React__default["default"].createElement(ReactAsyncHighlighter.highlightInstance, _extends$
|
|
56344
|
+
return /*#__PURE__*/React__default["default"].createElement(ReactAsyncHighlighter.highlightInstance, _extends$3({}, this.props, {
|
|
56345
56345
|
language: this.normalizeLanguage(this.props.language),
|
|
56346
56346
|
astGenerator: ReactAsyncHighlighter.astGenerator
|
|
56347
56347
|
}));
|
|
@@ -90725,7 +90725,7 @@ var EmbedCode = function EmbedCode(_ref) {
|
|
|
90725
90725
|
})))
|
|
90726
90726
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
90727
90727
|
className: "w-full"
|
|
90728
|
-
}, t("neetoCommons.widget.installation.instructions.sessionContext"))) : null, /*#__PURE__*/React__default["default"].createElement(CodeSnippet, _extends$
|
|
90728
|
+
}, t("neetoCommons.widget.installation.instructions.sessionContext"))) : null, /*#__PURE__*/React__default["default"].createElement(CodeSnippet, _extends$3({
|
|
90729
90729
|
isPaneOpen: !!emailType && isNotEmpty(selectedWidgets),
|
|
90730
90730
|
onClose: function onClose() {
|
|
90731
90731
|
return setEmailType(EMAIL_TYPES["null"]);
|
|
@@ -91928,9 +91928,26 @@ var withImmutableActions = function withImmutableActions(config) {
|
|
|
91928
91928
|
};
|
|
91929
91929
|
};
|
|
91930
91930
|
|
|
91931
|
+
var _path$1, _path2$1;
|
|
91932
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
91933
|
+
var SvgInternalServerError = function SvgInternalServerError(props) {
|
|
91934
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
91935
|
+
width: 120,
|
|
91936
|
+
height: 120,
|
|
91937
|
+
fill: "none",
|
|
91938
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
91939
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
91940
|
+
d: "M120 60c0-33.137-26.863-60-60-60H0v120h120V60Z",
|
|
91941
|
+
fill: "#1D1D1F"
|
|
91942
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
91943
|
+
d: "M30.602 107.562c2.343 0 4.421-.484 6.234-1.453 1.812-.984 3.234-2.343 4.266-4.078 1.03-1.734 1.546-3.726 1.546-5.976v-.047c0-2.172-.484-4.094-1.453-5.766a10.432 10.432 0 0 0-3.96-3.984c-1.672-.969-3.594-1.453-5.766-1.453-1.094 0-2.125.132-3.094.398a9.096 9.096 0 0 0-2.625 1.172 7.204 7.204 0 0 0-1.969 1.922h-.093l1.148-11.367h15.89v-3.75H21.368l-1.734 19.289h3.726c.22-.39.461-.75.727-1.078.281-.329.57-.633.867-.914a7.185 7.185 0 0 1 2.578-1.524c.985-.344 2.047-.516 3.188-.516 1.5 0 2.828.329 3.984.985a7.101 7.101 0 0 1 2.719 2.719c.672 1.14 1.008 2.453 1.008 3.937v.047c0 1.516-.328 2.86-.985 4.031a7.056 7.056 0 0 1-2.742 2.719c-1.172.656-2.523.984-4.055.984-1.343 0-2.554-.257-3.632-.773-1.078-.516-1.953-1.219-2.625-2.109a6.34 6.34 0 0 1-1.22-3.024l-.023-.187H19l.023.257c.172 1.829.766 3.461 1.782 4.899 1.015 1.437 2.36 2.57 4.03 3.398 1.688.828 3.61 1.242 5.767 1.242ZM58.844 107.562c2.593 0 4.82-.71 6.68-2.132 1.859-1.422 3.28-3.438 4.265-6.047 1-2.61 1.5-5.703 1.5-9.281v-.047c0-3.578-.5-6.672-1.5-9.282-.984-2.609-2.406-4.617-4.266-6.023-1.859-1.422-4.085-2.133-6.68-2.133-2.593 0-4.82.711-6.679 2.133-1.844 1.406-3.258 3.414-4.242 6.023-.984 2.61-1.477 5.704-1.477 9.282v.047c0 3.578.492 6.671 1.477 9.28.984 2.61 2.398 4.626 4.242 6.048 1.86 1.422 4.086 2.132 6.68 2.132Zm0-3.679c-1.719 0-3.188-.555-4.407-1.664-1.218-1.125-2.148-2.719-2.789-4.781-.64-2.063-.96-4.508-.96-7.336v-.047c0-2.828.32-5.266.96-7.313.641-2.062 1.57-3.648 2.79-4.758 1.218-1.109 2.687-1.664 4.406-1.664 1.718 0 3.187.555 4.406 1.664 1.234 1.11 2.172 2.696 2.813 4.758.656 2.047.984 4.485.984 7.313v.047c0 2.828-.328 5.273-.984 7.335-.641 2.063-1.579 3.657-2.813 4.782-1.219 1.109-2.688 1.664-4.406 1.664ZM87.953 107.562c2.594 0 4.82-.71 6.68-2.132 1.86-1.422 3.281-3.438 4.265-6.047 1-2.61 1.5-5.703 1.5-9.281v-.047c0-3.578-.5-6.672-1.5-9.282-.984-2.609-2.406-4.617-4.265-6.023-1.86-1.422-4.086-2.133-6.68-2.133-2.594 0-4.82.711-6.68 2.133-1.843 1.406-3.257 3.414-4.242 6.023-.984 2.61-1.476 5.704-1.476 9.282v.047c0 3.578.492 6.671 1.476 9.28.985 2.61 2.399 4.626 4.242 6.048 1.86 1.422 4.086 2.132 6.68 2.132Zm0-3.679c-1.719 0-3.187-.555-4.406-1.664-1.219-1.125-2.149-2.719-2.79-4.781-.64-2.063-.96-4.508-.96-7.336v-.047c0-2.828.32-5.266.96-7.313.641-2.062 1.571-3.648 2.79-4.758 1.219-1.109 2.687-1.664 4.406-1.664 1.719 0 3.188.555 4.406 1.664 1.235 1.11 2.172 2.696 2.813 4.758.656 2.047.984 4.485.984 7.313v.047c0 2.828-.328 5.273-.984 7.335-.64 2.063-1.578 3.657-2.813 4.782-1.218 1.109-2.687 1.664-4.406 1.664Z",
|
|
91944
|
+
fill: "#fff"
|
|
91945
|
+
})));
|
|
91946
|
+
};
|
|
91947
|
+
|
|
91931
91948
|
var _path, _path2;
|
|
91932
91949
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
91933
|
-
var
|
|
91950
|
+
var SvgPageNotFound = function SvgPageNotFound(props) {
|
|
91934
91951
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
91935
91952
|
width: 121,
|
|
91936
91953
|
height: 120,
|
|
@@ -91945,15 +91962,37 @@ var SvgErrorPage = function SvgErrorPage(props) {
|
|
|
91945
91962
|
})));
|
|
91946
91963
|
};
|
|
91947
91964
|
|
|
91965
|
+
var ERRORS = {
|
|
91966
|
+
404: {
|
|
91967
|
+
Image: SvgPageNotFound,
|
|
91968
|
+
trans: {
|
|
91969
|
+
i18nKey: "neetoCommons.errorPage.cantBeFound",
|
|
91970
|
+
content: "The page you're looking for <br /> can't be found."
|
|
91971
|
+
}
|
|
91972
|
+
},
|
|
91973
|
+
500: {
|
|
91974
|
+
Image: SvgInternalServerError,
|
|
91975
|
+
trans: {
|
|
91976
|
+
i18nKey: "neetoCommons.errorPage.internalServerError",
|
|
91977
|
+
content: "The server encountered an error and <br /> could not complete your request."
|
|
91978
|
+
}
|
|
91979
|
+
}
|
|
91980
|
+
};
|
|
91981
|
+
|
|
91948
91982
|
var ErrorPage = function ErrorPage(_ref) {
|
|
91949
91983
|
var _ref$homeUrl = _ref.homeUrl,
|
|
91950
|
-
homeUrl = _ref$homeUrl === void 0 ? "/" : _ref$homeUrl
|
|
91984
|
+
homeUrl = _ref$homeUrl === void 0 ? "/" : _ref$homeUrl,
|
|
91985
|
+
_ref$status = _ref.status,
|
|
91986
|
+
status = _ref$status === void 0 ? 404 : _ref$status;
|
|
91951
91987
|
var _useTranslation = reactI18next.useTranslation(),
|
|
91952
91988
|
t = _useTranslation.t;
|
|
91989
|
+
var _ref2 = ERRORS[status] || ERRORS[404],
|
|
91990
|
+
Image = _ref2.Image,
|
|
91991
|
+
trans = _ref2.trans;
|
|
91953
91992
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
91954
91993
|
className: "flex min-h-screen w-full flex-col items-center justify-center",
|
|
91955
91994
|
"data-cy": "error-page-container"
|
|
91956
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
91995
|
+
}, /*#__PURE__*/React__default["default"].createElement(Image, {
|
|
91957
91996
|
className: "mb-8",
|
|
91958
91997
|
"data-cy": "error-image"
|
|
91959
91998
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
@@ -91962,8 +92001,8 @@ var ErrorPage = function ErrorPage(_ref) {
|
|
|
91962
92001
|
style: "h2",
|
|
91963
92002
|
weight: "semibold"
|
|
91964
92003
|
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
91965
|
-
i18nKey:
|
|
91966
|
-
},
|
|
92004
|
+
i18nKey: trans.i18nKey
|
|
92005
|
+
}, trans.content)), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
91967
92006
|
href: homeUrl,
|
|
91968
92007
|
label: t("neetoCommons.errorPage.backToHome"),
|
|
91969
92008
|
size: "large",
|
package/react-utils.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export function useOnClickOutside<T>(
|
|
|
83
83
|
export function usePrevious<T>(value: T): T;
|
|
84
84
|
export function useUpdateEffect(effect: () => void, deps: any[]): void;
|
|
85
85
|
|
|
86
|
-
export const ErrorPage: React.FC<{ homeUrl?: string }>;
|
|
86
|
+
export const ErrorPage: React.FC<{ homeUrl?: string; status?: number }>;
|
|
87
87
|
export const LoginPage: React.FC<{
|
|
88
88
|
handleSubmit: (data: {
|
|
89
89
|
user: {
|