@ikas/storefront 0.0.162-alpha.17 → 0.0.162-alpha.2

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.
@@ -35,19 +35,6 @@ export declare enum CartStatusEnum {
35
35
  ACTIVE = "ACTIVE",
36
36
  PASSIVE = "PASSIVE"
37
37
  }
38
- /**
39
- * CategoryProductsOrder Types
40
- */
41
- export declare enum CategoryProductsOrderTypeEnum {
42
- BEST_SELLER = "BEST_SELLER",
43
- HIGHEST_DISCOUNT_RATIO = "HIGHEST_DISCOUNT_RATIO",
44
- HIGHEST_PRICE = "HIGHEST_PRICE",
45
- LOWEST_DISCOUNT_RATIO = "LOWEST_DISCOUNT_RATIO",
46
- LOWEST_PRICE = "LOWEST_PRICE",
47
- MANUALLY = "MANUALLY",
48
- NEWEST = "NEWEST",
49
- OLDEST = "OLDEST"
50
- }
51
38
  /**
52
39
  * Checkout Recovery Email Status Enum
53
40
  */
@@ -1,4 +1,4 @@
1
- import { StringFilterInput, PaginationInput, CategoryProductsOrderTypeEnum, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, PaginationInput, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listProductBrand_listProductBrand_data_metaData {
3
3
  __typename: "HTMLMetaData";
4
4
  slug: string;
@@ -13,7 +13,6 @@ export interface listProductBrand_listProductBrand_data {
13
13
  id: string;
14
14
  name: string;
15
15
  imageId: string | null;
16
- orderType: CategoryProductsOrderTypeEnum | null;
17
16
  metaData: listProductBrand_listProductBrand_data_metaData | null;
18
17
  }
19
18
  export interface listProductBrand_listProductBrand {
@@ -1,4 +1,4 @@
1
- import { StringFilterInput, PaginationInput, CategoryProductsOrderTypeEnum, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, PaginationInput, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listCategory_listCategory_data_metaData {
3
3
  __typename: "HTMLMetaData";
4
4
  slug: string;
@@ -17,7 +17,6 @@ export interface listCategory_listCategory_data {
17
17
  name: string;
18
18
  parentId: string | null;
19
19
  imageId: string | null;
20
- orderType: CategoryProductsOrderTypeEnum | null;
21
20
  metaData: listCategory_listCategory_data_metaData | null;
22
21
  categoryPath: string[] | null;
23
22
  }
package/build/index.es.js CHANGED
@@ -10917,7 +10917,6 @@ var IkasStorefrontConfig = /** @class */ (function () {
10917
10917
  IkasStorefrontConfig.routings = [];
10918
10918
  IkasStorefrontConfig.paymentGateways = [];
10919
10919
  IkasStorefrontConfig.translations = {};
10920
- IkasStorefrontConfig.isEditor = false;
10921
10920
  return IkasStorefrontConfig;
10922
10921
  }());
10923
10922
 
@@ -11002,14 +11001,12 @@ var IkasBrand = /** @class */ (function () {
11002
11001
  if (data === void 0) { data = {}; }
11003
11002
  this.metaData = null;
11004
11003
  this.image = null;
11005
- this.orderType = null;
11006
11004
  this.id = data.id || Date.now() + "";
11007
11005
  this.name = data.name || "";
11008
11006
  this.metaData = data.metaData
11009
11007
  ? new IkasHTMLMetaData(data.metaData)
11010
11008
  : undefined;
11011
11009
  this.image = data.image ? new IkasImage(data.image.id) : null;
11012
- this.orderType = data.orderType || null;
11013
11010
  makeAutoObservable(this);
11014
11011
  }
11015
11012
  Object.defineProperty(IkasBrand.prototype, "href", {
@@ -11030,7 +11027,6 @@ var IkasCategory = /** @class */ (function () {
11030
11027
  if (data === void 0) { data = {}; }
11031
11028
  this.metaData = null;
11032
11029
  this.image = null;
11033
- this.orderType = null;
11034
11030
  this.id = data.id || Date.now() + "";
11035
11031
  this.name = data.name || "";
11036
11032
  this.parentId = data.parentId || null;
@@ -11039,7 +11035,6 @@ var IkasCategory = /** @class */ (function () {
11039
11035
  : undefined;
11040
11036
  this.image = data.image ? new IkasImage(data.image.id) : null;
11041
11037
  this.path = data.path ? data.path.map(function (p) { return new IkasCategoryPath(p); }) : [];
11042
- this.orderType = data.orderType || null;
11043
11038
  makeAutoObservable(this);
11044
11039
  }
11045
11040
  Object.defineProperty(IkasCategory.prototype, "href", {
@@ -11106,18 +11101,7 @@ var IkasFilterCategory = /** @class */ (function () {
11106
11101
  return __assign(__assign({}, this), { isSelected: this._isSelected });
11107
11102
  };
11108
11103
  return IkasFilterCategory;
11109
- }());
11110
- var ModelOrder;
11111
- (function (ModelOrder) {
11112
- ModelOrder["BEST_SELLER"] = "BEST_SELLER";
11113
- ModelOrder["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
11114
- ModelOrder["HIGHEST_PRICE"] = "HIGHEST_PRICE";
11115
- ModelOrder["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
11116
- ModelOrder["LOWEST_PRICE"] = "LOWEST_PRICE";
11117
- ModelOrder["MANUALLY"] = "MANUALLY";
11118
- ModelOrder["NEWEST"] = "NEWEST";
11119
- ModelOrder["OLDEST"] = "OLDEST";
11120
- })(ModelOrder || (ModelOrder = {}));
11104
+ }());
11121
11105
 
11122
11106
  var IkasCheckoutSettings = /** @class */ (function () {
11123
11107
  function IkasCheckoutSettings(data) {
@@ -27440,20 +27424,6 @@ var CartStatusEnum;
27440
27424
  CartStatusEnum["ACTIVE"] = "ACTIVE";
27441
27425
  CartStatusEnum["PASSIVE"] = "PASSIVE";
27442
27426
  })(CartStatusEnum || (CartStatusEnum = {}));
27443
- /**
27444
- * CategoryProductsOrder Types
27445
- */
27446
- var CategoryProductsOrderTypeEnum;
27447
- (function (CategoryProductsOrderTypeEnum) {
27448
- CategoryProductsOrderTypeEnum["BEST_SELLER"] = "BEST_SELLER";
27449
- CategoryProductsOrderTypeEnum["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
27450
- CategoryProductsOrderTypeEnum["HIGHEST_PRICE"] = "HIGHEST_PRICE";
27451
- CategoryProductsOrderTypeEnum["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
27452
- CategoryProductsOrderTypeEnum["LOWEST_PRICE"] = "LOWEST_PRICE";
27453
- CategoryProductsOrderTypeEnum["MANUALLY"] = "MANUALLY";
27454
- CategoryProductsOrderTypeEnum["NEWEST"] = "NEWEST";
27455
- CategoryProductsOrderTypeEnum["OLDEST"] = "OLDEST";
27456
- })(CategoryProductsOrderTypeEnum || (CategoryProductsOrderTypeEnum = {}));
27457
27427
  /**
27458
27428
  * Checkout Recovery Email Status Enum
27459
27429
  */
@@ -27789,7 +27759,6 @@ var IkasProductList = /** @class */ (function () {
27789
27759
  this._minPage = null;
27790
27760
  this._filterBrandId = null;
27791
27761
  this._filterCategoryId = null;
27792
- this.pageSpecificData = null;
27793
27762
  this._recommendFor = null; // productId
27794
27763
  this._isLoading = false;
27795
27764
  this._fetchRequestTime = 0;
@@ -28080,10 +28049,8 @@ var IkasProductList = /** @class */ (function () {
28080
28049
  this._filterCategories = data.filterCategories
28081
28050
  ? data.filterCategories.map(function (c) { return new IkasFilterCategory(c); })
28082
28051
  : null;
28083
- this.pageSpecificData = data.pageSpecificData || null;
28084
28052
  this.router = router;
28085
28053
  makeAutoObservable(this);
28086
- this.setPageSpecificSort();
28087
28054
  if (this.isBrowser()) {
28088
28055
  this.restoreInfiniteScrollPage();
28089
28056
  if (location.search &&
@@ -28297,44 +28264,6 @@ var IkasProductList = /** @class */ (function () {
28297
28264
  enumerable: false,
28298
28265
  configurable: true
28299
28266
  });
28300
- Object.defineProperty(IkasProductList.prototype, "isFeaturedSortEnabled", {
28301
- get: function () {
28302
- var _a;
28303
- return (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) === ModelOrder.MANUALLY &&
28304
- [IkasProductListType.ALL, IkasProductListType.CATEGORY].includes(this._type));
28305
- },
28306
- enumerable: false,
28307
- configurable: true
28308
- });
28309
- IkasProductList.prototype.setPageSpecificSort = function () {
28310
- var _a;
28311
- if (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) &&
28312
- [IkasProductListType.ALL, IkasProductListType.CATEGORY].includes(this._type)) {
28313
- switch (this.pageSpecificData.orderType) {
28314
- case ModelOrder.HIGHEST_DISCOUNT_RATIO:
28315
- this._sort = IkasProductListSortType.DECRASING_DISCOUNT;
28316
- break;
28317
- case ModelOrder.LOWEST_DISCOUNT_RATIO:
28318
- this._sort = IkasProductListSortType.INCREASING_DISCOUNT;
28319
- break;
28320
- case ModelOrder.HIGHEST_PRICE:
28321
- this._sort = IkasProductListSortType.DECREASING_PRICE;
28322
- break;
28323
- case ModelOrder.LOWEST_PRICE:
28324
- this._sort = IkasProductListSortType.INCREASING_PRICE;
28325
- break;
28326
- case ModelOrder.NEWEST:
28327
- this._sort = IkasProductListSortType.LAST_ADDED;
28328
- break;
28329
- case ModelOrder.OLDEST:
28330
- this._sort = IkasProductListSortType.FIRST_ADDED;
28331
- break;
28332
- case ModelOrder.MANUALLY:
28333
- this._sort = IkasProductListSortType.FEATURED;
28334
- break;
28335
- }
28336
- }
28337
- };
28338
28267
  IkasProductList.prototype.getSortParams = function () {
28339
28268
  var direction = SortByDirectionEnum.DESC;
28340
28269
  var type = SortByTypeEnum.CREATED_AT;
@@ -28371,10 +28300,6 @@ var IkasProductList = /** @class */ (function () {
28371
28300
  direction = SortByDirectionEnum.DESC;
28372
28301
  type = SortByTypeEnum.DISCOUNT_RATIO;
28373
28302
  break;
28374
- case IkasProductListSortType.FEATURED:
28375
- direction = SortByDirectionEnum.ASC;
28376
- type = SortByTypeEnum.MANUAL_SORT;
28377
- break;
28378
28303
  }
28379
28304
  return {
28380
28305
  direction: direction,
@@ -28596,7 +28521,6 @@ var IkasProductList = /** @class */ (function () {
28596
28521
  filters: this.filters,
28597
28522
  recommendFor: this._recommendFor,
28598
28523
  productListPropValue: this._productListPropValue,
28599
- pageSpecificData: this.pageSpecificData,
28600
28524
  };
28601
28525
  };
28602
28526
  IkasProductList.prototype.restoreInfiniteScrollPage = function () {
@@ -28650,7 +28574,6 @@ var IkasProductListSortType;
28650
28574
  IkasProductListSortType["FIRST_ADDED"] = "FIRST_ADDED";
28651
28575
  IkasProductListSortType["INCREASING_DISCOUNT"] = "INCREASING_DISCOUNT";
28652
28576
  IkasProductListSortType["DECRASING_DISCOUNT"] = "DECRASING_DISCOUNT";
28653
- IkasProductListSortType["FEATURED"] = "FEATURED";
28654
28577
  })(IkasProductListSortType || (IkasProductListSortType = {}));
28655
28578
 
28656
28579
  /**
@@ -30716,12 +30639,6 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
30716
30639
  filterBrandId: filterBrandId,
30717
30640
  filterCategoryId: filterCategoryId,
30718
30641
  pageType: this.pageType,
30719
- pageSpecificData: [
30720
- IkasThemePageType.CATEGORY,
30721
- IkasThemePageType.BRAND,
30722
- ].includes(this.pageType)
30723
- ? this.pageSpecificData
30724
- : undefined,
30725
30642
  });
30726
30643
  //@ts-ignore
30727
30644
  return [4 /*yield*/, productList.getInitial()];
@@ -33360,7 +33277,7 @@ function t(pathString, params) {
33360
33277
  }
33361
33278
  return pathString;
33362
33279
  }
33363
- function useTranslation(namespace) {
33280
+ function useTranslation() {
33364
33281
  return {
33365
33282
  t: t,
33366
33283
  };
@@ -33778,7 +33695,7 @@ var IkasBrandAPI = /** @class */ (function () {
33778
33695
  return __generator(this, function (_b) {
33779
33696
  switch (_b.label) {
33780
33697
  case 0:
33781
- LIST_QUERY = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
33698
+ LIST_QUERY = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
33782
33699
  _b.label = 1;
33783
33700
  case 1:
33784
33701
  _b.trys.push([1, 3, , 4]);
@@ -33817,7 +33734,6 @@ var IkasBrandAPI = /** @class */ (function () {
33817
33734
  name: b.name,
33818
33735
  metaData: b.metaData || undefined,
33819
33736
  image: b.imageId ? new IkasImage(b.imageId) : undefined,
33820
- orderType: b.orderType,
33821
33737
  });
33822
33738
  });
33823
33739
  return [2 /*return*/, {
@@ -33928,7 +33844,7 @@ var IkasCategoryAPI = /** @class */ (function () {
33928
33844
  return __generator(this, function (_b) {
33929
33845
  switch (_b.label) {
33930
33846
  case 0:
33931
- LIST_QUERY = src(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
33847
+ LIST_QUERY = src(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
33932
33848
  _b.label = 1;
33933
33849
  case 1:
33934
33850
  _b.trys.push([1, 10, , 11]);
@@ -33967,7 +33883,6 @@ var IkasCategoryAPI = /** @class */ (function () {
33967
33883
  parentId: c.parentId,
33968
33884
  metaData: c.metaData || undefined,
33969
33885
  image: c.imageId ? new IkasImage(c.imageId) : undefined,
33970
- orderType: c.orderType,
33971
33886
  });
33972
33887
  });
33973
33888
  _b.label = 3;
@@ -35495,8 +35410,7 @@ function simpleToProduct(simple) {
35495
35410
  stock: v.stocks
35496
35411
  .filter(function (s) {
35497
35412
  var _a;
35498
- return isLocal ||
35499
- IkasStorefrontConfig.isEditor || ((_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId));
35413
+ return isLocal || ((_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId));
35500
35414
  })
35501
35415
  .reduce(function (total, current) { return current.stockCount + total; }, 0) || 0,
35502
35416
  variantValues: (_d = v.variantValues) === null || _d === void 0 ? void 0 : _d.map(function (vv) {
@@ -37471,91 +37385,6 @@ var style = {
37471
37385
  backgroundColor: "rgba(255, 0, 0, 0.5)",
37472
37386
  };
37473
37387
 
37474
- var IkasStorefrontLocalization = /** @class */ (function () {
37475
- function IkasStorefrontLocalization(data) {
37476
- this.id = data.id || "";
37477
- this.isDefault = data.isDefault || false;
37478
- this.locale = data.locale || "";
37479
- this.name = data.name || "";
37480
- }
37481
- return IkasStorefrontLocalization;
37482
- }());
37483
-
37484
- var IkasStorefrontDomain = /** @class */ (function () {
37485
- function IkasStorefrontDomain(data) {
37486
- if (data === void 0) { data = {}; }
37487
- this.id = data.id || "";
37488
- this.merchantDomainId = data.merchantDomainId || "";
37489
- this.name = data.name || "";
37490
- this.redirectDomainName = data.redirectDomainName || null;
37491
- this.isDefault = data.isDefault || false;
37492
- makeAutoObservable(this);
37493
- }
37494
- return IkasStorefrontDomain;
37495
- }());
37496
-
37497
- var IkasStorefrontRouting = /** @class */ (function () {
37498
- function IkasStorefrontRouting(data) {
37499
- this.id = data.id || "";
37500
- this.countryCodes = data.countryCodes || null;
37501
- this.domain = data.domain || null;
37502
- this.locale = data.locale || "";
37503
- this.path = data.path || null;
37504
- this.priceListId = data.priceListId || null;
37505
- }
37506
- return IkasStorefrontRouting;
37507
- }());
37508
-
37509
- var IkasStorefrontThemeStatus;
37510
- (function (IkasStorefrontThemeStatus) {
37511
- IkasStorefrontThemeStatus["WAITING"] = "WAITING";
37512
- IkasStorefrontThemeStatus["READY"] = "READY";
37513
- })(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
37514
- var IkasStorefrontTheme = /** @class */ (function () {
37515
- function IkasStorefrontTheme(data) {
37516
- this.id = data.id || "";
37517
- this.isMainTheme = data.isMainTheme || false;
37518
- this.name = data.name || "";
37519
- this.status = data.status || IkasStorefrontThemeStatus.WAITING;
37520
- this.themeId = data.themeId || "";
37521
- this.themeVersionId = data.themeVersionId || "";
37522
- }
37523
- return IkasStorefrontTheme;
37524
- }());
37525
-
37526
- var StorefrontStatus;
37527
- (function (StorefrontStatus) {
37528
- StorefrontStatus["WAITING"] = "WAITING";
37529
- StorefrontStatus["READY"] = "READY";
37530
- })(StorefrontStatus || (StorefrontStatus = {}));
37531
- var IkasStorefront = /** @class */ (function () {
37532
- function IkasStorefront(data) {
37533
- if (data === void 0) { data = {}; }
37534
- this.id = data.id || "";
37535
- this.name = data.name || "";
37536
- this.status = data.status || StorefrontStatus.WAITING;
37537
- this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
37538
- this.emailSettingsId = data.emailSettingsId || null;
37539
- this.salesChannelId = data.salesChannelId || null;
37540
- this.gtmId = data.gtmId || null;
37541
- this.fbpId = data.fbpId || null;
37542
- // Sub Models
37543
- this.localizations = data.localizations
37544
- ? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
37545
- : [];
37546
- this.routings = data.routings
37547
- ? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
37548
- : [];
37549
- this.domains = data.domains
37550
- ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
37551
- : [];
37552
- this.themes = data.themes
37553
- ? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
37554
- : [];
37555
- }
37556
- return IkasStorefront;
37557
- }());
37558
-
37559
37388
  var PACKAGE_VERSION = "0.0.161";
37560
37389
  var PageViewModel = /** @class */ (function () {
37561
37390
  function PageViewModel(router) {
@@ -37712,8 +37541,6 @@ var PageViewModel = /** @class */ (function () {
37712
37541
  };
37713
37542
  // Message Handlers
37714
37543
  this.handleUpdateFrameData = function (data) { return __awaiter(_this, void 0, void 0, function () {
37715
- var storefront, _storefront, routing;
37716
- var _this = this;
37717
37544
  return __generator(this, function (_a) {
37718
37545
  switch (_a.label) {
37719
37546
  case 0:
@@ -37724,26 +37551,9 @@ var PageViewModel = /** @class */ (function () {
37724
37551
  this.apiKey = data.apiKey;
37725
37552
  this.locale = data.locale || "en";
37726
37553
  this.translations = data.translations || undefined;
37727
- storefront = data.storefront;
37728
- if (storefront) {
37729
- _storefront = new IkasStorefront(storefront);
37730
- routing = _storefront.routings.find(function (sr) { return sr.locale === _this.locale; });
37731
- IkasStorefrontConfig.storefrontId = _storefront.id;
37732
- IkasStorefrontConfig.storefrontRoutingId = routing === null || routing === void 0 ? void 0 : routing.id;
37733
- if (_storefront.mainStorefrontThemeId)
37734
- IkasStorefrontConfig.storefrontThemeId =
37735
- _storefront.mainStorefrontThemeId;
37736
- if (_storefront.salesChannelId)
37737
- IkasStorefrontConfig.salesChannelId = _storefront.salesChannelId;
37738
- if (routing === null || routing === void 0 ? void 0 : routing.priceListId)
37739
- IkasStorefrontConfig.priceListId = routing.priceListId;
37740
- IkasStorefrontConfig.routings = _storefront.routings;
37741
- IkasStorefrontConfig.stockPreference = this.theme.settings.stockPreference;
37742
- }
37743
37554
  // Production editor mode
37744
37555
  if (this.translations)
37745
37556
  IkasStorefrontConfig.translations = this.translations;
37746
- IkasStorefrontConfig.isEditor = true;
37747
37557
  apollo.createApolloClient(this.apiKey || undefined);
37748
37558
  window.editorApiKey = data.apiKey;
37749
37559
  return [4 /*yield*/, this.getPagePropValues()];
@@ -38067,6 +37877,91 @@ var index = /*#__PURE__*/Object.freeze({
38067
37877
  Image: Image
38068
37878
  });
38069
37879
 
37880
+ var IkasStorefrontLocalization = /** @class */ (function () {
37881
+ function IkasStorefrontLocalization(data) {
37882
+ this.id = data.id || "";
37883
+ this.isDefault = data.isDefault || false;
37884
+ this.locale = data.locale || "";
37885
+ this.name = data.name || "";
37886
+ }
37887
+ return IkasStorefrontLocalization;
37888
+ }());
37889
+
37890
+ var IkasStorefrontDomain = /** @class */ (function () {
37891
+ function IkasStorefrontDomain(data) {
37892
+ if (data === void 0) { data = {}; }
37893
+ this.id = data.id || "";
37894
+ this.merchantDomainId = data.merchantDomainId || "";
37895
+ this.name = data.name || "";
37896
+ this.redirectDomainName = data.redirectDomainName || null;
37897
+ this.isDefault = data.isDefault || false;
37898
+ makeAutoObservable(this);
37899
+ }
37900
+ return IkasStorefrontDomain;
37901
+ }());
37902
+
37903
+ var IkasStorefrontRouting = /** @class */ (function () {
37904
+ function IkasStorefrontRouting(data) {
37905
+ this.id = data.id || "";
37906
+ this.countryCodes = data.countryCodes || null;
37907
+ this.domain = data.domain || null;
37908
+ this.locale = data.locale || "";
37909
+ this.path = data.path || null;
37910
+ this.priceListId = data.priceListId || null;
37911
+ }
37912
+ return IkasStorefrontRouting;
37913
+ }());
37914
+
37915
+ var IkasStorefrontThemeStatus;
37916
+ (function (IkasStorefrontThemeStatus) {
37917
+ IkasStorefrontThemeStatus["WAITING"] = "WAITING";
37918
+ IkasStorefrontThemeStatus["READY"] = "READY";
37919
+ })(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
37920
+ var IkasStorefrontTheme = /** @class */ (function () {
37921
+ function IkasStorefrontTheme(data) {
37922
+ this.id = data.id || "";
37923
+ this.isMainTheme = data.isMainTheme || false;
37924
+ this.name = data.name || "";
37925
+ this.status = data.status || IkasStorefrontThemeStatus.WAITING;
37926
+ this.themeId = data.themeId || "";
37927
+ this.themeVersionId = data.themeVersionId || "";
37928
+ }
37929
+ return IkasStorefrontTheme;
37930
+ }());
37931
+
37932
+ var StorefrontStatus;
37933
+ (function (StorefrontStatus) {
37934
+ StorefrontStatus["WAITING"] = "WAITING";
37935
+ StorefrontStatus["READY"] = "READY";
37936
+ })(StorefrontStatus || (StorefrontStatus = {}));
37937
+ var IkasStorefront = /** @class */ (function () {
37938
+ function IkasStorefront(data) {
37939
+ if (data === void 0) { data = {}; }
37940
+ this.id = data.id || "";
37941
+ this.name = data.name || "";
37942
+ this.status = data.status || StorefrontStatus.WAITING;
37943
+ this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
37944
+ this.emailSettingsId = data.emailSettingsId || null;
37945
+ this.salesChannelId = data.salesChannelId || null;
37946
+ this.gtmId = data.gtmId || null;
37947
+ this.fbpId = data.fbpId || null;
37948
+ // Sub Models
37949
+ this.localizations = data.localizations
37950
+ ? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
37951
+ : [];
37952
+ this.routings = data.routings
37953
+ ? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
37954
+ : [];
37955
+ this.domains = data.domains
37956
+ ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
37957
+ : [];
37958
+ this.themes = data.themes
37959
+ ? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
37960
+ : [];
37961
+ }
37962
+ return IkasStorefront;
37963
+ }());
37964
+
38070
37965
  var IkasSalesChannel = /** @class */ (function () {
38071
37966
  function IkasSalesChannel(data) {
38072
37967
  if (data === void 0) { data = {}; }
@@ -38271,14 +38166,11 @@ var SettingsHelper = /** @class */ (function () {
38271
38166
  SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes, isEditor) {
38272
38167
  var _a;
38273
38168
  return __awaiter(this, void 0, void 0, function () {
38274
- var isLocal, isProdEditor, serverRuntimeConfig, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds_1, components, componentDirs, nextI18nConf, currentLocale, i18nReader, translations;
38169
+ var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, isProdEditor, componentIds_1, components, componentDirs, nextI18nConf, currentLocale, i18nReader, translations;
38275
38170
  return __generator(this, function (_b) {
38276
38171
  switch (_b.label) {
38277
38172
  case 0:
38278
38173
  isLocal = process.env.NEXT_PUBLIC_ENV === "local";
38279
- isProdEditor = !isLocal && isEditor;
38280
- serverRuntimeConfig = getConfig().serverRuntimeConfig;
38281
- if (!!isProdEditor) return [3 /*break*/, 5];
38282
38174
  locale = context.locale;
38283
38175
  if (!locale) {
38284
38176
  return [2 /*return*/, {
@@ -38286,6 +38178,7 @@ var SettingsHelper = /** @class */ (function () {
38286
38178
  notFound: true,
38287
38179
  }];
38288
38180
  }
38181
+ serverRuntimeConfig = getConfig().serverRuntimeConfig;
38289
38182
  return [4 /*yield*/, SettingsHelper.getSettings(locale)];
38290
38183
  case 1:
38291
38184
  settings = _b.sent();
@@ -38316,14 +38209,17 @@ var SettingsHelper = /** @class */ (function () {
38316
38209
  return [4 /*yield*/, provider.getPageData()];
38317
38210
  case 2:
38318
38211
  _b.sent();
38319
- if (!provider.page) {
38320
- return [2 /*return*/, {
38321
- props: {},
38322
- notFound: true,
38323
- }];
38324
- }
38325
38212
  _b.label = 3;
38326
38213
  case 3:
38214
+ if (!provider.page) {
38215
+ if (!isEditor)
38216
+ return [2 /*return*/, {
38217
+ props: {},
38218
+ notFound: true,
38219
+ }];
38220
+ }
38221
+ isProdEditor = !isLocal && isEditor;
38222
+ if (!!isProdEditor) return [3 /*break*/, 5];
38327
38223
  componentIds_1 = isEditor
38328
38224
  ? provider.theme.components.map(function (c) { return c.id; })
38329
38225
  : provider.page.components.map(function (pc) { return pc.componentId; });
@@ -38336,6 +38232,8 @@ var SettingsHelper = /** @class */ (function () {
38336
38232
  case 4:
38337
38233
  translations = _b.sent();
38338
38234
  IkasStorefrontConfig.translations = translations;
38235
+ _b.label = 5;
38236
+ case 5:
38339
38237
  if (isServer)
38340
38238
  return [2 /*return*/, {
38341
38239
  props: provider.nextPageData.props,
@@ -38345,10 +38243,6 @@ var SettingsHelper = /** @class */ (function () {
38345
38243
  props: provider.nextPageData.props,
38346
38244
  revalidate: 60,
38347
38245
  }];
38348
- case 5: return [2 /*return*/, {
38349
- props: {},
38350
- }];
38351
- case 6: return [2 /*return*/];
38352
38246
  }
38353
38247
  });
38354
38248
  });
@@ -38434,26 +38328,27 @@ var Page$1 = function (_a) {
38434
38328
  };
38435
38329
  var index$1 = observer(Page$1);
38436
38330
  var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
38331
+ var targetTypes, metaData;
38437
38332
  return __generator(this, function (_a) {
38438
- // const targetTypes = [
38439
- // IkasHTMLMetaDataTargetType.BRAND,
38440
- // IkasHTMLMetaDataTargetType.CATEGORY,
38441
- // ];
38442
- // const metaData = await IkasHTMLMetaDataAPI.listHTMLMetaData(
38443
- // undefined,
38444
- // undefined,
38445
- // targetTypes
38446
- // );
38447
- // metaData.map((m) => ({
38448
- // params: {
38449
- // slug: m.slug,
38450
- // originalSlug: m.slug,
38451
- // },
38452
- // }))
38453
- return [2 /*return*/, {
38454
- paths: [],
38455
- fallback: "blocking",
38456
- }];
38333
+ switch (_a.label) {
38334
+ case 0:
38335
+ targetTypes = [
38336
+ IkasHTMLMetaDataTargetType.BRAND,
38337
+ IkasHTMLMetaDataTargetType.CATEGORY,
38338
+ ];
38339
+ return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, undefined, targetTypes)];
38340
+ case 1:
38341
+ metaData = _a.sent();
38342
+ return [2 /*return*/, {
38343
+ paths: metaData.map(function (m) { return ({
38344
+ params: {
38345
+ slug: m.slug,
38346
+ originalSlug: m.slug,
38347
+ },
38348
+ }); }),
38349
+ fallback: "blocking",
38350
+ }];
38351
+ }
38457
38352
  });
38458
38353
  }); };
38459
38354
  var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -38886,11 +38781,7 @@ var cart = /*#__PURE__*/Object.freeze({
38886
38781
  });
38887
38782
 
38888
38783
  var IkasPageEditor$1 = dynamic(function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
38889
- var Page$c = function (_a) {
38890
- var configJson = _a.configJson;
38891
- if (configJson) {
38892
- IkasStorefrontConfig.initWithJson(configJson);
38893
- }
38784
+ var Page$c = function () {
38894
38785
  return createElement(IkasPageEditor$1, null);
38895
38786
  };
38896
38787
  var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {