@ikas/storefront 0.0.161-alpha.2 → 0.0.161-alpha.4

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.
@@ -221,6 +221,7 @@ export declare enum ProductFilterDisplayTypeEnum {
221
221
  export declare enum ProductFilterSortTypeEnum {
222
222
  ALPHABETICAL_ASC = "ALPHABETICAL_ASC",
223
223
  ALPHABETICAL_DESC = "ALPHABETICAL_DESC",
224
+ CUSTOM_SORT = "CUSTOM_SORT",
224
225
  PRODUCT_COUNT_ASC = "PRODUCT_COUNT_ASC",
225
226
  PRODUCT_COUNT_DESC = "PRODUCT_COUNT_DESC"
226
227
  }
@@ -262,6 +263,7 @@ export declare enum SortByDirectionEnum {
262
263
  export declare enum SortByTypeEnum {
263
264
  CREATED_AT = "CREATED_AT",
264
265
  DISCOUNT_RATIO = "DISCOUNT_RATIO",
266
+ MANUAL_SORT = "MANUAL_SORT",
265
267
  NAME = "NAME",
266
268
  PRICE = "PRICE"
267
269
  }
@@ -67,4 +67,5 @@ export interface registerCustomerVariables {
67
67
  password: string;
68
68
  firstName: string;
69
69
  lastName: string;
70
+ isAcceptMarketing?: boolean | null;
70
71
  }
@@ -9,7 +9,7 @@ export declare class IkasCustomerAPI {
9
9
  token: string;
10
10
  tokenExpiry: number;
11
11
  } | undefined>;
12
- static register(email: string, password: string, firstName: string, lastName: string): Promise<{
12
+ static register(email: string, password: string, firstName: string, lastName: string, isAcceptMarketing?: boolean): Promise<{
13
13
  customer: IkasCustomer;
14
14
  __typename: "CustomerLoginResponse";
15
15
  token: string;
package/build/index.es.js CHANGED
@@ -7,6 +7,7 @@ import Link from 'next/link';
7
7
  import NextImage from 'next/image';
8
8
  import fs from 'fs';
9
9
  import getConfig from 'next/config';
10
+ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
10
11
  import dynamic from 'next/dynamic';
11
12
  import Error$1 from 'next/error';
12
13
 
@@ -23547,11 +23548,11 @@ var IkasCustomerStore = /** @class */ (function () {
23547
23548
  }
23548
23549
  });
23549
23550
  }); };
