@ikas/storefront 0.0.162-alpha.5 → 0.0.162-alpha.7

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,6 +35,19 @@ 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
+ }
38
51
  /**
39
52
  * Checkout Recovery Email Status Enum
40
53
  */
@@ -1,4 +1,4 @@
1
- import { StringFilterInput, PaginationInput, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, PaginationInput, CategoryProductsOrderTypeEnum, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listProductBrand_listProductBrand_data_metaData {
3
3
  __typename: "HTMLMetaData";
4
4
  slug: string;
@@ -13,6 +13,7 @@ export interface listProductBrand_listProductBrand_data {
13
13
  id: string;
14
14
  name: string;
15
15
  imageId: string | null;
16
+ orderType: CategoryProductsOrderTypeEnum | null;
16
17
  metaData: listProductBrand_listProductBrand_data_metaData | null;
17
18
  }
18
19
  export interface listProductBrand_listProductBrand {
@@ -1,4 +1,4 @@
1
- import { StringFilterInput, PaginationInput, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, PaginationInput, CategoryProductsOrderTypeEnum, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listCategory_listCategory_data_metaData {
3
3
  __typename: "HTMLMetaData";
4
4
  slug: string;
@@ -17,6 +17,7 @@ export interface listCategory_listCategory_data {
17
17
  name: string;
18
18
  parentId: string | null;
19
19
  imageId: string | null;
20
+ orderType: CategoryProductsOrderTypeEnum | null;
20
21
  metaData: listCategory_listCategory_data_metaData | null;
21
22
  categoryPath: string[] | null;
22
23
  }
package/build/index.es.js CHANGED
@@ -11001,12 +11001,14 @@ var IkasBrand = /** @class */ (function () {
11001
11001
  if (data === void 0) { data = {}; }
11002
11002
  this.metaData = null;
11003
11003
  this.image = null;
11004
+ this.orderType = null;
11004
11005
  this.id = data.id || Date.now() + "";
11005
11006
  this.name = data.name || "";
11006
11007
  this.metaData = data.metaData
11007
11008
  ? new IkasHTMLMetaData(data.metaData)
11008
11009
  : undefined;
11009
11010
  this.image = data.image ? new IkasImage(data.image.id) : null;
11011
+ this.orderType = data.orderType || null;
11010
11012
  makeAutoObservable(this);
11011
11013
  }
11012
11014
  Object.defineProperty(IkasBrand.prototype, "href", {
@@ -11027,6 +11029,7 @@ var IkasCategory = /** @class */ (function () {
11027
11029
  if (data === void 0) { data = {}; }
11028
11030
  this.metaData = null;
11029
11031
  this.image = null;
11032
+ this.orderType = null;
11030
11033
  this.id = data.id || Date.now() + "";
11031
11034
  this.name = data.name || "";
11032
11035
  this.parentId = data.parentId || null;
@@ -11035,6 +11038,7 @@ var IkasCategory = /** @class */ (function () {
11035
11038
  : undefined;
11036
11039
  this.image = data.image ? new IkasImage(data.image.id) : null;
11037
11040
  this.path = data.path ? data.path.map(function (p) { return new IkasCategoryPath(p); }) : [];
11041
+ this.orderType = data.orderType || null;
11038
11042
  makeAutoObservable(this);
11039
11043
  }
11040
11044
  Object.defineProperty(IkasCategory.prototype, "href", {
@@ -11101,7 +11105,18 @@ var IkasFilterCategory = /** @class */ (function () {
11101
11105
  return __assign(__assign({}, this), { isSelected: this._isSelected });
11102
11106
  };
11103
11107
  return IkasFilterCategory;
11104
- }());
11108
+ }());
11109
+ var ModelOrder;
11110
+ (function (ModelOrder) {
11111
+ ModelOrder["BEST_SELLER"] = "BEST_SELLER";
11112
+ ModelOrder["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
11113
+ ModelOrder["HIGHEST_PRICE"] = "HIGHEST_PRICE";
11114
+ ModelOrder["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
11115
+ ModelOrder["LOWEST_PRICE"] = "LOWEST_PRICE";
11116
+ ModelOrder["MANUALLY"] = "MANUALLY";
11117
+ ModelOrder["NEWEST"] = "NEWEST";
11118
+ ModelOrder["OLDEST"] = "OLDEST";
11119
+ })(ModelOrder || (ModelOrder = {}));
11105
11120
 
11106
11121
  var IkasCheckoutSettings = /** @class */ (function () {
11107
11122
  function IkasCheckoutSettings(data) {
@@ -27424,6 +27439,20 @@ var CartStatusEnum;
27424
27439
  CartStatusEnum["ACTIVE"] = "ACTIVE";
27425
27440
  CartStatusEnum["PASSIVE"] = "PASSIVE";
27426
27441
  })(CartStatusEnum || (CartStatusEnum = {}));
27442
+ /**
27443
+ * CategoryProductsOrder Types
27444
+ */
27445
+ var CategoryProductsOrderTypeEnum;
27446
+ (function (CategoryProductsOrderTypeEnum) {
27447
+ CategoryProductsOrderTypeEnum["BEST_SELLER"] = "BEST_SELLER";
27448
+ CategoryProductsOrderTypeEnum["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
27449
+ CategoryProductsOrderTypeEnum["HIGHEST_PRICE"] = "HIGHEST_PRICE";
27450
+ CategoryProductsOrderTypeEnum["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
27451
+ CategoryProductsOrderTypeEnum["LOWEST_PRICE"] = "LOWEST_PRICE";
27452
+ CategoryProductsOrderTypeEnum["MANUALLY"] = "MANUALLY";
27453
+ CategoryProductsOrderTypeEnum["NEWEST"] = "NEWEST";
27454
+ CategoryProductsOrderTypeEnum["OLDEST"] = "OLDEST";
27455
+ })(CategoryProductsOrderTypeEnum || (CategoryProductsOrderTypeEnum = {}));
27427
27456
  /**
27428
27457
  * Checkout Recovery Email Status Enum
27429
27458
  */
@@ -27759,6 +27788,7 @@ var IkasProductList = /** @class */ (function () {
27759
27788
  this._minPage = null;
27760
27789
  this._filterBrandId = null;
27761
27790
  this._filterCategoryId = null;
27791
+ this.pageSpecificData = null;
27762
27792
  this._recommendFor = null; // productId
27763
27793
  this._isLoading = false;
27764
27794
  this._fetchRequestTime = 0;
@@ -28049,8 +28079,10 @@ var IkasProductList = /** @class */ (function () {
28049
28079
  this._filterCategories = data.filterCategories
28050
28080
  ? data.filterCategories.map(function (c) { return new IkasFilterCategory(c); })
28051
28081
  : null;
28082
+ this.pageSpecificData = data.pageSpecificData || null;
28052
28083
  this.router = router;
28053
28084
  makeAutoObservable(this);
28085
+ this.setPageSpecificSort();
28054
28086
  if (this.isBrowser()) {
28055
28087
  this.restoreInfiniteScrollPage();
28056
28088
  if (location.search &&
@@ -28264,6 +28296,44 @@ var IkasProductList = /** @class */ (function () {
28264
28296
  enumerable: false,
28265
28297
  configurable: true
28266
28298
  });
28299
+ Object.defineProperty(IkasProductList.prototype, "isFeaturedSortEnabled", {
28300
+ get: function () {
28301
+ var _a;
28302
+ return (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) === ModelOrder.MANUALLY &&
28303
+ [IkasProductListType.ALL, IkasProductListType.CATEGORY].includes(this._type));
28304
+ },
28305
+ enumerable: false,
28306
+ configurable: true
28307
+ });
28308
+ IkasProductList.prototype.setPageSpecificSort = function () {
28309
+ var _a;
28310
+ if (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) &&
28311
+ [IkasProductListType.ALL, IkasProductListType.CATEGORY].includes(this._type)) {
28312
+ switch (this.pageSpecificData.orderType) {
28313
+ case ModelOrder.HIGHEST_DISCOUNT_RATIO:
28314
+ this._sort = IkasProductListSortType.DECRASING_DISCOUNT;
28315
+ break;
28316
+ case ModelOrder.LOWEST_DISCOUNT_RATIO:
28317
+ this._sort = IkasProductListSortType.INCREASING_DISCOUNT;
28318
+ break;
28319
+ case ModelOrder.HIGHEST_PRICE:
28320
+ this._sort = IkasProductListSortType.DECREASING_PRICE;
28321
+ break;
28322
+ case ModelOrder.LOWEST_PRICE:
28323
+ this._sort = IkasProductListSortType.INCREASING_PRICE;
28324
+ break;
28325
+ case ModelOrder.NEWEST:
28326
+ this._sort = IkasProductListSortType.LAST_ADDED;
28327
+ break;
28328
+ case ModelOrder.OLDEST:
28329
+ this._sort = IkasProductListSortType.FIRST_ADDED;
28330
+ break;
28331
+ case ModelOrder.MANUALLY:
28332
+ this._sort = IkasProductListSortType.FEATURED;
28333
+ break;
28334
+ }
28335
+ }
28336
+ };
28267
28337
  IkasProductList.prototype.getSortParams = function () {
28268
28338
  var direction = SortByDirectionEnum.DESC;
28269
28339
  var type = SortByTypeEnum.CREATED_AT;
@@ -28300,6 +28370,10 @@ var IkasProductList = /** @class */ (function () {
28300
28370
  direction = SortByDirectionEnum.DESC;
28301
28371
  type = SortByTypeEnum.DISCOUNT_RATIO;
28302
28372
  break;
28373
+ case IkasProductListSortType.FEATURED:
28374
+ direction = SortByDirectionEnum.ASC;
28375
+ type = SortByTypeEnum.MANUAL_SORT;
28376
+ break;
28303
28377
  }
28304
28378
  return {
28305
28379
  direction: direction,
@@ -28521,6 +28595,7 @@ var IkasProductList = /** @class */ (function () {
28521
28595
  filters: this.filters,
28522
28596
  recommendFor: this._recommendFor,
28523
28597
  productListPropValue: this._productListPropValue,
28598
+ pageSpecificData: this.pageSpecificData,
28524
28599
  };
28525
28600
  };
28526
28601
  IkasProductList.prototype.restoreInfiniteScrollPage = function () {
@@ -28574,6 +28649,7 @@ var IkasProductListSortType;
28574
28649
  IkasProductListSortType["FIRST_ADDED"] = "FIRST_ADDED";
28575
28650
  IkasProductListSortType["INCREASING_DISCOUNT"] = "INCREASING_DISCOUNT";
28576
28651
  IkasProductListSortType["DECRASING_DISCOUNT"] = "DECRASING_DISCOUNT";
28652
+ IkasProductListSortType["FEATURED"] = "FEATURED";
28577
28653
  })(IkasProductListSortType || (IkasProductListSortType = {}));
28578
28654
 
28579
28655
  /**
@@ -30639,6 +30715,12 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
30639
30715
  filterBrandId: filterBrandId,
30640
30716
  filterCategoryId: filterCategoryId,
30641
30717
  pageType: this.pageType,
30718
+ pageSpecificData: [
30719
+ IkasThemePageType.CATEGORY,
30720
+ IkasThemePageType.BRAND,
30721
+ ].includes(this.pageType)
30722
+ ? this.pageSpecificData
30723
+ : undefined,
30642
30724
  });
30643
30725
  //@ts-ignore
30644
30726
  return [4 /*yield*/, productList.getInitial()];
@@ -33695,7 +33777,7 @@ var IkasBrandAPI = /** @class */ (function () {
33695
33777
  return __generator(this, function (_b) {
33696
33778
  switch (_b.label) {
33697
33779
  case 0:
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 "])));
33780
+ 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 "])));
33699
33781
  _b.label = 1;
33700
33782
  case 1:
33701
33783
  _b.trys.push([1, 3, , 4]);
@@ -33734,6 +33816,7 @@ var IkasBrandAPI = /** @class */ (function () {
33734
33816
  name: b.name,
33735
33817
  metaData: b.metaData || undefined,
33736
33818
  image: b.imageId ? new IkasImage(b.imageId) : undefined,
33819
+ orderType: b.orderType,
33737
33820
  });
33738
33821
  });
33739
33822
  return [2 /*return*/, {
@@ -33844,7 +33927,7 @@ var IkasCategoryAPI = /** @class */ (function () {
33844
33927
  return __generator(this, function (_b) {
33845
33928
  switch (_b.label) {
33846
33929
  case 0:
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 "])));
33930
+ 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 "])));
33848
33931
  _b.label = 1;
33849
33932
  case 1:
33850
33933
  _b.trys.push([1, 10, , 11]);
@@ -33883,6 +33966,7 @@ var IkasCategoryAPI = /** @class */ (function () {
33883
33966
  parentId: c.parentId,
33884
33967
  metaData: c.metaData || undefined,
33885
33968
  image: c.imageId ? new IkasImage(c.imageId) : undefined,
33969
+ orderType: c.orderType,
33886
33970
  });
33887
33971
  });
33888
33972
  _b.label = 3;
@@ -37385,6 +37469,91 @@ var style = {
37385
37469
  backgroundColor: "rgba(255, 0, 0, 0.5)",
37386
37470
  };
37387
37471
 
37472
+ var IkasStorefrontLocalization = /** @class */ (function () {
37473
+ function IkasStorefrontLocalization(data) {
37474
+ this.id = data.id || "";
37475
+ this.isDefault = data.isDefault || false;
37476
+ this.locale = data.locale || "";
37477
+ this.name = data.name || "";
37478
+ }
37479
+ return IkasStorefrontLocalization;
37480
+ }());
37481
+
37482
+ var IkasStorefrontDomain = /** @class */ (function () {
37483
+ function IkasStorefrontDomain(data) {
37484
+ if (data === void 0) { data = {}; }
37485
+ this.id = data.id || "";
37486
+ this.merchantDomainId = data.merchantDomainId || "";
37487
+ this.name = data.name || "";
37488
+ this.redirectDomainName = data.redirectDomainName || null;
37489
+ this.isDefault = data.isDefault || false;
37490
+ makeAutoObservable(this);
37491
+ }
37492
+ return IkasStorefrontDomain;
37493
+ }());
37494
+
37495
+ var IkasStorefrontRouting = /** @class */ (function () {
37496
+ function IkasStorefrontRouting(data) {
37497
+ this.id = data.id || "";
37498
+ this.countryCodes = data.countryCodes || null;
37499
+ this.domain = data.domain || null;
37500
+ this.locale = data.locale || "";
37501
+ this.path = data.path || null;
37502
+ this.priceListId = data.priceListId || null;
37503
+ }
37504
+ return IkasStorefrontRouting;
37505
+ }());
37506
+
37507
+ var IkasStorefrontThemeStatus;
37508
+ (function (IkasStorefrontThemeStatus) {
37509
+ IkasStorefrontThemeStatus["WAITING"] = "WAITING";
37510
+ IkasStorefrontThemeStatus["READY"] = "READY";
37511
+ })(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
37512
+ var IkasStorefrontTheme = /** @class */ (function () {
37513
+ function IkasStorefrontTheme(data) {
37514
+ this.id = data.id || "";
37515
+ this.isMainTheme = data.isMainTheme || false;
37516
+ this.name = data.name || "";
37517
+ this.status = data.status || IkasStorefrontThemeStatus.WAITING;
37518
+ this.themeId = data.themeId || "";
37519
+ this.themeVersionId = data.themeVersionId || "";
37520
+ }
37521
+ return IkasStorefrontTheme;
37522
+ }());
37523
+
37524
+ var StorefrontStatus;
37525
+ (function (StorefrontStatus) {
37526
+ StorefrontStatus["WAITING"] = "WAITING";
37527
+ StorefrontStatus["READY"] = "READY";
37528
+ })(StorefrontStatus || (StorefrontStatus = {}));
37529
+ var IkasStorefront = /** @class */ (function () {
37530
+ function IkasStorefront(data) {
37531
+ if (data === void 0) { data = {}; }
37532
+ this.id = data.id || "";
37533
+ this.name = data.name || "";
37534
+ this.status = data.status || StorefrontStatus.WAITING;
37535
+ this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
37536
+ this.emailSettingsId = data.emailSettingsId || null;
37537
+ this.salesChannelId = data.salesChannelId || null;
37538
+ this.gtmId = data.gtmId || null;
37539
+ this.fbpId = data.fbpId || null;
37540
+ // Sub Models
37541
+ this.localizations = data.localizations
37542
+ ? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
37543
+ : [];
37544
+ this.routings = data.routings
37545
+ ? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
37546
+ : [];
37547
+ this.domains = data.domains
37548
+ ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
37549
+ : [];
37550
+ this.themes = data.themes
37551
+ ? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
37552
+ : [];
37553
+ }
37554
+ return IkasStorefront;
37555
+ }());
37556
+
37388
37557
  var PACKAGE_VERSION = "0.0.161";
37389
37558
  var PageViewModel = /** @class */ (function () {
37390
37559
  function PageViewModel(router) {
@@ -37541,6 +37710,8 @@ var PageViewModel = /** @class */ (function () {
37541
37710
  };
37542
37711
  // Message Handlers
37543
37712
  this.handleUpdateFrameData = function (data) { return __awaiter(_this, void 0, void 0, function () {
37713
+ var storefront, _storefront, routing;
37714
+ var _this = this;
37544
37715
  return __generator(this, function (_a) {
37545
37716
  switch (_a.label) {
37546
37717
  case 0:
@@ -37551,6 +37722,22 @@ var PageViewModel = /** @class */ (function () {
37551
37722
  this.apiKey = data.apiKey;
37552
37723
  this.locale = data.locale || "en";
37553
37724
  this.translations = data.translations || undefined;
37725
+ storefront = data.storefront;
37726
+ if (storefront) {
37727
+ _storefront = new IkasStorefront(storefront);
37728
+ routing = _storefront.routings.find(function (sr) { return sr.locale === _this.locale; });
37729
+ IkasStorefrontConfig.storefrontId = _storefront.id;
37730
+ IkasStorefrontConfig.storefrontRoutingId = routing === null || routing === void 0 ? void 0 : routing.id;
37731
+ if (_storefront.mainStorefrontThemeId)
37732
+ IkasStorefrontConfig.storefrontThemeId =
37733
+ _storefront.mainStorefrontThemeId;
37734
+ if (_storefront.salesChannelId)
37735
+ IkasStorefrontConfig.salesChannelId = _storefront.salesChannelId;
37736
+ if (routing === null || routing === void 0 ? void 0 : routing.priceListId)
37737
+ IkasStorefrontConfig.priceListId = routing.priceListId;
37738
+ IkasStorefrontConfig.routings = _storefront.routings;
37739
+ IkasStorefrontConfig.stockPreference = this.theme.settings.stockPreference;
37740
+ }
37554
37741
  // Production editor mode
37555
37742
  if (this.translations)
37556
37743
  IkasStorefrontConfig.translations = this.translations;
@@ -37877,91 +38064,6 @@ var index = /*#__PURE__*/Object.freeze({
37877
38064
  Image: Image
37878
38065
  });
37879
38066
 
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
-
37965
38067
  var IkasSalesChannel = /** @class */ (function () {
37966
38068
  function IkasSalesChannel(data) {
37967
38069
  if (data === void 0) { data = {}; }
package/build/index.js CHANGED
@@ -11016,12 +11016,14 @@ var IkasBrand = /** @class */ (function () {
11016
11016
  if (data === void 0) { data = {}; }
11017
11017
  this.metaData = null;
11018
11018
  this.image = null;
11019
+ this.orderType = null;
11019
11020
  this.id = data.id || Date.now() + "";
11020
11021
  this.name = data.name || "";
11021
11022
  this.metaData = data.metaData
11022
11023
  ? new IkasHTMLMetaData(data.metaData)
11023
11024
  : undefined;
11024
11025
  this.image = data.image ? new IkasImage(data.image.id) : null;
11026
+ this.orderType = data.orderType || null;
11025
11027
  mobx.makeAutoObservable(this);
11026
11028
  }
11027
11029
  Object.defineProperty(IkasBrand.prototype, "href", {
@@ -11042,6 +11044,7 @@ var IkasCategory = /** @class */ (function () {
11042
11044
  if (data === void 0) { data = {}; }
11043
11045
  this.metaData = null;
11044
11046
  this.image = null;
11047
+ this.orderType = null;
11045
11048
  this.id = data.id || Date.now() + "";
11046
11049
  this.name = data.name || "";
11047
11050
  this.parentId = data.parentId || null;
@@ -11050,6 +11053,7 @@ var IkasCategory = /** @class */ (function () {
11050
11053
  : undefined;
11051
11054
  this.image = data.image ? new IkasImage(data.image.id) : null;
11052
11055
  this.path = data.path ? data.path.map(function (p) { return new IkasCategoryPath(p); }) : [];
11056
+ this.orderType = data.orderType || null;
11053
11057
  mobx.makeAutoObservable(this);
11054
11058
  }
11055
11059
  Object.defineProperty(IkasCategory.prototype, "href", {
@@ -11116,7 +11120,18 @@ var IkasFilterCategory = /** @class */ (function () {
11116
11120
  return __assign(__assign({}, this), { isSelected: this._isSelected });
11117
11121
  };
11118
11122
  return IkasFilterCategory;
11119
- }());
11123
+ }());
11124
+ var ModelOrder;
11125
+ (function (ModelOrder) {
11126
+ ModelOrder["BEST_SELLER"] = "BEST_SELLER";
11127
+ ModelOrder["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
11128
+ ModelOrder["HIGHEST_PRICE"] = "HIGHEST_PRICE";
11129
+ ModelOrder["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
11130
+ ModelOrder["LOWEST_PRICE"] = "LOWEST_PRICE";
11131
+ ModelOrder["MANUALLY"] = "MANUALLY";
11132
+ ModelOrder["NEWEST"] = "NEWEST";
11133
+ ModelOrder["OLDEST"] = "OLDEST";
11134
+ })(ModelOrder || (ModelOrder = {}));
11120
11135
 
11121
11136
  var IkasCheckoutSettings = /** @class */ (function () {
11122
11137
  function IkasCheckoutSettings(data) {
@@ -27406,6 +27421,20 @@ var CartStatusEnum;
27406
27421
  CartStatusEnum["ACTIVE"] = "ACTIVE";
27407
27422
  CartStatusEnum["PASSIVE"] = "PASSIVE";
27408
27423
  })(CartStatusEnum || (CartStatusEnum = {}));
27424
+ /**
27425
+ * CategoryProductsOrder Types
27426
+ */
27427
+ var CategoryProductsOrderTypeEnum;
27428
+ (function (CategoryProductsOrderTypeEnum) {
27429
+ CategoryProductsOrderTypeEnum["BEST_SELLER"] = "BEST_SELLER";
27430
+ CategoryProductsOrderTypeEnum["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
27431
+ CategoryProductsOrderTypeEnum["HIGHEST_PRICE"] = "HIGHEST_PRICE";
27432
+ CategoryProductsOrderTypeEnum["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
27433
+ CategoryProductsOrderTypeEnum["LOWEST_PRICE"] = "LOWEST_PRICE";
27434
+ CategoryProductsOrderTypeEnum["MANUALLY"] = "MANUALLY";
27435
+ CategoryProductsOrderTypeEnum["NEWEST"] = "NEWEST";
27436
+ CategoryProductsOrderTypeEnum["OLDEST"] = "OLDEST";
27437
+ })(CategoryProductsOrderTypeEnum || (CategoryProductsOrderTypeEnum = {}));
27409
27438
  /**
27410
27439
  * Checkout Recovery Email Status Enum
27411
27440
  */
@@ -27741,6 +27770,7 @@ var IkasProductList = /** @class */ (function () {
27741
27770
  this._minPage = null;
27742
27771
  this._filterBrandId = null;
27743
27772
  this._filterCategoryId = null;
27773
+ this.pageSpecificData = null;
27744
27774
  this._recommendFor = null; // productId
27745
27775
  this._isLoading = false;
27746
27776
  this._fetchRequestTime = 0;
@@ -28031,8 +28061,10 @@ var IkasProductList = /** @class */ (function () {
28031
28061
  this._filterCategories = data.filterCategories
28032
28062
  ? data.filterCategories.map(function (c) { return new IkasFilterCategory(c); })
28033
28063
  : null;
28064
+ this.pageSpecificData = data.pageSpecificData || null;
28034
28065
  this.router = router;
28035
28066
  mobx.makeAutoObservable(this);
28067
+ this.setPageSpecificSort();
28036
28068
  if (this.isBrowser()) {
28037
28069
  this.restoreInfiniteScrollPage();
28038
28070
  if (location.search &&
@@ -28246,6 +28278,44 @@ var IkasProductList = /** @class */ (function () {
28246
28278
  enumerable: false,
28247
28279
  configurable: true
28248
28280
  });
28281
+ Object.defineProperty(IkasProductList.prototype, "isFeaturedSortEnabled", {
28282
+ get: function () {
28283
+ var _a;
28284
+ return (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) === ModelOrder.MANUALLY &&
28285
+ [exports.IkasProductListType.ALL, exports.IkasProductListType.CATEGORY].includes(this._type));
28286
+ },
28287
+ enumerable: false,
28288
+ configurable: true
28289
+ });
28290
+ IkasProductList.prototype.setPageSpecificSort = function () {
28291
+ var _a;
28292
+ if (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) &&
28293
+ [exports.IkasProductListType.ALL, exports.IkasProductListType.CATEGORY].includes(this._type)) {
28294
+ switch (this.pageSpecificData.orderType) {
28295
+ case ModelOrder.HIGHEST_DISCOUNT_RATIO:
28296
+ this._sort = exports.IkasProductListSortType.DECRASING_DISCOUNT;
28297
+ break;
28298
+ case ModelOrder.LOWEST_DISCOUNT_RATIO:
28299
+ this._sort = exports.IkasProductListSortType.INCREASING_DISCOUNT;
28300
+ break;
28301
+ case ModelOrder.HIGHEST_PRICE:
28302
+ this._sort = exports.IkasProductListSortType.DECREASING_PRICE;
28303
+ break;
28304
+ case ModelOrder.LOWEST_PRICE:
28305
+ this._sort = exports.IkasProductListSortType.INCREASING_PRICE;
28306
+ break;
28307
+ case ModelOrder.NEWEST:
28308
+ this._sort = exports.IkasProductListSortType.LAST_ADDED;
28309
+ break;
28310
+ case ModelOrder.OLDEST:
28311
+ this._sort = exports.IkasProductListSortType.FIRST_ADDED;
28312
+ break;
28313
+ case ModelOrder.MANUALLY:
28314
+ this._sort = exports.IkasProductListSortType.FEATURED;
28315
+ break;
28316
+ }
28317
+ }
28318
+ };
28249
28319
  IkasProductList.prototype.getSortParams = function () {
28250
28320
  var direction = SortByDirectionEnum.DESC;
28251
28321
  var type = SortByTypeEnum.CREATED_AT;
@@ -28282,6 +28352,10 @@ var IkasProductList = /** @class */ (function () {
28282
28352
  direction = SortByDirectionEnum.DESC;
28283
28353
  type = SortByTypeEnum.DISCOUNT_RATIO;
28284
28354
  break;
28355
+ case exports.IkasProductListSortType.FEATURED:
28356
+ direction = SortByDirectionEnum.ASC;
28357
+ type = SortByTypeEnum.MANUAL_SORT;
28358
+ break;
28285
28359
  }
28286
28360
  return {
28287
28361
  direction: direction,
@@ -28503,6 +28577,7 @@ var IkasProductList = /** @class */ (function () {
28503
28577
  filters: this.filters,
28504
28578
  recommendFor: this._recommendFor,
28505
28579
  productListPropValue: this._productListPropValue,
28580
+ pageSpecificData: this.pageSpecificData,
28506
28581
  };
28507
28582
  };
28508
28583
  IkasProductList.prototype.restoreInfiniteScrollPage = function () {
@@ -28554,6 +28629,7 @@ var IkasProductList = /** @class */ (function () {
28554
28629
  IkasProductListSortType["FIRST_ADDED"] = "FIRST_ADDED";
28555
28630
  IkasProductListSortType["INCREASING_DISCOUNT"] = "INCREASING_DISCOUNT";
28556
28631
  IkasProductListSortType["DECRASING_DISCOUNT"] = "DECRASING_DISCOUNT";
28632
+ IkasProductListSortType["FEATURED"] = "FEATURED";
28557
28633
  })(exports.IkasProductListSortType || (exports.IkasProductListSortType = {}));
28558
28634
 
28559
28635
  /**
@@ -30618,6 +30694,12 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
30618
30694
  filterBrandId: filterBrandId,
30619
30695
  filterCategoryId: filterCategoryId,
30620
30696
  pageType: this.pageType,
30697
+ pageSpecificData: [
30698
+ exports.IkasThemePageType.CATEGORY,
30699
+ exports.IkasThemePageType.BRAND,
30700
+ ].includes(this.pageType)
30701
+ ? this.pageSpecificData
30702
+ : undefined,
30621
30703
  });
30622
30704
  //@ts-ignore
30623
30705
  return [4 /*yield*/, productList.getInitial()];
@@ -33673,7 +33755,7 @@ var IkasBrandAPI = /** @class */ (function () {
33673
33755
  return __generator(this, function (_b) {
33674
33756
  switch (_b.label) {
33675
33757
  case 0:
33676
- 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 "])));
33758
+ 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 "])));
33677
33759
  _b.label = 1;
33678
33760
  case 1:
33679
33761
  _b.trys.push([1, 3, , 4]);
@@ -33712,6 +33794,7 @@ var IkasBrandAPI = /** @class */ (function () {
33712
33794
  name: b.name,
33713
33795
  metaData: b.metaData || undefined,
33714
33796
  image: b.imageId ? new IkasImage(b.imageId) : undefined,
33797
+ orderType: b.orderType,
33715
33798
  });
33716
33799
  });
33717
33800
  return [2 /*return*/, {
@@ -33822,7 +33905,7 @@ var IkasCategoryAPI = /** @class */ (function () {
33822
33905
  return __generator(this, function (_b) {
33823
33906
  switch (_b.label) {
33824
33907
  case 0:
33825
- 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 "])));
33908
+ 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 "])));
33826
33909
  _b.label = 1;
33827
33910
  case 1:
33828
33911
  _b.trys.push([1, 10, , 11]);
@@ -33861,6 +33944,7 @@ var IkasCategoryAPI = /** @class */ (function () {
33861
33944
  parentId: c.parentId,
33862
33945
  metaData: c.metaData || undefined,
33863
33946
  image: c.imageId ? new IkasImage(c.imageId) : undefined,
33947
+ orderType: c.orderType,
33864
33948
  });
33865
33949
  });
33866
33950
  _b.label = 3;
@@ -37363,6 +37447,91 @@ var style = {
37363
37447
  backgroundColor: "rgba(255, 0, 0, 0.5)",
37364
37448
  };
37365
37449
 
37450
+ var IkasStorefrontLocalization = /** @class */ (function () {
37451
+ function IkasStorefrontLocalization(data) {
37452
+ this.id = data.id || "";
37453
+ this.isDefault = data.isDefault || false;
37454
+ this.locale = data.locale || "";
37455
+ this.name = data.name || "";
37456
+ }
37457
+ return IkasStorefrontLocalization;
37458
+ }());
37459
+
37460
+ var IkasStorefrontDomain = /** @class */ (function () {
37461
+ function IkasStorefrontDomain(data) {
37462
+ if (data === void 0) { data = {}; }
37463
+ this.id = data.id || "";
37464
+ this.merchantDomainId = data.merchantDomainId || "";
37465
+ this.name = data.name || "";
37466
+ this.redirectDomainName = data.redirectDomainName || null;
37467
+ this.isDefault = data.isDefault || false;
37468
+ mobx.makeAutoObservable(this);
37469
+ }
37470
+ return IkasStorefrontDomain;
37471
+ }());
37472
+
37473
+ var IkasStorefrontRouting = /** @class */ (function () {
37474
+ function IkasStorefrontRouting(data) {
37475
+ this.id = data.id || "";
37476
+ this.countryCodes = data.countryCodes || null;
37477
+ this.domain = data.domain || null;
37478
+ this.locale = data.locale || "";
37479
+ this.path = data.path || null;
37480
+ this.priceListId = data.priceListId || null;
37481
+ }
37482
+ return IkasStorefrontRouting;
37483
+ }());
37484
+
37485
+ var IkasStorefrontThemeStatus;
37486
+ (function (IkasStorefrontThemeStatus) {
37487
+ IkasStorefrontThemeStatus["WAITING"] = "WAITING";
37488
+ IkasStorefrontThemeStatus["READY"] = "READY";
37489
+ })(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
37490
+ var IkasStorefrontTheme = /** @class */ (function () {
37491
+ function IkasStorefrontTheme(data) {
37492
+ this.id = data.id || "";
37493
+ this.isMainTheme = data.isMainTheme || false;
37494
+ this.name = data.name || "";
37495
+ this.status = data.status || IkasStorefrontThemeStatus.WAITING;
37496
+ this.themeId = data.themeId || "";
37497
+ this.themeVersionId = data.themeVersionId || "";
37498
+ }
37499
+ return IkasStorefrontTheme;
37500
+ }());
37501
+
37502
+ var StorefrontStatus;
37503
+ (function (StorefrontStatus) {
37504
+ StorefrontStatus["WAITING"] = "WAITING";
37505
+ StorefrontStatus["READY"] = "READY";
37506
+ })(StorefrontStatus || (StorefrontStatus = {}));
37507
+ var IkasStorefront = /** @class */ (function () {
37508
+ function IkasStorefront(data) {
37509
+ if (data === void 0) { data = {}; }
37510
+ this.id = data.id || "";
37511
+ this.name = data.name || "";
37512
+ this.status = data.status || StorefrontStatus.WAITING;
37513
+ this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
37514
+ this.emailSettingsId = data.emailSettingsId || null;
37515
+ this.salesChannelId = data.salesChannelId || null;
37516
+ this.gtmId = data.gtmId || null;
37517
+ this.fbpId = data.fbpId || null;
37518
+ // Sub Models
37519
+ this.localizations = data.localizations
37520
+ ? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
37521
+ : [];
37522
+ this.routings = data.routings
37523
+ ? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
37524
+ : [];
37525
+ this.domains = data.domains
37526
+ ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
37527
+ : [];
37528
+ this.themes = data.themes
37529
+ ? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
37530
+ : [];
37531
+ }
37532
+ return IkasStorefront;
37533
+ }());
37534
+
37366
37535
  var PACKAGE_VERSION = "0.0.161";
37367
37536
  var PageViewModel = /** @class */ (function () {
37368
37537
  function PageViewModel(router) {
@@ -37519,6 +37688,8 @@ var PageViewModel = /** @class */ (function () {
37519
37688
  };
37520
37689
  // Message Handlers
37521
37690
  this.handleUpdateFrameData = function (data) { return __awaiter(_this, void 0, void 0, function () {
37691
+ var storefront, _storefront, routing;
37692
+ var _this = this;
37522
37693
  return __generator(this, function (_a) {
37523
37694
  switch (_a.label) {
37524
37695
  case 0:
@@ -37529,6 +37700,22 @@ var PageViewModel = /** @class */ (function () {
37529
37700
  this.apiKey = data.apiKey;
37530
37701
  this.locale = data.locale || "en";
37531
37702
  this.translations = data.translations || undefined;
37703
+ storefront = data.storefront;
37704
+ if (storefront) {
37705
+ _storefront = new IkasStorefront(storefront);
37706
+ routing = _storefront.routings.find(function (sr) { return sr.locale === _this.locale; });
37707
+ IkasStorefrontConfig.storefrontId = _storefront.id;
37708
+ IkasStorefrontConfig.storefrontRoutingId = routing === null || routing === void 0 ? void 0 : routing.id;
37709
+ if (_storefront.mainStorefrontThemeId)
37710
+ IkasStorefrontConfig.storefrontThemeId =
37711
+ _storefront.mainStorefrontThemeId;
37712
+ if (_storefront.salesChannelId)
37713
+ IkasStorefrontConfig.salesChannelId = _storefront.salesChannelId;
37714
+ if (routing === null || routing === void 0 ? void 0 : routing.priceListId)
37715
+ IkasStorefrontConfig.priceListId = routing.priceListId;
37716
+ IkasStorefrontConfig.routings = _storefront.routings;
37717
+ IkasStorefrontConfig.stockPreference = this.theme.settings.stockPreference;
37718
+ }
37532
37719
  // Production editor mode
37533
37720
  if (this.translations)
37534
37721
  IkasStorefrontConfig.translations = this.translations;
@@ -37855,91 +38042,6 @@ var index = /*#__PURE__*/Object.freeze({
37855
38042
  Image: Image
37856
38043
  });
37857
38044
 
37858
- var IkasStorefrontLocalization = /** @class */ (function () {
37859
- function IkasStorefrontLocalization(data) {
37860
- this.id = data.id || "";
37861
- this.isDefault = data.isDefault || false;
37862
- this.locale = data.locale || "";
37863
- this.name = data.name || "";
37864
- }
37865
- return IkasStorefrontLocalization;
37866
- }());
37867
-
37868
- var IkasStorefrontDomain = /** @class */ (function () {
37869
- function IkasStorefrontDomain(data) {
37870
- if (data === void 0) { data = {}; }
37871
- this.id = data.id || "";
37872
- this.merchantDomainId = data.merchantDomainId || "";
37873
- this.name = data.name || "";
37874
- this.redirectDomainName = data.redirectDomainName || null;
37875
- this.isDefault = data.isDefault || false;
37876
- mobx.makeAutoObservable(this);
37877
- }
37878
- return IkasStorefrontDomain;
37879
- }());
37880
-
37881
- var IkasStorefrontRouting = /** @class */ (function () {
37882
- function IkasStorefrontRouting(data) {
37883
- this.id = data.id || "";
37884
- this.countryCodes = data.countryCodes || null;
37885
- this.domain = data.domain || null;
37886
- this.locale = data.locale || "";
37887
- this.path = data.path || null;
37888
- this.priceListId = data.priceListId || null;
37889
- }
37890
- return IkasStorefrontRouting;
37891
- }());
37892
-
37893
- var IkasStorefrontThemeStatus;
37894
- (function (IkasStorefrontThemeStatus) {
37895
- IkasStorefrontThemeStatus["WAITING"] = "WAITING";
37896
- IkasStorefrontThemeStatus["READY"] = "READY";
37897
- })(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
37898
- var IkasStorefrontTheme = /** @class */ (function () {
37899
- function IkasStorefrontTheme(data) {
37900
- this.id = data.id || "";
37901
- this.isMainTheme = data.isMainTheme || false;
37902
- this.name = data.name || "";
37903
- this.status = data.status || IkasStorefrontThemeStatus.WAITING;
37904
- this.themeId = data.themeId || "";
37905
- this.themeVersionId = data.themeVersionId || "";
37906
- }
37907
- return IkasStorefrontTheme;
37908
- }());
37909
-
37910
- var StorefrontStatus;
37911
- (function (StorefrontStatus) {
37912
- StorefrontStatus["WAITING"] = "WAITING";
37913
- StorefrontStatus["READY"] = "READY";
37914
- })(StorefrontStatus || (StorefrontStatus = {}));
37915
- var IkasStorefront = /** @class */ (function () {
37916
- function IkasStorefront(data) {
37917
- if (data === void 0) { data = {}; }
37918
- this.id = data.id || "";
37919
- this.name = data.name || "";
37920
- this.status = data.status || StorefrontStatus.WAITING;
37921
- this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
37922
- this.emailSettingsId = data.emailSettingsId || null;
37923
- this.salesChannelId = data.salesChannelId || null;
37924
- this.gtmId = data.gtmId || null;
37925
- this.fbpId = data.fbpId || null;
37926
- // Sub Models
37927
- this.localizations = data.localizations
37928
- ? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
37929
- : [];
37930
- this.routings = data.routings
37931
- ? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
37932
- : [];
37933
- this.domains = data.domains
37934
- ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
37935
- : [];
37936
- this.themes = data.themes
37937
- ? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
37938
- : [];
37939
- }
37940
- return IkasStorefront;
37941
- }());
37942
-
37943
38045
  var IkasSalesChannel = /** @class */ (function () {
37944
38046
  function IkasSalesChannel(data) {
37945
38047
  if (data === void 0) { data = {}; }
@@ -1,10 +1,12 @@
1
1
  import { IkasImage } from "../image/index";
2
2
  import { IkasHTMLMetaData } from "../html-meta-data/index";
3
+ import { ModelOrder } from "../category/index";
3
4
  export declare class IkasBrand {
4
5
  id: string;
5
6
  name: string;
6
7
  metaData?: IkasHTMLMetaData | null;
7
8
  image?: IkasImage | null;
9
+ orderType: ModelOrder | null;
8
10
  constructor(data?: Partial<IkasBrand>);
9
11
  get href(): string;
10
12
  }
@@ -7,6 +7,7 @@ export declare class IkasCategory {
7
7
  metaData?: IkasHTMLMetaData | null;
8
8
  image?: IkasImage | null;
9
9
  path: IkasCategoryPath[];
10
+ orderType: ModelOrder | null;
10
11
  constructor(data?: Partial<IkasCategory>);
11
12
  get href(): string;
12
13
  }
@@ -30,3 +31,13 @@ export declare class IkasFilterCategory {
30
31
  isSelected: boolean;
31
32
  };
32
33
  }
34
+ export declare enum ModelOrder {
35
+ BEST_SELLER = "BEST_SELLER",
36
+ HIGHEST_DISCOUNT_RATIO = "HIGHEST_DISCOUNT_RATIO",
37
+ HIGHEST_PRICE = "HIGHEST_PRICE",
38
+ LOWEST_DISCOUNT_RATIO = "LOWEST_DISCOUNT_RATIO",
39
+ LOWEST_PRICE = "LOWEST_PRICE",
40
+ MANUALLY = "MANUALLY",
41
+ NEWEST = "NEWEST",
42
+ OLDEST = "OLDEST"
43
+ }
@@ -2,7 +2,8 @@ import { IkasProductListPropValue, IkasThemePageType } from "../../theme/index";
2
2
  import { IkasProductDetail } from "../product-detail/index";
3
3
  import { IkasProductFilter } from "../../data/product-filter/index";
4
4
  import { NextRouter } from "next/router";
5
- import { IkasFilterCategory } from "../../data/category/index";
5
+ import { IkasCategory, IkasFilterCategory } from "../../data/category/index";
6
+ import { IkasBrand } from "../../data/index";
6
7
  export declare class IkasProductList {
7
8
  data: IkasProductDetail[];
8
9
  filters?: IkasProductFilter[] | null;
@@ -20,6 +21,7 @@ export declare class IkasProductList {
20
21
  private _productListPropValue;
21
22
  private _filterBrandId?;
22
23
  private _filterCategoryId?;
24
+ private pageSpecificData?;
23
25
  private _recommendFor?;
24
26
  private _isLoading;
25
27
  private _fetchRequestTime;
@@ -48,6 +50,8 @@ export declare class IkasProductList {
48
50
  get filterQueryParams(): string;
49
51
  get filterCategories(): IkasFilterCategory[] | undefined;
50
52
  get hasAppliedfilter(): boolean | undefined;
53
+ get isFeaturedSortEnabled(): boolean;
54
+ private setPageSpecificSort;
51
55
  private getSortParams;
52
56
  private searchProducts;
53
57
  private getFilters;
@@ -78,6 +82,7 @@ export declare class IkasProductList {
78
82
  filters: IkasProductFilter[] | null | undefined;
79
83
  recommendFor: string | null | undefined;
80
84
  productListPropValue: IkasProductListPropValue;
85
+ pageSpecificData: IkasCategory | IkasBrand | null | undefined;
81
86
  };
82
87
  setVisibleInfiniteScrollPage: (page: number) => void;
83
88
  private restoreInfiniteScrollPage;
@@ -104,6 +109,7 @@ export declare type IkasProductListParams = {
104
109
  filterCategories?: IkasFilterCategory[];
105
110
  recommendFor?: string;
106
111
  productListPropValue: IkasProductListPropValue;
112
+ pageSpecificData?: IkasCategory | IkasBrand | null;
107
113
  };
108
114
  export declare enum IkasProductListType {
109
115
  ALL = "ALL",
@@ -120,5 +126,6 @@ export declare enum IkasProductListSortType {
120
126
  LAST_ADDED = "LAST_ADDED",
121
127
  FIRST_ADDED = "FIRST_ADDED",
122
128
  INCREASING_DISCOUNT = "INCREASING_DISCOUNT",
123
- DECRASING_DISCOUNT = "DECRASING_DISCOUNT"
129
+ DECRASING_DISCOUNT = "DECRASING_DISCOUNT",
130
+ FEATURED = "FEATURED"
124
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.162-alpha.5",
3
+ "version": "0.0.162-alpha.7",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",