@bigbinary/neeto-commons-frontend 2.1.31 → 2.1.33

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.
@@ -26,6 +26,11 @@ const commonOptions = {
26
26
  infrastructureLogging: { level: "warn" },
27
27
  devtool,
28
28
  resolve,
29
+ optimization: {
30
+ splitChunks: {
31
+ maxSize: 15000000, // 15MB
32
+ },
33
+ },
29
34
  module: { rules },
30
35
  plugins: [
31
36
  new webpack.ProvidePlugin({ process: "process/browser" }),
@@ -2287,6 +2287,101 @@ var Browser = /*#__PURE__*/function () {
2287
2287
  }();
2288
2288
  Browser.type = 'languageDetector';
2289
2289
 
2290
+ function _arrayWithHoles(arr) {
2291
+ if (Array.isArray(arr)) return arr;
2292
+ }
2293
+
2294
+ function _iterableToArrayLimit(arr, i) {
2295
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
2296
+ if (null != _i) {
2297
+ var _s,
2298
+ _e,
2299
+ _x,
2300
+ _r,
2301
+ _arr = [],
2302
+ _n = !0,
2303
+ _d = !1;
2304
+ try {
2305
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
2306
+ if (Object(_i) !== _i) return;
2307
+ _n = !1;
2308
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2309
+ } catch (err) {
2310
+ _d = !0, _e = err;
2311
+ } finally {
2312
+ try {
2313
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2314
+ } finally {
2315
+ if (_d) throw _e;
2316
+ }
2317
+ }
2318
+ return _arr;
2319
+ }
2320
+ }
2321
+
2322
+ function _arrayLikeToArray(arr, len) {
2323
+ if (len == null || len > arr.length) len = arr.length;
2324
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2325
+ return arr2;
2326
+ }
2327
+
2328
+ function _unsupportedIterableToArray(o, minLen) {
2329
+ if (!o) return;
2330
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2331
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2332
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2333
+ if (n === "Map" || n === "Set") return Array.from(o);
2334
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2335
+ }
2336
+
2337
+ function _nonIterableRest() {
2338
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2339
+ }
2340
+
2341
+ function _slicedToArray(arr, i) {
2342
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2343
+ }
2344
+
2345
+ var getter = function getter(key) {
2346
+ return function () {
2347
+ return i18n__default["default"].t("taxonomyDefaultLabels.".concat(key));
2348
+ };
2349
+ };
2350
+ var replaceNullValuesWithGetter = function replaceNullValuesWithGetter(inputObject) {
2351
+ var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2352
+ var result = {};
2353
+ for (var _i = 0, _Object$entries = Object.entries(inputObject); _i < _Object$entries.length; _i++) {
2354
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
2355
+ key = _Object$entries$_i[0],
2356
+ value = _Object$entries$_i[1];
2357
+ var transKey = parentKey ? "".concat(parentKey, ".").concat(key) : key;
2358
+ if (value === null) {
2359
+ Object.defineProperty(result, key, {
2360
+ get: getter(transKey)
2361
+ });
2362
+ } else if (_typeof$1(value) === "object") {
2363
+ result[key] = replaceNullValuesWithGetter(value, transKey);
2364
+ } else {
2365
+ result[key] = value;
2366
+ }
2367
+ }
2368
+ return result;
2369
+ };
2370
+ var getSentenceCaseProcessor = function getSentenceCaseProcessor() {
2371
+ return {
2372
+ type: "postProcessor",
2373
+ name: "sentenceCasePlaceholderAndTypography",
2374
+ process: function process(value, keys) {
2375
+ if (keys.some(function (str) {
2376
+ return (str.startsWith("placeholder.") || str.startsWith("typography.")) && !str.includes("anyCase.");
2377
+ })) {
2378
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLocaleLowerCase();
2379
+ }
2380
+ return value;
2381
+ }
2382
+ };
2383
+ };
2384
+
2290
2385
  var generic = {
2291
2386
  error: "Something went wrong. Please try again later."
2292
2387
  };
@@ -2402,31 +2497,27 @@ var commonsEn = {
2402
2497
  neetoCommons: neetoCommons
2403
2498
  };
2404
2499
 
2405
- var sentenceCasePlaceholderAndTypographyProcessor = {
2406
- type: "postProcessor",
2407
- name: "sentenceCasePlaceholderAndTypography",
2408
- process: function process(value, keys) {
2409
- if (keys.some(function (str) {
2410
- return (str.startsWith("placeholder.") || str.startsWith("typography.")) && !str.includes("anyCase.");
2411
- })) {
2412
- return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLocaleLowerCase();
2413
- }
2414
- return value;
2415
- }
2416
- };
2417
- var commonsTranslations = {
2418
- en: {
2419
- translation: commonsEn
2420
- }
2421
- };
2500
+ // eslint-disable-next-line import/no-mutable-exports
2501
+ exports.taxonomies = {};
2422
2502
  var initializeI18n = function initializeI18n(hostTranslations) {
2423
- var _i18n$services$format;
2503
+ var _window$globalProps, _i18n$services$format;
2424
2504
  var packageTranslations = preval.require("./configs/scripts/getPkgTranslations.js");
2505
+ var commonsTranslations = {
2506
+ en: {
2507
+ translation: commonsEn
2508
+ }
2509
+ };
2425
2510
  var resources = [hostTranslations, commonsTranslations, packageTranslations].reduce(ramda.mergeDeepLeft);
2426
- i18n__default["default"].use(Browser).use(reactI18next.initReactI18next).use(sentenceCasePlaceholderAndTypographyProcessor).init({
2511
+ if ((_window$globalProps = window.globalProps) !== null && _window$globalProps !== void 0 && _window$globalProps.taxonomies) {
2512
+ exports.taxonomies = replaceNullValuesWithGetter(window.globalProps.taxonomies);
2513
+ }
2514
+ i18n__default["default"].use(Browser).use(reactI18next.initReactI18next).use(getSentenceCaseProcessor()).init({
2427
2515
  resources: resources,
2428
2516
  fallbackLng: "en",
2429
2517
  interpolation: {
2518
+ defaultVariables: {
2519
+ taxonomies: exports.taxonomies
2520
+ },
2430
2521
  escapeValue: false,
2431
2522
  skipOnVariables: false
2432
2523
  },