@bigbinary/neeto-commons-frontend 2.0.96 → 2.0.98

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/README.md CHANGED
@@ -28,6 +28,7 @@ Category
28
28
  - [Set up translations](./docs/initializers/translation.md)
29
29
  - [Set up mixpanel](./docs/initializers/mixpanel.md)
30
30
  - [Set up logger](./docs/initializers/logger.md)
31
+ - [Disable React Developer Tools in production](./docs/initializers/reactDevTools.md)
31
32
  </td>
32
33
  <td style="vertical-align: top;">
33
34
 
@@ -56,6 +57,7 @@ Category
56
57
  - [useStateWithDependency](./docs/react/hooks.md#usestatewithdependency)
57
58
  - [withImmutableActions](./docs/react/utils.md#withimmutableactions)
58
59
  - [withTitle](./docs/react/utils.md#withtitle)
60
+ - [withT](./docs/react/utils.md#witht)
59
61
  - [registerBrowserNotifications](./docs/react/utils.md#registerbrowsernotifications)
60
62
  - [destroyBrowserSubscription](./docs/react/utils.md#destroybrowsersubscription)
61
63
  - [handleMetaClick](./docs/react/utils.md#handlemetaclick)
@@ -4,7 +4,7 @@ const commonConfiguration = require("../../eslint");
4
4
 
5
5
  const nanosConfiguration = {
6
6
  extends: [
7
- "plugin:@bigbinary/neeto/recommended",
7
+ "plugin:@bigbinary/neeto/nanos-recommended",
8
8
  "plugin:cypress/recommended",
9
9
  "plugin:json/recommended",
10
10
  "eslint:recommended",
@@ -15,7 +15,6 @@ const nanosConfiguration = {
15
15
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/imports/enforced",
16
16
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/react",
17
17
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/promise",
18
- "./node_modules/@bigbinary/neeto-commons-frontend/configs/nanos/eslint/neeto",
19
18
  "prettier",
20
19
  ],
21
20
  };
@@ -4,7 +4,7 @@ const commonConfiguration = require("../../eslint");
4
4
 
5
5
  const nextjsConfiguration = {
6
6
  extends: [
7
- "plugin:@bigbinary/neeto/recommended",
7
+ "plugin:@bigbinary/neeto/nextjs-recommended",
8
8
  "plugin:cypress/recommended",
9
9
  "plugin:json/recommended",
10
10
  "eslint:recommended",
@@ -15,7 +15,6 @@ const nextjsConfiguration = {
15
15
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/imports/enforced",
16
16
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/react",
17
17
  "./node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/promise",
18
- "./node_modules/@bigbinary/neeto-commons-frontend/configs/nextjs/eslint/neeto",
19
18
  "prettier",
20
19
  ],
21
20
  };
@@ -2233,7 +2233,7 @@ var commonsEn = {
2233
2233
  neetoCommons: neetoCommons
2234
2234
  };
2235
2235
 
2236
- var packageNames = ["neeto-molecules", "neeto-team-members-frontend", "neeto-tags-frontend"];
2236
+ var packageNames = ["neeto-molecules", "neeto-integrations-frontend", "neeto-team-members-frontend", "neeto-tags-frontend"];
2237
2237
  var getPackageTranslations = function getPackageTranslations(language, packageNames) {
2238
2238
  var loadTranslations = ramda.curry(function (language, packageName) {
2239
2239
  try {
@@ -2302,6 +2302,24 @@ function initializeMixPanel() {
2302
2302
  mixpanel__default["default"].identify(globalProps.user.email);
2303
2303
  }
2304
2304
 
2305
+ var isObjectOrFunction = function isObjectOrFunction(object) {
2306
+ var type = _typeof(object);
2307
+ return type === "function" || type === "object" && !!object;
2308
+ };
2309
+ function disableReactDevTools() {
2310
+ if (window && window.document) {
2311
+ var developerToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
2312
+ if (!isObjectOrFunction(developerToolsHook)) return;
2313
+ for (var prop in developerToolsHook) {
2314
+ if (prop === "renderers") {
2315
+ developerToolsHook[prop] = new Map();
2316
+ } else {
2317
+ developerToolsHook[prop] = typeof developerToolsHook[prop] === "function" ? Function.prototype : null;
2318
+ }
2319
+ }
2320
+ }
2321
+ }
2322
+
2305
2323
  // eslint-disable-next-line import/no-mutable-exports
2306
2324
  exports.globalProps = {};
2307
2325
  function initializeApplication(_ref) {
@@ -2318,6 +2336,7 @@ function initializeApplication(_ref) {
2318
2336
  }
2319
2337
  if (!(skip !== null && skip !== void 0 && skip.i18n)) initializeI18n(translationResources);
2320
2338
  if (!(skip !== null && skip !== void 0 && skip.logger)) initializeLogger();
2339
+ if (process.env.NODE_ENV === "production") disableReactDevTools();
2321
2340
  }
2322
2341
 
2323
2342
  Object.defineProperty(exports, 'useDisplayErrorPage', {