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

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,25 @@ 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;
38055
+ console.log(JSON.stringify({
38056
+ i18n: {
38057
+ locales: routingLocales,
38058
+ defaultLocale: defaultRoutingLocale,
38059
+ },
38060
+ serializeConfig: false,
38061
+ localePath: nextI18nConf.localePath,
38062
+ }, null, 2));
38029
38063
  if (!isServer) return [3 /*break*/, 4];
38030
38064
  _d = {};
38031
38065
  _b = [{}];
38032
- return [4 /*yield*/, serverSideTranslations(locale, componentDirs, isLocal
38066
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38033
38067
  ? undefined
38034
38068
  : {
38035
38069
  i18n: {
38036
- locales: nextI18nConf.i18n.locales,
38037
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38070
+ locales: routingLocales,
38071
+ defaultLocale: defaultRoutingLocale,
38038
38072
  },
38039
38073
  serializeConfig: false,
38040
38074
  localePath: nextI18nConf.localePath,
@@ -38044,12 +38078,12 @@ var SettingsHelper = /** @class */ (function () {
38044
38078
  case 4:
38045
38079
  _e = {};
38046
38080
  _c = [{}];
38047
- return [4 /*yield*/, serverSideTranslations(locale, componentDirs, isLocal
38081
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38048
38082
  ? undefined
38049
38083
  : {
38050
38084
  i18n: {
38051
- locales: nextI18nConf.i18n.locales,
38052
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38085
+ locales: routingLocales,
38086
+ defaultLocale: defaultRoutingLocale,
38053
38087
  },
38054
38088
  serializeConfig: false,
38055
38089
  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,25 @@ 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;
38032
+ console.log(JSON.stringify({
38033
+ i18n: {
38034
+ locales: routingLocales,
38035
+ defaultLocale: defaultRoutingLocale,
38036
+ },
38037
+ serializeConfig: false,
38038
+ localePath: nextI18nConf.localePath,
38039
+ }, null, 2));
38006
38040
  if (!isServer) return [3 /*break*/, 4];
38007
38041
  _d = {};
38008
38042
  _b = [{}];
38009
- return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, isLocal
38043
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38010
38044
  ? undefined
38011
38045
  : {
38012
38046
  i18n: {
38013
- locales: nextI18nConf.i18n.locales,
38014
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38047
+ locales: routingLocales,
38048
+ defaultLocale: defaultRoutingLocale,
38015
38049
  },
38016
38050
  serializeConfig: false,
38017
38051
  localePath: nextI18nConf.localePath,
@@ -38021,12 +38055,12 @@ var SettingsHelper = /** @class */ (function () {
38021
38055
  case 4:
38022
38056
  _e = {};
38023
38057
  _c = [{}];
38024
- return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, isLocal
38058
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38025
38059
  ? undefined
38026
38060
  : {
38027
38061
  i18n: {
38028
- locales: nextI18nConf.i18n.locales,
38029
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38062
+ locales: routingLocales,
38063
+ defaultLocale: defaultRoutingLocale,
38030
38064
  },
38031
38065
  serializeConfig: false,
38032
38066
  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.13",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",