23550
- this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
23551
+ this.register = function (firstName, lastName, email, password, isMarketingAccepted) { return __awaiter(_this, void 0, void 0, function () {
23551
23552
  var response;
23552
23553
  return __generator(this, function (_a) {
23553
23554
  switch (_a.label) {
23554
- case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
23555
+ case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName, isMarketingAccepted)];
23555
23556
  case 1:
23556
23557
  response = _a.sent();
23557
23558
  if (response) {
@@ -27625,6 +27626,7 @@ var ProductFilterSortTypeEnum;
27625
27626
  (function (ProductFilterSortTypeEnum) {
27626
27627
  ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
27627
27628
  ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
27629
+ ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
27628
27630
  ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
27629
27631
  ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
27630
27632
  })(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
@@ -27671,6 +27673,7 @@ var SortByTypeEnum;
27671
27673
  (function (SortByTypeEnum) {
27672
27674
  SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
27673
27675
  SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
27676
+ SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
27674
27677
  SortByTypeEnum["NAME"] = "NAME";
27675
27678
  SortByTypeEnum["PRICE"] = "PRICE";
27676
27679
  })(SortByTypeEnum || (SortByTypeEnum = {}));
@@ -29673,6 +29676,7 @@ var RegisterForm = /** @class */ (function () {
29673
29676
  lastName: "",
29674
29677
  email: "",
29675
29678
  password: "",
29679
+ isMarketingAccepted: false,
29676
29680
  };
29677
29681
  this.onFirstNameChange = function (value) {
29678
29682
  _this.firstName = value;
@@ -29772,6 +29776,16 @@ var RegisterForm = /** @class */ (function () {
29772
29776
  enumerable: false,
29773
29777
  configurable: true
29774
29778
  });
29779
+ Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
29780
+ get: function () {
29781
+ return this.model.isMarketingAccepted;
29782
+ },
29783
+ set: function (value) {
29784
+ this.model.isMarketingAccepted = value;
29785
+ },
29786
+ enumerable: false,
29787
+ configurable: true
29788
+ });
29775
29789
  Object.defineProperty(RegisterForm.prototype, "hasError", {
29776
29790
  get: function () {
29777
29791
  return this.validator.hasError;
@@ -29837,7 +29851,7 @@ var RegisterForm = /** @class */ (function () {
29837
29851
  _b.label = 2;
29838
29852
  case 2:
29839
29853
  _b.trys.push([2, 4, , 5]);
29840
- return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
29854
+ return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
29841
29855
  case 3:
29842
29856
  isRegisterSuccess = _b.sent();
29843
29857
  if (isRegisterSuccess) {
@@ -34352,13 +34366,13 @@ var IkasCustomerAPI = /** @class */ (function () {
34352
34366
  });
34353
34367
  });
34354
34368
  };
34355
- IkasCustomerAPI.register = function (email, password, firstName, lastName) {
34369
+ IkasCustomerAPI.register = function (email, password, firstName, lastName, isAcceptMarketing) {
34356
34370
  return __awaiter(this, void 0, void 0, function () {
34357
34371
  var MUTATION, _a, data, errors, err_2;
34358
34372
  return __generator(this, function (_b) {
34359
34373
  switch (_b.label) {
34360
34374
  case 0:
34361
- MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
34375
+ MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
34362
34376
  _b.label = 1;
34363
34377
  case 1:
34364
34378
  _b.trys.push([1, 3, , 4]);
@@ -34371,6 +34385,7 @@ var IkasCustomerAPI = /** @class */ (function () {
34371
34385
  password: password,
34372
34386
  firstName: firstName,
34373
34387
  lastName: lastName,
34388
+ isAcceptMarketing: isAcceptMarketing,
34374
34389
  },
34375
34390
  })];
34376
34391
  case 2:
@@ -37905,7 +37920,7 @@ var SettingsHelper = /** @class */ (function () {
37905
37920
  id: storefront.salesChannelId,
37906
37921
  }),
37907
37922
  routing: storefront.routings.length
37908
- ? storefront.routings.find(function (r) { return !r.path && !r.domain; }) ||
37923
+ ? storefront.routings.find(function (r) { return r.locale === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
37909
37924
  storefront.routings[0]
37910
37925
  : new IkasStorefrontRouting({}),
37911
37926
  favicon: localTheme.settings.favicon,
@@ -37956,9 +37971,10 @@ var SettingsHelper = /** @class */ (function () {
37956
37971
  SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
37957
37972
  var _a;
37958
37973
  return __awaiter(this, void 0, void 0, function () {
37959
- var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider;
37960
- return __generator(this, function (_b) {
37961
- switch (_b.label) {
37974
+ var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, _b, _c;
37975
+ var _d, _e;
37976
+ return __generator(this, function (_f) {
37977
+ switch (_f.label) {
37962
37978
  case 0:
37963
37979
  isLocal = process.env.NEXT_PUBLIC_ENV === "local";
37964
37980
  locale = isLocal ? "en" : context.locale;
@@ -37970,7 +37986,7 @@ var SettingsHelper = /** @class */ (function () {
37970
37986
  }
37971
37987
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
37972
37988
  case 1:
37973
- settings = _b.sent();
37989
+ settings = _f.sent();
37974
37990
  if (!settings ||
37975
37991
  !settings.storefront.mainStorefrontThemeId ||
37976
37992
  !settings.storefront.salesChannelId) {
@@ -37996,20 +38012,31 @@ var SettingsHelper = /** @class */ (function () {
37996
38012
  provider.possiblePageTypes = possiblePageTypes;
37997
38013
  return [4 /*yield*/, provider.getPageData()];
37998
38014
  case 2:
37999
- _b.sent();
38015
+ _f.sent();
38000
38016
  if (!provider.page) {
38001
38017
  return [2 /*return*/, {
38002
38018
  props: {},
38003
38019
  notFound: true,
38004
38020
  }];
38005
38021
  }
38006
- if (isServer)
38007
- return [2 /*return*/, provider.nextPageData];
38008
- else
38009
- return [2 /*return*/, {
38010
- props: provider.nextPageData.props,
38011
- revalidate: 60,
38012
- }];
38022
+ componentIds = provider.page.components.map(function (pc) { return pc.componentId; });
38023
+ components = themeLocalization.themeJson.components.filter(function (c) {
38024
+ return componentIds.includes(c.id);
38025
+ });
38026
+ componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
38027
+ if (!isServer) return [3 /*break*/, 4];
38028
+ _d = {};
38029
+ _b = [{}];
38030
+ return [4 /*yield*/, serverSideTranslations(locale, componentDirs)];
38031
+ case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
38032
+ _d)];
38033
+ case 4:
38034
+ _e = {};
38035
+ _c = [{}];
38036
+ return [4 /*yield*/, serverSideTranslations(locale, componentDirs)];
38037
+ case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
38038
+ _e.revalidate = 60,
38039
+ _e)];
38013
38040
  }
38014
38041
  });
38015
38042
  });
package/build/index.js CHANGED
@@ -11,6 +11,7 @@ var Link = require('next/link');
11
11
  var NextImage = require('next/image');
12
12
  var fs = require('fs');
13
13
  var getConfig = require('next/config');
14
+ var serverSideTranslations = require('next-i18next/serverSideTranslations');
14
15
  var dynamic = require('next/dynamic');
15
16
  var Error$1 = require('next/error');
16
17
 
@@ -23553,11 +23554,11 @@ var IkasCustomerStore = /** @class */ (function () {
23553
23554
  }
23554
23555
  });
23555
23556
  }); };
23556
- this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
23557
+ this.register = function (firstName, lastName, email, password, isMarketingAccepted) { return __awaiter(_this, void 0, void 0, function () {
23557
23558
  var response;
23558
23559
  return __generator(this, function (_a) {
23559
23560
  switch (_a.label) {
23560
- case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
23561
+ case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName, isMarketingAccepted)];
23561
23562
  case 1:
23562
23563
  response = _a.sent();
23563
23564
  if (response) {
@@ -27606,6 +27607,7 @@ var ProductFilterSortTypeEnum;
27606
27607
  (function (ProductFilterSortTypeEnum) {
27607
27608
  ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
27608
27609
  ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
27610
+ ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
27609
27611
  ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
27610
27612
  ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
27611
27613
  })(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
@@ -27652,6 +27654,7 @@ var SortByTypeEnum;
27652
27654
  (function (SortByTypeEnum) {
27653
27655
  SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
27654
27656
  SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
27657
+ SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
27655
27658
  SortByTypeEnum["NAME"] = "NAME";
27656
27659
  SortByTypeEnum["PRICE"] = "PRICE";
27657
27660
  })(SortByTypeEnum || (SortByTypeEnum = {}));
@@ -29651,6 +29654,7 @@ var RegisterForm = /** @class */ (function () {
29651
29654
  lastName: "",
29652
29655
  email: "",
29653
29656
  password: "",
29657
+ isMarketingAccepted: false,
29654
29658
  };
29655
29659
  this.onFirstNameChange = function (value) {
29656
29660
  _this.firstName = value;
@@ -29750,6 +29754,16 @@ var RegisterForm = /** @class */ (function () {
29750
29754
  enumerable: false,
29751
29755
  configurable: true
29752
29756
  });
29757
+ Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
29758
+ get: function () {
29759
+ return this.model.isMarketingAccepted;
29760
+ },
29761
+ set: function (value) {
29762
+ this.model.isMarketingAccepted = value;
29763
+ },
29764
+ enumerable: false,
29765
+ configurable: true
29766
+ });
29753
29767
  Object.defineProperty(RegisterForm.prototype, "hasError", {
29754
29768
  get: function () {
29755
29769
  return this.validator.hasError;
@@ -29815,7 +29829,7 @@ var RegisterForm = /** @class */ (function () {
29815
29829
  _b.label = 2;
29816
29830
  case 2:
29817
29831
  _b.trys.push([2, 4, , 5]);
29818
- return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
29832
+ return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
29819
29833
  case 3:
29820
29834
  isRegisterSuccess = _b.sent();
29821
29835
  if (isRegisterSuccess) {
@@ -34329,13 +34343,13 @@ var IkasCustomerAPI = /** @class */ (function () {
34329
34343
  });
34330
34344
  });
34331
34345
  };
34332
- IkasCustomerAPI.register = function (email, password, firstName, lastName) {
34346
+ IkasCustomerAPI.register = function (email, password, firstName, lastName, isAcceptMarketing) {
34333
34347
  return __awaiter(this, void 0, void 0, function () {
34334
34348
  var MUTATION, _a, data, errors, err_2;
34335
34349
  return __generator(this, function (_b) {
34336
34350
  switch (_b.label) {
34337
34351
  case 0:
34338
- MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
34352
+ MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
34339
34353
  _b.label = 1;
34340
34354
  case 1:
34341
34355
  _b.trys.push([1, 3, , 4]);
@@ -34348,6 +34362,7 @@ var IkasCustomerAPI = /** @class */ (function () {
34348
34362
  password: password,
34349
34363
  firstName: firstName,
34350
34364
  lastName: lastName,
34365
+ isAcceptMarketing: isAcceptMarketing,
34351
34366
  },
34352
34367
  })];
34353
34368
  case 2:
@@ -37882,7 +37897,7 @@ var SettingsHelper = /** @class */ (function () {
37882
37897
  id: storefront.salesChannelId,
37883
37898
  }),
37884
37899
  routing: storefront.routings.length
37885
- ? storefront.routings.find(function (r) { return !r.path && !r.domain; }) ||
37900
+ ? storefront.routings.find(function (r) { return r.locale === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
37886
37901
  storefront.routings[0]
37887
37902
  : new IkasStorefrontRouting({}),
37888
37903
  favicon: localTheme.settings.favicon,
@@ -37933,9 +37948,10 @@ var SettingsHelper = /** @class */ (function () {
37933
37948
  SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
37934
37949
  var _a;
37935
37950
  return __awaiter(this, void 0, void 0, function () {
37936
- var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider;
37937
- return __generator(this, function (_b) {
37938
- switch (_b.label) {
37951
+ var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, _b, _c;
37952
+ var _d, _e;
37953
+ return __generator(this, function (_f) {
37954
+ switch (_f.label) {
37939
37955
  case 0:
37940
37956
  isLocal = process.env.NEXT_PUBLIC_ENV === "local";
37941
37957
  locale = isLocal ? "en" : context.locale;
@@ -37947,7 +37963,7 @@ var SettingsHelper = /** @class */ (function () {
37947
37963
  }
37948
37964
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
37949
37965
  case 1:
37950
- settings = _b.sent();
37966
+ settings = _f.sent();
37951
37967
  if (!settings ||
37952
37968
  !settings.storefront.mainStorefrontThemeId ||
37953
37969
  !settings.storefront.salesChannelId) {
@@ -37973,20 +37989,31 @@ var SettingsHelper = /** @class */ (function () {
37973
37989
  provider.possiblePageTypes = possiblePageTypes;
37974
37990
  return [4 /*yield*/, provider.getPageData()];
37975
37991
  case 2:
37976
- _b.sent();
37992
+ _f.sent();
37977
37993
  if (!provider.page) {
37978
37994
  return [2 /*return*/, {
37979
37995
  props: {},
37980
37996
  notFound: true,
37981
37997
  }];
37982
37998
  }
37983
- if (isServer)
37984
- return [2 /*return*/, provider.nextPageData];
37985
- else
37986
- return [2 /*return*/, {
37987
- props: provider.nextPageData.props,
37988
- revalidate: 60,
37989
- }];
37999
+ componentIds = provider.page.components.map(function (pc) { return pc.componentId; });
38000
+ components = themeLocalization.themeJson.components.filter(function (c) {
38001
+ return componentIds.includes(c.id);
38002
+ });
38003
+ componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
38004
+ if (!isServer) return [3 /*break*/, 4];
38005
+ _d = {};
38006
+ _b = [{}];
38007
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs)];
38008
+ case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
38009
+ _d)];
38010
+ case 4:
38011
+ _e = {};
38012
+ _c = [{}];
38013
+ return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs)];
38014
+ case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
38015
+ _e.revalidate = 60,
38016
+ _e)];
37990
38017
  }
37991
38018
  });
37992
38019
  });
@@ -12,6 +12,7 @@ declare type RegisterFormModel = {
12
12
  lastName: string;
13
13
  email: string;
14
14
  password: string;
15
+ isMarketingAccepted?: boolean;
15
16
  };
16
17
  export declare class RegisterForm {
17
18
  private model;
@@ -26,6 +27,8 @@ export declare class RegisterForm {
26
27
  set email(value: string);
27
28
  get password(): string;
28
29
  set password(value: string);
30
+ get isMarketingAccepted(): boolean | undefined;
31
+ set isMarketingAccepted(value: boolean | undefined);
29
32
  get hasError(): boolean;
30
33
  get firstNameErrorMessage(): string | undefined;
31
34
  get lastNameErrorMessage(): string | undefined;
@@ -15,7 +15,7 @@ export declare class IkasCustomerStore {
15
15
  get canCreateEmailSubscription(): boolean;
16
16
  get customerConsentGranted(): boolean;
17
17
  login: (email: string, password: string) => Promise<boolean>;
18
- register: (firstName: string, lastName: string, email: string, password: string) => Promise<boolean>;
18
+ register: (firstName: string, lastName: string, email: string, password: string, isMarketingAccepted?: boolean | undefined) => Promise<boolean>;
19
19
  saveContactForm: (input: SaveContactForm) => Promise<boolean | undefined>;
20
20
  checkEmail: (email: string) => Promise<boolean>;
21
21
  forgotPassword: (email: string) => Promise<boolean>;
@@ -13,6 +13,10 @@ export declare class SettingsHelper {
13
13
  static readSettingsFile(): Promise<any>;
14
14
  static getSettings(locale: string): Promise<SettingsData | null>;
15
15
  static getPageData(context: GetStaticPropsContext<ParsedUrlQuery> | GetServerSidePropsContext<ParsedUrlQuery>, isServer: boolean, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]): Promise<{
16
+ props: {};
17
+ notFound: boolean;
18
+ revalidate?: undefined;
19
+ } | {
16
20
  props: {
17
21
  propValuesStr: string;
18
22
  pageSpecificDataStr: string;
@@ -33,10 +37,13 @@ export declare class SettingsHelper {
33
37
  favicon: any;
34
38
  stockPreference: IkasThemeStockPreference;
35
39
  };
40
+ _nextI18Next: {
41
+ initialI18nStore: any;
42
+ initialLocale: string;
43
+ userConfig: import("next-i18next").UserConfig | null;
44
+ };
36
45
  };
37
- } | {
38
- props: {};
39
- notFound: boolean;
46
+ notFound?: undefined;
40
47
  revalidate?: undefined;
41
48
  } | {
42
49
  props: {
@@ -59,11 +66,20 @@ export declare class SettingsHelper {
59
66
  favicon: any;
60
67
  stockPreference: IkasThemeStockPreference;
61
68
  };
69
+ _nextI18Next: {
70
+ initialI18nStore: any;
71
+ initialLocale: string;
72
+ userConfig: import("next-i18next").UserConfig | null;
73
+ };
62
74
  };
63
75
  revalidate: number;
64
76
  notFound?: undefined;
65
77
  }>;
66
78
  static getStaticProps(context: GetStaticPropsContext<ParsedUrlQuery>, pageType?: IkasThemePageType, possiblePageTypes?: IkasThemePageType[]): Promise<{
79
+ props: {};
80
+ notFound: boolean;
81
+ revalidate?: undefined;
82
+ } | {
67
83
  props: {
68
84
  propValuesStr: string;
69
85
  pageSpecificDataStr: string;
@@ -84,10 +100,13 @@ export declare class SettingsHelper {
84
100
  favicon: any;
85
101
  stockPreference: IkasThemeStockPreference;
86
102
  };
103
+ _nextI18Next: {
104
+ initialI18nStore: any;
105
+ initialLocale: string;
106
+ userConfig: import("next-i18next").UserConfig | null;
107
+ };
87
108
  };
88
- } | {
89
- props: {};
90
- notFound: boolean;
109
+ notFound?: undefined;
91
110
  revalidate?: undefined;
92
111
  } | {
93
112
  props: {
@@ -110,11 +129,20 @@ export declare class SettingsHelper {
110
129
  favicon: any;
111
130
  stockPreference: IkasThemeStockPreference;
112
131
  };
132
+ _nextI18Next: {
133
+ initialI18nStore: any;
134
+ initialLocale: string;
135
+ userConfig: import("next-i18next").UserConfig | null;
136
+ };
113
137
  };
114
138
  revalidate: number;
115
139
  notFound?: undefined;
116
140
  }>;
117
141
  static getServerSideProps(context: GetServerSidePropsContext<ParsedUrlQuery>, pageType?: IkasThemePageType): Promise<{
142
+ props: {};
143
+ notFound: boolean;
144
+ revalidate?: undefined;
145
+ } | {
118
146
  props: {
119
147
  propValuesStr: string;
120
148
  pageSpecificDataStr: string;
@@ -135,10 +163,13 @@ export declare class SettingsHelper {
135
163
  favicon: any;
136
164
  stockPreference: IkasThemeStockPreference;
137
165
  };
166
+ _nextI18Next: {
167
+ initialI18nStore: any;
168
+ initialLocale: string;
169
+ userConfig: import("next-i18next").UserConfig | null;
170
+ };
138
171
  };
139
- } | {
140
- props: {};
141
- notFound: boolean;
172
+ notFound?: undefined;
142
173
  revalidate?: undefined;
143
174
  } | {
144
175
  props: {
@@ -161,6 +192,11 @@ export declare class SettingsHelper {
161
192
  favicon: any;
162
193
  stockPreference: IkasThemeStockPreference;
163
194
  };
195
+ _nextI18Next: {
196
+ initialI18nStore: any;
197
+ initialLocale: string;
198
+ userConfig: import("next-i18next").UserConfig | null;
199
+ };
164
200
  };
165
201
  revalidate: number;
166
202
  notFound?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.161-alpha.2",
3
+ "version": "0.0.161-alpha.4",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",
@@ -19,6 +19,7 @@
19
19
  "mobx": "^6.1.3",
20
20
  "mobx-react-lite": "^3.1.5",
21
21
  "next": "10.0.6",
22
+ "next-i18next": "^8.5.5",
22
23
  "react": "17.0.1",
23
24
  "react-dom": "17.0.1"
24
25
  },
@@ -70,6 +71,7 @@
70
71
  "mobx": "^6.1.3",
71
72
  "mobx-react-lite": "^3.1.5",
72
73
  "next": "10.0.6",
74
+ "next-i18next": "^8.5.5",
73
75
  "node-sass": "^5.0.0",
74
76
  "postcss": "^8.2.4",
75
77
  "prettier": "^2.2.1",