@ikas/storefront 0.0.161-alpha.10 → 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,30 +38050,36 @@ 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, {
38033
- i18n: {
38034
- locales: nextI18nConf.i18n.locales,
38035
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38036
- },
38037
- serializeConfig: false,
38038
- localePath: nextI18nConf.localePath,
38039
- })];
38058
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38059
+ ? undefined
38060
+ : {
38061
+ i18n: {
38062
+ locales: routingLocales,
38063
+ defaultLocale: defaultRoutingLocale,
38064
+ },
38065
+ serializeConfig: false,
38066
+ localePath: nextI18nConf.localePath,
38067
+ })];
38040
38068
  case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
38041
38069
  _d)];
38042
38070
  case 4:
38043
38071
  _e = {};
38044
38072
  _c = [{}];
38045
- return [4 /*yield*/, serverSideTranslations(locale, componentDirs, {
38046
- i18n: {
38047
- locales: nextI18nConf.i18n.locales,
38048
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38049
- },
38050
- serializeConfig: false,
38051
- localePath: nextI18nConf.localePath,
38052
- })];
38073
+ return [4 /*yield*/, serverSideTranslations(routing.locale, componentDirs, isLocal
38074
+ ? undefined
38075
+ : {
38076
+ i18n: {
38077
+ locales: routingLocales,
38078
+ defaultLocale: defaultRoutingLocale,
38079
+ },
38080
+ serializeConfig: false,
38081
+ localePath: nextI18nConf.localePath,
38082
+ })];
38053
38083
  case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
38054
38084
  _e.revalidate = 60,
38055
38085
  _e)];
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,30 +38027,36 @@ 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, {
38010
- i18n: {
38011
- locales: nextI18nConf.i18n.locales,
38012
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38013
- },
38014
- serializeConfig: false,
38015
- localePath: nextI18nConf.localePath,
38016
- })];
38035
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38036
+ ? undefined
38037
+ : {
38038
+ i18n: {
38039
+ locales: routingLocales,
38040
+ defaultLocale: defaultRoutingLocale,
38041
+ },
38042
+ serializeConfig: false,
38043
+ localePath: nextI18nConf.localePath,
38044
+ })];
38017
38045
  case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
38018
38046
  _d)];
38019
38047
  case 4:
38020
38048
  _e = {};
38021
38049
  _c = [{}];
38022
- return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, {
38023
- i18n: {
38024
- locales: nextI18nConf.i18n.locales,
38025
- defaultLocale: nextI18nConf.i18n.defaultLocale,
38026
- },
38027
- serializeConfig: false,
38028
- localePath: nextI18nConf.localePath,
38029
- })];
38050
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(routing.locale, componentDirs, isLocal
38051
+ ? undefined
38052
+ : {
38053
+ i18n: {
38054
+ locales: routingLocales,
38055
+ defaultLocale: defaultRoutingLocale,
38056
+ },
38057
+ serializeConfig: false,
38058
+ localePath: nextI18nConf.localePath,
38059
+ })];
38030
38060
  case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
38031
38061
  _e.revalidate = 60,
38032
38062
  _e)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.161-alpha.10",
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",