@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.
- package/build/__generated__/global-types.d.ts +0 -13
- package/build/api/brand/__generated__/listProductBrand.d.ts +1 -2
- package/build/api/category/__generated__/listCategory.d.ts +1 -2
- package/build/index.es.js +124 -233
- package/build/index.js +124 -233
- package/build/models/data/brand/index.d.ts +0 -2
- package/build/models/data/category/index.d.ts +0 -11
- package/build/models/ui/product-list/index.d.ts +2 -9
- package/build/pages/editor.d.ts +4 -5
- package/build/storefront/index.d.ts +0 -1
- package/build/utils/i18n.d.ts +1 -1
- package/build/utils/settings.d.ts +0 -12
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -10933,7 +10933,6 @@ var IkasStorefrontConfig = /** @class */ (function () {
|
|
|
10933
10933
|
IkasStorefrontConfig.routings = [];
|
|
10934
10934
|
IkasStorefrontConfig.paymentGateways = [];
|
|
10935
10935
|
IkasStorefrontConfig.translations = {};
|
|
10936
|
-
IkasStorefrontConfig.isEditor = false;
|
|
10937
10936
|
return IkasStorefrontConfig;
|
|
10938
10937
|
}());
|
|
10939
10938
|
|
|
@@ -11017,14 +11016,12 @@ var IkasBrand = /** @class */ (function () {
|
|
|
11017
11016
|
if (data === void 0) { data = {}; }
|
|
11018
11017
|
this.metaData = null;
|
|
11019
11018
|
this.image = null;
|
|
11020
|
-
this.orderType = null;
|
|
11021
11019
|
this.id = data.id || Date.now() + "";
|
|
11022
11020
|
this.name = data.name || "";
|
|
11023
11021
|
this.metaData = data.metaData
|
|
11024
11022
|
? new IkasHTMLMetaData(data.metaData)
|
|
11025
11023
|
: undefined;
|
|
11026
11024
|
this.image = data.image ? new IkasImage(data.image.id) : null;
|
|
11027
|
-
this.orderType = data.orderType || null;
|
|
11028
11025
|
mobx.makeAutoObservable(this);
|
|
11029
11026
|
}
|
|
11030
11027
|
Object.defineProperty(IkasBrand.prototype, "href", {
|
|
@@ -11045,7 +11042,6 @@ var IkasCategory = /** @class */ (function () {
|
|
|
11045
11042
|
if (data === void 0) { data = {}; }
|
|
11046
11043
|
this.metaData = null;
|
|
11047
11044
|
this.image = null;
|
|
11048
|
-
this.orderType = null;
|
|
11049
11045
|
this.id = data.id || Date.now() + "";
|
|
11050
11046
|
this.name = data.name || "";
|
|
11051
11047
|
this.parentId = data.parentId || null;
|
|
@@ -11054,7 +11050,6 @@ var IkasCategory = /** @class */ (function () {
|
|
|
11054
11050
|
: undefined;
|
|
11055
11051
|
this.image = data.image ? new IkasImage(data.image.id) : null;
|
|
11056
11052
|
this.path = data.path ? data.path.map(function (p) { return new IkasCategoryPath(p); }) : [];
|
|
11057
|
-
this.orderType = data.orderType || null;
|
|
11058
11053
|
mobx.makeAutoObservable(this);
|
|
11059
11054
|
}
|
|
11060
11055
|
Object.defineProperty(IkasCategory.prototype, "href", {
|
|
@@ -11121,18 +11116,7 @@ var IkasFilterCategory = /** @class */ (function () {
|
|
|
11121
11116
|
return __assign(__assign({}, this), { isSelected: this._isSelected });
|
|
11122
11117
|
};
|
|
11123
11118
|
return IkasFilterCategory;
|
|
11124
|
-
}());
|
|
11125
|
-
var ModelOrder;
|
|
11126
|
-
(function (ModelOrder) {
|
|
11127
|
-
ModelOrder["BEST_SELLER"] = "BEST_SELLER";
|
|
11128
|
-
ModelOrder["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
|
|
11129
|
-
ModelOrder["HIGHEST_PRICE"] = "HIGHEST_PRICE";
|
|
11130
|
-
ModelOrder["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
|
|
11131
|
-
ModelOrder["LOWEST_PRICE"] = "LOWEST_PRICE";
|
|
11132
|
-
ModelOrder["MANUALLY"] = "MANUALLY";
|
|
11133
|
-
ModelOrder["NEWEST"] = "NEWEST";
|
|
11134
|
-
ModelOrder["OLDEST"] = "OLDEST";
|
|
11135
|
-
})(ModelOrder || (ModelOrder = {}));
|
|
11119
|
+
}());
|
|
11136
11120
|
|
|
11137
11121
|
var IkasCheckoutSettings = /** @class */ (function () {
|
|
11138
11122
|
function IkasCheckoutSettings(data) {
|
|
@@ -27422,20 +27406,6 @@ var CartStatusEnum;
|
|
|
27422
27406
|
CartStatusEnum["ACTIVE"] = "ACTIVE";
|
|
27423
27407
|
CartStatusEnum["PASSIVE"] = "PASSIVE";
|
|
27424
27408
|
})(CartStatusEnum || (CartStatusEnum = {}));
|
|
27425
|
-
/**
|
|
27426
|
-
* CategoryProductsOrder Types
|
|
27427
|
-
*/
|
|
27428
|
-
var CategoryProductsOrderTypeEnum;
|
|
27429
|
-
(function (CategoryProductsOrderTypeEnum) {
|
|
27430
|
-
CategoryProductsOrderTypeEnum["BEST_SELLER"] = "BEST_SELLER";
|
|
27431
|
-
CategoryProductsOrderTypeEnum["HIGHEST_DISCOUNT_RATIO"] = "HIGHEST_DISCOUNT_RATIO";
|
|
27432
|
-
CategoryProductsOrderTypeEnum["HIGHEST_PRICE"] = "HIGHEST_PRICE";
|
|
27433
|
-
CategoryProductsOrderTypeEnum["LOWEST_DISCOUNT_RATIO"] = "LOWEST_DISCOUNT_RATIO";
|
|
27434
|
-
CategoryProductsOrderTypeEnum["LOWEST_PRICE"] = "LOWEST_PRICE";
|
|
27435
|
-
CategoryProductsOrderTypeEnum["MANUALLY"] = "MANUALLY";
|
|
27436
|
-
CategoryProductsOrderTypeEnum["NEWEST"] = "NEWEST";
|
|
27437
|
-
CategoryProductsOrderTypeEnum["OLDEST"] = "OLDEST";
|
|
27438
|
-
})(CategoryProductsOrderTypeEnum || (CategoryProductsOrderTypeEnum = {}));
|
|
27439
27409
|
/**
|
|
27440
27410
|
* Checkout Recovery Email Status Enum
|
|
27441
27411
|
*/
|
|
@@ -27771,7 +27741,6 @@ var IkasProductList = /** @class */ (function () {
|
|
|
27771
27741
|
this._minPage = null;
|
|
27772
27742
|
this._filterBrandId = null;
|
|
27773
27743
|
this._filterCategoryId = null;
|
|
27774
|
-
this.pageSpecificData = null;
|
|
27775
27744
|
this._recommendFor = null; // productId
|
|
27776
27745
|
this._isLoading = false;
|
|
27777
27746
|
this._fetchRequestTime = 0;
|
|
@@ -28062,10 +28031,8 @@ var IkasProductList = /** @class */ (function () {
|
|
|
28062
28031
|
this._filterCategories = data.filterCategories
|
|
28063
28032
|
? data.filterCategories.map(function (c) { return new IkasFilterCategory(c); })
|
|
28064
28033
|
: null;
|
|
28065
|
-
this.pageSpecificData = data.pageSpecificData || null;
|
|
28066
28034
|
this.router = router;
|
|
28067
28035
|
mobx.makeAutoObservable(this);
|
|
28068
|
-
this.setPageSpecificSort();
|
|
28069
28036
|
if (this.isBrowser()) {
|
|
28070
28037
|
this.restoreInfiniteScrollPage();
|
|
28071
28038
|
if (location.search &&
|
|
@@ -28279,44 +28246,6 @@ var IkasProductList = /** @class */ (function () {
|
|
|
28279
28246
|
enumerable: false,
|
|
28280
28247
|
configurable: true
|
|
28281
28248
|
});
|
|
28282
|
-
Object.defineProperty(IkasProductList.prototype, "isFeaturedSortEnabled", {
|
|
28283
|
-
get: function () {
|
|
28284
|
-
var _a;
|
|
28285
|
-
return (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) === ModelOrder.MANUALLY &&
|
|
28286
|
-
[exports.IkasProductListType.ALL, exports.IkasProductListType.CATEGORY].includes(this._type));
|
|
28287
|
-
},
|
|
28288
|
-
enumerable: false,
|
|
28289
|
-
configurable: true
|
|
28290
|
-
});
|
|
28291
|
-
IkasProductList.prototype.setPageSpecificSort = function () {
|
|
28292
|
-
var _a;
|
|
28293
|
-
if (((_a = this.pageSpecificData) === null || _a === void 0 ? void 0 : _a.orderType) &&
|
|
28294
|
-
[exports.IkasProductListType.ALL, exports.IkasProductListType.CATEGORY].includes(this._type)) {
|
|
28295
|
-
switch (this.pageSpecificData.orderType) {
|
|
28296
|
-
case ModelOrder.HIGHEST_DISCOUNT_RATIO:
|
|
28297
|
-
this._sort = exports.IkasProductListSortType.DECRASING_DISCOUNT;
|
|
28298
|
-
break;
|
|
28299
|
-
case ModelOrder.LOWEST_DISCOUNT_RATIO:
|
|
28300
|
-
this._sort = exports.IkasProductListSortType.INCREASING_DISCOUNT;
|
|
28301
|
-
break;
|
|
28302
|
-
case ModelOrder.HIGHEST_PRICE:
|
|
28303
|
-
this._sort = exports.IkasProductListSortType.DECREASING_PRICE;
|
|
28304
|
-
break;
|
|
28305
|
-
case ModelOrder.LOWEST_PRICE:
|
|
28306
|
-
this._sort = exports.IkasProductListSortType.INCREASING_PRICE;
|
|
28307
|
-
break;
|
|
28308
|
-
case ModelOrder.NEWEST:
|
|
28309
|
-
this._sort = exports.IkasProductListSortType.LAST_ADDED;
|
|
28310
|
-
break;
|
|
28311
|
-
case ModelOrder.OLDEST:
|
|
28312
|
-
this._sort = exports.IkasProductListSortType.FIRST_ADDED;
|
|
28313
|
-
break;
|
|
28314
|
-
case ModelOrder.MANUALLY:
|
|
28315
|
-
this._sort = exports.IkasProductListSortType.FEATURED;
|
|
28316
|
-
break;
|
|
28317
|
-
}
|
|
28318
|
-
}
|
|
28319
|
-
};
|
|
28320
28249
|
IkasProductList.prototype.getSortParams = function () {
|
|
28321
28250
|
var direction = SortByDirectionEnum.DESC;
|
|
28322
28251
|
var type = SortByTypeEnum.CREATED_AT;
|
|
@@ -28353,10 +28282,6 @@ var IkasProductList = /** @class */ (function () {
|
|
|
28353
28282
|
direction = SortByDirectionEnum.DESC;
|
|
28354
28283
|
type = SortByTypeEnum.DISCOUNT_RATIO;
|
|
28355
28284
|
break;
|
|
28356
|
-
case exports.IkasProductListSortType.FEATURED:
|
|
28357
|
-
direction = SortByDirectionEnum.ASC;
|
|
28358
|
-
type = SortByTypeEnum.MANUAL_SORT;
|
|
28359
|
-
break;
|
|
28360
28285
|
}
|
|
28361
28286
|
return {
|
|
28362
28287
|
direction: direction,
|
|
@@ -28578,7 +28503,6 @@ var IkasProductList = /** @class */ (function () {
|
|
|
28578
28503
|
filters: this.filters,
|
|
28579
28504
|
recommendFor: this._recommendFor,
|
|
28580
28505
|
productListPropValue: this._productListPropValue,
|
|
28581
|
-
pageSpecificData: this.pageSpecificData,
|
|
28582
28506
|
};
|
|
28583
28507
|
};
|
|
28584
28508
|
IkasProductList.prototype.restoreInfiniteScrollPage = function () {
|
|
@@ -28630,7 +28554,6 @@ var IkasProductList = /** @class */ (function () {
|
|
|
28630
28554
|
IkasProductListSortType["FIRST_ADDED"] = "FIRST_ADDED";
|
|
28631
28555
|
IkasProductListSortType["INCREASING_DISCOUNT"] = "INCREASING_DISCOUNT";
|
|
28632
28556
|
IkasProductListSortType["DECRASING_DISCOUNT"] = "DECRASING_DISCOUNT";
|
|
28633
|
-
IkasProductListSortType["FEATURED"] = "FEATURED";
|
|
28634
28557
|
})(exports.IkasProductListSortType || (exports.IkasProductListSortType = {}));
|
|
28635
28558
|
|
|
28636
28559
|
/**
|
|
@@ -30695,12 +30618,6 @@ var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
|
30695
30618
|
filterBrandId: filterBrandId,
|
|
30696
30619
|
filterCategoryId: filterCategoryId,
|
|
30697
30620
|
pageType: this.pageType,
|
|
30698
|
-
pageSpecificData: [
|
|
30699
|
-
exports.IkasThemePageType.CATEGORY,
|
|
30700
|
-
exports.IkasThemePageType.BRAND,
|
|
30701
|
-
].includes(this.pageType)
|
|
30702
|
-
? this.pageSpecificData
|
|
30703
|
-
: undefined,
|
|
30704
30621
|
});
|
|
30705
30622
|
//@ts-ignore
|
|
30706
30623
|
return [4 /*yield*/, productList.getInitial()];
|
|
@@ -33339,7 +33256,7 @@ function t(pathString, params) {
|
|
|
33339
33256
|
}
|
|
33340
33257
|
return pathString;
|
|
33341
33258
|
}
|
|
33342
|
-
function useTranslation(
|
|
33259
|
+
function useTranslation() {
|
|
33343
33260
|
return {
|
|
33344
33261
|
t: t,
|
|
33345
33262
|
};
|
|
@@ -33756,7 +33673,7 @@ var IkasBrandAPI = /** @class */ (function () {
|
|
|
33756
33673
|
return __generator(this, function (_b) {
|
|
33757
33674
|
switch (_b.label) {
|
|
33758
33675
|
case 0:
|
|
33759
|
-
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
|
|
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 "])));
|
|
33760
33677
|
_b.label = 1;
|
|
33761
33678
|
case 1:
|
|
33762
33679
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -33795,7 +33712,6 @@ var IkasBrandAPI = /** @class */ (function () {
|
|
|
33795
33712
|
name: b.name,
|
|
33796
33713
|
metaData: b.metaData || undefined,
|
|
33797
33714
|
image: b.imageId ? new IkasImage(b.imageId) : undefined,
|
|
33798
|
-
orderType: b.orderType,
|
|
33799
33715
|
});
|
|
33800
33716
|
});
|
|
33801
33717
|
return [2 /*return*/, {
|
|
@@ -33906,7 +33822,7 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
33906
33822
|
return __generator(this, function (_b) {
|
|
33907
33823
|
switch (_b.label) {
|
|
33908
33824
|
case 0:
|
|
33909
|
-
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
|
|
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 "])));
|
|
33910
33826
|
_b.label = 1;
|
|
33911
33827
|
case 1:
|
|
33912
33828
|
_b.trys.push([1, 10, , 11]);
|
|
@@ -33945,7 +33861,6 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
33945
33861
|
parentId: c.parentId,
|
|
33946
33862
|
metaData: c.metaData || undefined,
|
|
33947
33863
|
image: c.imageId ? new IkasImage(c.imageId) : undefined,
|
|
33948
|
-
orderType: c.orderType,
|
|
33949
33864
|
});
|
|
33950
33865
|
});
|
|
33951
33866
|
_b.label = 3;
|
|
@@ -35473,8 +35388,7 @@ function simpleToProduct(simple) {
|
|
|
35473
35388
|
stock: v.stocks
|
|
35474
35389
|
.filter(function (s) {
|
|
35475
35390
|
var _a;
|
|
35476
|
-
return isLocal ||
|
|
35477
|
-
IkasStorefrontConfig.isEditor || ((_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId));
|
|
35391
|
+
return isLocal || ((_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId));
|
|
35478
35392
|
})
|
|
35479
35393
|
.reduce(function (total, current) { return current.stockCount + total; }, 0) || 0,
|
|
35480
35394
|
variantValues: (_d = v.variantValues) === null || _d === void 0 ? void 0 : _d.map(function (vv) {
|
|
@@ -37449,91 +37363,6 @@ var style = {
|
|
|
37449
37363
|
backgroundColor: "rgba(255, 0, 0, 0.5)",
|
|
37450
37364
|
};
|
|
37451
37365
|
|
|
37452
|
-
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
37453
|
-
function IkasStorefrontLocalization(data) {
|
|
37454
|
-
this.id = data.id || "";
|
|
37455
|
-
this.isDefault = data.isDefault || false;
|
|
37456
|
-
this.locale = data.locale || "";
|
|
37457
|
-
this.name = data.name || "";
|
|
37458
|
-
}
|
|
37459
|
-
return IkasStorefrontLocalization;
|
|
37460
|
-
}());
|
|
37461
|
-
|
|
37462
|
-
var IkasStorefrontDomain = /** @class */ (function () {
|
|
37463
|
-
function IkasStorefrontDomain(data) {
|
|
37464
|
-
if (data === void 0) { data = {}; }
|
|
37465
|
-
this.id = data.id || "";
|
|
37466
|
-
this.merchantDomainId = data.merchantDomainId || "";
|
|
37467
|
-
this.name = data.name || "";
|
|
37468
|
-
this.redirectDomainName = data.redirectDomainName || null;
|
|
37469
|
-
this.isDefault = data.isDefault || false;
|
|
37470
|
-
mobx.makeAutoObservable(this);
|
|
37471
|
-
}
|
|
37472
|
-
return IkasStorefrontDomain;
|
|
37473
|
-
}());
|
|
37474
|
-
|
|
37475
|
-
var IkasStorefrontRouting = /** @class */ (function () {
|
|
37476
|
-
function IkasStorefrontRouting(data) {
|
|
37477
|
-
this.id = data.id || "";
|
|
37478
|
-
this.countryCodes = data.countryCodes || null;
|
|
37479
|
-
this.domain = data.domain || null;
|
|
37480
|
-
this.locale = data.locale || "";
|
|
37481
|
-
this.path = data.path || null;
|
|
37482
|
-
this.priceListId = data.priceListId || null;
|
|
37483
|
-
}
|
|
37484
|
-
return IkasStorefrontRouting;
|
|
37485
|
-
}());
|
|
37486
|
-
|
|
37487
|
-
var IkasStorefrontThemeStatus;
|
|
37488
|
-
(function (IkasStorefrontThemeStatus) {
|
|
37489
|
-
IkasStorefrontThemeStatus["WAITING"] = "WAITING";
|
|
37490
|
-
IkasStorefrontThemeStatus["READY"] = "READY";
|
|
37491
|
-
})(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
|
|
37492
|
-
var IkasStorefrontTheme = /** @class */ (function () {
|
|
37493
|
-
function IkasStorefrontTheme(data) {
|
|
37494
|
-
this.id = data.id || "";
|
|
37495
|
-
this.isMainTheme = data.isMainTheme || false;
|
|
37496
|
-
this.name = data.name || "";
|
|
37497
|
-
this.status = data.status || IkasStorefrontThemeStatus.WAITING;
|
|
37498
|
-
this.themeId = data.themeId || "";
|
|
37499
|
-
this.themeVersionId = data.themeVersionId || "";
|
|
37500
|
-
}
|
|
37501
|
-
return IkasStorefrontTheme;
|
|
37502
|
-
}());
|
|
37503
|
-
|
|
37504
|
-
var StorefrontStatus;
|
|
37505
|
-
(function (StorefrontStatus) {
|
|
37506
|
-
StorefrontStatus["WAITING"] = "WAITING";
|
|
37507
|
-
StorefrontStatus["READY"] = "READY";
|
|
37508
|
-
})(StorefrontStatus || (StorefrontStatus = {}));
|
|
37509
|
-
var IkasStorefront = /** @class */ (function () {
|
|
37510
|
-
function IkasStorefront(data) {
|
|
37511
|
-
if (data === void 0) { data = {}; }
|
|
37512
|
-
this.id = data.id || "";
|
|
37513
|
-
this.name = data.name || "";
|
|
37514
|
-
this.status = data.status || StorefrontStatus.WAITING;
|
|
37515
|
-
this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
|
|
37516
|
-
this.emailSettingsId = data.emailSettingsId || null;
|
|
37517
|
-
this.salesChannelId = data.salesChannelId || null;
|
|
37518
|
-
this.gtmId = data.gtmId || null;
|
|
37519
|
-
this.fbpId = data.fbpId || null;
|
|
37520
|
-
// Sub Models
|
|
37521
|
-
this.localizations = data.localizations
|
|
37522
|
-
? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
|
|
37523
|
-
: [];
|
|
37524
|
-
this.routings = data.routings
|
|
37525
|
-
? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
|
|
37526
|
-
: [];
|
|
37527
|
-
this.domains = data.domains
|
|
37528
|
-
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
37529
|
-
: [];
|
|
37530
|
-
this.themes = data.themes
|
|
37531
|
-
? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
|
|
37532
|
-
: [];
|
|
37533
|
-
}
|
|
37534
|
-
return IkasStorefront;
|
|
37535
|
-
}());
|
|
37536
|
-
|
|
37537
37366
|
var PACKAGE_VERSION = "0.0.161";
|
|
37538
37367
|
var PageViewModel = /** @class */ (function () {
|
|
37539
37368
|
function PageViewModel(router) {
|
|
@@ -37690,8 +37519,6 @@ var PageViewModel = /** @class */ (function () {
|
|
|
37690
37519
|
};
|
|
37691
37520
|
// Message Handlers
|
|
37692
37521
|
this.handleUpdateFrameData = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
37693
|
-
var storefront, _storefront, routing;
|
|
37694
|
-
var _this = this;
|
|
37695
37522
|
return __generator(this, function (_a) {
|
|
37696
37523
|
switch (_a.label) {
|
|
37697
37524
|
case 0:
|
|
@@ -37702,26 +37529,9 @@ var PageViewModel = /** @class */ (function () {
|
|
|
37702
37529
|
this.apiKey = data.apiKey;
|
|
37703
37530
|
this.locale = data.locale || "en";
|
|
37704
37531
|
this.translations = data.translations || undefined;
|
|
37705
|
-
storefront = data.storefront;
|
|
37706
|
-
if (storefront) {
|
|
37707
|
-
_storefront = new IkasStorefront(storefront);
|
|
37708
|
-
routing = _storefront.routings.find(function (sr) { return sr.locale === _this.locale; });
|
|
37709
|
-
IkasStorefrontConfig.storefrontId = _storefront.id;
|
|
37710
|
-
IkasStorefrontConfig.storefrontRoutingId = routing === null || routing === void 0 ? void 0 : routing.id;
|
|
37711
|
-
if (_storefront.mainStorefrontThemeId)
|
|
37712
|
-
IkasStorefrontConfig.storefrontThemeId =
|
|
37713
|
-
_storefront.mainStorefrontThemeId;
|
|
37714
|
-
if (_storefront.salesChannelId)
|
|
37715
|
-
IkasStorefrontConfig.salesChannelId = _storefront.salesChannelId;
|
|
37716
|
-
if (routing === null || routing === void 0 ? void 0 : routing.priceListId)
|
|
37717
|
-
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
37718
|
-
IkasStorefrontConfig.routings = _storefront.routings;
|
|
37719
|
-
IkasStorefrontConfig.stockPreference = this.theme.settings.stockPreference;
|
|
37720
|
-
}
|
|
37721
37532
|
// Production editor mode
|
|
37722
37533
|
if (this.translations)
|
|
37723
37534
|
IkasStorefrontConfig.translations = this.translations;
|
|
37724
|
-
IkasStorefrontConfig.isEditor = true;
|
|
37725
37535
|
apollo.createApolloClient(this.apiKey || undefined);
|
|
37726
37536
|
window.editorApiKey = data.apiKey;
|
|
37727
37537
|
return [4 /*yield*/, this.getPagePropValues()];
|
|
@@ -38045,6 +37855,91 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
38045
37855
|
Image: Image
|
|
38046
37856
|
});
|
|
38047
37857
|
|
|
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
|
+
|
|
38048
37943
|
var IkasSalesChannel = /** @class */ (function () {
|
|
38049
37944
|
function IkasSalesChannel(data) {
|
|
38050
37945
|
if (data === void 0) { data = {}; }
|
|
@@ -38249,14 +38144,11 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38249
38144
|
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes, isEditor) {
|
|
38250
38145
|
var _a;
|
|
38251
38146
|
return __awaiter(this, void 0, void 0, function () {
|
|
38252
|
-
var isLocal,
|
|
38147
|
+
var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, isProdEditor, componentIds_1, components, componentDirs, nextI18nConf, currentLocale, i18nReader, translations;
|
|
38253
38148
|
return __generator(this, function (_b) {
|
|
38254
38149
|
switch (_b.label) {
|
|
38255
38150
|
case 0:
|
|
38256
38151
|
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
38257
|
-
isProdEditor = !isLocal && isEditor;
|
|
38258
|
-
serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
38259
|
-
if (!!isProdEditor) return [3 /*break*/, 5];
|
|
38260
38152
|
locale = context.locale;
|
|
38261
38153
|
if (!locale) {
|
|
38262
38154
|
return [2 /*return*/, {
|
|
@@ -38264,6 +38156,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38264
38156
|
notFound: true,
|
|
38265
38157
|
}];
|
|
38266
38158
|
}
|
|
38159
|
+
serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
38267
38160
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
38268
38161
|
case 1:
|
|
38269
38162
|
settings = _b.sent();
|
|
@@ -38294,14 +38187,17 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38294
38187
|
return [4 /*yield*/, provider.getPageData()];
|
|
38295
38188
|
case 2:
|
|
38296
38189
|
_b.sent();
|
|
38297
|
-
if (!provider.page) {
|
|
38298
|
-
return [2 /*return*/, {
|
|
38299
|
-
props: {},
|
|
38300
|
-
notFound: true,
|
|
38301
|
-
}];
|
|
38302
|
-
}
|
|
38303
38190
|
_b.label = 3;
|
|
38304
38191
|
case 3:
|
|
38192
|
+
if (!provider.page) {
|
|
38193
|
+
if (!isEditor)
|
|
38194
|
+
return [2 /*return*/, {
|
|
38195
|
+
props: {},
|
|
38196
|
+
notFound: true,
|
|
38197
|
+
}];
|
|
38198
|
+
}
|
|
38199
|
+
isProdEditor = !isLocal && isEditor;
|
|
38200
|
+
if (!!isProdEditor) return [3 /*break*/, 5];
|
|
38305
38201
|
componentIds_1 = isEditor
|
|
38306
38202
|
? provider.theme.components.map(function (c) { return c.id; })
|
|
38307
38203
|
: provider.page.components.map(function (pc) { return pc.componentId; });
|
|
@@ -38314,6 +38210,8 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38314
38210
|
case 4:
|
|
38315
38211
|
translations = _b.sent();
|
|
38316
38212
|
IkasStorefrontConfig.translations = translations;
|
|
38213
|
+
_b.label = 5;
|
|
38214
|
+
case 5:
|
|
38317
38215
|
if (isServer)
|
|
38318
38216
|
return [2 /*return*/, {
|
|
38319
38217
|
props: provider.nextPageData.props,
|
|
@@ -38323,10 +38221,6 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38323
38221
|
props: provider.nextPageData.props,
|
|
38324
38222
|
revalidate: 60,
|
|
38325
38223
|
}];
|
|
38326
|
-
case 5: return [2 /*return*/, {
|
|
38327
|
-
props: {},
|
|
38328
|
-
}];
|
|
38329
|
-
case 6: return [2 /*return*/];
|
|
38330
38224
|
}
|
|
38331
38225
|
});
|
|
38332
38226
|
});
|
|
@@ -38412,26 +38306,27 @@ var Page$1 = function (_a) {
|
|
|
38412
38306
|
};
|
|
38413
38307
|
var index$1 = mobxReactLite.observer(Page$1);
|
|
38414
38308
|
var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38309
|
+
var targetTypes, metaData;
|
|
38415
38310
|
return __generator(this, function (_a) {
|
|
38416
|
-
|
|
38417
|
-
|
|
38418
|
-
|
|
38419
|
-
|
|
38420
|
-
|
|
38421
|
-
|
|
38422
|
-
|
|
38423
|
-
|
|
38424
|
-
|
|
38425
|
-
|
|
38426
|
-
|
|
38427
|
-
|
|
38428
|
-
|
|
38429
|
-
|
|
38430
|
-
|
|
38431
|
-
|
|
38432
|
-
|
|
38433
|
-
|
|
38434
|
-
|
|
38311
|
+
switch (_a.label) {
|
|
38312
|
+
case 0:
|
|
38313
|
+
targetTypes = [
|
|
38314
|
+
exports.IkasHTMLMetaDataTargetType.BRAND,
|
|
38315
|
+
exports.IkasHTMLMetaDataTargetType.CATEGORY,
|
|
38316
|
+
];
|
|
38317
|
+
return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, undefined, targetTypes)];
|
|
38318
|
+
case 1:
|
|
38319
|
+
metaData = _a.sent();
|
|
38320
|
+
return [2 /*return*/, {
|
|
38321
|
+
paths: metaData.map(function (m) { return ({
|
|
38322
|
+
params: {
|
|
38323
|
+
slug: m.slug,
|
|
38324
|
+
originalSlug: m.slug,
|
|
38325
|
+
},
|
|
38326
|
+
}); }),
|
|
38327
|
+
fallback: "blocking",
|
|
38328
|
+
}];
|
|
38329
|
+
}
|
|
38435
38330
|
});
|
|
38436
38331
|
}); };
|
|
38437
38332
|
var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -38864,11 +38759,7 @@ var cart = /*#__PURE__*/Object.freeze({
|
|
|
38864
38759
|
});
|
|
38865
38760
|
|
|
38866
38761
|
var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|
|
38867
|
-
var Page$c = function (
|
|
38868
|
-
var configJson = _a.configJson;
|
|
38869
|
-
if (configJson) {
|
|
38870
|
-
IkasStorefrontConfig.initWithJson(configJson);
|
|
38871
|
-
}
|
|
38762
|
+
var Page$c = function () {
|
|
38872
38763
|
return React.createElement(IkasPageEditor$1, null);
|
|
38873
38764
|
};
|
|
38874
38765
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { IkasImage } from "../image/index";
|
|
2
2
|
import { IkasHTMLMetaData } from "../html-meta-data/index";
|
|
3
|
-
import { ModelOrder } from "../category/index";
|
|
4
3
|
export declare class IkasBrand {
|
|
5
4
|
id: string;
|
|
6
5
|
name: string;
|
|
7
6
|
metaData?: IkasHTMLMetaData | null;
|
|
8
7
|
image?: IkasImage | null;
|
|
9
|
-
orderType: ModelOrder | null;
|
|
10
8
|
constructor(data?: Partial<IkasBrand>);
|
|
11
9
|
get href(): string;
|
|
12
10
|
}
|
|
@@ -7,7 +7,6 @@ export declare class IkasCategory {
|
|
|
7
7
|
metaData?: IkasHTMLMetaData | null;
|
|
8
8
|
image?: IkasImage | null;
|
|
9
9
|
path: IkasCategoryPath[];
|
|
10
|
-
orderType: ModelOrder | null;
|
|
11
10
|
constructor(data?: Partial<IkasCategory>);
|
|
12
11
|
get href(): string;
|
|
13
12
|
}
|
|
@@ -31,13 +30,3 @@ export declare class IkasFilterCategory {
|
|
|
31
30
|
isSelected: boolean;
|
|
32
31
|
};
|
|
33
32
|
}
|
|
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,8 +2,7 @@ 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 {
|
|
6
|
-
import { IkasBrand } from "../../data/index";
|
|
5
|
+
import { IkasFilterCategory } from "../../data/category/index";
|
|
7
6
|
export declare class IkasProductList {
|
|
8
7
|
data: IkasProductDetail[];
|
|
9
8
|
filters?: IkasProductFilter[] | null;
|
|
@@ -21,7 +20,6 @@ export declare class IkasProductList {
|
|
|
21
20
|
private _productListPropValue;
|
|
22
21
|
private _filterBrandId?;
|
|
23
22
|
private _filterCategoryId?;
|
|
24
|
-
private pageSpecificData?;
|
|
25
23
|
private _recommendFor?;
|
|
26
24
|
private _isLoading;
|
|
27
25
|
private _fetchRequestTime;
|
|
@@ -50,8 +48,6 @@ export declare class IkasProductList {
|
|
|
50
48
|
get filterQueryParams(): string;
|
|
51
49
|
get filterCategories(): IkasFilterCategory[] | undefined;
|
|
52
50
|
get hasAppliedfilter(): boolean | undefined;
|
|
53
|
-
get isFeaturedSortEnabled(): boolean;
|
|
54
|
-
private setPageSpecificSort;
|
|
55
51
|
private getSortParams;
|
|
56
52
|
private searchProducts;
|
|
57
53
|
private getFilters;
|
|
@@ -82,7 +78,6 @@ export declare class IkasProductList {
|
|
|
82
78
|
filters: IkasProductFilter[] | null | undefined;
|
|
83
79
|
recommendFor: string | null | undefined;
|
|
84
80
|
productListPropValue: IkasProductListPropValue;
|
|
85
|
-
pageSpecificData: IkasCategory | IkasBrand | null | undefined;
|
|
86
81
|
};
|
|
87
82
|
setVisibleInfiniteScrollPage: (page: number) => void;
|
|
88
83
|
private restoreInfiniteScrollPage;
|
|
@@ -109,7 +104,6 @@ export declare type IkasProductListParams = {
|
|
|
109
104
|
filterCategories?: IkasFilterCategory[];
|
|
110
105
|
recommendFor?: string;
|
|
111
106
|
productListPropValue: IkasProductListPropValue;
|
|
112
|
-
pageSpecificData?: IkasCategory | IkasBrand | null;
|
|
113
107
|
};
|
|
114
108
|
export declare enum IkasProductListType {
|
|
115
109
|
ALL = "ALL",
|
|
@@ -126,6 +120,5 @@ export declare enum IkasProductListSortType {
|
|
|
126
120
|
LAST_ADDED = "LAST_ADDED",
|
|
127
121
|
FIRST_ADDED = "FIRST_ADDED",
|
|
128
122
|
INCREASING_DISCOUNT = "INCREASING_DISCOUNT",
|
|
129
|
-
DECRASING_DISCOUNT = "DECRASING_DISCOUNT"
|
|
130
|
-
FEATURED = "FEATURED"
|
|
123
|
+
DECRASING_DISCOUNT = "DECRASING_DISCOUNT"
|
|
131
124
|
}
|