@ikas/storefront 0.0.161-alpha.11 → 0.0.161-alpha.12

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/build/index.es.js CHANGED
@@ -37682,6 +37682,30 @@ var index = /*#__PURE__*/Object.freeze({
37682
37682
  Image: Image
37683
37683
  });
37684
37684
 
37685
+ /**
37686
+ * Creates a duplicate-free version of an array, using
37687
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
37688
+ * for equality comparisons, in which only the first occurrence of each element
37689
+ * is kept. The order of result values is determined by the order they occur
37690
+ * in the array.
37691
+ *
37692
+ * @static
37693
+ * @memberOf _
37694
+ * @since 0.1.0
37695
+ * @category Array
37696
+ * @param {Array} array The array to inspect.
37697
+ * @returns {Array} Returns the new duplicate free array.
37698
+ * @example
37699
+ *
37700
+ * _.uniq([2, 1, 2]);
37701
+ * // => [2, 1]
37702
+ */
37703
+ function uniq(array) {
37704
+ return (array && array.length) ? _baseUniq(array) : [];
37705
+ }
37706
+
37707
+ var uniq_1 = uniq;
37708
+
37685
37709
  var IkasStorefrontLocalization = /** @class */ (function () {
37686
37710
  function IkasStorefrontLocalization(data) {
37687
37711
  this.id = data.id || "";
@@ -37971,7 +37995,7 @@ var SettingsHelper = /** @class */ (function () {
37971
37995
  SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
37972
37996
  var _a;
37973
37997
  return __awaiter(this, void 0, void 0, function () {
37974
- var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, _b, _c;
37998
+ var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, routingLocales, defaultRoutingLocale, _b, _c;
37975
37999
  var _d, _e;
37976
38000
  return __generator(this, function (_f) {
37977
38001
  switch (_f.label) {
@@ -38026,15 +38050,17 @@ var SettingsHelper = /** @class */ (function () {
38026
38050
  });
38027
38051
  componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
38028
38052
  nextI18nConf = serverRuntimeConfig.nextI18nConf;
38053
+ routingLocales = uniq_1(storefront.routings.map(function (sr) { return sr.locale; }));
38054
+ defaultRoutingLocale = routing.locale;
38029
38055
  if (!isServer) return [3 /*break*/, 4];
38030
38056
  _d = {};
38031
38057
  _b = [{}];
38032
- return [4 /*yield*/, serverSideTranslations(locale, componentDirs, isLocal
38058
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38033
38059
  ? undefined
38034
38060
  : {
38035
38061
  i18n: {
38036
- locales: nextI18nConf.i18n.locales,
38037
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38062
+ locales: routingLocales,
38063
+ defaultLocale: defaultRoutingLocale,
38038
38064
  },
38039
38065
  serializeConfig: false,
38040
38066
  localePath: nextI18nConf.localePath,
@@ -38044,12 +38070,12 @@ var SettingsHelper = /** @class */ (function () {
38044
38070
  case 4:
38045
38071
  _e = {};
38046
38072
  _c = [{}];
38047
- return [4 /*yield*/, serverSideTranslations(locale, componentDirs, isLocal
38073
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38048
38074
  ? undefined
38049
38075
  : {
38050
38076
  i18n: {
38051
- locales: nextI18nConf.i18n.locales,
38052
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38077
+ locales: routingLocales,
38078
+ defaultLocale: defaultRoutingLocale,
38053
38079
  },
38054
38080
  serializeConfig: false,
38055
38081
  localePath: nextI18nConf.localePath,
package/build/index.js CHANGED
@@ -37659,6 +37659,30 @@ var index = /*#__PURE__*/Object.freeze({
37659
37659
  Image: Image
37660
37660
  });
37661
37661
 
37662
+ /**
37663
+ * Creates a duplicate-free version of an array, using
37664
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
37665
+ * for equality comparisons, in which only the first occurrence of each element
37666
+ * is kept. The order of result values is determined by the order they occur
37667
+ * in the array.
37668
+ *
37669
+ * @static
37670
+ * @memberOf _
37671
+ * @since 0.1.0
37672
+ * @category Array
37673
+ * @param {Array} array The array to inspect.
37674
+ * @returns {Array} Returns the new duplicate free array.
37675
+ * @example
37676
+ *
37677
+ * _.uniq([2, 1, 2]);
37678
+ * // => [2, 1]
37679
+ */
37680
+ function uniq(array) {
37681
+ return (array && array.length) ? _baseUniq(array) : [];
37682
+ }
37683
+
37684
+ var uniq_1 = uniq;
37685
+
37662
37686
  var IkasStorefrontLocalization = /** @class */ (function () {
37663
37687
  function IkasStorefrontLocalization(data) {
37664
37688
  this.id = data.id || "";
@@ -37948,7 +37972,7 @@ var SettingsHelper = /** @class */ (function () {
37948
37972
  SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
37949
37973
  var _a;
37950
37974
  return __awaiter(this, void 0, void 0, function () {
37951
- var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, _b, _c;
37975
+ var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, routingLocales, defaultRoutingLocale, _b, _c;
37952
37976
  var _d, _e;
37953
37977
  return __generator(this, function (_f) {
37954
37978
  switch (_f.label) {
@@ -38003,15 +38027,17 @@ var SettingsHelper = /** @class */ (function () {
38003
38027
  });
38004
38028
  componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
38005
38029
  nextI18nConf = serverRuntimeConfig.nextI18nConf;
38030
+ routingLocales = uniq_1(storefront.routings.map(function (sr) { return sr.locale; }));
38031
+ defaultRoutingLocale = routing.locale;
38006
38032
  if (!isServer) return [3 /*break*/, 4];
38007
38033
  _d = {};
38008
38034
  _b = [{}];
38009
- return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, isLocal
38035
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38010
38036
  ? undefined
38011
38037
  : {
38012
38038
  i18n: {
38013
- locales: nextI18nConf.i18n.locales,
38014
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38039
+ locales: routingLocales,
38040
+ defaultLocale: defaultRoutingLocale,
38015
38041
  },
38016
38042
  serializeConfig: false,
38017
38043
  localePath: nextI18nConf.localePath,
@@ -38021,12 +38047,12 @@ var SettingsHelper = /** @class */ (function () {
38021
38047
  case 4:
38022
38048
  _e = {};
38023
38049
  _c = [{}];
38024
- return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, isLocal
38050
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38025
38051
  ? undefined
38026
38052
  : {
38027
38053
  i18n: {
38028
- locales: nextI18nConf.i18n.locales,
38029
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38054
+ locales: routingLocales,
38055
+ defaultLocale: defaultRoutingLocale,
38030
38056
  },
38031
38057
  serializeConfig: false,
38032
38058
  localePath: nextI18nConf.localePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.161-alpha.11",
3
+ "version": "0.0.161-alpha.12",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",